Threaded render loop should block until the frame is swapped.

Introduced the concept of an expose cycle, as the WM_Expose
is followed by WM_RequestSync and only after we handled the
sync and then swap, should we unlock. Otherwise, we are
potentially waiting for the wrong swap.

This also fixes a bug when we get an expose while the render
thread is animating on its own. We would previously set
RequestRepaint, but this could potentially be reset by a render
thread animation if the GUI thread took a short while getting
to the point where it sent the RequestSync. If that requestsync
did not result in SG changes, we would not render anything.
With the exposeCycle, we are now guaranteed to repaint after
we handled the sync, which is how it should be.

Task-number: QTBUG-35805

Change-Id: Ib5c588f135763142e57f84b39dd3827fd05b9485
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
Ensure that ShaderEffectSource's texture has correct parameters.

The provider is created on demand in textureProvider(), but its
parameters are set in updatePaintNode() so if updatePaintNode() was
called before a consumer asked for the texture provider, they wouldn't
be set until the next time updatePaintNode() was called.

Change-Id: Iff866d50a8fe16f3d371cb8e590528f5f8c5ee61
Reviewed-by: Mikko Harju <mikko.harju@jolla.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>