[cairo] Extending XRender to support non-blurry edges for transformations(?)

Clemens Eisserer linuxhippy at gmail.com
Wed Jul 30 07:14:48 PDT 2008


Hi,

I am currently implementing a Java2D-XRender backend and I am faced
with the problem that XRender always interpolates the edges with the
transparent pixels surrounding it when a scaling transformation is set
on the source and using billinear interpolation, as shown here:
http://picasaweb.google.com/linuxhippy/Transformations/photo#5226911151131301954

Java itself requires scaled images to have sharp edges, so in order to
comply with the java2d-spec I would have to fall back to software :-/

I've read that Cairo-1.6.4 now has support for EXTEND_REPEAT on
image-surfaces, which allows to work arround that problem.
However it still has some overhead if the user just would like to draw
a single transformed image -  it requires to draw the geometry of the
transformed image in a mask and its not supported by Xorg for now.

What do you think about extending XRender with support for restricting
filter to source picture only?
I guess for the drivers it should be no problem to implement it, and
if the driver only supports REPEAT_PAD (unfourtunatly I don't know
one) it still could be emulated on the server-side easily.
I've opened a feature-request:
https://bugs.freedesktop.org/show_bug.cgi?id=16847

It could be either done as:
- New attribute in PictureFormat
- A new Repeat property, like RepeatStop
- A new set of filters, like billinear_sharp

I would be happy to hear about suggestions and ideas.
Do you think this could be also benefitial for cairo?

Thanks, Clemens


More information about the cairo mailing list