From 5b05a78d0055757adb3b2703ea990e07dbcd145a Mon Sep 17 00:00:00 2001 From: Gunnar Sletta Date: Wed, 30 Oct 2013 14:32:54 +0100 Subject: Added private API for enabling sharing between the QQuickwindow instances. This API is primarily a hook which is needed by the Qt WebEngine to set up sharing with the scene graph's OpenGL contexts. Change-Id: I5bb03abd9ab99f502db8e413fe838a8b30365b8d Reviewed-by: Jocelyn Turcotte --- src/quick/scenegraph/qsgcontext.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/quick/scenegraph/qsgcontext.cpp') diff --git a/src/quick/scenegraph/qsgcontext.cpp b/src/quick/scenegraph/qsgcontext.cpp index 4fbefb37d8..c6dbf350b6 100644 --- a/src/quick/scenegraph/qsgcontext.cpp +++ b/src/quick/scenegraph/qsgcontext.cpp @@ -117,8 +117,12 @@ public: QSGContext::AntialiasingMethod antialiasingMethod; bool distanceFieldDisabled; QSGDistanceFieldGlyphNode::AntialiasingMode distanceFieldAntialiasing; + + static QOpenGLContext *sharedOpenGLContext; }; +QOpenGLContext *QSGContextPrivate::sharedOpenGLContext = 0; + class QSGTextureCleanupEvent : public QEvent { public: @@ -170,6 +174,20 @@ QSGContext::~QSGContext() { } +/*! + * This function is used by the Qt WebEngine to set up context sharing + * across multiple windows. Do not use it for any other purpose. + */ +void QSGContext::setSharedOpenGLContext(QOpenGLContext *context) +{ + QSGContextPrivate::sharedOpenGLContext = context; +} + +QOpenGLContext *QSGContext::sharedOpenGLContext() +{ + return QSGContextPrivate::sharedOpenGLContext; +} + void QSGContext::renderContextInitialized(QSGRenderContext *renderContext) { Q_D(QSGContext); -- cgit v1.2.3