[mutter/wayland] cullable: Use relative actor coordinates for culling



commit 1011331cafc725ffded2223f4f8333799fd980bb
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Nov 25 15:27:48 2013 -0500

    cullable: Use relative actor coordinates for culling
    
    This ensures that nested cullables work fine.

 src/compositor/clutter-utils.c       |    6 ++++--
 src/compositor/meta-cullable.c       |    6 ++++--
 src/compositor/meta-shaped-texture.c |   11 ++---------
 3 files changed, 10 insertions(+), 13 deletions(-)
---
diff --git a/src/compositor/clutter-utils.c b/src/compositor/clutter-utils.c
index dd91036..7bca7c5 100644
--- a/src/compositor/clutter-utils.c
+++ b/src/compositor/clutter-utils.c
@@ -95,8 +95,10 @@ meta_actor_vertices_are_untransformed (ClutterVertex *verts,
       v3x != v1x || v3y != v2y)
     return FALSE;
 
-  *x_origin = x;
-  *y_origin = y;
+  if (x_origin)
+    *x_origin = x;
+  if (y_origin)
+    *y_origin = y;
 
   return TRUE;
 }
diff --git a/src/compositor/meta-cullable.c b/src/compositor/meta-cullable.c
index a139166..6910140 100644
--- a/src/compositor/meta-cullable.c
+++ b/src/compositor/meta-cullable.c
@@ -71,7 +71,7 @@ meta_cullable_cull_out_children (MetaCullable   *cullable,
   clutter_actor_iter_init (&iter, actor);
   while (clutter_actor_iter_prev (&iter, &child))
     {
-      int x, y;
+      float x, y;
 
       if (!CLUTTER_ACTOR_IS_VISIBLE (child))
         continue;
@@ -98,9 +98,11 @@ meta_cullable_cull_out_children (MetaCullable   *cullable,
       if (!META_IS_CULLABLE (child))
         continue;
 
-      if (!meta_actor_is_untransformed (child, &x, &y))
+      if (!meta_actor_is_untransformed (child, NULL, NULL))
         continue;
 
+      clutter_actor_get_position (child, &x, &y);
+
       /* Temporarily move to the coordinate system of the actor */
       cairo_region_translate (unobscured_region, - x, - y);
       cairo_region_translate (clip_region, - x, - y);
diff --git a/src/compositor/meta-shaped-texture.c b/src/compositor/meta-shaped-texture.c
index 5462042..6f6422d 100644
--- a/src/compositor/meta-shaped-texture.c
+++ b/src/compositor/meta-shaped-texture.c
@@ -301,15 +301,8 @@ meta_shaped_texture_paint (ClutterActor *actor)
 
   filter = COGL_PIPELINE_FILTER_LINEAR;
 
-  if (!clutter_actor_is_in_clone_paint (actor))
-    {
-      int x_origin, y_origin;
-
-      if (meta_actor_is_untransformed (actor,
-                                       &x_origin,
-                                       &y_origin))
-        filter = COGL_PIPELINE_FILTER_NEAREST;
-    }
+  if (!clutter_actor_is_in_clone_paint (actor) && meta_actor_is_untransformed (actor, NULL, NULL))
+    filter = COGL_PIPELINE_FILTER_NEAREST;
 
   ctx = clutter_backend_get_cogl_context (clutter_get_default_backend ());
   fb = cogl_get_draw_framebuffer ();


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]