[clutter] paint-volumes: remove is_axis_aligned assert for _union



commit e936b9591a92de4e227057abf9346511e215212e
Author: Robert Bragg <robert linux intel com>
Date:   Thu Jun 16 15:22:03 2011 +0100

    paint-volumes: remove is_axis_aligned assert for _union
    
    This removes the pv->is_xis_aligned assertion in
    _clutter_paint_volume_union. We were already considering the case where
    the second volume may not be axis aligned and aligning it into a
    temporary variable in that case, but we now also consider that the first
    pv may also not be aligned.

 clutter/clutter-paint-volume.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/clutter/clutter-paint-volume.c b/clutter/clutter-paint-volume.c
index 8c4c57e..2e39ac8 100644
--- a/clutter/clutter-paint-volume.c
+++ b/clutter/clutter-paint-volume.c
@@ -424,8 +424,10 @@ clutter_paint_volume_get_depth (const ClutterPaintVolume *pv)
  *      union
  * @another_pv: A second #ClutterPaintVolume to union with @pv
  *
- * Updates the geometry of @pv to be the union bounding box that
- * encompases @pv and @another_pv.
+ * Updates the geometry of @pv to encompass @pv and @another_pv.
+ *
+ * <note>There are no guarantees about how precisely the two volumes
+ * will be encompassed.</note>
  *
  * Since: 1.6
  */
@@ -436,9 +438,11 @@ clutter_paint_volume_union (ClutterPaintVolume *pv,
   ClutterPaintVolume aligned_pv;
 
   g_return_if_fail (pv != NULL);
-  g_return_if_fail (pv->is_axis_aligned);
   g_return_if_fail (another_pv != NULL);
 
+  /* Both volumes have to belong to the same local coordinate space */
+  g_return_if_fail (pv->actor == another_pv->actor);
+
   /* NB: we only have to update vertices 0, 1, 3 and 4
    * (See the ClutterPaintVolume typedef for more details) */
 
@@ -455,6 +459,9 @@ clutter_paint_volume_union (ClutterPaintVolume *pv,
       goto done;
     }
 
+  if (!pv->is_axis_aligned)
+    _clutter_paint_volume_axis_align (pv);
+
   if (!another_pv->is_axis_aligned)
     {
       _clutter_paint_volume_copy_static (another_pv, &aligned_pv);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]