[Xcb] Anyone ever used "XCBRenderCompositeGlyphs"
Yang JianJun
supermaper at gmail.com
Thu Oct 12 05:06:10 PDT 2006
hi lan,
I have checked out the latest git sources. Referring to the implementation
of
XRenderCompositeString8 in libXrender, I try to implement
xcb_render_composite_string_8
simply, but it does not work well.
<code>
typedef struct {
uint8_t len;
uint8_t pad1;
uint16_t pad2;
int16_t deltax;
int16_t deltay;
} xGlyphElt;
void
xcb_render_composite_string_8 (xcb_connection_t *dpy,
int op,
xcb_render_picture_t src,
xcb_render_picture_t dst,
const xcb_render_pictformat_t mask_format,
xcb_render_glyphset_t glyphset,
int src_x,
int src_y,
int xDst,
int yDst,
const char *string, /* a list of xcb_render_glyph_t */
int nchar) /* number of xcb_render_glyph_t */
{
int nbytes;
xGlyphElt *elt;
if (nchar)
{
nbytes = (nchar + sizeof(xGlyphElt) + 3) & ~3;
elt = (xGlyphElt *)malloc(nbytes);
elt->len = nchar;
elt->deltax = xDst;
elt->deltay = yDst;
memcpy ((char *) (elt + 1), string, nchar);
}
xcb_render_composite_glyphs_8 (dpy,op,src,dst,mask_format,glyphset,
src_x,src_y,nbytes,(uint8_t *)elt);
}
</code>
I think the problem is how to convert a list of xcb_render_glyph_t to an
array of bytes(glyphcmds).
Any suggestion to this will be of great help.
jianjun
On 10/11/06, Ian Osgood <iano at quirkster.com> wrote:
>
>
> On Oct 11, 2006, at 2:29 AM, Yang JianJun wrote:
>
> > Hi All,
> >
> > Has anyone ever used "XCBRenderCompositeGlyphs"? and how to convert
> > XCBRenderGLYPH list to XCBRenderGLYPHITEM8 when rendering the
> > glyphs. I am porting XRenderCompositeString to XCB. Thanks in advance.
>
> First, we recently changed the naming convention for XCB 1.0 RC1, so
> the requests are now called xcb_render_composite_glyphs_8/16/32.
>
> Second, we discovered that our XML code generation could not
> correctly support all the types of glyphs, so the parameters to these
> functions have changed from a list of GLYPH unions to simply an array
> of bytes. However, this leaves it up to the caller to convert the
> list of glyphs correctly.
>
> Third, the function you are porting belongs in the xcb/util/
> renderutil library, named xcb_renderutil_composite_string_8. A
> useful starting point would be the implementation in the libXrender
> library found here:
>
> http://gitweb.freedesktop.org/?p=xorg/lib/libXrender.git;f=src/
> Glyph.c;a=blob
>
> I encourage you to work from the latest git sources. You can find
> information on working with our anonymous repositories here:
>
> http://xcb.freedesktop.org/wiki/DevelopersGuide
>
> Sorry if this means more work for you.
>
> Ian
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/xcb/attachments/20061012/c47d4f3e/attachment.htm
More information about the Xcb
mailing list