Fix errors in keeping track of the stage bounding rectangle
authorOwen W. Taylor <otaylor@fishsoup.net>
Thu, 18 Mar 2010 17:55:01 +0000 (13:55 -0400)
committerEmmanuele Bassi <ebassi@linux.intel.com>
Fri, 19 Mar 2010 10:29:53 +0000 (10:29 +0000)
commitd21b7522f825d913317a8e62b86314a7737c7e43
tree1722228af77b9e888d23ce3c1c354e5377c6d089
parentbfd2b19290dc021862ee542c80ddd4e21a20cfef
Fix errors in keeping track of the stage bounding rectangle

* Add new clutter_geometry_union(), because writing union intersection
  is harder than it looks. Fixes two problems with the inline code in
  clutter_stage_glx_add_redraw_clip().

  1) The ->x and ->y of were reassigned to before using them to
     compute the new width and height.
  2) since ClutterGeometry has unsigned width, x + width is unsigned,
     and comparison goes wrong if either rectangle has a negative
     x + width. (We fixed width for GdkRectangle to be signed for GTK+-2.0,
     this is a potent source of bugs.)

* Use in clutter_stage_glx_add_redraw_clip()

* Account for the case where the incoming rectangle is empty, and don't
  end up with the stage being entirely redrawn.

* Account for the case where the stage already has a degenerate
  width and don't end up with redrawing only the new rectangle and not
  the rest of the stage.

The better fix here for the second two problems is to stop using a 0
width to mean the entire stage, but this should work for now.

http://bugzilla.openedhand.com/show_bug.cgi?id=2040

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
clutter/clutter-actor.c
clutter/clutter-types.h
clutter/glx/clutter-stage-glx.c