2007-11-15 Emmanuele Bassi <ebassi@openedhand.com>

* clutter/clutter-texture.c:
	(clutter_texture_request_coords), (clutter_texture_class_init),
	(clutter_texture_init): Unset :sync-size if explicitly setting
	the texture size. (#616)
This commit is contained in:
Emmanuele Bassi 2007-11-15 17:38:40 +00:00
parent 75d186c3f9
commit c640b05182
2 changed files with 41 additions and 18 deletions

View File

@ -1,3 +1,10 @@
2007-11-15 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-texture.c:
(clutter_texture_request_coords), (clutter_texture_class_init),
(clutter_texture_init): Unset :sync-size if explicitly setting
the texture size. (#616)
2007-11-15 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.[ch]: Massive API clean-ups. Initial

View File

@ -767,6 +767,20 @@ clutter_texture_paint (ClutterActor *self)
cogl_pop_matrix ();
}
static void
clutter_texture_request_coords (ClutterActor *self,
ClutterActorBox *box)
{
ClutterTexture *texture = CLUTTER_TEXTURE (self);
ClutterActorBox old_request;
clutter_actor_query_coords (self, &old_request);
if (((box->x2 - box->x1) != (old_request.x2 - old_request.x1)) ||
((box->y2 - box->y1) != (old_request.y2 - old_request.y1)))
texture->priv->sync_actor_size = FALSE;
}
static void
clutter_texture_dispose (GObject *object)
{
@ -904,6 +918,7 @@ clutter_texture_class_init (ClutterTextureClass *klass)
actor_class->unrealize = clutter_texture_unrealize;
actor_class->show = clutter_texture_show;
actor_class->hide = clutter_texture_hide;
actor_class->request_coords = clutter_texture_request_coords;
gobject_class->dispose = clutter_texture_dispose;
gobject_class->set_property = clutter_texture_set_property;
@ -938,7 +953,7 @@ clutter_texture_class_init (ClutterTextureClass *klass)
"Auto sync size of actor to underlying pixbuf"
"dimentions",
TRUE,
G_PARAM_CONSTRUCT | CLUTTER_PARAM_READWRITE));
CLUTTER_PARAM_READWRITE));
g_object_class_install_property
(gobject_class, PROP_REPEAT_X,
@ -947,7 +962,7 @@ clutter_texture_class_init (ClutterTextureClass *klass)
"Reapeat underlying pixbuf rather than scale"
"in x direction. Currently UNWORKING",
FALSE,
G_PARAM_CONSTRUCT | CLUTTER_PARAM_READWRITE));
CLUTTER_PARAM_READWRITE));
g_object_class_install_property
(gobject_class, PROP_REPEAT_Y,
@ -956,7 +971,7 @@ clutter_texture_class_init (ClutterTextureClass *klass)
"Reapeat underlying pixbuf rather than scale"
"in y direction. Currently UNWORKING",
FALSE,
G_PARAM_CONSTRUCT | CLUTTER_PARAM_READWRITE));
CLUTTER_PARAM_READWRITE));
/* FIXME: Ideally this option needs to have some kind of global
* overide as to imporve performance.
@ -972,7 +987,7 @@ clutter_texture_class_init (ClutterTextureClass *klass)
0,
G_MAXINT,
1,
G_PARAM_CONSTRUCT | CLUTTER_PARAM_READWRITE));
CLUTTER_PARAM_READWRITE));
g_object_class_install_property
(gobject_class, PROP_MAX_TILE_WASTE,
@ -1057,6 +1072,7 @@ clutter_texture_init (ClutterTexture *self)
priv->pixel_format = CGL_RGBA;
priv->repeat_x = FALSE;
priv->repeat_y = FALSE;
priv->sync_actor_size = TRUE;
if (clutter_feature_available (CLUTTER_FEATURE_TEXTURE_RECTANGLE))
{