[cairo] Bug with fallback resolution of groups

Carl Worth cworth at cworth.org
Wed May 21 15:54:03 PDT 2008

On Wed, 21 May 2008 12:19:30 -0700, Carl Worth wrote:
> So that should be plenty of disclaimers to let you know this patch is
> totally inadequate. If you're not still convinced, let me also point
> out that this patch doesn't even work. The intermediate group's image
> is rendered at the correct resolution now, but it's then being scaled
> up again, (apparently when composited with the final image surface
> that also has the appropriate device_transform set).

Here's a follow-on patch that eliminates the duplicate scaling, (also
on my acquire_source_image_transformed branch of course).

It seems to now get a correct result, (see attached). There are some
visible seams in the result due to two different fallback images being
placed next to each other, and their scaling not matching
exactly. That might be worth someone looking into still, but it's
really an artifact of the way I hacked up this test case to show both
behaviors next to each other. (There's only a single, low-resolution
fallback image in the original firefox-triggered bug I'm chasing

I'd still quite appreciate any review people might be able to give to
decide if this patch seems complete or if there are other callers to
_acquire_source_image that need similar treatment.

And I don't love this patch. It generally makes things more
functional but less clean---it feels like we still don't have a good
understanding of how the meta-surface should work internally.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: fallback-resolution.pdf
Type: application/pdf
Size: 48131 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20080521/30b2ef26/attachment-0001.pdf 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fallback-resolution.ps
Type: application/postscript
Size: 52955 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20080521/30b2ef26/attachment-0001.ps 
-------------- next part --------------
From a21b3222d7bfb0ac1e45264a8ddcbc54215a6442 Mon Sep 17 00:00:00 2001
From: Carl Worth <cworth at cworth.org>
Date: Wed, 21 May 2008 15:47:13 -0700
Subject: [PATCH] Prevent duplicate scaling of pattern's acquired surface

Now that we are passing the destination surface's device_transform down
to _acquire_source_image_transformed, we need to multiply it out of
the resulting attr. matrix returned with the surface.

With this change, the fallback-resolution test is passing once again,
(but for some seams issues).
 src/cairo-pattern.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/cairo-pattern.c b/src/cairo-pattern.c
index 1975daf..5ceb717 100644
--- a/src/cairo-pattern.c
+++ b/src/cairo-pattern.c
@@ -1620,6 +1620,10 @@ _cairo_pattern_acquire_surface_for_surface (cairo_surface_pattern_t   *pattern,
 	attr->matrix = pattern->base.matrix;
+	cairo_matrix_scale (&attr->matrix,
+			    dst->device_transform.xx,
+			    dst->device_transform.yy);
 	attr->x_offset = attr->y_offset = 0;
 	tx = 0;
 	ty = 0;

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20080521/30b2ef26/attachment-0001.pgp 

More information about the cairo mailing list