surface: Remove gdk_surface_invalidate_maybe_recurse()
authorBenjamin Otte <otte@redhat.com>
Tue, 20 Mar 2018 23:35:51 +0000 (00:35 +0100)
committerBenjamin Otte <otte@redhat.com>
Tue, 20 Mar 2018 23:43:28 +0000 (00:43 +0100)
This also means we can now get rid of child funcs because they're not
used anymore.

docs/reference/gdk/gdk4-sections.txt
gdk/gdksurface.c
gdk/gdksurface.h

index ccf21accd7755533c077cbde9a9411cbd789fd9a..3c3280f33f9eb8ffbf4ab9a309ee8303387dece7 100644 (file)
@@ -243,8 +243,6 @@ gdk_surface_get_visible_region
 <SUBSECTION>
 gdk_surface_invalidate_rect
 gdk_surface_invalidate_region
-GdkSurfaceChildFunc
-gdk_surface_invalidate_maybe_recurse
 gdk_surface_get_update_area
 gdk_surface_freeze_updates
 gdk_surface_thaw_updates
index 45ecc83dc3a8a0cc9beec52a65a648f2da0af083..5fe656be2ed9462e0a4da68fa3865612321a8408 100644 (file)
@@ -490,12 +490,6 @@ _gdk_surface_has_impl (GdkSurface *surface)
   return gdk_surface_has_impl (surface);
 }
 
-static gboolean
-gdk_surface_has_no_impl (GdkSurface *surface)
-{
-  return surface->impl_surface != surface;
-}
-
 static void
 remove_sibling_overlapped_area (GdkSurface *surface,
                                cairo_region_t *region)
@@ -2526,10 +2520,8 @@ impl_surface_add_update_area (GdkSurface *impl_surface,
 }
 
 static void
-gdk_surface_invalidate_maybe_recurse_full (GdkSurface            *surface,
-                                         const cairo_region_t *region,
-                                          GdkSurfaceChildFunc    child_func,
-                                         gpointer              user_data)
+gdk_surface_invalidate_full (GdkSurface           *surface,
+                            const cairo_region_t *region)
 {
   cairo_region_t *visible_region;
   cairo_rectangle_int_t r;
@@ -2573,52 +2565,12 @@ gdk_surface_invalidate_maybe_recurse_full (GdkSurface            *surface,
   cairo_region_destroy (visible_region);
 }
 
-/**
- * gdk_surface_invalidate_maybe_recurse:
- * @surface: a #GdkSurface
- * @region: a #cairo_region_t
- * @child_func: (scope call) (allow-none): function to use to decide if to
- *     recurse to a child, %NULL means never recurse.
- * @user_data: data passed to @child_func
- *
- * Adds @region to the update area for @surface. The update area is the
- * region that needs to be redrawn, or “dirty region.”
- *
- * GDK will process all updates whenever the frame clock schedules a redraw,
- * so there’s no need to do forces redraws manually, you just need to
- * invalidate regions that you know should be redrawn.
- *
- * The @child_func parameter controls whether the region of
- * each child surface that intersects @region will also be invalidated.
- * Only children for which @child_func returns #TRUE will have the area
- * invalidated.
- **/
-void
-gdk_surface_invalidate_maybe_recurse (GdkSurface            *surface,
-                                    const cairo_region_t *region,
-                                     GdkSurfaceChildFunc    child_func,
-                                    gpointer              user_data)
-{
-  gdk_surface_invalidate_maybe_recurse_full (surface, region,
-                                           child_func, user_data);
-}
-
-static gboolean
-true_predicate (GdkSurface *surface,
-               gpointer   user_data)
-{
-  return TRUE;
-}
-
 static void
 gdk_surface_invalidate_region_full (GdkSurface       *surface,
                                    const cairo_region_t *region,
                                    gboolean         invalidate_children)
 {
-  gdk_surface_invalidate_maybe_recurse_full (surface, region,
-                                           invalidate_children ?
-                                           true_predicate : (gboolean (*) (GdkSurface *, gpointer))NULL,
-                                      NULL);
+  gdk_surface_invalidate_full (surface, region);
 }
 
 /**
@@ -2637,18 +2589,14 @@ gdk_surface_invalidate_region_full (GdkSurface       *surface,
  * The @invalidate_children parameter controls whether the region of
  * each child surface that intersects @region will also be invalidated.
  * If %FALSE, then the update area for child surfaces will remain
- * unaffected. See gdk_surface_invalidate_maybe_recurse if you need
- * fine grained control over which children are invalidated.
+ * unaffected.
  **/
 void
 gdk_surface_invalidate_region (GdkSurface       *surface,
                              const cairo_region_t *region,
                              gboolean         invalidate_children)
 {
-  gdk_surface_invalidate_maybe_recurse (surface, region,
-                                      invalidate_children ?
-                                        true_predicate : (gboolean (*) (GdkSurface *, gpointer))NULL,
-                                      NULL);
+  gdk_surface_invalidate_full (surface, region);
 }
 
 /**
@@ -2670,9 +2618,7 @@ void
 _gdk_surface_invalidate_for_expose (GdkSurface       *surface,
                                   cairo_region_t       *region)
 {
-  gdk_surface_invalidate_maybe_recurse_full (surface, region,
-                                           (gboolean (*) (GdkSurface *, gpointer))gdk_surface_has_no_impl,
-                                           NULL);
+  gdk_surface_invalidate_full (surface, region);
 }
 
 
index 2f6e7371f93fa696a86cdf351ee9630b2385e544..3a46e40b5676d2b067de1468c2ecb8da88d298fb 100644 (file)
@@ -851,25 +851,6 @@ void       gdk_surface_invalidate_region         (GdkSurface          *surface,
                                                 const cairo_region_t    *region,
                                                 gboolean            invalidate_children);
 
-/**
- * GdkSurfaceChildFunc:
- * @surface: a #GdkSurface
- * @user_data: user data
- *
- * A function of this type is passed to gdk_surface_invalidate_maybe_recurse().
- * It gets called for each child of the surface to determine whether to
- * recursively invalidate it or now.
- *
- * Returns: %TRUE to invalidate @surface recursively
- */
-typedef gboolean (*GdkSurfaceChildFunc)          (GdkSurface *surface,
-                                                 gpointer   user_data);
-
-GDK_AVAILABLE_IN_ALL
-void       gdk_surface_invalidate_maybe_recurse  (GdkSurface            *surface,
-                                                const cairo_region_t *region,
-                                                GdkSurfaceChildFunc    child_func,
-                                                gpointer              user_data);
 GDK_AVAILABLE_IN_ALL
 cairo_region_t *gdk_surface_get_update_area      (GdkSurface            *surface);