コード例 #1
0
ファイル: Glyph.c プロジェクト: geekmaster/buildroot-kindle
void
XRenderAddGlyphs (Display	*dpy,
		  GlyphSet	glyphset,
		  _Xconst Glyph		*gids,
		  _Xconst XGlyphInfo	*glyphs,
		  int		nglyphs,
		  _Xconst char		*images,
		  int		nbyte_images)
{
    XRenderExtDisplayInfo         *info = XRenderFindDisplay (dpy);
    xRenderAddGlyphsReq	    *req;
    long		    len;

    if (nbyte_images & 3)
	nbyte_images += 4 - (nbyte_images & 3);
    RenderSimpleCheckExtension (dpy, info);
    LockDisplay(dpy);
    GetReq(RenderAddGlyphs, req);
    req->reqType = info->codes->major_opcode;
    req->renderReqType = X_RenderAddGlyphs;
    req->glyphset = glyphset;
    req->nglyphs = nglyphs;
    len = (nglyphs * (SIZEOF (xGlyphInfo) + 4) + nbyte_images) >> 2;
    SetReqLen(req, len, len);
    Data32 (dpy, (long *) gids, nglyphs * 4);
    Data16 (dpy, (short *) glyphs, nglyphs * SIZEOF (xGlyphInfo));
    Data (dpy, images, nbyte_images);
    UnlockDisplay(dpy);
    SyncHandle();
}
コード例 #2
0
ファイル: Picture.c プロジェクト: aosm/X11libs
void
XRenderSetPictureTransform (Display	*dpy,
			    Picture	picture,
			    XTransform	*transform)
{
    XRenderExtDisplayInfo		    *info = XRenderFindDisplay (dpy);
    xRenderSetPictureTransformReq   *req;
    
    RenderSimpleCheckExtension (dpy, info);
    LockDisplay (dpy);
    GetReq(RenderSetPictureTransform, req);
    req->reqType = info->codes->major_opcode;
    req->renderReqType = X_RenderSetPictureTransform;
    req->picture = picture;
    req->transform.matrix11 = transform->matrix[0][0];
    req->transform.matrix12 = transform->matrix[0][1];
    req->transform.matrix13 = transform->matrix[0][2];
    req->transform.matrix21 = transform->matrix[1][0];
    req->transform.matrix22 = transform->matrix[1][1];
    req->transform.matrix23 = transform->matrix[1][2];
    req->transform.matrix31 = transform->matrix[2][0];
    req->transform.matrix32 = transform->matrix[2][1];
    req->transform.matrix33 = transform->matrix[2][2];
    UnlockDisplay(dpy);
    SyncHandle();
    
}
コード例 #3
0
ファイル: Picture.c プロジェクト: aosm/X11libs
void
XRenderSetPictureClipRegion (Display	    *dpy,
			     Picture	    picture,
			     Region	    r)
{
    XRenderExtDisplayInfo *info = XRenderFindDisplay (dpy);
    int		    i;
    XRectangle	    *xr, *pr;
    BOX		    *pb;
    unsigned long   total;
    
    RenderSimpleCheckExtension (dpy, info);
    LockDisplay(dpy);
    total = r->numRects * sizeof (XRectangle);
    if ((xr = (XRectangle *) _XAllocTemp(dpy, total))) {
	for (pr = xr, pb = r->rects, i = r->numRects; --i >= 0; pr++, pb++) {
	    pr->x = pb->x1;
	    pr->y = pb->y1;
	    pr->width = pb->x2 - pb->x1;
	    pr->height = pb->y2 - pb->y1;
	}
    }
    if (xr || !r->numRects)
	_XRenderSetPictureClipRectangles (dpy, info, picture, 0, 0, 
					  xr, r->numRects);
    if (xr)
	_XFreeTemp(dpy, (char *)xr, total);
    UnlockDisplay(dpy);
    SyncHandle();
}    
コード例 #4
0
ファイル: Glyph.c プロジェクト: geekmaster/buildroot-kindle
void
XRenderFreeGlyphSet (Display *dpy, GlyphSet glyphset)
{
    XRenderExtDisplayInfo         *info = XRenderFindDisplay (dpy);
    xRenderFreeGlyphSetReq  *req;

    RenderSimpleCheckExtension (dpy, info);
    LockDisplay(dpy);
    GetReq(RenderFreeGlyphSet, req);
    req->reqType = info->codes->major_opcode;
    req->renderReqType = X_RenderFreeGlyphSet;
    req->glyphset = glyphset;
    UnlockDisplay(dpy);
    SyncHandle();
}
コード例 #5
0
ファイル: Picture.c プロジェクト: aosm/X11libs
void
XRenderFreePicture (Display                   *dpy,
		    Picture                   picture)
{
    XRenderExtDisplayInfo         *info = XRenderFindDisplay (dpy);
    xRenderFreePictureReq   *req;

    RenderSimpleCheckExtension (dpy, info);
    LockDisplay(dpy);
    GetReq(RenderFreePicture, req);
    req->reqType = info->codes->major_opcode;
    req->renderReqType = X_RenderFreePicture;
    req->picture = picture;
    UnlockDisplay(dpy);
    SyncHandle();
}
コード例 #6
0
ファイル: Picture.c プロジェクト: aosm/X11libs
void
XRenderSetPictureClipRectangles (Display	*dpy,
				 Picture	picture,
				 int		xOrigin,
				 int		yOrigin,
				 _Xconst XRectangle	*rects,
				 int		n)
{
    XRenderExtDisplayInfo	    *info = XRenderFindDisplay (dpy);
    
    RenderSimpleCheckExtension (dpy, info);
    LockDisplay(dpy);
    _XRenderSetPictureClipRectangles (dpy, info, picture, 
				      xOrigin, yOrigin, rects, n);
    UnlockDisplay (dpy);
    SyncHandle ();
}
コード例 #7
0
ファイル: FillRects.c プロジェクト: aosm/X11libs
void
XRenderFillRectangles (Display		    *dpy,
		       int		    op,
		       Picture		    dst,
		       _Xconst XRenderColor *color,
		       _Xconst XRectangle   *rectangles,
		       int		    n_rects)
{
    XRenderExtDisplayInfo		*info = XRenderFindDisplay (dpy);
    xRenderFillRectanglesReq	*req;
    long			len;
    int				n;

    RenderSimpleCheckExtension (dpy, info);
    LockDisplay(dpy);

    while (n_rects) 
    {
	GetReq(RenderFillRectangles, req);
	
	req->reqType = info->codes->major_opcode;
	req->renderReqType = X_RenderFillRectangles;
	req->op = op;
	req->dst = dst;
	req->color.red = color->red;
	req->color.green = color->green;
	req->color.blue = color->blue;
	req->color.alpha = color->alpha;
	
	n = n_rects;
	len = ((long)n) << 1;
	if (!dpy->bigreq_size && len > (dpy->max_request_size - req->length)) 
	{
	    n = (dpy->max_request_size - req->length) >> 1;
	    len = ((long)n) << 1;
	}
	SetReqLen(req, len, len);
	len <<= 2; /* watch out for macros... */
	Data16 (dpy, (short *) rectangles, len);
	n_rects -= n;
	rectangles += n;
    }
コード例 #8
0
ファイル: Glyph.c プロジェクト: dimkr/tinyxlib
void
XRenderFreeGlyphs (Display   *dpy,
		   GlyphSet  glyphset,
		   _Xconst Glyph     *gids,
		   int       nglyphs)
{
    XExtDisplayInfo         *info = XRenderFindDisplay (dpy);
    xRenderFreeGlyphsReq    *req;
    long                    len;

    RenderSimpleCheckExtension (dpy, info);
    LockDisplay(dpy);
    GetReq(RenderFreeGlyphs, req);
    req->reqType = info->codes->major_opcode;
    req->renderReqType = X_RenderFreeGlyphs;
    len = nglyphs;
    SetReqLen(req, len, len);
    len <<= 2;
    Data32 (dpy, (long *) gids, len);
    UnlockDisplay(dpy);
    SyncHandle();
}
コード例 #9
0
ファイル: Picture.c プロジェクト: aosm/X11libs
void
XRenderChangePicture (Display                   *dpy,
		      Picture			picture,
		      unsigned long             valuemask,
		      _Xconst XRenderPictureAttributes  *attributes)
{
    XRenderExtDisplayInfo	    *info = XRenderFindDisplay (dpy);
    xRenderChangePictureReq *req;
    
    RenderSimpleCheckExtension (dpy, info);
    LockDisplay(dpy);
    GetReq(RenderChangePicture, req);
    req->reqType = info->codes->major_opcode;
    req->renderReqType = X_RenderChangePicture;
    req->picture = picture;
    req->mask = valuemask;
    _XRenderProcessPictureAttributes (dpy,
				      req,
				      valuemask,
				      attributes);
    UnlockDisplay(dpy);
    SyncHandle();
}
コード例 #10
0
ファイル: Filter.c プロジェクト: geekmaster/buildroot-kindle
void
XRenderSetPictureFilter  (Display   *dpy,
			  Picture   picture,
			  const char *filter,
			  XFixed    *params,
			  int	    nparams)
{
    XRenderExtDisplayInfo		*info = XRenderFindDisplay (dpy);
    xRenderSetPictureFilterReq	*req;
    int				nbytes = strlen (filter);

    RenderSimpleCheckExtension (dpy, info);
    LockDisplay(dpy);
    GetReq(RenderSetPictureFilter, req);
    req->reqType = info->codes->major_opcode;
    req->renderReqType = X_RenderSetPictureFilter;
    req->picture = picture;
    req->nbytes = nbytes;
    req->length += ((nbytes + 3) >> 2) + nparams;
    Data (dpy, filter, nbytes);
    Data (dpy, (_Xconst char *)params, nparams << 2);
    UnlockDisplay(dpy);
    SyncHandle();
}
コード例 #11
0
ファイル: Glyph.c プロジェクト: geekmaster/buildroot-kindle
void
XRenderCompositeText8 (Display			    *dpy,
		       int			    op,
		       Picture			    src,
		       Picture			    dst,
		       _Xconst XRenderPictFormat    *maskFormat,
		       int			    xSrc,
		       int			    ySrc,
		       int			    xDst,
		       int			    yDst,
		       _Xconst XGlyphElt8	    *elts,
		       int			    nelt)
{
    XRenderExtDisplayInfo		*info = XRenderFindDisplay (dpy);
    xRenderCompositeGlyphs8Req	*req;
    GlyphSet			glyphset;
    long			len;
    long			elen;
    xGlyphElt			*elt;
    int				i;
    _Xconst char		*chars;
    int				nchars;

    if (!nelt)
	return;

    RenderSimpleCheckExtension (dpy, info);
    LockDisplay(dpy);

    GetReq(RenderCompositeGlyphs8, req);
    req->reqType = info->codes->major_opcode;
    req->renderReqType = X_RenderCompositeGlyphs8;
    req->op = op;
    req->src = src;
    req->dst = dst;
    req->maskFormat = maskFormat ? maskFormat->id : None;
    req->glyphset = elts[0].glyphset;
    req->xSrc = xSrc;
    req->ySrc = ySrc;

    /*
     * Compute the space necessary
     */
    len = 0;

#define MAX_8 252

    glyphset = elts[0].glyphset;
    for (i = 0; i < nelt; i++)
    {
	/*
	 * Check for glyphset change
	 */
	if (elts[i].glyphset != glyphset)
	{
	    glyphset = elts[i].glyphset;
	    len += (SIZEOF (xGlyphElt) + 4) >> 2;
	}
	nchars = elts[i].nchars;
	/*
	 * xGlyphElt must be aligned on a 32-bit boundary; this is
	 * easily done by filling no more than 252 glyphs in each
	 * bucket
	 */
	elen = SIZEOF(xGlyphElt) * ((nchars + MAX_8-1) / MAX_8) + nchars;
	len += (elen + 3) >> 2;
    }
コード例 #12
0
ファイル: Glyph.c プロジェクト: geekmaster/buildroot-kindle
void
XRenderCompositeString32 (Display	    *dpy,
			  int		    op,
			  Picture	    src,
			  Picture	    dst,
			  _Xconst XRenderPictFormat  *maskFormat,
			  GlyphSet	    glyphset,
			  int		    xSrc,
			  int		    ySrc,
			  int		    xDst,
			  int		    yDst,
			  _Xconst unsigned int	    *string,
			  int		    nchar)
{
    XRenderExtDisplayInfo		*info = XRenderFindDisplay (dpy);
    xRenderCompositeGlyphs8Req	*req;
    long			len;
    xGlyphElt			*elt;
    int				nbytes;

    if (!nchar)
	return;

    RenderSimpleCheckExtension (dpy, info);
    LockDisplay(dpy);

    GetReq(RenderCompositeGlyphs32, req);
    req->reqType = info->codes->major_opcode;
    req->renderReqType = X_RenderCompositeGlyphs32;
    req->op = op;
    req->src = src;
    req->dst = dst;
    req->maskFormat = maskFormat ? maskFormat->id : None;
    req->glyphset = glyphset;
    req->xSrc = xSrc;
    req->ySrc = ySrc;

#define MAX_32	254

    len = SIZEOF(xGlyphElt) * ((nchar + MAX_32-1) / MAX_32) + nchar * 4;

    req->length += (len + 3)>>2;  /* convert to number of 32-bit words */

    /*
     * If the entire request does not fit into the remaining space in the
     * buffer, flush the buffer first.
     */

    if (dpy->bufptr + len > dpy->bufmax)
    	_XFlush (dpy);

    while(nchar > MAX_32)
    {
	nbytes = MAX_32 * 4 + SIZEOF(xGlyphElt);
	BufAlloc (xGlyphElt *, elt, nbytes);
	elt->len = MAX_32;
	elt->deltax = xDst;
	elt->deltay = yDst;
	xDst = 0;
	yDst = 0;
	memcpy ((char *) (elt + 1), (char *) string, MAX_32 * 4);
	nchar = nchar - MAX_32;
	string += MAX_32;
    }

    if (nchar)
    {
	nbytes = nchar * 4 + SIZEOF(xGlyphElt);
	BufAlloc (xGlyphElt *, elt, nbytes);
	elt->len = nchar;
	elt->deltax = xDst;
	elt->deltay = yDst;
	memcpy ((char *) (elt + 1), (char *) string, nchar * 4);
    }
#undef MAX_32

    UnlockDisplay(dpy);
    SyncHandle();
}
コード例 #13
0
ファイル: Glyph.c プロジェクト: geekmaster/buildroot-kindle
void
XRenderCompositeString8 (Display	    *dpy,
			 int		    op,
			 Picture	    src,
			 Picture	    dst,
			 _Xconst XRenderPictFormat  *maskFormat,
			 GlyphSet	    glyphset,
			 int		    xSrc,
			 int		    ySrc,
			 int		    xDst,
			 int		    yDst,
			 _Xconst char	    *string,
			 int		    nchar)
{
    XRenderExtDisplayInfo		*info = XRenderFindDisplay (dpy);
    xRenderCompositeGlyphs8Req	*req;
    long			len;
    xGlyphElt			*elt;
    int				nbytes;

    if (!nchar)
	return;

    RenderSimpleCheckExtension (dpy, info);
    LockDisplay(dpy);

    GetReq(RenderCompositeGlyphs8, req);
    req->reqType = info->codes->major_opcode;
    req->renderReqType = X_RenderCompositeGlyphs8;
    req->op = op;
    req->src = src;
    req->dst = dst;
    req->maskFormat = maskFormat ? maskFormat->id : None;
    req->glyphset = glyphset;
    req->xSrc = xSrc;
    req->ySrc = ySrc;

    /*
     * xGlyphElt must be aligned on a 32-bit boundary; this is
     * easily done by filling no more than 252 glyphs in each
     * bucket
     */

#define MAX_8 252

    len = SIZEOF(xGlyphElt) * ((nchar + MAX_8-1) / MAX_8) + nchar;

    req->length += (len + 3)>>2;  /* convert to number of 32-bit words */

    /*
     * If the entire request does not fit into the remaining space in the
     * buffer, flush the buffer first.
     */

    if (dpy->bufptr + len > dpy->bufmax)
    	_XFlush (dpy);

    while(nchar > MAX_8)
    {
	nbytes = MAX_8 + SIZEOF(xGlyphElt);
	BufAlloc (xGlyphElt *, elt, nbytes);
	elt->len = MAX_8;
	elt->deltax = xDst;
	elt->deltay = yDst;
	xDst = 0;
	yDst = 0;
	memcpy ((char *) (elt + 1), string, MAX_8);
	nchar = nchar - MAX_8;
	string += MAX_8;
    }

    if (nchar)
    {
	nbytes = (nchar + SIZEOF(xGlyphElt) + 3) & ~3;
	BufAlloc (xGlyphElt *, elt, nbytes);
	elt->len = nchar;
	elt->deltax = xDst;
	elt->deltay = yDst;
	memcpy ((char *) (elt + 1), string, nchar);
    }
#undef MAX_8

    UnlockDisplay(dpy);
    SyncHandle();
}
コード例 #14
0
ファイル: Glyph.c プロジェクト: dimkr/tinyxlib
void
XRenderCompositeText32 (Display			    *dpy,
			int			    op,
			Picture			    src,
			Picture			    dst,
			_Xconst XRenderPictFormat   *maskFormat,
			int			    xSrc,
			int			    ySrc,
			int			    xDst,
			int			    yDst,
			_Xconst XGlyphElt32	    *elts,
			int			    nelt)
{
    XExtDisplayInfo		*info = XRenderFindDisplay (dpy);
    xRenderCompositeGlyphs32Req	*req;
    long			len;
    long			elen;
    xGlyphElt			*elt;
    int				i;
    _Xconst unsigned int    	*chars;
    int				nchars;

    if (!nelt)
	return;
    
    RenderSimpleCheckExtension (dpy, info);
    LockDisplay(dpy);

    GetReq(RenderCompositeGlyphs32, req);
    req->reqType = info->codes->major_opcode;
    req->renderReqType = X_RenderCompositeGlyphs32;
    req->op = op;
    req->src = src;
    req->dst = dst;
    req->maskFormat = maskFormat ? maskFormat->id : None;
    req->glyphset = elts[0].glyphset;
    req->xSrc = xSrc;
    req->ySrc = ySrc;    

    /*
     * Compute the space necessary
     */
    len = 0;
    
    for (i = 0; i < nelt; i++)
    {
	if (elts[i].glyphset != req->glyphset)
	    len += (SIZEOF (xGlyphElt) + 4) >> 2;
	nchars = elts[i].nchars;
	elen = SIZEOF(xGlyphElt) * ((nchars + MAX_32) / MAX_32) + nchars *4;
	len += (elen + 3) >> 2;
    }
    
    req->length += len;
    /* 
     * If the entire request does not fit into the remaining space in the
     * buffer, flush the buffer first.
     */

    if (dpy->bufptr + (len << 2) > dpy->bufmax)
    	_XFlush (dpy);

    for (i = 0; i < nelt; i++)
    {
	/*
	 * Switch glyphsets
	 */
	if (elts[i].glyphset != req->glyphset)
	{
	    BufAlloc (xGlyphElt *, elt, SIZEOF (xGlyphElt));
	    elt->len = 0xff;
	    elt->deltax = 0;
	    elt->deltay = 0;
	    Data32(dpy, &elts[i].glyphset, 4);
	}
	nchars = elts[i].nchars;
	xDst = elts[i].xOff;
	yDst = elts[i].yOff;
	chars = elts[i].chars;
	while (nchars)
	{
	    BufAlloc (xGlyphElt *, elt, SIZEOF(xGlyphElt))
	    elt->len = nchars > MAX_32 ? MAX_32 : nchars;
	    elt->deltax = xDst;
	    elt->deltay = yDst;
	    xDst = 0;
	    yDst = 0;
	    Data32 (dpy, chars, elt->len * 4);
	    nchars -= elt->len;
	    chars += elt->len;
	}
    }
    
    UnlockDisplay(dpy);
    SyncHandle();
}