[cairo] [PATCH] BugFix the tighten-bounds with egl backend

xiaolin.ji at intel.com xiaolin.ji at intel.com
Wed Nov 21 11:58:41 PST 2012


From: xiaolin.ji <xiaolin.ji at intel.com>

I tested tighten-bounds with egl backend at my sandybridge, it failed. when fill_boxes with the boxes which create from "_cairo_boxes_init_from_rectangle", the boxes->chunks.count is zero, it will do nothing when emit the aligned boxes
---
 src/cairo-boxes.c |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/src/cairo-boxes.c b/src/cairo-boxes.c
index 63b68dd..b96b4b8 100644
--- a/src/cairo-boxes.c
+++ b/src/cairo-boxes.c
@@ -57,10 +57,18 @@ void
 _cairo_boxes_init_from_rectangle (cairo_boxes_t *boxes,
 				  int x, int y, int w, int h)
 {
+    cairo_box_t box;
+    cairo_int_status_t status;
+	
     _cairo_boxes_init (boxes);
+	
+    box.p1.x = _cairo_fixed_from_int (x);
+    box.p1.y = _cairo_fixed_from_int (y);
+    box.p2.x = _cairo_fixed_from_int (x + w);
+    box.p2.y = _cairo_fixed_from_int (y + h);
 
-    _cairo_box_from_integers (&boxes->chunks.base[0], x, y, w, h);
-    boxes->num_boxes = 1;
+    status = _cairo_boxes_add (boxes, CAIRO_ANTIALIAS_DEFAULT, &box);
+    assert (status == CAIRO_INT_STATUS_SUCCESS);
 }
 
 void
-- 
1.7.10.4



More information about the cairo mailing list