summaryrefslogtreecommitdiff
path: root/src/cairo-composite-rectangles.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-08-02 13:51:30 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-09-19 15:23:57 +0100
commitfd613cb9f94daff0c8d4fdb27ff89894d41682a3 (patch)
tree2543cce7d9fd20533e7632899fd01bceadee4487 /src/cairo-composite-rectangles.c
parent36a14230453a1fd282671a4ab7ac072b69b9a5f6 (diff)
downloadcairo-fd613cb9f94daff0c8d4fdb27ff89894d41682a3.tar.gz
xcb: track fallback damage
And only upload the parts of the image that are modified during the fallback. I have to keep reminding myself that the goal is always to reduce the amount of fallbacks required... Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/cairo-composite-rectangles.c')
-rw-r--r--src/cairo-composite-rectangles.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/cairo-composite-rectangles.c b/src/cairo-composite-rectangles.c
index c66d3d628..7fc0f5fe5 100644
--- a/src/cairo-composite-rectangles.c
+++ b/src/cairo-composite-rectangles.c
@@ -436,3 +436,21 @@ _cairo_composite_rectangles_can_reduce_clip (cairo_composite_rectangles_t *compo
_cairo_box_from_rectangle (&box, &extents);
return _cairo_clip_contains_box (clip, &box);
}
+
+cairo_int_status_t
+_cairo_composite_rectangles_add_to_damage (cairo_composite_rectangles_t *composite,
+ cairo_boxes_t *damage)
+{
+ cairo_int_status_t status;
+ int n;
+
+ for (n = 0; n < composite->clip->num_boxes; n++) {
+ status = _cairo_boxes_add (damage,
+ CAIRO_ANTIALIAS_NONE,
+ &composite->clip->boxes[n]);
+ if (unlikely (status))
+ return status;
+ }
+
+ return CAIRO_INT_STATUS_SUCCESS;
+}