summaryrefslogtreecommitdiffstats
path: root/src/opengl/qplatformbackingstoreopenglsupport.cpp
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2020-04-01 18:49:59 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2020-05-29 19:01:57 +0200
commitb39f33e311b603c6835b919778100e60759fa870 (patch)
tree4e84e3623060a7213be82696cf6c6d4fea11423c /src/opengl/qplatformbackingstoreopenglsupport.cpp
parentc4e09cf26790d6d293efd0e389517dcaf7f34d85 (diff)
Move QPlatformBackingStoreOpenGLSupport handling out of platform plugins
Allows them to not depend on QtOpenGL just to provide the default backing store OpenGL support backend. Change-Id: I90d6d9247ce76848d9d03e2d512fb736c81488d3 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/opengl/qplatformbackingstoreopenglsupport.cpp')
-rw-r--r--src/opengl/qplatformbackingstoreopenglsupport.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/opengl/qplatformbackingstoreopenglsupport.cpp b/src/opengl/qplatformbackingstoreopenglsupport.cpp
index 511d85a400..a188d25db5 100644
--- a/src/opengl/qplatformbackingstoreopenglsupport.cpp
+++ b/src/opengl/qplatformbackingstoreopenglsupport.cpp
@@ -450,6 +450,18 @@ GLuint QPlatformBackingStoreOpenGLSupport::toTexture(const QRegion &dirtyRegion,
return textureId;
}
+static QPlatformBackingStoreOpenGLSupportBase *createOpenGLSupport()
+{
+ return new QPlatformBackingStoreOpenGLSupport;
+}
+
+static void setDefaultOpenGLSupportFactoryFunction()
+{
+ if (!QPlatformBackingStoreOpenGLSupportBase::factoryFunction())
+ QPlatformBackingStoreOpenGLSupportBase::setFactoryFunction(createOpenGLSupport);
+}
+Q_CONSTRUCTOR_FUNCTION(setDefaultOpenGLSupportFactoryFunction);
+
#endif // QT_NO_OPENGL
QT_END_NAMESPACE