diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2020-04-01 18:49:59 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2020-05-29 19:01:57 +0200 |
commit | b39f33e311b603c6835b919778100e60759fa870 (patch) | |
tree | 4e84e3623060a7213be82696cf6c6d4fea11423c /src/gui/painting/qplatformbackingstore.h | |
parent | c4e09cf26790d6d293efd0e389517dcaf7f34d85 (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/gui/painting/qplatformbackingstore.h')
-rw-r--r-- | src/gui/painting/qplatformbackingstore.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/gui/painting/qplatformbackingstore.h b/src/gui/painting/qplatformbackingstore.h index 2a3d7d20b5..e0fdca2f21 100644 --- a/src/gui/painting/qplatformbackingstore.h +++ b/src/gui/painting/qplatformbackingstore.h @@ -117,8 +117,6 @@ public: QWindow *window() const; QBackingStore *backingStore() const; - void setOpenGLSupport(QPlatformBackingStoreOpenGLSupportBase *openGLSupport); - virtual QPaintDevice *paintDevice() = 0; virtual void flush(QWindow *window, const QRegion ®ion, const QPoint &offset) = 0; @@ -155,13 +153,24 @@ private: }; #ifndef QT_NO_OPENGL -class Q_GUI_EXPORT QPlatformBackingStoreOpenGLSupportBase // pure interface +class Q_GUI_EXPORT QPlatformBackingStoreOpenGLSupportBase { public: virtual void composeAndFlush(QWindow *window, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground) = 0; virtual GLuint toTexture(const QRegion &dirtyRegion, QSize *textureSize, QPlatformBackingStore::TextureFlags *flags) const = 0; virtual ~QPlatformBackingStoreOpenGLSupportBase() {} + + using FactoryFunction = QPlatformBackingStoreOpenGLSupportBase *(*)(); + static void setFactoryFunction(FactoryFunction); + static FactoryFunction factoryFunction(); + +protected: + QPlatformBackingStore *backingStore = nullptr; + friend class QPlatformBackingStore; + +private: + static FactoryFunction s_factoryFunction; }; #endif // QT_NO_OPENGL |