[cairo] Patch: fix subpixel BGR/vRGB rendering

Frederic Crozat fcrozat at mandriva.com
Fri Oct 21 06:49:53 PDT 2005


Le jeudi 20 octobre 2005 à 08:10 -0700, Carl Worth a écrit :
> On Thu, 20 Oct 2005 09:36:06 +0200, Frederic Crozat wrote:
> > Unfortunately, there is not testcase for David Turner problem : it was a
> > problem with the way cairo was using freetype. At first, we thought it
> > was that which was causing misrendering in cairo (with freetype 2.1.10)
> > but we later discovered it was a real bug in freetype (which was fixed
> > by Owen btw :).
> 
> Ah, OK.
> 
> > So, what I could do is to separate code cleanup from
> > subpixel BGR/vBGR rendering and only apply the BGR/vBGR patch to stable
> > branch (but we don't know if we won't hit freetype problem in the future
> > by keeping the freetype flags mix spotted by David).
> 
> We can commit both on the stable branch I think. But do let's separate
> them if you don't mind.

It was a good idea : while splitting both patches, I noticed I
introduced an error in horizontal subpixel ordering when trying to use
freetype2 correctly, thanks to the testcase :)

I've splitted my original (and buggy) patch in two patches :
-first patch is cairo-subpixel-bgr.patch which add support for BGR
subpixel hinting. I've updated text-antialias-subpixel test so the 4
different subpixel rendering mode are now tested. Use the attached image
to replace the test reference image.

-second patch is cairo-freetype-usage.patch (which must be applied after
the first patch) change a little the logic in hinting to follow the same
logic as Xft and doesn't try to mix FT_LOAD_TARGET which should not be
mixed (based on David Turner comments). There is no testcase for this
patch, but I've checked it doesn't break previous testcase for text
rendering.

-- 
Frederic Crozat <fcrozat at mandriva.com>
Mandriva
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cairo-freetype-usage.patch
Type: text/x-patch
Size: 3828 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20051021/c08210c7/cairo-freetype-usage.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cairo-subpixel-bgr.patch
Type: text/x-patch
Size: 5929 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20051021/c08210c7/cairo-subpixel-bgr.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: text-antialias-subpixel-ref.png
Type: image/png
Size: 3833 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20051021/c08210c7/text-antialias-subpixel-ref.png


More information about the cairo mailing list