cairo-texture: Disable :sync-size

The :sync-size property of ClutterTexture should be set to FALSE by
default by ClutterCairoTexture. The preferred size of the
ClutterCairoTexture is already the size of the internal Cairo surface,
and we override the preferred width/height getters to that effect.

The :sync-size property is also responsible of changing the size of
the Texture actor when changing the texture handle - but since we
encourage that to happen during the CairoTexture allocation, we get a
queue_relayout() invocation (and a warning) when we change the size
of the Cairo image surface.

Since GObject doesn't make it easy to override the default value of the
:sync-size property in sub-classes, we should simply call the setter
function during the ClutterCairoTexture instance initialization.

We should also change one of the interactive tests using a CairoTexture
to rebuild the contents of the actor in response to an allocation.
This commit is contained in:
Emmanuele Bassi
2010-06-16 13:58:41 +01:00
parent 72fa820dbd
commit 2d99f77e3b
2 changed files with 65 additions and 9 deletions

View File

@ -430,6 +430,14 @@ clutter_cairo_texture_init (ClutterCairoTexture *self)
* match that format
*/
priv->format = CAIRO_FORMAT_ARGB32;
/* the Cairo surface is responsible for driving the size of
* the texture; if we let sync_size to its default of TRUE,
* the Texture will try to queue a relayout every time we
* change the size of the Cairo surface - which is not what
* we want
*/
clutter_texture_set_sync_size (CLUTTER_TEXTURE (self), FALSE);
}
/**