131void QPlatformTextureList::appendTexture(
void *source, QRhiTexture *texture,
const QRect &geometry,
132 const QRect &clipRect, Flags flags)
134 Q_D(QPlatformTextureList);
135 QBackingstoreTextureInfo bi;
137 bi.texture = texture;
138 bi.textureExtra =
nullptr;
140 bi.clipRect = clipRect;
142 d->textures.append(bi);
145void QPlatformTextureList::appendTexture(
void *source, QRhiTexture *textureLeft, QRhiTexture *textureRight,
const QRect &geometry,
146 const QRect &clipRect, Flags flags)
148 Q_D(QPlatformTextureList);
150 QBackingstoreTextureInfo bi;
152 bi.texture = textureLeft;
153 bi.textureExtra = textureRight;
155 bi.clipRect = clipRect;
157 d->textures.append(bi);
211QPlatformBackingStore::FlushResult QPlatformBackingStore::rhiFlush(QWindow *window,
212 qreal sourceDevicePixelRatio,
213 const QRegion ®ion,
214 const QPoint &offset,
215 QPlatformTextureList *textures,
216 bool translucentBackground,
217 qreal sourceTransformFactor)
219 auto &surfaceSupport = d_ptr->surfaceSupport[window->surfaceType()];
220 return surfaceSupport.compositor.flush(
this,
221 surfaceSupport.rhiSupport.rhi(),
222 surfaceSupport.rhiSupport.swapChainForWindow(window),
223 window, sourceDevicePixelRatio, region, offset, textures,
224 translucentBackground, sourceTransformFactor);
270QRhiTexture *QPlatformBackingStore::toTexture(QRhiResourceUpdateBatch *resourceUpdates,
271 const QRegion &dirtyRegion,
272 TextureFlags *flags)
const
274 auto &surfaceSupport = d_ptr->surfaceSupport[window()->surfaceType()];
275 return surfaceSupport.compositor.toTexture(
this,
276 surfaceSupport.rhiSupport.rhi(), resourceUpdates,
372void QPlatformBackingStore::createRhi(QWindow *window, QPlatformBackingStoreRhiConfig config)
374 if (!config.isEnabled())
377 qCDebug(lcQpaBackingStore) <<
"Setting up RHI support in" <<
this
378 <<
"for" << window <<
"with" << window->surfaceType()
379 <<
"and requested API" << config.api();
381 auto &support = d_ptr->surfaceSupport[window->surfaceType()];
382 if (!support.rhiSupport.rhi()) {
383 support.rhiSupport.setConfig(config);
384 support.rhiSupport.setWindow(window);
385 support.rhiSupport.setFormat(window->format());
386 support.rhiSupport.create();
388 qCDebug(lcQpaBackingStore) <<
"Window already has RHI support"
389 <<
"with backend" << support.rhiSupport.rhi()->backendName();
399void QPlatformBackingStore::graphicsDeviceReportedLost(QWindow *window)
401 auto &surfaceSupport = d_ptr->surfaceSupport[window->surfaceType()];
402 if (!surfaceSupport.rhiSupport.rhi())
405 qWarning(
"Rhi backingstore: graphics device lost, attempting to reinitialize");
406 surfaceSupport.compositor.reset();
407 surfaceSupport.rhiSupport.reset();
408 surfaceSupport.rhiSupport.create();
409 if (!surfaceSupport.rhiSupport.rhi())
410 qWarning(
"Rhi backingstore: failed to reinitialize after losing the device");
QPlatformTextureList::Flags flags
QRhiTexture * textureExtra