cullable: Use relative actor coordinates for culling

This ensures that nested cullables work fine.
This commit is contained in:
Jasper St. Pierre 2013-11-25 15:27:48 -05:00
parent f5bb6e407f
commit c1f5741ac0
3 changed files with 10 additions and 13 deletions

View File

@ -93,8 +93,10 @@ meta_actor_vertices_are_untransformed (ClutterVertex *verts,
v3x != v1x || v3y != v2y) v3x != v1x || v3y != v2y)
return FALSE; return FALSE;
*x_origin = x; if (x_origin)
*y_origin = y; *x_origin = x;
if (y_origin)
*y_origin = y;
return TRUE; return TRUE;
} }

View File

@ -69,7 +69,7 @@ meta_cullable_cull_out_children (MetaCullable *cullable,
clutter_actor_iter_init (&iter, actor); clutter_actor_iter_init (&iter, actor);
while (clutter_actor_iter_prev (&iter, &child)) while (clutter_actor_iter_prev (&iter, &child))
{ {
int x, y; float x, y;
if (!CLUTTER_ACTOR_IS_VISIBLE (child)) if (!CLUTTER_ACTOR_IS_VISIBLE (child))
continue; continue;
@ -96,9 +96,11 @@ meta_cullable_cull_out_children (MetaCullable *cullable,
if (!META_IS_CULLABLE (child)) if (!META_IS_CULLABLE (child))
continue; continue;
if (!meta_actor_is_untransformed (child, &x, &y)) if (!meta_actor_is_untransformed (child, NULL, NULL))
continue; continue;
clutter_actor_get_position (child, &x, &y);
/* Temporarily move to the coordinate system of the actor */ /* Temporarily move to the coordinate system of the actor */
cairo_region_translate (unobscured_region, - x, - y); cairo_region_translate (unobscured_region, - x, - y);
cairo_region_translate (clip_region, - x, - y); cairo_region_translate (clip_region, - x, - y);

View File

@ -252,15 +252,8 @@ meta_shaped_texture_paint (ClutterActor *actor)
filter = COGL_PIPELINE_FILTER_LINEAR; filter = COGL_PIPELINE_FILTER_LINEAR;
if (!clutter_actor_is_in_clone_paint (actor)) if (!clutter_actor_is_in_clone_paint (actor) && meta_actor_is_untransformed (actor, NULL, NULL))
{ filter = COGL_PIPELINE_FILTER_NEAREST;
int x_origin, y_origin;
if (meta_actor_is_untransformed (actor,
&x_origin,
&y_origin))
filter = COGL_PIPELINE_FILTER_NEAREST;
}
ctx = clutter_backend_get_cogl_context (clutter_get_default_backend ()); ctx = clutter_backend_get_cogl_context (clutter_get_default_backend ());
fb = cogl_get_draw_framebuffer (); fb = cogl_get_draw_framebuffer ();