From: Laszlo Agocs Date: Tue, 25 Mar 2014 14:01:44 +0000 (+0100) Subject: Pass the actual window format to the offscreen surface during cleanup X-Git-Tag: upstream/5.2.95+rc1^2~103 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=577fd8b43dbfcf7fd319eade620b93764a1c94ca;p=platform%2Fupstream%2Fqtdeclarative.git Pass the actual window format to the offscreen surface during cleanup Using the requested format (we don't have anything else since the platform window is gone) is wrong on EGL implementations that offer a different set of configurations for window and pbuffer surfaces, because we may end up with a pbuffer surface that is incompatible with the context/window due to having different color buffer sizes. To be absolutely sure that the surface is compatible, store the actual surface format so that it is available even after the platform window is gone. Change-Id: Id17c25439c463d4c37af95fc90f336d3f67c6427 Reviewed-by: Gunnar Sletta Reviewed-by: Lars Knoll --- diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp index 4adcb3ccf..40243a5b1 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp +++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp @@ -850,6 +850,7 @@ void QSGThreadedRenderLoop::show(QQuickWindow *window) Window win; win.window = window; + win.actualWindowFormat = window->format(); win.thread = new QSGRenderThread(this, QQuickWindowPrivate::get(window)->context); win.timerId = 0; win.updateDuringSync = false; @@ -1102,7 +1103,7 @@ void QSGThreadedRenderLoop::releaseResources(QQuickWindow *window, bool inDestru if (!window->handle()) { QSG_GUI_DEBUG(w->window, " - using fallback surface"); fallback = new QOffscreenSurface(); - fallback->setFormat(window->requestedFormat()); + fallback->setFormat(w->actualWindowFormat); fallback->create(); } diff --git a/src/quick/scenegraph/qsgthreadedrenderloop_p.h b/src/quick/scenegraph/qsgthreadedrenderloop_p.h index e142f7f2c..82ab2cdaa 100644 --- a/src/quick/scenegraph/qsgthreadedrenderloop_p.h +++ b/src/quick/scenegraph/qsgthreadedrenderloop_p.h @@ -87,6 +87,7 @@ private: struct Window { QQuickWindow *window; QSGRenderThread *thread; + QSurfaceFormat actualWindowFormat; int timerId; uint updateDuringSync : 1; };