diff options
author | Gunnar Sletta <gunnar.sletta@jollamobile.com> | 2014-01-30 19:18:16 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-04 20:06:21 +0100 |
commit | d781cc7d99fa1a1f34440ce319bacadfa4326673 (patch) | |
tree | 083d26bd5b5a2012a6e1635613d8c7e520a8fb2d /src/quick | |
parent | 7c1e3dea8ba66f9eedee4f3d66dba55d7f7556b8 (diff) |
Fix backend API, broken since 5.2.0
Without this change, it is not possible to implement a custom context
without also implementing a renderloop.
Change-Id: Iac2aa732251cdf7221b28f665394cdd336a3d846
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Diffstat (limited to 'src/quick')
-rw-r--r-- | src/quick/scenegraph/qsgcontext.cpp | 5 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgcontext_p.h | 1 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgrenderloop.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgthreadedrenderloop.cpp | 2 | ||||
-rw-r--r-- | src/quick/scenegraph/qsgwindowsrenderloop.cpp | 2 |
5 files changed, 9 insertions, 3 deletions
diff --git a/src/quick/scenegraph/qsgcontext.cpp b/src/quick/scenegraph/qsgcontext.cpp index 829d33a0d7..f9bc615f5c 100644 --- a/src/quick/scenegraph/qsgcontext.cpp +++ b/src/quick/scenegraph/qsgcontext.cpp @@ -174,6 +174,11 @@ QSGContext::~QSGContext() { } +QSGRenderContext *QSGContext::createRenderContext() +{ + return new QSGRenderContext(this); +} + /*! * This function is used by the Qt WebEngine to set up context sharing * across multiple windows. Do not use it for any other purpose. diff --git a/src/quick/scenegraph/qsgcontext_p.h b/src/quick/scenegraph/qsgcontext_p.h index c1bf78a018..8378fe99b6 100644 --- a/src/quick/scenegraph/qsgcontext_p.h +++ b/src/quick/scenegraph/qsgcontext_p.h @@ -155,6 +155,7 @@ public: virtual void renderContextInitialized(QSGRenderContext *renderContext); virtual void renderContextInvalidated(QSGRenderContext *renderContext); + virtual QSGRenderContext *createRenderContext(); virtual QSGRectangleNode *createRectangleNode(); virtual QSGImageNode *createImageNode(); diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp index 219f877bec..f0ac725f22 100644 --- a/src/quick/scenegraph/qsgrenderloop.cpp +++ b/src/quick/scenegraph/qsgrenderloop.cpp @@ -213,7 +213,7 @@ QSGGuiThreadRenderLoop::QSGGuiThreadRenderLoop() , eventPending(false) { sg = QSGContext::createDefaultContext(); - rc = new QSGRenderContext(sg); + rc = sg->createRenderContext(); } QSGGuiThreadRenderLoop::~QSGGuiThreadRenderLoop() diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp index d8fe947122..207a4915e1 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp +++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp @@ -709,7 +709,7 @@ QSGThreadedRenderLoop::QSGThreadedRenderLoop() QSGRenderContext *QSGThreadedRenderLoop::createRenderContext(QSGContext *sg) const { - return new QSGRenderContext(sg); + return sg->createRenderContext(); } void QSGThreadedRenderLoop::maybePostPolishRequest(Window *w) diff --git a/src/quick/scenegraph/qsgwindowsrenderloop.cpp b/src/quick/scenegraph/qsgwindowsrenderloop.cpp index 5d9583cafb..6a6a6ab570 100644 --- a/src/quick/scenegraph/qsgwindowsrenderloop.cpp +++ b/src/quick/scenegraph/qsgwindowsrenderloop.cpp @@ -85,7 +85,7 @@ QSGWindowsRenderLoop::QSGWindowsRenderLoop() qsg_debug_timer.start(); #endif - m_rc = new QSGRenderContext(m_sg); + m_rc = m_sg->createRenderContext(); m_animationDriver = m_sg->createAnimationDriver(m_sg); m_animationDriver->install(); |