[mutter/wip/carlosg/clip-regions: 47/48] clutter: Check updated devices with the current clip



commit 353d7909f6abc0fa717287fc67e387c6c831f9b6
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Oct 20 13:36:44 2019 +0200

    clutter: Check updated devices with the current clip
    
    We do check the clip area as an optimization to know which input devices
    might need updating state after a relayout (Assuming that if a device is
    under a non-painted area, it's actor beneath didn't change).
    
    Use the clip region for this, and drop the last usage of the clip region
    bounds.
    
    https://gitlab.gnome.org/GNOME/mutter/merge_requests/867

 clutter/clutter/clutter-stage.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
---
diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c
index 4b6f46612..1acca6995 100644
--- a/clutter/clutter/clutter-stage.c
+++ b/clutter/clutter/clutter-stage.c
@@ -1394,11 +1394,10 @@ _clutter_stage_check_updated_pointers (ClutterStage *stage)
   ClutterDeviceManager *device_manager;
   GSList *updating = NULL;
   const GSList *devices;
-  cairo_rectangle_int_t clip;
+  cairo_region_t *clip;
   graphene_point_t point;
-  gboolean has_clip;
 
-  has_clip = _clutter_stage_window_get_redraw_clip_bounds (priv->impl, &clip);
+  clip = _clutter_stage_window_get_redraw_clip (priv->impl);
 
   device_manager = clutter_device_manager_get_default ();
   devices = clutter_device_manager_peek_devices (device_manager);
@@ -1421,9 +1420,7 @@ _clutter_stage_check_updated_pointers (ClutterStage *stage)
           if (!clutter_input_device_get_coords (dev, NULL, &point))
             continue;
 
-          if (!has_clip ||
-              (point.x >= clip.x && point.x < clip.x + clip.width &&
-               point.y >= clip.y && point.y < clip.y + clip.height))
+          if (!clip || cairo_region_contains_point (clip, point.x, point.y))
             updating = g_slist_prepend (updating, dev);
           break;
         default:


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