]> www.fi.muni.cz Git - evince.git/commitdiff
[libview] Use cairo_region_xor() when available
authorCarlos Garcia Campos <carlosgc@gnome.org>
Mon, 12 Jul 2010 18:01:25 +0000 (20:01 +0200)
committerCarlos Garcia Campos <carlosgc@gnome.org>
Mon, 12 Jul 2010 18:01:25 +0000 (20:01 +0200)
libview/ev-view.c

index 61e4c0c6441cc76e87fb282bcaa74c9304b076ac..e024fb9faa70234da7d10872991f912b1949d850 100644 (file)
@@ -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);