CompositeGlyph question..

Michel Dänzer michel at tungstengraphics.com
Thu Jul 24 00:50:14 PDT 2008


On Wed, 2008-07-23 at 09:22 -0700, Mohan Parthasarathy wrote:
> 
> 
> On Wed, Jul 23, 2008 at 12:19 AM, Michel Dänzer
> <michel at tungstengraphics.com> wrote:
>         On Tue, 2008-07-22 at 11:01 -0700, Mohan Parthasarathy wrote:
>         >
>         > CompositeGlyph according to the spec,
>         >
>         >
>         >        When mask-format is not None, glyphs are rendered in
>         the
>         > following way with the effective mask computed in
>         mask-format:
>         >
>         > tmp = temporary alpha picture
>         > Combine (Zero, tmp, tmp, None)
>         > for each glyph
>         >      Combine (Add, tmp, glyph, None)
>         > Combine (op, dst, source, tmp)
>         >
>         >
>         >  So, i can see that before glyphs are actually rendered, it
>         is
>         > combined with a mask.
>         
>         
>         When a mask format is specified, the glyphs are first
>         accumulated to a
>         temporary picture of the specified format, which is then used
>         as a mask
>  
> Is this accumulation a composite operation ? 

Yes, using the Add operator. Again, see the miGlyphs() or exaGlyphs()
implementations for reference.


>         for a single composite operation to the destination picture in
>         order to
>         actually render the glyphs. Without a mask format, each glyph
>         is used as
>         a mask for a composite operation to the destination picture
>         directly.
>         
>         The result should be visually identical unless the mask format
>         is
>         different from any of the glyphs or the glyphs overlap.
>  
> Thanks for the explanation. Do we know how this is done in practice ? 
> I am trying to understand the sequence of operations
> 
> 1) The client adds glyphs to the server 
> 2) The client calls CompositeGlyph with a non-null format
> 3) The client calls CompositeGlyph with a null-format and a
> destination picture
> 
> Is (2) and (3) done separately or just (3) is done ? 

I'm not sure I understand. (2) needs a destination as well, so (2) and
(3) should be essentially identical, with the caveats I mentioned above.


>         > I searched around in Xft and server side to see where this
>         code is
>         > implemented. I can see that in libXrender, maskFormat
>         getting set to
>         > None or the id. So, it has to be on the server side Perhaps,
>         i am
>         > missing something very obvious.. Can someone point me to
>         this code ?
>         
>         
>         miGlyphs() in render/glyph.c or exaGlyphs() in
>         exa/exa_glyphs.c .
>         
> I sort of figured that out working backwards from exaCompositeRects ->
> exaGlyphstoMask...
> But could not find out when the mask is set to null or not-null. 

I think it's simply NULL if the client passes None as maskFormat
parameter to XRenderCompositeString/Text*() and non-NULL otherwise.


-- 
Earthling Michel Dänzer           |          http://tungstengraphics.com
Libre software enthusiast         |          Debian, X and DRI developer




More information about the xorg mailing list