[mutter] shaped-texture: Remove silly ClutterPaintVolume code with slightly less silly ClutterActorBox code
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] shaped-texture: Remove silly ClutterPaintVolume code with slightly less silly ClutterActorBox code
- Date: Wed, 30 Jul 2014 15:16:10 +0000 (UTC)
commit 626e4965b1dc2d3a42c2c8e57d6d7bd77809a7b6
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Wed Jul 30 17:00:11 2014 +0200
shaped-texture: Remove silly ClutterPaintVolume code with slightly less silly ClutterActorBox code
src/compositor/meta-shaped-texture.c | 27 +++++++++------------------
1 files changed, 9 insertions(+), 18 deletions(-)
---
diff --git a/src/compositor/meta-shaped-texture.c b/src/compositor/meta-shaped-texture.c
index 4916aa0..4b752eb 100644
--- a/src/compositor/meta-shaped-texture.c
+++ b/src/compositor/meta-shaped-texture.c
@@ -499,32 +499,23 @@ meta_shaped_texture_get_paint_volume (ClutterActor *actor,
ClutterPaintVolume *volume)
{
MetaShapedTexture *self = META_SHAPED_TEXTURE (actor);
+ ClutterActorBox box;
cairo_rectangle_int_t unobscured_bounds;
- if (!clutter_paint_volume_set_from_allocation (volume, actor))
+ if (!clutter_actor_has_allocation (actor))
return FALSE;
+ clutter_actor_get_allocation_box (actor, &box);
+
if (meta_shaped_texture_get_unobscured_bounds (self, &unobscured_bounds))
{
- ClutterVertex origin;
- cairo_rectangle_int_t bounds;
-
- /* I hate ClutterPaintVolume so much... */
- clutter_paint_volume_get_origin (volume, &origin);
- bounds.x = origin.x;
- bounds.y = origin.y;
- bounds.width = clutter_paint_volume_get_width (volume);
- bounds.height = clutter_paint_volume_get_height (volume);
-
- gdk_rectangle_intersect (&bounds, &unobscured_bounds, &bounds);
-
- origin.x = bounds.x;
- origin.y = bounds.y;
- clutter_paint_volume_set_origin (volume, &origin);
- clutter_paint_volume_set_width (volume, bounds.width);
- clutter_paint_volume_set_height (volume, bounds.height);
+ box.x1 = MAX (unobscured_bounds.x, box.x1);
+ box.x2 = MIN (unobscured_bounds.x + unobscured_bounds.width, box.x2);
+ box.y1 = MAX (unobscured_bounds.y, box.y1);
+ box.y2 = MIN (unobscured_bounds.y + unobscured_bounds.height, box.y2);
}
+ clutter_paint_volume_union_box (volume, &box);
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]