From a13e8d6660913bec172d1374f78083498c539df0 Mon Sep 17 00:00:00 2001 From: Johan Klokkhammer Helsing Date: Tue, 21 Jan 2020 15:21:00 +0100 Subject: 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 Reviewed-by: Qt CI Bot --- src/gui/painting/qplatformbackingstore.h | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/gui/painting/qplatformbackingstore.h') 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 ®ion, const QPoint &offset) = 0; @@ -153,6 +154,17 @@ private: friend class QBackingStore; }; +#ifndef QT_NO_OPENGL +class Q_GUI_EXPORT QPlatformBackingStoreOpenGLSupportBase // pure interface +{ +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() {} +}; +#endif // QT_NO_OPENGL + #ifndef QT_NO_OPENGL Q_DECLARE_OPERATORS_FOR_FLAGS(QPlatformBackingStore::TextureFlags) #endif -- cgit v1.2.3