summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@theqtcompany.com>2016-06-16 10:54:49 +0200
committerLiang Qi <liang.qi@qt.io>2016-06-16 20:20:20 +0000
commit2c7163385f78f3a8f3be0ebbe094791b03f89ef8 (patch)
treeb1d13b1d4c69892c8af64dbd7f7518fcecc229f2
parent5079a4fb1da63f00d089eac0d40a88bb0e0e45a4 (diff)
Adapt to new public QSGRenderNode API
Make the necessary changes to compile with the recent changes made to QSGRenderNode in qtdeclarative/28f8795d716035516f03542cd55275375462fdc5 Change-Id: Icc2b70db6913cc7a51480ed9c556999aa8874472 Reviewed-by: Liang Qi <liang.qi@qt.io>
-rw-r--r--Source/WebKit2/UIProcess/qt/QtWebPageSGNode.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/Source/WebKit2/UIProcess/qt/QtWebPageSGNode.cpp b/Source/WebKit2/UIProcess/qt/QtWebPageSGNode.cpp
index 002d00507..d6a694ae6 100644
--- a/Source/WebKit2/UIProcess/qt/QtWebPageSGNode.cpp
+++ b/Source/WebKit2/UIProcess/qt/QtWebPageSGNode.cpp
@@ -24,10 +24,10 @@
#include <QtGui/QPolygonF>
#include <QtQuick/QQuickItem>
#include <QtQuick/QQuickWindow>
+#include <QtQuick/QSGRenderNode>
#include <QtQuick/QSGSimpleRectNode>
#include <WebCore/CoordinatedGraphicsScene.h>
#include <WebCore/TransformationMatrix.h>
-#include <private/qsgrendernode_p.h>
using namespace WebCore;
@@ -41,12 +41,12 @@ public:
coordinatedGraphicsScene()->setActive(true);
}
- virtual StateFlags changedStates()
+ StateFlags changedStates() const Q_DECL_OVERRIDE
{
return StateFlags(StencilState) | ColorState | BlendState;
}
- virtual void render(const RenderState& state)
+ void render(const RenderState *state) Q_DECL_OVERRIDE
{
TransformationMatrix renderMatrix;
if (pageNode()->devicePixelRatio() != 1.0) {
@@ -58,18 +58,23 @@ public:
// When rendering to an intermediate surface, Qt will
// mirror the projection matrix to fit on the destination coordinate system.
- const QMatrix4x4* projection = state.projectionMatrix;
+ const QMatrix4x4* projection = state->projectionMatrix();
bool mirrored = projection && (*projection)(0, 0) * (*projection)(1, 1) - (*projection)(0, 1) * (*projection)(1, 0) > 0;
// FIXME: Support non-rectangular clippings.
coordinatedGraphicsScene()->paintToCurrentGLContext(renderMatrix, inheritedOpacity(), clipRect(), mirrored ? TextureMapper::PaintingMirrored : 0);
}
- ~ContentsSGNode()
+ void releaseResources() Q_DECL_OVERRIDE
{
coordinatedGraphicsScene()->purgeGLResources();
}
+ ~ContentsSGNode()
+ {
+ releaseResources();
+ }
+
const QtWebPageSGNode* pageNode() const
{
const QtWebPageSGNode* parent = static_cast<QtWebPageSGNode*>(this->parent());