From 505eabb78cfc2e96e1ed2d8f6c2ac62c4e7b8174 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Thu, 31 Jul 2014 11:11:43 +0200 Subject: [PATCH] surface-actor: Remove unused APIs --- src/compositor/meta-shaped-texture-private.h | 2 - src/compositor/meta-shaped-texture.c | 68 ++++++++++---------- src/compositor/meta-surface-actor.c | 8 --- src/compositor/meta-surface-actor.h | 2 - 4 files changed, 34 insertions(+), 46 deletions(-) diff --git a/src/compositor/meta-shaped-texture-private.h b/src/compositor/meta-shaped-texture-private.h index 48ae0dfbd..4ee8027de 100644 --- a/src/compositor/meta-shaped-texture-private.h +++ b/src/compositor/meta-shaped-texture-private.h @@ -32,8 +32,6 @@ ClutterActor *meta_shaped_texture_new (void); void meta_shaped_texture_set_texture (MetaShapedTexture *stex, CoglTexture *texture); -gboolean meta_shaped_texture_get_unobscured_bounds (MetaShapedTexture *stex, - cairo_rectangle_int_t *unobscured_bounds); gboolean meta_shaped_texture_is_obscured (MetaShapedTexture *self); #endif diff --git a/src/compositor/meta-shaped-texture.c b/src/compositor/meta-shaped-texture.c index 5983faa8d..be87e8159 100644 --- a/src/compositor/meta-shaped-texture.c +++ b/src/compositor/meta-shaped-texture.c @@ -494,6 +494,39 @@ meta_shaped_texture_get_preferred_height (ClutterActor *self, *natural_height_p = priv->tex_height; } +static cairo_region_t * +effective_unobscured_region (MetaShapedTexture *self) +{ + MetaShapedTexturePrivate *priv = self->priv; + ClutterActor *parent = clutter_actor_get_parent (CLUTTER_ACTOR (self)); + + if (clutter_actor_has_mapped_clones (CLUTTER_ACTOR (self))) + return NULL; + + while (parent && !META_IS_WINDOW_ACTOR (parent)) + parent = clutter_actor_get_parent (parent); + + if (parent && clutter_actor_has_mapped_clones (parent)) + return NULL; + + return priv->unobscured_region; +} + +static gboolean +get_unobscured_bounds (MetaShapedTexture *self, + cairo_rectangle_int_t *unobscured_bounds) +{ + cairo_region_t *unobscured_region = effective_unobscured_region (self); + + if (unobscured_region) + { + cairo_region_get_extents (unobscured_region, unobscured_bounds); + return TRUE; + } + else + return FALSE; +} + static gboolean meta_shaped_texture_get_paint_volume (ClutterActor *actor, ClutterPaintVolume *volume) @@ -507,7 +540,7 @@ meta_shaped_texture_get_paint_volume (ClutterActor *actor, clutter_actor_get_allocation_box (actor, &box); - if (meta_shaped_texture_get_unobscured_bounds (self, &unobscured_bounds)) + if (get_unobscured_bounds (self, &unobscured_bounds)) { box.x1 = MAX (unobscured_bounds.x, box.x1); box.x2 = MIN (unobscured_bounds.x + unobscured_bounds.width, box.x2); @@ -563,39 +596,6 @@ meta_shaped_texture_set_mask_texture (MetaShapedTexture *stex, clutter_actor_queue_redraw (CLUTTER_ACTOR (stex)); } -static cairo_region_t * -effective_unobscured_region (MetaShapedTexture *self) -{ - MetaShapedTexturePrivate *priv = self->priv; - ClutterActor *parent = clutter_actor_get_parent (CLUTTER_ACTOR (self)); - - if (clutter_actor_has_mapped_clones (CLUTTER_ACTOR (self))) - return NULL; - - while (parent && !META_IS_WINDOW_ACTOR (parent)) - parent = clutter_actor_get_parent (parent); - - if (parent && clutter_actor_has_mapped_clones (parent)) - return NULL; - - return priv->unobscured_region; -} - -gboolean -meta_shaped_texture_get_unobscured_bounds (MetaShapedTexture *self, - cairo_rectangle_int_t *unobscured_bounds) -{ - cairo_region_t *unobscured_region = effective_unobscured_region (self); - - if (unobscured_region) - { - cairo_region_get_extents (unobscured_region, unobscured_bounds); - return TRUE; - } - else - return FALSE; -} - gboolean meta_shaped_texture_is_obscured (MetaShapedTexture *self) { diff --git a/src/compositor/meta-surface-actor.c b/src/compositor/meta-surface-actor.c index 3e7db6b20..20933b6ed 100644 --- a/src/compositor/meta-surface-actor.c +++ b/src/compositor/meta-surface-actor.c @@ -42,14 +42,6 @@ enum { static guint signals[LAST_SIGNAL]; -gboolean -meta_surface_actor_get_unobscured_bounds (MetaSurfaceActor *self, - cairo_rectangle_int_t *unobscured_bounds) -{ - MetaSurfaceActorPrivate *priv = self->priv; - return meta_shaped_texture_get_unobscured_bounds (priv->texture, unobscured_bounds); -} - static void meta_surface_actor_pick (ClutterActor *actor, const ClutterColor *color) diff --git a/src/compositor/meta-surface-actor.h b/src/compositor/meta-surface-actor.h index 3991d5297..e5f8286d1 100644 --- a/src/compositor/meta-surface-actor.h +++ b/src/compositor/meta-surface-actor.h @@ -55,8 +55,6 @@ MetaShapedTexture *meta_surface_actor_get_texture (MetaSurfaceActor *self); MetaWindow *meta_surface_actor_get_window (MetaSurfaceActor *self); gboolean meta_surface_actor_is_obscured (MetaSurfaceActor *self); -gboolean meta_surface_actor_get_unobscured_bounds (MetaSurfaceActor *self, - cairo_rectangle_int_t *unobscured_bounds); void meta_surface_actor_set_input_region (MetaSurfaceActor *self, cairo_region_t *region);