summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qplatformbackingstore.h
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2020-01-21 15:21:00 +0100
committerJohan Klokkhammer Helsing <johan.helsing@qt.io>2020-02-03 22:05:44 +0100
commita13e8d6660913bec172d1374f78083498c539df0 (patch)
treeb1a2572fb71a9a896825e2cbbf9653abd9797d0d /src/gui/painting/qplatformbackingstore.h
parentc6e1b54f94e84950ee12c3bb2be0641f5742056b (diff)
Move backing store OpenGL support to the platformcompositor module
QPlatformBackingStore had a dependency on the QOpenGLTextureBlitter, which is a problem because we want to get rid of all the public QOpenGL* classes in the gui module. This splits the heavily QOpenGL dependent parts of the backing store implementation into a separate class and moves it to the platformcompositor module. qplatformbackingstore.cpp is now mostly free from OpenGL implementation details. Platform integrations now have to explicitly request backing store OpenGL support. This has been done for: - xcb - windows - cocoa - winrt - android - wasm - ios QPlatformGraphicsBufferHelper::lockAndBindToTexture is now exported so it can be used from other modules. Task-number: QTBUG-74409 Change-Id: I42ad9250e5a424939cf751a8ad880c7381ede2ae Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/gui/painting/qplatformbackingstore.h')
-rw-r--r--src/gui/painting/qplatformbackingstore.h16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/gui/painting/qplatformbackingstore.h b/src/gui/painting/qplatformbackingstore.h
index 7aa054f1e2..2a3d7d20b5 100644
--- a/src/gui/painting/qplatformbackingstore.h
+++ b/src/gui/painting/qplatformbackingstore.h
@@ -67,11 +67,10 @@ class QRect;
class QPoint;
class QImage;
class QPlatformBackingStorePrivate;
-class QPlatformWindow;
class QPlatformTextureList;
class QPlatformTextureListPrivate;
-class QOpenGLContext;
class QPlatformGraphicsBuffer;
+class QPlatformBackingStoreOpenGLSupportBase;
#ifndef QT_NO_OPENGL
class Q_GUI_EXPORT QPlatformTextureList : public QObject
@@ -118,6 +117,8 @@ public:
QWindow *window() const;
QBackingStore *backingStore() const;
+ void setOpenGLSupport(QPlatformBackingStoreOpenGLSupportBase *openGLSupport);
+
virtual QPaintDevice *paintDevice() = 0;
virtual void flush(QWindow *window, const QRegion &region, const QPoint &offset) = 0;
@@ -154,6 +155,17 @@ private:
};
#ifndef QT_NO_OPENGL
+class Q_GUI_EXPORT QPlatformBackingStoreOpenGLSupportBase // pure interface
+{
+public:
+ virtual void composeAndFlush(QWindow *window, const QRegion &region, const QPoint &offset,
+ QPlatformTextureList *textures, bool translucentBackground) = 0;
+ virtual GLuint toTexture(const QRegion &dirtyRegion, QSize *textureSize, QPlatformBackingStore::TextureFlags *flags) const = 0;
+ virtual ~QPlatformBackingStoreOpenGLSupportBase() {}
+};
+#endif // QT_NO_OPENGL
+
+#ifndef QT_NO_OPENGL
Q_DECLARE_OPERATORS_FOR_FLAGS(QPlatformBackingStore::TextureFlags)
#endif