summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2008-10-23 14:38:44 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2008-10-30 16:19:54 +0000
commit540f555840ba4076e3ab86669daf9bee5695afa2 (patch)
tree7100cb0ff551bd38a858e777a0722fa5cc46e5b8
parent4b2998893930e4bab19646e6f0a0c8d2a47f12a2 (diff)
[analysis] Only limit to mask extends if bounded by mask.
The extents of cairo_mask() is only limited to the mask if the operation is bounded by the mask.
-rw-r--r--src/cairo-analysis-surface.c8
-rw-r--r--test/clip-operator-pdf-argb32-ref.pngbin11145 -> 12125 bytes
-rw-r--r--test/clip-operator-pdf-rgb24-ref.pngbin6530 -> 7367 bytes
-rw-r--r--test/operator-clear-pdf-argb32-ref.pngbin1438 -> 1614 bytes
-rw-r--r--test/operator-clear-pdf-rgb24-ref.pngbin1170 -> 1402 bytes
-rw-r--r--test/operator-source-pdf-argb32-ref.pngbin4694 -> 5149 bytes
-rw-r--r--test/operator-source-pdf-rgb24-ref.pngbin3848 -> 4354 bytes
7 files changed, 6 insertions, 2 deletions
diff --git a/src/cairo-analysis-surface.c b/src/cairo-analysis-surface.c
index 90eb3f56..057be529 100644
--- a/src/cairo-analysis-surface.c
+++ b/src/cairo-analysis-surface.c
@@ -416,12 +416,16 @@ _cairo_analysis_surface_mask (void *abstract_surface,
return status;
is_empty = _cairo_rectangle_intersect (&extents, &source_extents);
+ }
+
+ if (_cairo_operator_bounded_by_mask (op)) {
+ cairo_rectangle_int_t mask_extents;
- status = _cairo_pattern_get_extents (mask, &source_extents);
+ status = _cairo_pattern_get_extents (mask, &mask_extents);
if (status)
return status;
- is_empty = _cairo_rectangle_intersect (&extents, &source_extents);
+ is_empty = _cairo_rectangle_intersect (&extents, &mask_extents);
}
is_empty = _cairo_rectangle_intersect (&extents, &surface->current_clip);
diff --git a/test/clip-operator-pdf-argb32-ref.png b/test/clip-operator-pdf-argb32-ref.png
index b00cc00f..b3ee1437 100644
--- a/test/clip-operator-pdf-argb32-ref.png
+++ b/test/clip-operator-pdf-argb32-ref.png
Binary files differ
diff --git a/test/clip-operator-pdf-rgb24-ref.png b/test/clip-operator-pdf-rgb24-ref.png
index f9377fa0..b420f385 100644
--- a/test/clip-operator-pdf-rgb24-ref.png
+++ b/test/clip-operator-pdf-rgb24-ref.png
Binary files differ
diff --git a/test/operator-clear-pdf-argb32-ref.png b/test/operator-clear-pdf-argb32-ref.png
index d36de27f..06fc51e3 100644
--- a/test/operator-clear-pdf-argb32-ref.png
+++ b/test/operator-clear-pdf-argb32-ref.png
Binary files differ
diff --git a/test/operator-clear-pdf-rgb24-ref.png b/test/operator-clear-pdf-rgb24-ref.png
index 2dec75c8..55b44ad6 100644
--- a/test/operator-clear-pdf-rgb24-ref.png
+++ b/test/operator-clear-pdf-rgb24-ref.png
Binary files differ
diff --git a/test/operator-source-pdf-argb32-ref.png b/test/operator-source-pdf-argb32-ref.png
index 821112a6..f110ff2a 100644
--- a/test/operator-source-pdf-argb32-ref.png
+++ b/test/operator-source-pdf-argb32-ref.png
Binary files differ
diff --git a/test/operator-source-pdf-rgb24-ref.png b/test/operator-source-pdf-rgb24-ref.png
index 6faf143c..c6b71705 100644
--- a/test/operator-source-pdf-rgb24-ref.png
+++ b/test/operator-source-pdf-rgb24-ref.png
Binary files differ