55 QPlatformBackingStoreRhiConfig()
59 QPlatformBackingStoreRhiConfig(Api api)
64 bool isEnabled()
const {
return m_enable; }
65 void setEnabled(
bool enable) { m_enable = enable; }
67 Api api()
const {
return m_api; }
68 void setApi(Api api) { m_api = api; }
70 bool isDebugLayerEnabled()
const {
return m_debugLayer; }
71 void setDebugLayer(
bool enable) { m_debugLayer = enable; }
76 bool m_debugLayer =
false;
77 friend bool operator==(
const QPlatformBackingStoreRhiConfig &a,
const QPlatformBackingStoreRhiConfig &b);
95 Q_DECLARE_PRIVATE(QPlatformTextureList)
100 NeedsPremultipliedAlphaBlending = 0x04,
101 MirrorVertically = 0x08
103 Q_DECLARE_FLAGS(Flags, Flag)
105 explicit QPlatformTextureList(QObject *parent =
nullptr);
106 ~QPlatformTextureList();
109 bool isEmpty()
const {
return count() == 0; }
110 QRhiTexture *texture(
int index)
const;
111 QRhiTexture *textureExtra(
int index)
const;
112 QRect geometry(
int index)
const;
113 QRect clipRect(
int index)
const;
114 void *source(
int index);
115 Flags flags(
int index)
const;
117 bool isLocked()
const;
119 void appendTexture(
void *source, QRhiTexture *texture,
const QRect &geometry,
120 const QRect &clipRect = QRect(), Flags flags = { });
122 void appendTexture(
void *source, QRhiTexture *textureLeft, QRhiTexture *textureRight,
const QRect &geometry,
123 const QRect &clipRect = QRect(), Flags flags = { });
131class Q_GUI_EXPORT QPlatformBackingStore
137 FlushFailedDueToLostDevice
140 explicit QPlatformBackingStore(QWindow *window);
141 virtual ~QPlatformBackingStore();
143 QWindow *window()
const;
144 QBackingStore *backingStore()
const;
146 virtual QPaintDevice *paintDevice() = 0;
148 virtual void flush(QWindow *window,
const QRegion ®ion,
const QPoint &offset);
150 virtual FlushResult rhiFlush(QWindow *window,
151 qreal sourceDevicePixelRatio,
152 const QRegion ®ion,
153 const QPoint &offset,
154 QPlatformTextureList *textures,
155 bool translucentBackground,
156 qreal sourceTransformFactor = 0);
158 virtual QImage toImage()
const;
161 TextureSwizzle = 0x01,
163 TexturePremultiplied = 0x04
165 Q_DECLARE_FLAGS(TextureFlags, TextureFlag)
166 virtual QRhiTexture *toTexture(QRhiResourceUpdateBatch *resourceUpdates,
167 const QRegion &dirtyRegion,
168 TextureFlags *flags)
const;
170 virtual QPlatformGraphicsBuffer *graphicsBuffer()
const;
172 virtual void resize(
const QSize &size,
const QRegion &staticContents) = 0;
174 virtual bool scroll(
const QRegion &area,
int dx,
int dy);
176 virtual void beginPaint(
const QRegion &);
177 virtual void endPaint();
179 void createRhi(QWindow *window, QPlatformBackingStoreRhiConfig config);
180 QRhi *rhi(QWindow *window)
const;
181 void surfaceAboutToBeDestroyed();
182 void graphicsDeviceReportedLost(QWindow *window);
185 QPlatformBackingStorePrivate *d_ptr;
187 void setBackingStore(QBackingStore *);
188 friend class QBackingStore;
QPlatformTextureList::Flags flags
QRhiTexture * textureExtra