Fix resizing canvas with renderStrategy == Cooperative
authorGunnar Sletta <gunnar.sletta@digia.com>
Wed, 12 Jun 2013 14:30:05 +0000 (16:30 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Thu, 13 Jun 2013 08:00:56 +0000 (10:00 +0200)
commite500396d12c9f0155797ff53e347bf8ba9f69c7a
tree48d02db4241f5834562f990ec4744296df22bfaa
parentd1b549956423867054732e233b05a61501c44360
Fix resizing canvas with renderStrategy == Cooperative

updatePolish() called prepare() which would use a queued
metaInvoke() to change the size of the texture. However,
there is no guaranteed event processing on the render thread
between polish on the GUI thread and sync on the render
thread, we would very often get to updatePaintNode() before
the queued invoke landed, resulting the drawing being done
to a texture of the wrong size.

Fix this by calling prepare from updatePaintNode when
in CooperativeMode so that the autoconnection becomes
a direct one and we get prepare and flush processed in
the right order.

Change-Id: I0fa4687a94ada4bdaddca19133e686bca0bc745c
Reviewed-by: Alan Alpert <aalpert@blackberry.com>
src/quick/items/context2d/qquickcanvasitem.cpp