From d781cc7d99fa1a1f34440ce319bacadfa4326673 Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Thu, 30 Jan 2014 19:18:16 +0100 Subject: 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 --- src/quick/scenegraph/qsgcontext.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/quick/scenegraph/qsgcontext.cpp') 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. -- cgit v1.2.3 From a8a90519cb35481e96fe8889846bfaa424e13e8a Mon Sep 17 00:00:00 2001 From: Michael Brasser Date: Wed, 5 Feb 2014 15:55:23 -0600 Subject: Fix scenegraph backend API for material shaders. Without this change, it is not possible to implement a custom renderer (it has no way to compile or initialize material shaders). Change-Id: Ie8778f739f3551f88f0d44ccb9769063a87ff276 Reviewed-by: Gunnar Sletta --- src/quick/scenegraph/qsgcontext.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/quick/scenegraph/qsgcontext.cpp') diff --git a/src/quick/scenegraph/qsgcontext.cpp b/src/quick/scenegraph/qsgcontext.cpp index f9bc615f5c..5135cc629c 100644 --- a/src/quick/scenegraph/qsgcontext.cpp +++ b/src/quick/scenegraph/qsgcontext.cpp @@ -445,6 +445,20 @@ void QSGRenderContext::registerFontengineForCleanup(QFontEngine *engine) m_fontEnginesToClean << engine; } +/*! + compile/initialize are protected member functions of QSGMaterialShader. + We expose them here for custom renderers. + */ +void QSGRenderContext::compileShader(QSGMaterialShader *shader) +{ + shader->compile(); +} + +void QSGRenderContext::initializeShader(QSGMaterialShader *shader) +{ + shader->initialize(); +} + /*! Initializes the scene graph render context with the GL context \a context. This also emits the ready() signal so that the QML graph can start building scene graph nodes. -- cgit v1.2.3