[cairo] filters/image processing

MenTaLguY mental at rydia.net
Tue Sep 5 18:20:17 PDT 2006

On Tue, 2006-09-05 at 10:40 -0700, Bill Spitzak wrote:
> In this case of GLSL, my recommendation is a new interface to set the 
> compositing to "use this GLSL, and if you don't support it, use this 
> compositing operation".

If Inkscape relied on such an API for filters we'd be deluged with bug
reports.  At best we'd have to assemble a whitelist of surface types (is
there a public API for determining the backend for a surface?) for which
cairo properly supported filters, and then implement them the hard/slow
way for the remainder.

> There is zero interest in getting GLSL or any 
> filtering to work on unaccelerated backends,

I, uh, respectfully beg to disagree... via cairo or by hand, we
absolutely do need filters for image surfaces.  I'd prefer to be able to
consistently rely on cairo, though.  Whether that means GLSL is a
separate discussion.

(If we want entirely general-purpose AND acceleratable filters, though,
a GLSL dialect seems like a good long-term goal -- no sense reinventing

> but being able to say if your operation is similar to over or add or clear

Nearly all interesting filter operations are entirely dissimilar to any
of the Porter/Duff compositing operators, to the point where there's no
point in specifying.  May as well use OVER as the fallback if you're
going to do that.

(There are a few SVG filters that correspond to the Porter/Duff
operators, but those would be implemented using that mechanism in cairo
to begin with...)

> is probably useful for making the output more legible when the OpenGL backend is not there.

Imagine if cairo adopted that approach for, say, gradient support...

I really think the current approach of "if we offer it in the generic
API, make it work consistently on all surfaces, even if it's not fast on
all of them" is much preferable.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20060905/8fe867f5/attachment.pgp

More information about the cairo mailing list