Fix flicker when showing QQuickWidget
authorLaszlo Agocs <laszlo.agocs@digia.com>
Thu, 14 Aug 2014 10:58:55 +0000 (12:58 +0200)
committerLaszlo Agocs <laszlo.agocs@digia.com>
Thu, 14 Aug 2014 13:58:45 +0000 (15:58 +0200)
commitddb134af9903512408b7e52455f1787e4b6b62ea
treeb4ad1bb20aa7ee322ccd283876eb8d4625652ab8
parentccb1eb743d11e7e6658e6ad72c12b39d39b4c9eb
Fix flicker when showing QQuickWidget

This also reintroduces the change from commit 14b4747b17d522fe57f3a5f21738c5a89323b5e2.
Due to some bizarre merge issue that change has disappeared from qquickwidget.cpp
and its history. It is there in the main log, though.

The new fix depends on this older one, so the combined one fixes the following
three issues:

1. Polish and sync cannot be skipped when we are rendering for the first time.

2. Recreating the fbo twice when the widget is shown. Calling
createFramebufferObject() is not necessary in this case since createContext()
will trigger this anyhow due to scenegraphInitialized().

3. Avoid recreating the fbo when the size is the same as before. Some platforms
are keen on sending resize events with the same size. These should be ignored.
What's worse, some platforms (cocoa) generate a resize on exitting (Cmd-Q)
and not ignoring the resize at that stage is dangerous since the scenegraph
is already invalidated.

Task-number: QTBUG-40710
Task-number: QTBUG-40505
Change-Id: I2e897acc68fa68233563a1db63ffb6c5d0baad73
Reviewed-by: Gunnar Sletta <gunnar.sletta@jollamobile.com>
src/quickwidgets/qquickwidget.cpp