Handle context loss in QPlatformBackingStore
This powers a QQuickWidget and we also need to reset the context if we get a context loss event. Change-Id: Id8b7112606670985860069c2bb11cf141b3ac723 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
This commit is contained in:
parent
c962c77044
commit
3425c9c6d7
@ -338,7 +338,16 @@ void QPlatformBackingStore::composeAndFlush(QWindow *window, const QRegion ®i
|
||||
}
|
||||
}
|
||||
|
||||
if (!d_ptr->context->makeCurrent(window)) {
|
||||
bool current = d_ptr->context->makeCurrent(window);
|
||||
|
||||
if (!current && !d_ptr->context->isValid()) {
|
||||
delete d_ptr->blitter;
|
||||
d_ptr->blitter = nullptr;
|
||||
d_ptr->textureId = 0;
|
||||
current = d_ptr->context->create() && d_ptr->context->makeCurrent(window);
|
||||
}
|
||||
|
||||
if (!current) {
|
||||
qCWarning(lcQpaBackingStore, "composeAndFlush: makeCurrent() failed");
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user