From b39f33e311b603c6835b919778100e60759fa870 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Wed, 1 Apr 2020 18:49:59 +0200 Subject: 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 --- src/opengl/qplatformbackingstoreopenglsupport.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/opengl/qplatformbackingstoreopenglsupport.cpp') diff --git a/src/opengl/qplatformbackingstoreopenglsupport.cpp b/src/opengl/qplatformbackingstoreopenglsupport.cpp index 511d85a400b..a188d25db5e 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 -- cgit v1.2.3