Commit e28a36af authored by Jasper St. Pierre's avatar Jasper St. Pierre
Browse files

window-actor: Merge two simple methods

With some recent changes to how mask textures are constructed from
shapes, a helper method we made was only called in one place, allowing
us to drop a reference/destroy, and remove a double clear.

https://bugzilla.gnome.org/show_bug.cgi?id=679901
parent 53534b4d
......@@ -1577,33 +1577,6 @@ meta_window_actor_update_bounding_region_and_borders (MetaWindowActor *self,
g_signal_emit (self, signals[SIZE_CHANGED], 0);
}
static void
meta_window_actor_update_shape_region (MetaWindowActor *self,
cairo_region_t *region)
{
MetaWindowActorPrivate *priv = self->priv;
g_clear_pointer (&priv->shape_region, cairo_region_destroy);
/* region must be non-null */
priv->shape_region = region;
cairo_region_reference (region);
/* Our "shape_region" is called the "bounding region" in the X Shape
* Extension Documentation.
*
* Our "bounding_region" is called the "bounding rectangle", which defines
* the shape of the window as if it the window was unshaped.
*
* The X Shape extension requires that the "bounding region" can never
* extend outside the "bounding rectangle", and says it must be implicitly
* clipped before rendering. The region we get back hasn't been clipped.
* We explicitly clip the region here.
*/
if (priv->bounding_region != NULL)
cairo_region_intersect (priv->shape_region, priv->bounding_region);
}
/**
* meta_window_actor_get_obscured_region:
* @self: a #MetaWindowActor
......@@ -2234,8 +2207,21 @@ check_needs_reshape (MetaWindowActor *self)
build_and_scan_frame_mask (self, &borders, &client_area, region);
}
meta_window_actor_update_shape_region (self, region);
cairo_region_destroy (region);
priv->shape_region = region;
/* Our "shape_region" is called the "bounding region" in the X Shape
* Extension Documentation.
*
* Our "bounding_region" is called the "bounding rectangle", which defines
* the shape of the window as if it the window was unshaped.
*
* The X Shape extension requires that the "bounding region" can never
* extend outside the "bounding rectangle", and says it must be implicitly
* clipped before rendering. The region we get back hasn't been clipped.
* We explicitly clip the region here.
*/
if (priv->bounding_region != NULL)
cairo_region_intersect (priv->shape_region, priv->bounding_region);
priv->needs_reshape = FALSE;
meta_window_actor_invalidate_shadow (self);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment