summaryrefslogtreecommitdiffstats
path: root/src/core/delegated_frame_node.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/delegated_frame_node.cpp')
-rw-r--r--src/core/delegated_frame_node.cpp25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/core/delegated_frame_node.cpp b/src/core/delegated_frame_node.cpp
index aebdfd027..1b6a80f82 100644
--- a/src/core/delegated_frame_node.cpp
+++ b/src/core/delegated_frame_node.cpp
@@ -57,6 +57,7 @@
#include "cc/quads/checkerboard_draw_quad.h"
#include "cc/quads/debug_border_draw_quad.h"
#include "cc/quads/draw_quad.h"
+#include "cc/quads/io_surface_draw_quad.h"
#include "cc/quads/render_pass_draw_quad.h"
#include "cc/quads/solid_color_draw_quad.h"
#include "cc/quads/stream_video_draw_quad.h"
@@ -80,6 +81,10 @@
#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFFull
#endif
+#ifndef GL_TEXTURE_RECTANGLE
+#define GL_TEXTURE_RECTANGLE 0x84F5
+#endif
+
namespace QtWebEngineCore {
class MailboxTexture : public QSGTexture, protected QOpenGLFunctions {
@@ -655,13 +660,29 @@ void DelegatedFrameNode::commit(ChromiumCompositorData *chromiumCompositorData,
MailboxTexture *texture = static_cast<MailboxTexture *>(initAndHoldTexture(resource, quad->ShouldDrawWithBlending()));
texture->setTarget(GL_TEXTURE_EXTERNAL_OES); // since this is not default TEXTURE_2D type
- StreamVideoNode *svideoNode = new StreamVideoNode(texture);
+ StreamVideoNode *svideoNode = new StreamVideoNode(texture, false, ExternalTarget);
svideoNode->setRect(toQt(squad->rect));
svideoNode->setTextureMatrix(toQt(squad->matrix.matrix()));
currentLayerChain->appendChildNode(svideoNode);
break;
#endif
- } default:
+ }
+ case cc::DrawQuad::IO_SURFACE_CONTENT: {
+ const cc::IOSurfaceDrawQuad *ioquad = cc::IOSurfaceDrawQuad::MaterialCast(quad);
+ ResourceHolder *resource = findAndHoldResource(ioquad->io_surface_resource_id(), resourceCandidates);
+ MailboxTexture *texture = static_cast<MailboxTexture *>(initAndHoldTexture(resource, quad->ShouldDrawWithBlending()));
+ texture->setTarget(GL_TEXTURE_RECTANGLE);
+
+ bool flip = ioquad->orientation != cc::IOSurfaceDrawQuad::FLIPPED;
+ StreamVideoNode *svideoNode = new StreamVideoNode(texture, flip, RectangleTarget);
+ QMatrix4x4 matrix;
+ matrix.scale(ioquad->io_surface_size.width(), ioquad->io_surface_size.height());
+ svideoNode->setRect(toQt(ioquad->rect));
+ svideoNode->setTextureMatrix(matrix);
+ currentLayerChain->appendChildNode(svideoNode);
+ break;
+ }
+ default:
qWarning("Unimplemented quad material: %d", quad->material);
}
}