[cairo] OVER / SOURCE optimization for cairo_paint
Owen Taylor
otaylor at redhat.com
Tue Feb 19 11:14:52 PST 2008
On Sat, 2008-02-16 at 03:29 -0500, Antoine Azar wrote:
> [ I hope this message doesn't land 3 times on the mailing list. For
> some reason the first two attempts didn't go through ]
>
> Hey all,
> I've got a working optimization that speeds up paint operations for
> opaque sources. The optimization replaces an OVER operator by a
> SOURCE operator, and in the case of EXTEND_NONE, creates a path
> around the source's extents and calls a fill operation instead. The
> speedups can be huge, espescially in the case of copying a small
> surface onto a much larger one.
I was hoping someone else would pick up this topic, but since nobody
else has: is this really a legitimate optimization when the
source is scaled or transformed?
- It will produce clearly incorrect results unless you replace
EXTEND_NONE with the (not yet implemented?) EXTEND_PAD, since
SOURCE for EXTEND_NONE is going to give 0,0,0,0 pixels outside
the edge.
- It will produce very different, though in many cases arguably
better, results if you do that substitution. Is a 1x1 source
scaled up to 20x20 a fuzzy dot or a rectangle?
In my opinion, optimizations should not change appearance in such
a way ... even if the appearance is better .... because it means
that you get discontinuities between the optimized path and when
you can't optimize for one reason or the other.
The other thing I wonder about the patch in general: what's it going to
do for a backend where OVER is normal and SOURCE abnormal? Does the
backend have to reverse the optimization? (In other words, the
question is: should this optimization be in the image backend
at a low level or even inside libpixman, rather than in cairo-gstate.c?)
- Owen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.cairographics.org/archives/cairo/attachments/20080219/ad2c2849/attachment.pgp
More information about the cairo
mailing list