summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2018-03-21 00:35:51 +0100
committerBenjamin Otte <otte@redhat.com>2018-03-21 00:43:28 +0100
commit7862894f11ad8a8889a109d6e6ac4d897118b9a0 (patch)
treeccf70786b91a07195fb6f35a5b69a73a3b314140
parenta1898d678bc6d052a15d7862b36f8a8fb5aaf311 (diff)
downloadgtk+-7862894f11ad8a8889a109d6e6ac4d897118b9a0.tar.gz
surface: Remove gdk_surface_invalidate_maybe_recurse()
This also means we can now get rid of child funcs because they're not used anymore.
-rw-r--r--docs/reference/gdk/gdk4-sections.txt2
-rw-r--r--gdk/gdksurface.c66
-rw-r--r--gdk/gdksurface.h19
3 files changed, 6 insertions, 81 deletions
diff --git a/docs/reference/gdk/gdk4-sections.txt b/docs/reference/gdk/gdk4-sections.txt
index ccf21accd7..3c3280f33f 100644
--- a/docs/reference/gdk/gdk4-sections.txt
+++ b/docs/reference/gdk/gdk4-sections.txt
@@ -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
diff --git a/gdk/gdksurface.c b/gdk/gdksurface.c
index 45ecc83dc3..5fe656be2e 100644
--- a/gdk/gdksurface.c
+++ b/gdk/gdksurface.c
@@ -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);
}
diff --git a/gdk/gdksurface.h b/gdk/gdksurface.h
index 2f6e7371f9..3a46e40b56 100644
--- a/gdk/gdksurface.h
+++ b/gdk/gdksurface.h
@@ -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);