Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2010-07-12 18:01:25 (GMT)
committer Carlos Garcia Campos <carlosgc@gnome.org>2010-07-12 18:01:25 (GMT)
commitcb2b94df0d415021904d5f96c68447152a7bcf6b (patch)
tree496ff39a5d0a60735d88b42cfb86fa94eda38344
parentaad601cdd13d8fc64913b31618403f9021715121 (diff)
[libview] Use cairo_region_xor() when available
-rw-r--r--libview/ev-view.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/libview/ev-view.c b/libview/ev-view.c
index 61e4c0c..e024fb9 100644
--- a/libview/ev-view.c
+++ b/libview/ev-view.c
@@ -5664,12 +5664,14 @@ merge_selection_region (EvView *view,
/* Now we figure out what needs redrawing */
if (old_sel && new_sel) {
if (old_sel->covered_region && new_sel->covered_region) {
- cairo_region_t *tbr;
-
/* We only want to redraw the areas that have
* changed, so we xor the old and new regions
* and redraw if it's different */
region = cairo_region_copy (old_sel->covered_region);
+#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE(1, 9, 12)
+ cairo_region_xor (region, new_sel->covered_region);
+#else
+ cairo_region_t *tbr;
tbr = cairo_region_copy (new_sel->covered_region);
/* xor old_sel, new_sel*/
@@ -5677,6 +5679,7 @@ merge_selection_region (EvView *view,
cairo_region_subtract (region, new_sel->covered_region);
cairo_region_union (region, tbr);
cairo_region_destroy (tbr);
+#endif
if (cairo_region_is_empty (region)) {
cairo_region_destroy (region);