[cairo] cairo-gl glyph rendering performance
behdad at behdad.org
Mon May 2 18:34:36 PDT 2011
On 05/02/11 20:56, Bill Spitzak wrote:
> Behdad Esfahbod wrote:
>> On 05/02/11 15:57, Bill Spitzak wrote:
>>> If instead we composite a and b first we get a+b-ab.
>> Except that we ADD the glyphs together, not OVER them. That's the root of the
>> I admit, in practice, there's little to be noticed.
> Well then that is actually worse. You do not want to add alpha masks together.
> Setting the coverage to a+b indicates that you think the coverage of all
> partially covered pixels is such that the filled section of one does not
> intersect the filled section of another. If they intersect at all then the
> resulting coverage will be less than the sum.
This is inherited from XRender. According to Keith Packard the idea has been
to make sure Arabic glyphs that are supposed to join result in full pixels
where they meet. In theory this is nice. However, Microsoft recommends that
Arabic glyphs should have their baseline connection slightly bleed outside the
glyph boundary. In that case, both ADD and OVER result in artifacts at the
top and bottom pixels of the joint, so this is all moot. I have not found a
better solution, but I kinda agree that MAX() is probably equally good.
More information about the cairo