54 QPlatformBackingStoreRhiConfig()
58 QPlatformBackingStoreRhiConfig(Api api)
63 bool isEnabled()
const {
return m_enable; }
64 void setEnabled(
bool enable) { m_enable = enable; }
66 Api api()
const {
return m_api; }
67 void setApi(Api api) { m_api = api; }
69 bool isDebugLayerEnabled()
const {
return m_debugLayer; }
70 void setDebugLayer(
bool enable) { m_debugLayer = enable; }
75 bool m_debugLayer =
false;
76 friend bool operator==(
const QPlatformBackingStoreRhiConfig &a,
const QPlatformBackingStoreRhiConfig &b);
94 Q_DECLARE_PRIVATE(QPlatformTextureList)
99 NeedsPremultipliedAlphaBlending = 0x04,
100 MirrorVertically = 0x08
102 Q_DECLARE_FLAGS(Flags, Flag)
104 explicit QPlatformTextureList(QObject *parent =
nullptr);
105 ~QPlatformTextureList();
108 bool isEmpty()
const {
return count() == 0; }
109 QRhiTexture *texture(
int index)
const;
110 QRhiTexture *textureExtra(
int index)
const;
111 QRect geometry(
int index)
const;
112 QRect clipRect(
int index)
const;
113 void *source(
int index);
114 Flags flags(
int index)
const;
116 bool isLocked()
const;
118 void appendTexture(
void *source, QRhiTexture *texture,
const QRect &geometry,
119 const QRect &clipRect = QRect(), Flags flags = { });
121 void appendTexture(
void *source, QRhiTexture *textureLeft, QRhiTexture *textureRight,
const QRect &geometry,
122 const QRect &clipRect = QRect(), Flags flags = { });
130class Q_GUI_EXPORT QPlatformBackingStore
136 FlushFailedDueToLostDevice
139 explicit QPlatformBackingStore(QWindow *window);
140 virtual ~QPlatformBackingStore();
142 QWindow *window()
const;
143 QBackingStore *backingStore()
const;
145 virtual QPaintDevice *paintDevice() = 0;
147 virtual void flush(QWindow *window,
const QRegion ®ion,
const QPoint &offset);
149 virtual FlushResult rhiFlush(QWindow *window,
150 qreal sourceDevicePixelRatio,
151 const QRegion ®ion,
152 const QPoint &offset,
153 QPlatformTextureList *textures,
154 bool translucentBackground,
155 qreal sourceTransformFactor = 0);
157 virtual QImage toImage()
const;
160 TextureSwizzle = 0x01,
162 TexturePremultiplied = 0x04
164 Q_DECLARE_FLAGS(TextureFlags, TextureFlag)
165 virtual QRhiTexture *toTexture(QRhiResourceUpdateBatch *resourceUpdates,
166 const QRegion &dirtyRegion,
167 TextureFlags *flags)
const;
169 virtual QPlatformGraphicsBuffer *graphicsBuffer()
const;
171 virtual void resize(
const QSize &size,
const QRegion &staticContents) = 0;
173 virtual bool scroll(
const QRegion &area,
int dx,
int dy);
175 virtual void beginPaint(
const QRegion &);
176 virtual void endPaint();
178 void createRhi(QWindow *window, QPlatformBackingStoreRhiConfig config);
179 QRhi *rhi(QWindow *window)
const;
180 void surfaceAboutToBeDestroyed();
181 void graphicsDeviceReportedLost(QWindow *window);
184 QPlatformBackingStorePrivate *d_ptr;
186 void setBackingStore(QBackingStore *);
187 friend class QBackingStore;
QPlatformTextureList::Flags flags
QRhiTexture * textureExtra