summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qplatformbackingstore.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/painting/qplatformbackingstore.h')
-rw-r--r--src/gui/painting/qplatformbackingstore.h38
1 files changed, 15 insertions, 23 deletions
diff --git a/src/gui/painting/qplatformbackingstore.h b/src/gui/painting/qplatformbackingstore.h
index a1bae50555..a6cb43b4e6 100644
--- a/src/gui/painting/qplatformbackingstore.h
+++ b/src/gui/painting/qplatformbackingstore.h
@@ -23,7 +23,7 @@
QT_BEGIN_NAMESPACE
-Q_GUI_EXPORT Q_DECLARE_LOGGING_CATEGORY(lcQpaBackingStore)
+QT_DECLARE_EXPORTED_QT_LOGGING_CATEGORY(lcQpaBackingStore, Q_GUI_EXPORT)
class QRegion;
class QRect;
@@ -36,17 +36,20 @@ class QPlatformGraphicsBuffer;
class QRhi;
class QRhiTexture;
class QRhiResourceUpdateBatch;
-class QRhiSwapChain;
struct Q_GUI_EXPORT QPlatformBackingStoreRhiConfig
{
+ Q_GADGET
+public:
enum Api {
OpenGL,
Metal,
Vulkan,
D3D11,
+ D3D12,
Null
};
+ Q_ENUM(Api)
QPlatformBackingStoreRhiConfig()
: m_enable(false)
@@ -66,22 +69,10 @@ struct Q_GUI_EXPORT QPlatformBackingStoreRhiConfig
bool isDebugLayerEnabled() const { return m_debugLayer; }
void setDebugLayer(bool enable) { m_debugLayer = enable; }
- QByteArrayList instanceExtensions() const { return m_instanceExtensions; }
- void setInstanceExtensions(const QByteArrayList &e) { m_instanceExtensions = e; }
-
- QByteArrayList instanceLayers() const { return m_instanceLayers; }
- void setInstanceLayers(const QByteArrayList &e) { m_instanceLayers = e; }
-
- QByteArrayList deviceExtensions() const { return m_deviceExtensions; }
- void setDeviceExtensions(const QByteArrayList &e) { m_deviceExtensions = e; }
-
private:
bool m_enable;
Api m_api = Null;
bool m_debugLayer = false;
- QByteArrayList m_instanceExtensions;
- QByteArrayList m_instanceLayers;
- QByteArrayList m_deviceExtensions;
friend bool operator==(const QPlatformBackingStoreRhiConfig &a, const QPlatformBackingStoreRhiConfig &b);
};
@@ -89,10 +80,7 @@ inline bool operator==(const QPlatformBackingStoreRhiConfig &a, const QPlatformB
{
return a.m_enable == b.m_enable
&& a.m_api == b.m_api
- && a.m_debugLayer == b.m_debugLayer
- && a.m_instanceExtensions == b.m_instanceExtensions
- && a.m_instanceLayers == b.m_instanceLayers
- && a.m_deviceExtensions == b.m_deviceExtensions;
+ && a.m_debugLayer == b.m_debugLayer;
}
inline bool operator!=(const QPlatformBackingStoreRhiConfig &a, const QPlatformBackingStoreRhiConfig &b)
@@ -108,7 +96,8 @@ public:
enum Flag {
StacksOnTop = 0x01,
TextureIsSrgb = 0x02,
- NeedsPremultipliedAlphaBlending = 0x04
+ NeedsPremultipliedAlphaBlending = 0x04,
+ MirrorVertically = 0x08
};
Q_DECLARE_FLAGS(Flags, Flag)
@@ -118,6 +107,7 @@ public:
int count() const;
bool isEmpty() const { return count() == 0; }
QRhiTexture *texture(int index) const;
+ QRhiTexture *textureExtra(int index) const;
QRect geometry(int index) const;
QRect clipRect(int index) const;
void *source(int index);
@@ -127,6 +117,9 @@ public:
void appendTexture(void *source, QRhiTexture *texture, const QRect &geometry,
const QRect &clipRect = QRect(), Flags flags = { });
+
+ void appendTexture(void *source, QRhiTexture *textureLeft, QRhiTexture *textureRight, const QRect &geometry,
+ const QRect &clipRect = QRect(), Flags flags = { });
void clear();
Q_SIGNALS:
@@ -181,11 +174,10 @@ public:
virtual void beginPaint(const QRegion &);
virtual void endPaint();
- void setRhiConfig(const QPlatformBackingStoreRhiConfig &config);
- QRhi *rhi() const;
- QRhiSwapChain *rhiSwapChain() const;
+ void createRhi(QWindow *window, QPlatformBackingStoreRhiConfig config);
+ QRhi *rhi(QWindow *window) const;
void surfaceAboutToBeDestroyed();
- void graphicsDeviceReportedLost();
+ void graphicsDeviceReportedLost(QWindow *window);
private:
QPlatformBackingStorePrivate *d_ptr;