[cairo] some fixes and improvements to current cvs version of
cairo
Kristian Høgsberg
krh at bitplanet.net
Fri Jan 28 16:42:40 PST 2005
David Reveman wrote:
>>>@@ -2006,8 +1997,12 @@
>>> &device_width, &device_height);
>>>
>>> _cairo_pattern_init_for_surface (&pattern, surface);
>>>- _cairo_gstate_create_pattern (gstate, &pattern);
>>>
>>>+ if (!_cairo_matrix_is_integer_translation (&device_to_image, &xoff, &yoff))
>>>+ pattern.matrix = device_to_image;
>>>+
>>>+ _cairo_pattern_set_alpha (&pattern, gstate->alpha);
>>>+
>>
>>Isn't this an optimization that belongs in the backend?
>
> I don't think any backend would mind getting an integer translation as a
> source offset rather than a transformation matrix. But if you like to
> move this into the backends instead that's fine with me. You should know
> that this optimization makes a pretty big difference on xrender and
> image backends, so it's probably worth keeping, in some form.
Right, I just assumed that xrender and pixman had a fast path for this.
If it is a significant improvement, maybe it should be moved into
_cairo_pattern_get_surface so it kicks in for all source surfaces?
>>>@@ -810,16 +811,17 @@
>>> }
>>>
>>> image = _cairo_surface_get_image (src);
>>>-
>>>- surface = cairo_surface_create_similar (dst,
>>>- CAIRO_FORMAT_ARGB32,
>>>- width, height);
>>>+
>>>+ surface = cairo_surface_create_similar (dst, CAIRO_FORMAT_ARGB32,
>>>+ image->width,
>>>+ image->height);
>>
>>What the difference here?
>
> It makes a difference if x or y are negative, and when using
> cairo_surface_set_image, surface dimensions must match image dimensions.
> With width and height, this might not always be true.
Ah, yes, and in that case width and height would be larger than
image->width and image->height.
cheers,
Kristian
More information about the cairo
mailing list