mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 17:40:40 -05:00
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
This commit is contained in:
parent
53534b4ded
commit
e28a36affd
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user