libXrender.txt revision 6fae4e5d
1e5410a46Smrg                         The Xrender Library
2e5410a46Smrg			    Version 0.7
3e5410a46Smrg			      2002-11-6
4e5410a46Smrg			    Keith Packard
5e5410a46Smrg			  keithp@xfree86.org
6e5410a46Smrg
7e5410a46Smrg1. Introduction
8e5410a46Smrg
9e5410a46SmrgThe Xrender library is designed as a lightweight library interface to the
10e5410a46SmrgRender extension.  This document describes how the library maps to the
11e5410a46Smrgprotocol without duplicating the semantics described by that document.
12e5410a46Smrg
13e5410a46Smrg2. Data Types
14e5410a46Smrg
15e5410a46Smrg2.1 Primitive Types
16e5410a46Smrg
17e5410a46SmrgFor resources represented as CARD32 or XID on the wire, Xrender exposes them
18e5410a46Smrgusing an 'unsigned long' type as is the norm for 32-bit data objects in an
19e5410a46SmrgXlib compatible API.
20e5410a46Smrg
21e5410a46Smrg	typedef unsigned long	Glyph;
22e5410a46Smrg	typedef unsigned long	GlyphSet;
23e5410a46Smrg	typedef unsigned long	Picture;
24e5410a46Smrg	typedef unsigned long	PictFormat;
25e5410a46Smrg
26e5410a46SmrgGlyphs are just CARD32 objects, while GlyphSet, Picture and PictFormat
27e5410a46Smrgvalues are XIDs.
28e5410a46Smrg
29e5410a46Smrg	typedef int XFixed;
30e5410a46Smrg
31e5410a46SmrgFixed point numbers buck the Xlib convention by being represented as ints.
32e5410a46SmrgMachines for which 'int' is smaller than 32 bits cannot support the Xrender
33e5410a46Smrglibrary.
34e5410a46Smrg
35e5410a46Smrg2.2 PictFormat descriptions.
36e5410a46Smrg
37e5410a46SmrgThe definition of a PictFormat is exposed by two data structures:
38e5410a46Smrg
39e5410a46Smrg	typedef struct {
40e5410a46Smrg	    short   red;
41e5410a46Smrg	    short   redMask;
42e5410a46Smrg	    short   green;
43e5410a46Smrg	    short   greenMask;
44e5410a46Smrg	    short   blue;
45e5410a46Smrg	    short   blueMask;
46e5410a46Smrg	    short   alpha;
47e5410a46Smrg	    short   alphaMask;
48e5410a46Smrg	} XRenderDirectFormat;
49e5410a46Smrg
50e5410a46Smrg	typedef struct {
51e5410a46Smrg	    PictFormat		id;
52e5410a46Smrg	    int			type;
53e5410a46Smrg	    int			depth;
54e5410a46Smrg	    XRenderDirectFormat	direct;
55e5410a46Smrg	    Colormap		colormap;
56e5410a46Smrg	} XRenderPictFormat;
57e5410a46Smrg
58e5410a46SmrgThese serve both as a description of the available formats and as patterns
59e5410a46Smrgagainst which available formats are matched.
60e5410a46Smrg
61e5410a46Smrg2.3 Picture Attributes
62e5410a46Smrg
63e5410a46SmrgWhen creating or changing Picture objects, attributes are passed much as
64e5410a46Smrgthey are for XCreateWindow/XChangeWindowAttributes.  A structure capable of
65e5410a46Smrgholding all of the attributes has the relevant ones set and a bitmask passed
66e5410a46Smrgas a separate argument which marks the valid entries.
67e5410a46Smrg
68e5410a46Smrg	typedef struct _XRenderPictureAttributes {
69e5410a46Smrg	    Bool		repeat;
70e5410a46Smrg	    Picture		alpha_map;
71e5410a46Smrg	    int			alpha_x_origin;
72e5410a46Smrg	    int			alpha_y_origin;
73e5410a46Smrg	    int			clip_x_origin;
74e5410a46Smrg	    int			clip_y_origin;
75e5410a46Smrg	    Pixmap		clip_mask;
76e5410a46Smrg	    Bool		graphics_exposures;
77e5410a46Smrg	    int			subwindow_mode;
78e5410a46Smrg	    int			poly_edge;
79e5410a46Smrg	    int			poly_mode;
80e5410a46Smrg	    Atom		dither;
81e5410a46Smrg	    Bool		component_alpha;
82e5410a46Smrg	} XRenderPictureAttributes;
83e5410a46Smrg
84e5410a46Smrg2.4 Colors
85e5410a46Smrg
86e5410a46SmrgThe core protocol XColor type doesn't include an alpha component, so Xrender
87e5410a46Smrghas a separate type.
88e5410a46Smrg
89e5410a46Smrg	typedef struct {
90e5410a46Smrg	    unsigned short   red;
91e5410a46Smrg	    unsigned short   green;
92e5410a46Smrg	    unsigned short   blue;
93e5410a46Smrg	    unsigned short   alpha;
94e5410a46Smrg	} XRenderColor;
95e5410a46Smrg
96e5410a46Smrg2.5 Glyph Types
97e5410a46Smrg
98e5410a46SmrgGlyphs are stored in the server, so these definitions are passed from the
99e5410a46Smrgclient to the library and on to the server as glyphs are rasterized and
100e5410a46Smrgtransmitted over the wire.
101e5410a46Smrg
102e5410a46Smrg	typedef struct _XGlyphInfo {
103e5410a46Smrg	    unsigned short  width;
104e5410a46Smrg	    unsigned short  height;
105e5410a46Smrg	    short	    x;
106e5410a46Smrg	    short	    y;
107e5410a46Smrg	    short	    xOff;
108e5410a46Smrg	    short	    yOff;
109e5410a46Smrg	} XGlyphInfo;
110e5410a46Smrg
111e5410a46Smrg2.6 Glyph Rendering types
112e5410a46Smrg
113e5410a46SmrgGlyph rendering can either take a single string of glyph indices or an array
114e5410a46Smrgof one of the following structures.
115e5410a46Smrg
116e5410a46Smrg	typedef struct _XGlyphElt8 {
117e5410a46Smrg	    GlyphSet		    glyphset;
118e5410a46Smrg	    _Xconst char	    *chars;
119e5410a46Smrg	    int			    nchars;
120e5410a46Smrg	    int			    xOff;
121e5410a46Smrg	    int			    yOff;
122e5410a46Smrg	} XGlyphElt8;
123e5410a46Smrg
124e5410a46Smrg	typedef struct _XGlyphElt16 {
125e5410a46Smrg	    GlyphSet		    glyphset;
126e5410a46Smrg	    _Xconst unsigned short  *chars;
127e5410a46Smrg	    int			    nchars;
128e5410a46Smrg	    int			    xOff;
129e5410a46Smrg	    int			    yOff;
130e5410a46Smrg	} XGlyphElt16;
131e5410a46Smrg
132e5410a46Smrg	typedef struct _XGlyphElt32 {
133e5410a46Smrg	    GlyphSet		    glyphset;
134e5410a46Smrg	    _Xconst unsigned int    *chars;
135e5410a46Smrg	    int			    nchars;
136e5410a46Smrg	    int			    xOff;
137e5410a46Smrg	    int			    yOff;
138e5410a46Smrg	} XGlyphElt32;
139e5410a46Smrg
140e5410a46Smrg2.7 Geometric Types
141e5410a46Smrg
142e5410a46SmrgGeometric operations directly expose the available protocol datatypes
143e5410a46Smrg
144e5410a46Smrg	typedef struct _XPointFixed {
145e5410a46Smrg	    XFixed  x, y;
146e5410a46Smrg	} XPointFixed;
147e5410a46Smrg
148e5410a46Smrg	typedef struct _XLineFixed {
149e5410a46Smrg	    XPointFixed	p1, p2;
150e5410a46Smrg	} XLineFixed;
151e5410a46Smrg
152e5410a46Smrg	typedef struct _XTriangle {
153e5410a46Smrg	    XPointFixed	p1, p2, p3;
154e5410a46Smrg	} XTriangle;
155e5410a46Smrg
156e5410a46Smrg	typedef struct _XTrapezoid {
157e5410a46Smrg	    XFixed  top, bottom;
158e5410a46Smrg	    XLineFixed	left, right;
159e5410a46Smrg	} XTrapezoid;
160e5410a46Smrg
161e5410a46Smrg	typedef struct _XTransform {
162e5410a46Smrg	    XFixed  matrix[3][3];
163e5410a46Smrg	} XTransform;
164e5410a46Smrg
165e5410a46Smrg2.8 Transformation Filters
166e5410a46Smrg
167e5410a46SmrgAll of the filters are named simultaneously; Xrender provides no convenience
168e5410a46Smrgfunctions for dealing with them.
169e5410a46Smrg
170e5410a46Smrg	typedef struct _XFilters {
171e5410a46Smrg	    int	    nfilter;
172e5410a46Smrg	    char    **filter;
173e5410a46Smrg	    int	    nalias;
174e5410a46Smrg	    short   *alias;
175e5410a46Smrg	} XFilters;
176e5410a46Smrg
177e5410a46Smrg2.9 Index type PictFormat colors
178e5410a46Smrg
179e5410a46SmrgPictFormats of Index type advertise which colors will be used for drawing
180e5410a46Smrgthrough this type.
181e5410a46Smrg
182e5410a46Smrg	typedef struct _XIndexValue {
183e5410a46Smrg	    unsigned long    pixel;
184e5410a46Smrg	    unsigned short   red, green, blue, alpha;
185e5410a46Smrg	} XIndexValue;
186e5410a46Smrg
187e5410a46Smrg
188e5410a46Smrg3 Application Startup Functions
189e5410a46Smrg
190e5410a46Smrg3.1 Initialization functions
191e5410a46Smrg
192e5410a46Smrg	Bool XRenderQueryExtension (Display *dpy,
193e5410a46Smrg			            int     *event_basep,
194e5410a46Smrg				    int     *error_basep)
195e5410a46Smrg
196e5410a46SmrgThis function returns True if the Render extension is available on dpy.
197e5410a46Smrgevent_basep and error_basep will be filled in with the first event and error
198e5410a46Smrgnumbers used by the extension (note that Render currently uses no events).
199e5410a46Smrg
200e5410a46Smrg	Status XRenderQueryVersion (Display *dpy,
201e5410a46Smrg				    int     *major_versionp,
202e5410a46Smrg				    int     *minor_versionp)
203e5410a46Smrg
204e5410a46SmrgXRenderQueryVersion returns zero if the Render extension is not present or
205e5410a46Smrgsome error occurred while attempting to discover the current Render version
206e5410a46Smrgnumber.  Otherwise, XRenderQueryVersion returns 1 and stores the version
207e5410a46Smrgnumber returned by the server in *major_versionp and *minor_versionp, which
208e5410a46Smrgwill be less than or equal to the library version numbers RENDER_MAJOR and
209e5410a46SmrgRENDER_MINOR.
210e5410a46Smrg
211e5410a46Smrg	Status XRenderQueryFormats (Display *dpy)
212e5410a46Smrg
213e5410a46SmrgXRenderQueryFormats returns 1 if it successfully fetches the available
214e5410a46SmrgPictFormat information from the X server, 0 otherwise.  Applications needn't
215e5410a46Smrginvoke this function directly (hmm, perhaps it should be removed from the
216e5410a46Smrgexternal interfaces then).
217e5410a46Smrg
218e5410a46Smrg3.2 Subpixel Order
219e5410a46Smrg
220e5410a46Smrg	int XRenderQuerySubpixelOrder (Display *dpy, int screen)
221e5410a46Smrg
222e5410a46Smrg	Bool XRenderSetSubpixelOrder (Display *dpy, int screen, int subpixel)
223e5410a46Smrg
224e5410a46SmrgApplications interested in the geometry of the elements making up a single
225e5410a46Smrgpixel on the screen should use XRenderQuerySubpixelOrder and not cache the
226e5410a46Smrgreturn value.  XRenderSetSubpixelOrder is used by the XRandR library to
227e5410a46Smrgupdate the value stored by Xrender when the subpixel order changes as a
228e5410a46Smrgresult of screen reconfiguration.
229e5410a46Smrg
230e5410a46Smrg3.3 PictFormat matching
231e5410a46Smrg
232e5410a46SmrgXrender provides these APIs to help locate appropriate PictFormats; they are
233e5410a46Smrgintended to work much like the Visual matching APIs in Xlib.  The
234e5410a46Smrgapplication provides a specification including the necessary PictFormat
235e5410a46Smrgcharacteristics and Xrender returns a matching XRenderPictFormat structure
236e5410a46Smrgwhich describes the PictFormat.
237e5410a46Smrg
238e5410a46Smrg	XRenderPictFormat *
239e5410a46Smrg	XRenderFindFormat (Display			*dpy,
240e5410a46Smrg			   unsigned long		mask,
241e5410a46Smrg			   _Xconst XRenderPictFormat	*templ,
242e5410a46Smrg			   int				count)
243e5410a46Smrg
244e5410a46Smrg	#define PictFormatID	    (1 << 0)
245e5410a46Smrg	#define PictFormatType	    (1 << 1)
246e5410a46Smrg	#define PictFormatDepth	    (1 << 2)
247e5410a46Smrg	#define PictFormatRed	    (1 << 3)
248e5410a46Smrg	#define PictFormatRedMask   (1 << 4)
249e5410a46Smrg	#define PictFormatGreen	    (1 << 5)
250e5410a46Smrg	#define PictFormatGreenMask (1 << 6)
251e5410a46Smrg	#define PictFormatBlue	    (1 << 7)
252e5410a46Smrg	#define PictFormatBlueMask  (1 << 8)
253e5410a46Smrg	#define PictFormatAlpha	    (1 << 9)
254e5410a46Smrg	#define PictFormatAlphaMask (1 << 10)
255e5410a46Smrg	#define PictFormatColormap  (1 << 11)
256e5410a46Smrg
257e5410a46SmrgXRenderFindFormat locates a PictFormat matching the characteristics provided
258e5410a46Smrgin the templ.  Only elements whose associated bit in mask are compared.
259e5410a46Smrg
260e5410a46Smrg	XRenderPictFormat *
261e5410a46Smrg	XRenderFindVisualFormat (Display *dpy, _Xconst Visual *visual)
262e5410a46Smrg
263e5410a46SmrgFinds the PictFormat suitable for use with the specified visual.
264e5410a46Smrg
265e5410a46Smrg	XRenderPictFormat *
266e5410a46Smrg	XRenderFindStandardFormat (Display		*dpy,
267e5410a46Smrg				   int			format)
268e5410a46Smrg
269e5410a46Smrg	#define PictStandardARGB32  0
270e5410a46Smrg	#define PictStandardRGB24   1
271e5410a46Smrg	#define PictStandardA8	    2
272e5410a46Smrg	#define PictStandardA4	    3
273e5410a46Smrg	#define PictStandardA1	    4
274e5410a46Smrg	#define PictStandardNUM	    5
275e5410a46Smrg
2766fae4e5dSmrgAs a convenience, this function locates PictFormats that correspond to
277e5410a46Smrgcommonly used formats.
278e5410a46Smrg
279e5410a46Smrg	ARGB32		depth 32, bits 31-24 A, 23-16 R, 15-8 G, 7-0 B
280e5410a46Smrg	RGB24		depth 24, bits 23-16 R, 15-8 G, 7-0 B
281e5410a46Smrg	A8		depth 8, bits 7-0 A
282e5410a46Smrg	A4		depth 4, bits 3-0 A
283e5410a46Smrg	A1		depth 1, bits 0 A
284e5410a46Smrg
2856fae4e5dSmrgAny server supporting Render must have a PictFormat corresponding to each of
286e5410a46Smrgthese standard formats.
287e5410a46Smrg
288e5410a46Smrg3.4 Index type PictFormat color values
289e5410a46Smrg
290e5410a46Smrg	XIndexValue *
291e5410a46Smrg	XRenderQueryPictIndexValues(Display			*dpy,
292e5410a46Smrg				    _Xconst XRenderPictFormat	*format,
293e5410a46Smrg				    int				*num)
294e5410a46Smrg
295e5410a46SmrgIf format refers to an Index type PictFormat, XRenderQueryPictIndexValues
296e5410a46Smrgreturns the set of pixel values and their associated colors used when
297e5410a46Smrgdrawing to Pictures created with that format.  Otherwise,
298e5410a46SmrgXRenderQueryPictIndexValues generates a BadMatch error.
299e5410a46Smrg
300e5410a46Smrg3.5 Querying available filters
301e5410a46Smrg
302e5410a46Smrg	XFilters *
303e5410a46Smrg	XRenderQueryFilters (Display *dpy, Drawable drawable);
304e5410a46Smrg
305e5410a46SmrgFilters are used with non-identity transformation matrices, this function
306e5410a46Smrgreturns a datastructure identifying the available filters on display that
307e5410a46Smrgcan be associated with pictures for the screen associated with drawable.
308e5410a46Smrg
309e5410a46SmrgFree this structure with XFree.
310e5410a46Smrg
311e5410a46Smrg4 Picture Functions
312e5410a46Smrg
313e5410a46Smrg	Picture
314e5410a46Smrg	XRenderCreatePicture (Display				*dpy,
315e5410a46Smrg			      Drawable				drawable,
316e5410a46Smrg			      _Xconst XRenderPictFormat		*format,
317e5410a46Smrg			      unsigned long			valuemask,
318e5410a46Smrg			      _Xconst XRenderPictureAttributes	*attributes)
319e5410a46Smrg
320e5410a46Smrg	#define CPRepeat			    (1 << 0)
321e5410a46Smrg	#define CPAlphaMap			    (1 << 1)
322e5410a46Smrg	#define CPAlphaXOrigin			    (1 << 2)
323e5410a46Smrg	#define CPAlphaYOrigin			    (1 << 3)
324e5410a46Smrg	#define CPClipXOrigin			    (1 << 4)
325e5410a46Smrg	#define CPClipYOrigin			    (1 << 5)
326e5410a46Smrg	#define CPClipMask			    (1 << 6)
327e5410a46Smrg	#define CPGraphicsExposure		    (1 << 7)
328e5410a46Smrg	#define CPSubwindowMode			    (1 << 8)
329e5410a46Smrg	#define CPPolyEdge			    (1 << 9)
330e5410a46Smrg	#define CPPolyMode			    (1 << 10)
331e5410a46Smrg	#define CPDither			    (1 << 11)
332e5410a46Smrg	#define CPComponentAlpha		    (1 << 12)
3336fae4e5dSmrg	#define CPLastBit			    12
334e5410a46Smrg
335e5410a46SmrgCreates a picture for drawable in the specified format.  Any values
336e5410a46Smrgspecified in 'attributes' and 'valuemask' are used in place of the default
337e5410a46Smrgvalues.
338e5410a46Smrg
339e5410a46Smrg	void
340e5410a46Smrg	XRenderChangePicture (Display				*dpy,
341e5410a46Smrg			      Picture				picture,
342e5410a46Smrg			      unsigned long			valuemask,
343e5410a46Smrg			      _Xconst XRenderPictureAttributes  *attributes)
344e5410a46Smrg
345e5410a46SmrgChange values in picture to those specified by valuemask and attributes.
346e5410a46Smrg
347e5410a46Smrg
348e5410a46Smrg	void
349e5410a46Smrg	XRenderSetPictureClipRectangles (Display	    *dpy,
350e5410a46Smrg					 Picture	    picture,
351e5410a46Smrg					 int		    xOrigin,
352e5410a46Smrg					 int		    yOrigin,
353e5410a46Smrg					 _Xconst XRectangle *rects,
354e5410a46Smrg					 int		    n)
355e5410a46Smrg
356e5410a46SmrgSets the clip mask in picture to the union of rects offset by
357e5410a46SmrgxOrigin/yOrigin.
358e5410a46Smrg
359e5410a46Smrg	void
360e5410a46Smrg	XRenderSetPictureClipRegion (Display	    *dpy,
361e5410a46Smrg				     Picture	    picture,
362e5410a46Smrg				     Region	    r)
363e5410a46Smrg
364e5410a46SmrgSets the clip mask in picture to r.
365e5410a46Smrg
366e5410a46Smrg	void
367e5410a46Smrg	XRenderSetPictureTransform (Display	    *dpy,
368e5410a46Smrg				    Picture	    picture,
369e5410a46Smrg				    XTransform	    *transform)
370e5410a46Smrg
371e5410a46SmrgSets the projective transformation matrix of picture to transform.
372e5410a46Smrg
373e5410a46Smrg	void
374e5410a46Smrg	XRenderFreePicture (Display                   *dpy,
375e5410a46Smrg			    Picture                   picture)
376e5410a46Smrg
377e5410a46SmrgInstructs the server to free picture.
378e5410a46Smrg
379e5410a46Smrg5 GlyphSet functions
380e5410a46Smrg
381e5410a46Smrg	GlyphSet
382e5410a46Smrg	XRenderCreateGlyphSet (Display *dpy, _Xconst XRenderPictFormat *format)
383e5410a46Smrg
384e5410a46SmrgCreates a glyphset, every glyph in the set will use PictFormat format.
385e5410a46Smrg
386e5410a46Smrg	GlyphSet
387e5410a46Smrg	XRenderReferenceGlyphSet (Display *dpy, GlyphSet existing)
388e5410a46Smrg
389e5410a46SmrgCreates a new GlyphSet ID which references an existing GlyphSet.  The
390e5410a46Smrgtwo IDs refer to the same object so that changes using one ID will be
391e5410a46Smrgvisible through the other ID.  This is designed to allow multiple clients to
392e5410a46Smrgshare the same GlyphSet so that it doesn't get destroyed when the first
393e5410a46Smrgclient exits.
394e5410a46Smrg
395e5410a46Smrg	void
396e5410a46Smrg	XRenderFreeGlyphSet (Display *dpy, GlyphSet glyphset)
397e5410a46Smrg
398e5410a46SmrgFrees the glyphset ID.  If no other GlyphSet IDs refer to the underlying
399e5410a46SmrgGlyphSet, it will be destroyed.
400e5410a46Smrg
401e5410a46Smrg	void
402e5410a46Smrg	XRenderAddGlyphs (Display		*dpy,
403e5410a46Smrg			  GlyphSet		glyphset,
404e5410a46Smrg			  _Xconst Glyph		*gids,
405e5410a46Smrg			  _Xconst XGlyphInfo	*glyphs,
406e5410a46Smrg			  int			nglyphs,
407e5410a46Smrg			  _Xconst char		*images,
408e5410a46Smrg			  int			nbyte_images)
409e5410a46Smrg
410e5410a46SmrgAdd glyphs to glyphset.  The images are packed together in Z-pixmap format
411e5410a46Smrgaccording to the depth of the PictFormat used in creating glyphset.
412e5410a46Smrg
413e5410a46Smrg	void
414e5410a46Smrg	XRenderFreeGlyphs (Display	    *dpy,
415e5410a46Smrg			   GlyphSet	    glyphset,
416e5410a46Smrg			   _Xconst Glyph    *gids,
417e5410a46Smrg			   int		    nglyphs)
418e5410a46Smrg
419e5410a46SmrgFree some glyphs from glyphset.
420e5410a46Smrg
421e5410a46Smrg6 Glyph Drawing Routines
422e5410a46Smrg
423e5410a46SmrgXrender provides two parallel APIs for glyph rendering, a simple API which
424e5410a46Smrgaccepts a single string similar to XDrawString and a more complex API which
425e5410a46Smrgaccepts an array of XGlyphElt{8,16,32} structures, each of which includes a
426e5410a46Smrgglyphset, string and x/y offsets which parallel the XDrawText API.  Xrender
427e5410a46Smrgalso provides glyphs in three sizes, 8 16 and 32 bits.  The simple API is
428e5410a46Smrgjust a convenience for the user as both forms generate the same underlying
429e5410a46SmrgRender protocol.
430e5410a46Smrg
431e5410a46Smrg6.1 Simple single-string glyph drawing functions
432e5410a46Smrg
433e5410a46SmrgThese are identical except for the format of the glyph ids.
434e5410a46Smrg
435e5410a46Smrg	void
436e5410a46Smrg	XRenderCompositeString8 (Display		    *dpy,
437e5410a46Smrg				 int			    op,
438e5410a46Smrg				 Picture		    src,
439e5410a46Smrg				 Picture		    dst,
440e5410a46Smrg				 _Xconst XRenderPictFormat  *maskFormat,
441e5410a46Smrg				 GlyphSet		    glyphset,
442e5410a46Smrg				 int			    xSrc,
443e5410a46Smrg				 int			    ySrc,
444e5410a46Smrg				 int			    xDst,
445e5410a46Smrg				 int			    yDst,
446e5410a46Smrg				 _Xconst char		    *string,
447e5410a46Smrg				 int			    nchar)
448e5410a46Smrg
449e5410a46Smrg	void
450e5410a46Smrg	XRenderCompositeString16 (Display		    *dpy,
451e5410a46Smrg				  int			    op,
452e5410a46Smrg				  Picture		    src,
453e5410a46Smrg				  Picture		    dst,
454e5410a46Smrg				  _Xconst XRenderPictFormat *maskFormat,
455e5410a46Smrg				  GlyphSet		    glyphset,
456e5410a46Smrg				  int			    xSrc,
457e5410a46Smrg				  int			    ySrc,
458e5410a46Smrg				  int			    xDst,
459e5410a46Smrg				  int			    yDst,
460e5410a46Smrg				  _Xconst unsigned short    *string,
461e5410a46Smrg				  int			    nchar)
462e5410a46Smrg
463e5410a46Smrg	void
464e5410a46Smrg	XRenderCompositeString32 (Display		    *dpy,
465e5410a46Smrg				  int			    op,
466e5410a46Smrg				  Picture		    src,
467e5410a46Smrg				  Picture		    dst,
468e5410a46Smrg				  _Xconst XRenderPictFormat *maskFormat,
469e5410a46Smrg				  GlyphSet		    glyphset,
470e5410a46Smrg				  int			    xSrc,
471e5410a46Smrg				  int			    ySrc,
472e5410a46Smrg				  int			    xDst,
473e5410a46Smrg				  int			    yDst,
474e5410a46Smrg				  _Xconst unsigned int	    *string,
475e5410a46Smrg				  int			    nchar)
476e5410a46Smrg
477e5410a46Smrg6.2 Complete glyph drawing functions
478e5410a46Smrg
479e5410a46SmrgAs with the simple functions above, these differ only in the type of the
480e5410a46Smrgunderlying glyph id storage type.
481e5410a46Smrg
482e5410a46Smrg	void
483e5410a46Smrg	XRenderCompositeText8 (Display			    *dpy,
484e5410a46Smrg			       int			    op,
485e5410a46Smrg			       Picture			    src,
486e5410a46Smrg			       Picture			    dst,
487e5410a46Smrg			       _Xconst XRenderPictFormat    *maskFormat,
488e5410a46Smrg			       int			    xSrc,
489e5410a46Smrg			       int			    ySrc,
490e5410a46Smrg			       int			    xDst,
491e5410a46Smrg			       int			    yDst,
492e5410a46Smrg			       _Xconst XGlyphElt8	    *elts,
493e5410a46Smrg			       int			    nelt)
494e5410a46Smrg
495e5410a46Smrg	void
496e5410a46Smrg	XRenderCompositeText16 (Display			    *dpy,
497e5410a46Smrg				int			    op,
498e5410a46Smrg				Picture			    src,
499e5410a46Smrg				Picture			    dst,
500e5410a46Smrg				_Xconst XRenderPictFormat   *maskFormat,
501e5410a46Smrg				int			    xSrc,
502e5410a46Smrg				int			    ySrc,
503e5410a46Smrg				int			    xDst,
504e5410a46Smrg				int			    yDst,
505e5410a46Smrg				_Xconst XGlyphElt16	    *elts,
506e5410a46Smrg				int			    nelt)
507e5410a46Smrg
508e5410a46Smrg	void
509e5410a46Smrg	XRenderCompositeText32 (Display			    *dpy,
510e5410a46Smrg				int			    op,
511e5410a46Smrg				Picture			    src,
512e5410a46Smrg				Picture			    dst,
513e5410a46Smrg				_Xconst XRenderPictFormat   *maskFormat,
514e5410a46Smrg				int			    xSrc,
515e5410a46Smrg				int			    ySrc,
516e5410a46Smrg				int			    xDst,
517e5410a46Smrg				int			    yDst,
518e5410a46Smrg				_Xconst XGlyphElt32	    *elts,
519e5410a46Smrg				int			    nelt)
520e5410a46Smrg
521e5410a46Smrg7 Basic Graphics Functions
522e5410a46Smrg
523e5410a46SmrgThese are the simplest graphics functions upon which the other functions are
524e5410a46Smrgconceptually built.
525e5410a46Smrg
526e5410a46Smrg7.1 Composite
527e5410a46Smrg
528e5410a46SmrgXRenderComposite exposes the RenderComposite protocol request directly.
529e5410a46Smrg
530e5410a46Smrg	void
531e5410a46Smrg	XRenderComposite (Display   *dpy,
532e5410a46Smrg			  int	    op,
533e5410a46Smrg			  Picture   src,
534e5410a46Smrg			  Picture   mask,
535e5410a46Smrg			  Picture   dst,
536e5410a46Smrg			  int	    src_x,
537e5410a46Smrg			  int	    src_y,
538e5410a46Smrg			  int	    mask_x,
539e5410a46Smrg			  int	    mask_y,
540e5410a46Smrg			  int	    dst_x,
541e5410a46Smrg			  int	    dst_y,
542e5410a46Smrg			  unsigned int	width,
543e5410a46Smrg			  unsigned int	height)
544e5410a46Smrg
545e5410a46Smrg
546e5410a46Smrg7.2 Rectangles
547e5410a46Smrg
548e5410a46SmrgThese functions composite rectangles of the specified color, they differ
549e5410a46Smrgonly in that XRenderFillRectangles draws more than one at a time.
550e5410a46Smrg
551e5410a46Smrg	void
552e5410a46Smrg	XRenderFillRectangle (Display		    *dpy,
553e5410a46Smrg			      int		    op,
554e5410a46Smrg			      Picture		    dst,
555e5410a46Smrg			      _Xconst XRenderColor  *color,
556e5410a46Smrg			      int		    x,
557e5410a46Smrg			      int		    y,
558e5410a46Smrg			      unsigned int	    width,
559e5410a46Smrg			      unsigned int	    height)
560e5410a46Smrg
561e5410a46Smrg	void
562e5410a46Smrg	XRenderFillRectangles (Display		    *dpy,
563e5410a46Smrg			       int		    op,
564e5410a46Smrg			       Picture		    dst,
565e5410a46Smrg			       _Xconst XRenderColor *color,
566e5410a46Smrg			       _Xconst XRectangle   *rectangles,
567e5410a46Smrg			       int		    n_rects)
568e5410a46Smrg
569e5410a46Smrg8 Geometric Objects
570e5410a46Smrg
571e5410a46SmrgAll geometric drawing with Render is performed with sequences of trapezoids
572e5410a46Smrgor triangles; the client is responsible for breaking more complex figures
573e5410a46Smrginto these simple shapes.
574e5410a46Smrg
575e5410a46Smrg8.1 Trapezoids
576e5410a46Smrg
577e5410a46Smrg	void
578e5410a46Smrg	XRenderCompositeTrapezoids (Display		*dpy,
579e5410a46Smrg				    int			op,
580e5410a46Smrg				    Picture		src,
581e5410a46Smrg				    Picture		dst,
582e5410a46Smrg				    _Xconst XRenderPictFormat	*maskFormat,
583e5410a46Smrg				    int			xSrc,
584e5410a46Smrg				    int			ySrc,
585e5410a46Smrg				    _Xconst XTrapezoid	*traps,
586e5410a46Smrg				    int			ntrap)
587e5410a46Smrg
588e5410a46SmrgXRenderCompositeTrapezoids builds RenderTrapezoids requests to composite the
589e5410a46Smrgspecified list of trapezoids to dst.  XRenderCompositeTrapezoids will split
590e5410a46Smrgthe list of trapezoids to build requests no larger than the maximum request
591e5410a46Smrgsize supported by the server.  This can create rendering artifacts as the
592e5410a46Smrgprecompositing done by RenderTrapezoids when a maskFormat is specified
593e5410a46Smrgcannot span multiple requests.
594e5410a46Smrg
595e5410a46Smrg8.2 Triangles
596e5410a46Smrg
597e5410a46SmrgRender provides three different ways of encoding triangles on the wire,
598e5410a46SmrgXrender exposes those with three separate triangle drawing routines.  As
599e5410a46Smrgwith trapezoids above, Xrender will split the arguments to fit requests into
600e5410a46Smrgthe servers limits, but this may cause rendering artifacts.
601