diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-11-20 16:01:37 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2015-11-20 16:04:42 +0100 |
commit | 1f474fcc4cd47a85ce8d99f07d18b46ef2af5898 (patch) | |
tree | d4e52b5ac98343b4c2417d622164bf320d781a59 /src/core/delegated_frame_node.cpp | |
parent | 4cc28c7c89f794d469f5e8f778ff05effe8c646f (diff) | |
parent | 1173d48149a8133b607894b67e1ec32de68e21e8 (diff) |
Merge branch '5.6' into dev
Change-Id: I05fe27b8321944cf68cc96dfa9dfcaeb54c8c8cd
Diffstat (limited to 'src/core/delegated_frame_node.cpp')
-rw-r--r-- | src/core/delegated_frame_node.cpp | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/src/core/delegated_frame_node.cpp b/src/core/delegated_frame_node.cpp index 724c2c9bc..a2836d5e6 100644 --- a/src/core/delegated_frame_node.cpp +++ b/src/core/delegated_frame_node.cpp @@ -56,6 +56,7 @@ #include "cc/output/delegated_frame_data.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" @@ -79,6 +80,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 { @@ -130,7 +135,7 @@ private: QSGGeometry m_geometry; }; -static inline QSharedPointer<QSGLayer> findRenderPassLayer(const cc::RenderPassId &id, const QList<QPair<cc::RenderPassId, QSharedPointer<QSGLayer> > > &list) +static inline QSharedPointer<QSGLayer> findRenderPassLayer(const cc::RenderPassId &id, const QVector<QPair<cc::RenderPassId, QSharedPointer<QSGLayer> > > &list) { typedef QPair<cc::RenderPassId, QSharedPointer<QSGLayer> > Pair; Q_FOREACH (const Pair &pair, list) @@ -646,13 +651,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); } } |