summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/qplatformbackingstoreopenglsupport.cpp12
-rw-r--r--src/opengl/qplatformbackingstoreopenglsupport.h2
2 files changed, 12 insertions, 2 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
diff --git a/src/opengl/qplatformbackingstoreopenglsupport.h b/src/opengl/qplatformbackingstoreopenglsupport.h
index 8868703deb..4821f7300f 100644
--- a/src/opengl/qplatformbackingstoreopenglsupport.h
+++ b/src/opengl/qplatformbackingstoreopenglsupport.h
@@ -64,14 +64,12 @@ class QOpenGLBackingStore;
class Q_OPENGL_EXPORT QPlatformBackingStoreOpenGLSupport : public QPlatformBackingStoreOpenGLSupportBase
{
public:
- explicit QPlatformBackingStoreOpenGLSupport(QPlatformBackingStore *backingStore) : backingStore(backingStore) {}
~QPlatformBackingStoreOpenGLSupport() override;
void composeAndFlush(QWindow *window, const QRegion &region, const QPoint &offset,
QPlatformTextureList *textures, bool translucentBackground) override;
GLuint toTexture(const QRegion &dirtyRegion, QSize *textureSize, QPlatformBackingStore::TextureFlags *flags) const override;
private:
- QPlatformBackingStore *backingStore = nullptr;
QScopedPointer<QOpenGLContext> context;
mutable GLuint textureId = 0;
mutable QSize textureSize;