2 # error config.h must be included before pixman-private.h
5 #ifndef PIXMAN_PRIVATE_H
6 #define PIXMAN_PRIVATE_H
22 #ifdef WORDS_BIGENDIAN
23 # define IMAGE_BYTE_ORDER MSBFirst
24 # define BITMAP_BIT_ORDER MSBFirst
26 # define IMAGE_BYTE_ORDER LSBFirst
27 # define BITMAP_BIT_ORDER LSBFirst
33 #if defined (__GNUC__)
34 # define FUNC ((const char*) (__PRETTY_FUNCTION__))
35 #elif defined (__sun) || (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
36 # define FUNC ((const char*) (__func__))
38 # define FUNC ((const char*) ("???"))
42 # define INT16_MIN (-32767-1)
46 # define INT16_MAX (32767)
50 # define INT32_MIN (-2147483647-1)
54 # define INT32_MAX (2147483647)
58 # define UINT32_MIN (0)
62 # define UINT32_MAX (4294967295U)
66 # define M_PI 3.14159265358979323846
70 /* 'inline' is available only in C++ in MSVC */
71 # define inline __inline
72 # define force_inline __forceinline
73 #elif defined __GNUC__ || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
74 # define inline __inline__
75 # define force_inline __inline__ __attribute__ ((__always_inline__))
78 # define force_inline inline
83 #define FB_UNIT (1 << FB_SHIFT)
84 #define FB_HALFUNIT (1 << (FB_SHIFT-1))
85 #define FB_MASK (FB_UNIT - 1)
86 #define FB_ALLONES ((uint32_t) -1)
88 /* Memory allocation helpers */
89 void *pixman_malloc_ab (unsigned int n, unsigned int b);
90 void *pixman_malloc_abc (unsigned int a, unsigned int b, unsigned int c);
91 pixman_bool_t pixman_multiply_overflows_int (unsigned int a, unsigned int b);
92 pixman_bool_t pixman_addition_overflows_int (unsigned int a, unsigned int b);
96 #define return_if_fail(expr) \
101 fprintf(stderr, "In %s: %s failed\n", FUNC, #expr); \
107 #define return_val_if_fail(expr, retval) \
112 fprintf(stderr, "In %s: %s failed\n", FUNC, #expr); \
120 #define return_if_fail(expr) \
128 #define return_val_if_fail(expr, retval) \
138 typedef struct image_common image_common_t;
139 typedef struct source_image source_image_t;
140 typedef struct solid_fill solid_fill_t;
141 typedef struct gradient gradient_t;
142 typedef struct linear_gradient linear_gradient_t;
143 typedef struct horizontal_gradient horizontal_gradient_t;
144 typedef struct vertical_gradient vertical_gradient_t;
145 typedef struct conical_gradient conical_gradient_t;
146 typedef struct radial_gradient radial_gradient_t;
147 typedef struct bits_image bits_image_t;
148 typedef struct circle circle_t;
149 typedef struct point point_t;
151 /* FIXME - the types and structures below should be give proper names
155 typedef FASTCALL void (*CombineMaskU32) (uint32_t *src, const uint32_t *mask, int width);
156 typedef FASTCALL void (*CombineFuncU32) (uint32_t *dest, const uint32_t *src, int width);
157 typedef FASTCALL void (*CombineFuncC32) (uint32_t *dest, uint32_t *src, uint32_t *mask, int width);
158 typedef FASTCALL void (*fetchProc32)(bits_image_t *pict, int x, int y, int width,
160 typedef FASTCALL uint32_t (*fetchPixelProc32)(bits_image_t *pict, int offset, int line);
161 typedef FASTCALL void (*storeProc32)(pixman_image_t *, uint32_t *bits,
162 const uint32_t *values, int x, int width,
163 const pixman_indexed_t *);
165 typedef FASTCALL void (*CombineMaskU64) (uint64_t *src, const uint64_t *mask, int width);
166 typedef FASTCALL void (*CombineFuncU64) (uint64_t *dest, const uint64_t *src, int width);
167 typedef FASTCALL void (*CombineFuncC64) (uint64_t *dest, uint64_t *src, uint64_t *mask, int width);
168 typedef FASTCALL void (*fetchProc64)(bits_image_t *pict, int x, int y, int width,
170 typedef FASTCALL uint64_t (*fetchPixelProc64)(bits_image_t *pict, int offset, int line);
171 typedef FASTCALL void (*storeProc64)(pixman_image_t *, uint32_t *bits,
172 const uint64_t *values, int x, int width,
173 const pixman_indexed_t *);
175 typedef struct _FbComposeData {
178 pixman_image_t *mask;
179 pixman_image_t *dest;
190 typedef struct _FbComposeFunctions32 {
191 CombineFuncU32 *combineU;
192 CombineFuncC32 *combineC;
193 CombineMaskU32 combineMaskU;
194 } FbComposeFunctions32;
196 typedef struct _FbComposeFunctions64 {
197 CombineFuncU64 *combineU;
198 CombineFuncC64 *combineC;
199 CombineMaskU64 combineMaskU;
200 } FbComposeFunctions64;
202 extern FbComposeFunctions32 pixman_composeFunctions;
203 extern FbComposeFunctions64 pixman_composeFunctions64;
205 void pixman_composite_rect_general_accessors (const FbComposeData *data,
210 void pixman_composite_rect_general (const FbComposeData *data);
212 fetchProc32 pixman_fetchProcForPicture32 (bits_image_t *);
213 fetchPixelProc32 pixman_fetchPixelProcForPicture32 (bits_image_t *);
214 storeProc32 pixman_storeProcForPicture32 (bits_image_t *);
215 fetchProc32 pixman_fetchProcForPicture32_accessors (bits_image_t *);
216 fetchPixelProc32 pixman_fetchPixelProcForPicture32_accessors (bits_image_t *);
217 storeProc32 pixman_storeProcForPicture32_accessors (bits_image_t *);
219 fetchProc64 pixman_fetchProcForPicture64 (bits_image_t *);
220 fetchPixelProc64 pixman_fetchPixelProcForPicture64 (bits_image_t *);
221 storeProc64 pixman_storeProcForPicture64 (bits_image_t *);
222 fetchProc64 pixman_fetchProcForPicture64_accessors (bits_image_t *);
223 fetchPixelProc64 pixman_fetchPixelProcForPicture64_accessors (bits_image_t *);
224 storeProc64 pixman_storeProcForPicture64_accessors (bits_image_t *);
226 void pixman_expand(uint64_t *dst, const uint32_t *src, pixman_format_code_t, int width);
227 void pixman_contract(uint32_t *dst, const uint64_t *src, int width);
229 void pixmanFetchSourcePict(source_image_t *, int x, int y, int width,
230 uint32_t *buffer, uint32_t *mask, uint32_t maskBits);
231 void pixmanFetchSourcePict64(source_image_t *, int x, int y, int width,
232 uint64_t *buffer, uint64_t *mask, uint32_t maskBits);
234 void fbFetchTransformed(bits_image_t *, int x, int y, int width,
235 uint32_t *buffer, uint32_t *mask, uint32_t maskBits);
236 void fbStoreExternalAlpha(bits_image_t *, int x, int y, int width,
238 void fbFetchExternalAlpha(bits_image_t *, int x, int y, int width,
239 uint32_t *buffer, uint32_t *mask, uint32_t maskBits);
241 void fbFetchTransformed_accessors(bits_image_t *, int x, int y, int width,
242 uint32_t *buffer, uint32_t *mask,
244 void fbStoreExternalAlpha_accessors(bits_image_t *, int x, int y, int width,
246 void fbFetchExternalAlpha_accessors(bits_image_t *, int x, int y, int width,
247 uint32_t *buffer, uint32_t *mask,
250 void fbFetchTransformed64(bits_image_t *, int x, int y, int width,
251 uint64_t *buffer, uint64_t *mask, uint32_t maskBits);
252 void fbStoreExternalAlpha64(bits_image_t *, int x, int y, int width,
254 void fbFetchExternalAlpha64(bits_image_t *, int x, int y, int width,
255 uint64_t *buffer, uint64_t *mask, uint32_t maskBits);
257 void fbFetchTransformed64_accessors(bits_image_t *, int x, int y, int width,
258 uint64_t *buffer, uint64_t *mask,
260 void fbStoreExternalAlpha64_accessors(bits_image_t *, int x, int y, int width,
262 void fbFetchExternalAlpha64_accessors(bits_image_t *, int x, int y, int width,
263 uint64_t *buffer, uint64_t *mask,
277 #define IS_SOURCE_IMAGE(img) (((image_common_t *)img)->type > BITS)
281 SOURCE_IMAGE_CLASS_UNKNOWN,
282 SOURCE_IMAGE_CLASS_HORIZONTAL,
283 SOURCE_IMAGE_CLASS_VERTICAL,
284 } source_pict_class_t;
286 typedef source_pict_class_t (* classify_func_t) (pixman_image_t *image,
292 typedef void (*scanStoreProc)(pixman_image_t *, int, int, int, uint32_t *);
293 typedef void (*scanFetchProc)(pixman_image_t *, int, int, int, uint32_t *,
294 uint32_t *, uint32_t);
296 source_pict_class_t _pixman_image_classify (pixman_image_t *image,
303 _pixman_image_get_fetcher (pixman_image_t *image,
307 _pixman_image_get_storer (pixman_image_t *image,
319 pixman_region32_t full_region;
320 pixman_region32_t clip_region;
321 pixman_region32_t *src_clip;
322 pixman_bool_t has_client_clip;
323 pixman_transform_t *transform;
324 pixman_repeat_t repeat;
325 pixman_filter_t filter;
326 pixman_fixed_t *filter_params;
328 bits_image_t *alpha_map;
329 point_t alpha_origin;
330 pixman_bool_t component_alpha;
331 pixman_read_memory_func_t read_func;
332 pixman_write_memory_func_t write_func;
333 classify_func_t classify;
338 image_common_t common;
339 source_pict_class_t class;
344 source_image_t common;
345 uint32_t color; /* FIXME: shouldn't this be a pixman_color_t? */
350 source_image_t common;
352 pixman_gradient_stop_t * stops;
354 uint32_t * color_table;
355 int color_table_size;
358 struct linear_gradient
361 pixman_point_fixed_t p1;
362 pixman_point_fixed_t p2;
369 pixman_fixed_t radius;
372 struct radial_gradient
384 struct conical_gradient
387 pixman_point_fixed_t center;
388 pixman_fixed_t angle;
393 image_common_t common;
394 pixman_format_code_t format;
395 const pixman_indexed_t *indexed;
400 int rowstride; /* in number of uint32_t's */
406 image_common_t common;
408 source_image_t source;
410 linear_gradient_t linear;
411 conical_gradient_t conical;
412 radial_gradient_t radial;
417 #define LOG2_BITMAP_PAD 5
418 #define FB_STIP_SHIFT LOG2_BITMAP_PAD
419 #define FB_STIP_UNIT (1 << FB_STIP_SHIFT)
420 #define FB_STIP_MASK (FB_STIP_UNIT - 1)
421 #define FB_STIP_ALLONES ((uint32_t) -1)
423 #if BITMAP_BIT_ORDER == LSBFirst
424 #define FbScrLeft(x,n) ((x) >> (n))
425 #define FbScrRight(x,n) ((x) << (n))
426 #define FbLeftStipBits(x,n) ((x) & ((((uint32_t) 1) << (n)) - 1))
428 #define FbScrLeft(x,n) ((x) << (n))
429 #define FbScrRight(x,n) ((x) >> (n))
430 #define FbLeftStipBits(x,n) ((x) >> (FB_STIP_UNIT - (n)))
433 #define FbStipLeft(x,n) FbScrLeft(x,n)
434 #define FbStipRight(x,n) FbScrRight(x,n)
435 #define FbStipMask(x,w) (FbStipRight(FB_STIP_ALLONES,(x) & FB_STIP_MASK) & \
436 FbStipLeft(FB_STIP_ALLONES,(FB_STIP_UNIT - ((x)+(w))) & FB_STIP_MASK))
438 #define FbLeftMask(x) ( ((x) & FB_MASK) ? \
439 FbScrRight(FB_ALLONES,(x) & FB_MASK) : 0)
440 #define FbRightMask(x) ( ((FB_UNIT - (x)) & FB_MASK) ? \
441 FbScrLeft(FB_ALLONES,(FB_UNIT - (x)) & FB_MASK) : 0)
443 #define FbMaskBits(x,w,l,n,r) { \
445 r = FbRightMask((x)+n); \
448 n -= FB_UNIT - ((x) & FB_MASK); \
458 #if IMAGE_BYTE_ORDER == MSBFirst
459 #define Fetch24(img, a) ((unsigned long) (a) & 1 ? \
460 ((READ(img, a) << 16) | READ(img, (uint16_t *) ((a)+1))) : \
461 ((READ(img, (uint16_t *) (a)) << 8) | READ(img, (a)+2)))
462 #define Store24(img,a,v) ((unsigned long) (a) & 1 ? \
463 (WRITE(img, a, (uint8_t) ((v) >> 16)), \
464 WRITE(img, (uint16_t *) ((a)+1), (uint16_t) (v))) : \
465 (WRITE(img, (uint16_t *) (a), (uint16_t) ((v) >> 8)), \
466 WRITE(img, (a)+2, (uint8_t) (v))))
468 #define Fetch24(img,a) ((unsigned long) (a) & 1 ? \
469 (READ(img, a) | (READ(img, (uint16_t *) ((a)+1)) << 8)) : \
470 (READ(img, (uint16_t *) (a)) | (READ(img, (a)+2) << 16)))
471 #define Store24(img,a,v) ((unsigned long) (a) & 1 ? \
472 (WRITE(img, a, (uint8_t) (v)), \
473 WRITE(img, (uint16_t *) ((a)+1), (uint16_t) ((v) >> 8))) : \
474 (WRITE(img, (uint16_t *) (a), (uint16_t) (v)), \
475 WRITE(img, (a)+2, (uint8_t) ((v) >> 16))))
478 #define CvtR8G8B8toY15(s) (((((s) >> 16) & 0xff) * 153 + \
479 (((s) >> 8) & 0xff) * 301 + \
480 (((s) ) & 0xff) * 58) >> 2)
481 #define miCvtR8G8B8to15(s) ((((s) >> 3) & 0x001f) | \
482 (((s) >> 6) & 0x03e0) | \
483 (((s) >> 9) & 0x7c00))
484 #define miIndexToEnt15(mif,rgb15) ((mif)->ent[rgb15])
485 #define miIndexToEnt24(mif,rgb24) miIndexToEnt15(mif,miCvtR8G8B8to15(rgb24))
487 #define miIndexToEntY24(mif,rgb24) ((mif)->ent[CvtR8G8B8toY15(rgb24)])
490 #define FbIntMult(a,b,t) ( (t) = (a) * (b) + 0x80, ( ( ( (t)>>8 ) + (t) )>>8 ) )
491 #define FbIntDiv(a,b) (((uint16_t) (a) * 255) / (b))
493 #define FbGet8(v,i) ((uint16_t) (uint8_t) ((v) >> i))
496 #define cvt8888to0565(s) ((((s) >> 3) & 0x001f) | \
497 (((s) >> 5) & 0x07e0) | \
498 (((s) >> 8) & 0xf800))
499 #define cvt0565to0888(s) (((((s) << 3) & 0xf8) | (((s) >> 2) & 0x7)) | \
500 ((((s) << 5) & 0xfc00) | (((s) >> 1) & 0x300)) | \
501 ((((s) << 8) & 0xf80000) | (((s) << 3) & 0x70000)))
504 * There are two ways of handling alpha -- either as a single unified value or
505 * a separate value for each component, hence each macro must have two
506 * versions. The unified alpha version has a 'U' at the end of the name,
507 * the component version has a 'C'. Similarly, functions which deal with
508 * this difference will have two versions using the same convention.
511 #define FbOverU(x,y,i,a,t) ((t) = FbIntMult(FbGet8(y,i),(a),(t)) + FbGet8(x,i), \
512 (uint32_t) ((uint8_t) ((t) | (0 - ((t) >> 8)))) << (i))
514 #define FbOverC(x,y,i,a,t) ((t) = FbIntMult(FbGet8(y,i),FbGet8(a,i),(t)) + FbGet8(x,i), \
515 (uint32_t) ((uint8_t) ((t) | (0 - ((t) >> 8)))) << (i))
517 #define FbInU(x,i,a,t) ((uint32_t) FbIntMult(FbGet8(x,i),(a),(t)) << (i))
519 #define FbInC(x,i,a,t) ((uint32_t) FbIntMult(FbGet8(x,i),FbGet8(a,i),(t)) << (i))
521 #define FbAdd(x,y,i,t) ((t) = FbGet8(x,i) + FbGet8(y,i), \
522 (uint32_t) ((uint8_t) ((t) | (0 - ((t) >> 8)))) << (i))
524 #define div_255(x) (((x) + 0x80 + (((x) + 0x80) >> 8)) >> 8)
525 #define div_65535(x) (((x) + 0x8000 + (((x) + 0x8000) >> 16)) >> 16)
527 #define MOD(a,b) ((a) < 0 ? ((b) - ((-(a) - 1) % (b))) - 1 : (a) % (b))
529 #define DIV(a,b) ((((a) < 0) == ((b) < 0)) ? (a) / (b) : \
530 ((a) - (b) + 1 - (((b) < 0) << 1)) / (b))
532 #define CLIP(a,b,c) ((a) < (b) ? (b) : ((a) > (c) ? (c) : (a)))
535 /* FIXME: the MOD macro above is equivalent, but faster I think */
536 #define mod(a,b) ((b) == 1 ? 0 : (a) >= 0 ? (a) % (b) : (b) - (-a) % (b))
539 /* FIXME: the (void)__read_func hides lots of warnings (which is what they
540 * are supposed to do), but some of them are real. For example the one
541 * where Fetch4 doesn't have a READ
545 /* Framebuffer access support macros */
546 #define ACCESS_MEM(code) \
548 const image_common_t *const com__ = \
549 (image_common_t *)image; \
551 if (!com__->read_func && !com__->write_func) \
553 const int do_access__ = 0; \
554 const pixman_read_memory_func_t read_func__ = NULL; \
555 const pixman_write_memory_func_t write_func__ = NULL; \
557 (void)write_func__; \
564 const int do_access__ = 1; \
565 const pixman_read_memory_func_t read_func__ = \
567 const pixman_write_memory_func_t write_func__ = \
570 (void)write_func__; \
578 #ifdef PIXMAN_FB_ACCESSORS
580 #define ACCESS(sym) sym##_accessors
582 #define READ(img, ptr) \
583 ((img)->common.read_func ((ptr), sizeof(*(ptr))))
584 #define WRITE(img, ptr,val) \
585 ((img)->common.write_func ((ptr), (val), sizeof (*(ptr))))
587 #define MEMCPY_WRAPPED(img, dst, src, size) \
590 uint8_t *_dst = (uint8_t*)(dst), *_src = (uint8_t*)(src); \
591 for(_i = 0; _i < size; _i++) { \
592 WRITE((img), _dst +_i, READ((img), _src + _i)); \
596 #define MEMSET_WRAPPED(img, dst, val, size) \
599 uint8_t *_dst = (uint8_t*)(dst); \
600 for(_i = 0; _i < (size_t) size; _i++) { \
601 WRITE((img), _dst +_i, (val)); \
607 #define ACCESS(sym) sym
609 #define READ(img, ptr) (*(ptr))
610 #define WRITE(img, ptr, val) (*(ptr) = (val))
611 #define MEMCPY_WRAPPED(img, dst, src, size) \
612 memcpy(dst, src, size)
613 #define MEMSET_WRAPPED(img, dst, val, size) \
614 memset(dst, val, size)
618 #define fbComposeGetSolid(img, res, fmt) \
621 pixman_format_code_t format__; \
622 if (img->type == SOLID) \
624 format__ = PIXMAN_a8r8g8b8; \
625 (res) = img->solid.color; \
629 uint32_t *bits__ = (img)->bits.bits; \
630 format__ = (img)->bits.format; \
632 switch (PIXMAN_FORMAT_BPP((img)->bits.format)) \
635 (res) = READ(img, (uint32_t *)bits__); \
638 (res) = Fetch24(img, (uint8_t *) bits__); \
641 (res) = READ(img, (uint16_t *) bits__); \
642 (res) = cvt0565to0888(res); \
645 (res) = READ(img, (uint8_t *) bits__); \
646 (res) = (res) << 24; \
649 (res) = READ(img, (uint32_t *) bits__); \
650 (res) = FbLeftStipBits((res),1) ? 0xff000000 : 0x00000000; \
655 /* manage missing src alpha */ \
656 if (!PIXMAN_FORMAT_A((img)->bits.format)) \
657 (res) |= 0xff000000; \
660 /* If necessary, convert RGB <--> BGR. */ \
661 if (PIXMAN_FORMAT_TYPE (format__) != PIXMAN_FORMAT_TYPE(fmt)) \
663 (res) = ((((res) & 0xff000000) >> 0) | \
664 (((res) & 0x00ff0000) >> 16) | \
665 (((res) & 0x0000ff00) >> 0) | \
666 (((res) & 0x000000ff) << 16)); \
671 #define fbComposeGetStart(pict,x,y,type,out_stride,line,mul) do { \
672 uint32_t *__bits__; \
676 __bits__ = pict->bits.bits; \
677 __stride__ = pict->bits.rowstride; \
678 __bpp__ = PIXMAN_FORMAT_BPP(pict->bits.format); \
679 (out_stride) = __stride__ * (int) sizeof (uint32_t) / (int) sizeof (type); \
680 (line) = ((type *) __bits__) + \
681 (out_stride) * (y) + (mul) * (x); \
685 #define PIXMAN_FORMAT_16BPC(f) (PIXMAN_FORMAT_A(f) > 8 || \
686 PIXMAN_FORMAT_R(f) > 8 || \
687 PIXMAN_FORMAT_G(f) > 8 || \
688 PIXMAN_FORMAT_B(f) > 8)
693 #define MAX_ALPHA(n) ((1 << (n)) - 1)
694 #define N_Y_FRAC(n) ((n) == 1 ? 1 : (1 << ((n)/2)) - 1)
695 #define N_X_FRAC(n) ((n) == 1 ? 1 : (1 << ((n)/2)) + 1)
697 #define STEP_Y_SMALL(n) (pixman_fixed_1 / N_Y_FRAC(n))
698 #define STEP_Y_BIG(n) (pixman_fixed_1 - (N_Y_FRAC(n) - 1) * STEP_Y_SMALL(n))
700 #define Y_FRAC_FIRST(n) (STEP_Y_SMALL(n) / 2)
701 #define Y_FRAC_LAST(n) (Y_FRAC_FIRST(n) + (N_Y_FRAC(n) - 1) * STEP_Y_SMALL(n))
703 #define STEP_X_SMALL(n) (pixman_fixed_1 / N_X_FRAC(n))
704 #define STEP_X_BIG(n) (pixman_fixed_1 - (N_X_FRAC(n) - 1) * STEP_X_SMALL(n))
706 #define X_FRAC_FIRST(n) (STEP_X_SMALL(n) / 2)
707 #define X_FRAC_LAST(n) (X_FRAC_FIRST(n) + (N_X_FRAC(n) - 1) * STEP_X_SMALL(n))
709 #define RenderSamplesX(x,n) ((n) == 1 ? 0 : (pixman_fixed_frac (x) + X_FRAC_FIRST(n)) / STEP_X_SMALL(n))
712 * Step across a small sample grid gap
714 #define RenderEdgeStepSmall(edge) { \
715 edge->x += edge->stepx_small; \
716 edge->e += edge->dx_small; \
719 edge->e -= edge->dy; \
720 edge->x += edge->signdx; \
725 * Step across a large sample grid gap
727 #define RenderEdgeStepBig(edge) { \
728 edge->x += edge->stepx_big; \
729 edge->e += edge->dx_big; \
732 edge->e -= edge->dy; \
733 edge->x += edge->signdx; \
738 pixman_rasterize_edges_accessors (pixman_image_t *image,
745 pixman_image_is_opaque(pixman_image_t *image);
748 pixman_image_can_get_solid (pixman_image_t *image);
751 pixman_compute_composite_region32 (pixman_region32_t * pRegion,
752 pixman_image_t * pSrc,
753 pixman_image_t * pMask,
754 pixman_image_t * pDst,
765 #if defined(__GNUC__) && __GNUC__ >= 4
766 #define PIXMAN_EXPORT __attribute__ ((visibility("default")))
767 /* Sun Studio 8 visibility */
768 #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
769 #define PIXMAN_EXPORT __global
771 #define PIXMAN_EXPORT
775 pixman_bool_t pixman_region32_copy_from_region16 (pixman_region32_t *dst,
776 pixman_region16_t *src);
777 pixman_bool_t pixman_region16_copy_from_region32 (pixman_region16_t *dst,
778 pixman_region32_t *src);
779 void pixman_region_internal_set_static_pointers (pixman_box16_t *empty_box,
780 pixman_region16_data_t *empty_data,
781 pixman_region16_data_t *broken_data);
786 static inline uint64_t
787 oil_profile_stamp_rdtsc (void)
790 __asm__ __volatile__("rdtsc\n" : "=A" (ts));
793 #define OIL_STAMP oil_profile_stamp_rdtsc
795 typedef struct PixmanTimer PixmanTimer;
806 extern int timer_defined;
807 void pixman_timer_register (PixmanTimer *timer);
809 #define TIMER_BEGIN(tname) \
811 static PixmanTimer timer##tname; \
812 uint64_t begin##tname; \
814 if (!timer##tname.initialized) \
816 timer##tname.initialized = 1; \
817 timer##tname.name = #tname; \
818 pixman_timer_register (&timer##tname); \
821 timer##tname.n_times++; \
822 begin##tname = OIL_STAMP();
824 #define TIMER_END(tname) \
825 timer##tname.total += OIL_STAMP() - begin##tname; \
828 #endif /* PIXMAN_TIMING */
830 #endif /* PIXMAN_PRIVATE_H */