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__
74 # define inline __inline__
75 # define force_inline __inline__ __attribute__ ((__always_inline__))
79 #define FB_UNIT (1 << FB_SHIFT)
80 #define FB_HALFUNIT (1 << (FB_SHIFT-1))
81 #define FB_MASK (FB_UNIT - 1)
82 #define FB_ALLONES ((uint32_t) -1)
84 /* Memory allocation helpers */
85 void *pixman_malloc_ab (unsigned int n, unsigned int b);
86 void *pixman_malloc_abc (unsigned int a, unsigned int b, unsigned int c);
87 pixman_bool_t pixman_multiply_overflows_int (unsigned int a, unsigned int b);
88 pixman_bool_t pixman_addition_overflows_int (unsigned int a, unsigned int b);
92 #define return_if_fail(expr) \
97 fprintf(stderr, "In %s: %s failed\n", FUNC, #expr); \
103 #define return_val_if_fail(expr, retval) \
108 fprintf(stderr, "In %s: %s failed\n", FUNC, #expr); \
116 #define return_if_fail(expr) \
124 #define return_val_if_fail(expr, retval) \
134 typedef struct image_common image_common_t;
135 typedef struct source_image source_image_t;
136 typedef struct solid_fill solid_fill_t;
137 typedef struct gradient gradient_t;
138 typedef struct linear_gradient linear_gradient_t;
139 typedef struct horizontal_gradient horizontal_gradient_t;
140 typedef struct vertical_gradient vertical_gradient_t;
141 typedef struct conical_gradient conical_gradient_t;
142 typedef struct radial_gradient radial_gradient_t;
143 typedef struct bits_image bits_image_t;
144 typedef struct circle circle_t;
145 typedef struct point point_t;
147 /* FIXME - the types and structures below should be give proper names
151 typedef FASTCALL void (*CombineMaskU32) (uint32_t *src, const uint32_t *mask, int width);
152 typedef FASTCALL void (*CombineFuncU32) (uint32_t *dest, const uint32_t *src, int width);
153 typedef FASTCALL void (*CombineFuncC32) (uint32_t *dest, uint32_t *src, uint32_t *mask, int width);
154 typedef FASTCALL void (*fetchProc32)(bits_image_t *pict, int x, int y, int width,
156 typedef FASTCALL uint32_t (*fetchPixelProc32)(bits_image_t *pict, int offset, int line);
157 typedef FASTCALL void (*storeProc32)(pixman_image_t *, uint32_t *bits,
158 const uint32_t *values, int x, int width,
159 const pixman_indexed_t *);
161 typedef FASTCALL void (*CombineMaskU64) (uint64_t *src, const uint64_t *mask, int width);
162 typedef FASTCALL void (*CombineFuncU64) (uint64_t *dest, const uint64_t *src, int width);
163 typedef FASTCALL void (*CombineFuncC64) (uint64_t *dest, uint64_t *src, uint64_t *mask, int width);
164 typedef FASTCALL void (*fetchProc64)(bits_image_t *pict, int x, int y, int width,
166 typedef FASTCALL uint64_t (*fetchPixelProc64)(bits_image_t *pict, int offset, int line);
167 typedef FASTCALL void (*storeProc64)(pixman_image_t *, uint32_t *bits,
168 const uint64_t *values, int x, int width,
169 const pixman_indexed_t *);
171 typedef struct _FbComposeData {
174 pixman_image_t *mask;
175 pixman_image_t *dest;
186 typedef struct _FbComposeFunctions32 {
187 CombineFuncU32 *combineU;
188 CombineFuncC32 *combineC;
189 CombineMaskU32 combineMaskU;
190 } FbComposeFunctions32;
192 typedef struct _FbComposeFunctions64 {
193 CombineFuncU64 *combineU;
194 CombineFuncC64 *combineC;
195 CombineMaskU64 combineMaskU;
196 } FbComposeFunctions64;
198 extern FbComposeFunctions32 pixman_composeFunctions;
199 extern FbComposeFunctions64 pixman_composeFunctions64;
201 void pixman_composite_rect_general_accessors (const FbComposeData *data,
206 void pixman_composite_rect_general (const FbComposeData *data);
208 fetchProc32 pixman_fetchProcForPicture32 (bits_image_t *);
209 fetchPixelProc32 pixman_fetchPixelProcForPicture32 (bits_image_t *);
210 storeProc32 pixman_storeProcForPicture32 (bits_image_t *);
211 fetchProc32 pixman_fetchProcForPicture32_accessors (bits_image_t *);
212 fetchPixelProc32 pixman_fetchPixelProcForPicture32_accessors (bits_image_t *);
213 storeProc32 pixman_storeProcForPicture32_accessors (bits_image_t *);
215 fetchProc64 pixman_fetchProcForPicture64 (bits_image_t *);
216 fetchPixelProc64 pixman_fetchPixelProcForPicture64 (bits_image_t *);
217 storeProc64 pixman_storeProcForPicture64 (bits_image_t *);
218 fetchProc64 pixman_fetchProcForPicture64_accessors (bits_image_t *);
219 fetchPixelProc64 pixman_fetchPixelProcForPicture64_accessors (bits_image_t *);
220 storeProc64 pixman_storeProcForPicture64_accessors (bits_image_t *);
222 void pixman_expand(uint64_t *dst, const uint32_t *src, pixman_format_code_t, int width);
223 void pixman_contract(uint32_t *dst, const uint64_t *src, int width);
225 void pixmanFetchSourcePict(source_image_t *, int x, int y, int width,
226 uint32_t *buffer, uint32_t *mask, uint32_t maskBits);
227 void pixmanFetchSourcePict64(source_image_t *, int x, int y, int width,
228 uint64_t *buffer, uint64_t *mask, uint32_t maskBits);
230 void fbFetchTransformed(bits_image_t *, int x, int y, int width,
231 uint32_t *buffer, uint32_t *mask, uint32_t maskBits);
232 void fbStoreExternalAlpha(bits_image_t *, int x, int y, int width,
234 void fbFetchExternalAlpha(bits_image_t *, int x, int y, int width,
235 uint32_t *buffer, uint32_t *mask, uint32_t maskBits);
237 void fbFetchTransformed_accessors(bits_image_t *, int x, int y, int width,
238 uint32_t *buffer, uint32_t *mask,
240 void fbStoreExternalAlpha_accessors(bits_image_t *, int x, int y, int width,
242 void fbFetchExternalAlpha_accessors(bits_image_t *, int x, int y, int width,
243 uint32_t *buffer, uint32_t *mask,
246 void fbFetchTransformed64(bits_image_t *, int x, int y, int width,
247 uint64_t *buffer, uint64_t *mask, uint32_t maskBits);
248 void fbStoreExternalAlpha64(bits_image_t *, int x, int y, int width,
250 void fbFetchExternalAlpha64(bits_image_t *, int x, int y, int width,
251 uint64_t *buffer, uint64_t *mask, uint32_t maskBits);
253 void fbFetchTransformed64_accessors(bits_image_t *, int x, int y, int width,
254 uint64_t *buffer, uint64_t *mask,
256 void fbStoreExternalAlpha64_accessors(bits_image_t *, int x, int y, int width,
258 void fbFetchExternalAlpha64_accessors(bits_image_t *, int x, int y, int width,
259 uint64_t *buffer, uint64_t *mask,
273 #define IS_SOURCE_IMAGE(img) (((image_common_t *)img)->type > BITS)
277 SOURCE_IMAGE_CLASS_UNKNOWN,
278 SOURCE_IMAGE_CLASS_HORIZONTAL,
279 SOURCE_IMAGE_CLASS_VERTICAL
280 } source_pict_class_t;
291 pixman_region32_t full_region;
292 pixman_region32_t clip_region;
293 pixman_region32_t *src_clip;
294 pixman_bool_t has_client_clip;
295 pixman_transform_t *transform;
296 pixman_repeat_t repeat;
297 pixman_filter_t filter;
298 pixman_fixed_t *filter_params;
300 bits_image_t *alpha_map;
301 point_t alpha_origin;
302 pixman_bool_t component_alpha;
303 pixman_read_memory_func_t read_func;
304 pixman_write_memory_func_t write_func;
309 image_common_t common;
310 source_pict_class_t class;
315 source_image_t common;
316 uint32_t color; /* FIXME: shouldn't this be a pixman_color_t? */
321 source_image_t common;
323 pixman_gradient_stop_t * stops;
325 uint32_t * color_table;
326 int color_table_size;
329 struct linear_gradient
332 pixman_point_fixed_t p1;
333 pixman_point_fixed_t p2;
340 pixman_fixed_t radius;
343 struct radial_gradient
355 struct conical_gradient
358 pixman_point_fixed_t center;
359 pixman_fixed_t angle;
364 image_common_t common;
365 pixman_format_code_t format;
366 const pixman_indexed_t *indexed;
371 int rowstride; /* in number of uint32_t's */
377 image_common_t common;
380 linear_gradient_t linear;
381 conical_gradient_t conical;
382 radial_gradient_t radial;
387 #define LOG2_BITMAP_PAD 5
388 #define FB_STIP_SHIFT LOG2_BITMAP_PAD
389 #define FB_STIP_UNIT (1 << FB_STIP_SHIFT)
390 #define FB_STIP_MASK (FB_STIP_UNIT - 1)
391 #define FB_STIP_ALLONES ((uint32_t) -1)
393 #if BITMAP_BIT_ORDER == LSBFirst
394 #define FbScrLeft(x,n) ((x) >> (n))
395 #define FbScrRight(x,n) ((x) << (n))
396 #define FbLeftStipBits(x,n) ((x) & ((((uint32_t) 1) << (n)) - 1))
398 #define FbScrLeft(x,n) ((x) << (n))
399 #define FbScrRight(x,n) ((x) >> (n))
400 #define FbLeftStipBits(x,n) ((x) >> (FB_STIP_UNIT - (n)))
403 #define FbStipLeft(x,n) FbScrLeft(x,n)
404 #define FbStipRight(x,n) FbScrRight(x,n)
405 #define FbStipMask(x,w) (FbStipRight(FB_STIP_ALLONES,(x) & FB_STIP_MASK) & \
406 FbStipLeft(FB_STIP_ALLONES,(FB_STIP_UNIT - ((x)+(w))) & FB_STIP_MASK))
408 #define FbLeftMask(x) ( ((x) & FB_MASK) ? \
409 FbScrRight(FB_ALLONES,(x) & FB_MASK) : 0)
410 #define FbRightMask(x) ( ((FB_UNIT - (x)) & FB_MASK) ? \
411 FbScrLeft(FB_ALLONES,(FB_UNIT - (x)) & FB_MASK) : 0)
413 #define FbMaskBits(x,w,l,n,r) { \
415 r = FbRightMask((x)+n); \
418 n -= FB_UNIT - ((x) & FB_MASK); \
428 #if IMAGE_BYTE_ORDER == MSBFirst
429 #define Fetch24(img, a) ((unsigned long) (a) & 1 ? \
430 ((READ(img, a) << 16) | READ(img, (uint16_t *) ((a)+1))) : \
431 ((READ(img, (uint16_t *) (a)) << 8) | READ(img, (a)+2)))
432 #define Store24(img,a,v) ((unsigned long) (a) & 1 ? \
433 (WRITE(img, a, (uint8_t) ((v) >> 16)), \
434 WRITE(img, (uint16_t *) ((a)+1), (uint16_t) (v))) : \
435 (WRITE(img, (uint16_t *) (a), (uint16_t) ((v) >> 8)), \
436 WRITE(img, (a)+2, (uint8_t) (v))))
438 #define Fetch24(img,a) ((unsigned long) (a) & 1 ? \
439 (READ(img, a) | (READ(img, (uint16_t *) ((a)+1)) << 8)) : \
440 (READ(img, (uint16_t *) (a)) | (READ(img, (a)+2) << 16)))
441 #define Store24(img,a,v) ((unsigned long) (a) & 1 ? \
442 (WRITE(img, a, (uint8_t) (v)), \
443 WRITE(img, (uint16_t *) ((a)+1), (uint16_t) ((v) >> 8))) : \
444 (WRITE(img, (uint16_t *) (a), (uint16_t) (v)), \
445 WRITE(img, (a)+2, (uint8_t) ((v) >> 16))))
448 #define CvtR8G8B8toY15(s) (((((s) >> 16) & 0xff) * 153 + \
449 (((s) >> 8) & 0xff) * 301 + \
450 (((s) ) & 0xff) * 58) >> 2)
451 #define miCvtR8G8B8to15(s) ((((s) >> 3) & 0x001f) | \
452 (((s) >> 6) & 0x03e0) | \
453 (((s) >> 9) & 0x7c00))
454 #define miIndexToEnt15(mif,rgb15) ((mif)->ent[rgb15])
455 #define miIndexToEnt24(mif,rgb24) miIndexToEnt15(mif,miCvtR8G8B8to15(rgb24))
457 #define miIndexToEntY24(mif,rgb24) ((mif)->ent[CvtR8G8B8toY15(rgb24)])
460 #define FbIntMult(a,b,t) ( (t) = (a) * (b) + 0x80, ( ( ( (t)>>8 ) + (t) )>>8 ) )
461 #define FbIntDiv(a,b) (((uint16_t) (a) * 255) / (b))
463 #define FbGet8(v,i) ((uint16_t) (uint8_t) ((v) >> i))
466 #define cvt8888to0565(s) ((((s) >> 3) & 0x001f) | \
467 (((s) >> 5) & 0x07e0) | \
468 (((s) >> 8) & 0xf800))
469 #define cvt0565to0888(s) (((((s) << 3) & 0xf8) | (((s) >> 2) & 0x7)) | \
470 ((((s) << 5) & 0xfc00) | (((s) >> 1) & 0x300)) | \
471 ((((s) << 8) & 0xf80000) | (((s) << 3) & 0x70000)))
474 * There are two ways of handling alpha -- either as a single unified value or
475 * a separate value for each component, hence each macro must have two
476 * versions. The unified alpha version has a 'U' at the end of the name,
477 * the component version has a 'C'. Similarly, functions which deal with
478 * this difference will have two versions using the same convention.
481 #define FbOverU(x,y,i,a,t) ((t) = FbIntMult(FbGet8(y,i),(a),(t)) + FbGet8(x,i), \
482 (uint32_t) ((uint8_t) ((t) | (0 - ((t) >> 8)))) << (i))
484 #define FbOverC(x,y,i,a,t) ((t) = FbIntMult(FbGet8(y,i),FbGet8(a,i),(t)) + FbGet8(x,i), \
485 (uint32_t) ((uint8_t) ((t) | (0 - ((t) >> 8)))) << (i))
487 #define FbInU(x,i,a,t) ((uint32_t) FbIntMult(FbGet8(x,i),(a),(t)) << (i))
489 #define FbInC(x,i,a,t) ((uint32_t) FbIntMult(FbGet8(x,i),FbGet8(a,i),(t)) << (i))
491 #define FbAdd(x,y,i,t) ((t) = FbGet8(x,i) + FbGet8(y,i), \
492 (uint32_t) ((uint8_t) ((t) | (0 - ((t) >> 8)))) << (i))
494 #define div_255(x) (((x) + 0x80 + (((x) + 0x80) >> 8)) >> 8)
495 #define div_65535(x) (((x) + 0x8000 + (((x) + 0x8000) >> 16)) >> 16)
497 #define MOD(a,b) ((a) < 0 ? ((b) - ((-(a) - 1) % (b))) - 1 : (a) % (b))
499 #define DIV(a,b) ((((a) < 0) == ((b) < 0)) ? (a) / (b) : \
500 ((a) - (b) + 1 - (((b) < 0) << 1)) / (b))
502 #define CLIP(a,b,c) ((a) < (b) ? (b) : ((a) > (c) ? (c) : (a)))
505 /* FIXME: the MOD macro above is equivalent, but faster I think */
506 #define mod(a,b) ((b) == 1 ? 0 : (a) >= 0 ? (a) % (b) : (b) - (-a) % (b))
509 /* FIXME: the (void)__read_func hides lots of warnings (which is what they
510 * are supposed to do), but some of them are real. For example the one
511 * where Fetch4 doesn't have a READ
515 /* Framebuffer access support macros */
516 #define ACCESS_MEM(code) \
518 const image_common_t *const com__ = \
519 (image_common_t *)image; \
521 if (!com__->read_func && !com__->write_func) \
523 const int do_access__ = 0; \
524 const pixman_read_memory_func_t read_func__ = NULL; \
525 const pixman_write_memory_func_t write_func__ = NULL; \
527 (void)write_func__; \
534 const int do_access__ = 1; \
535 const pixman_read_memory_func_t read_func__ = \
537 const pixman_write_memory_func_t write_func__ = \
540 (void)write_func__; \
548 #ifdef PIXMAN_FB_ACCESSORS
550 #define ACCESS(sym) sym##_accessors
552 #define READ(img, ptr) \
553 ((img)->common.read_func ((ptr), sizeof(*(ptr))))
554 #define WRITE(img, ptr,val) \
555 ((img)->common.write_func ((ptr), (val), sizeof (*(ptr))))
557 #define MEMCPY_WRAPPED(img, dst, src, size) \
560 uint8_t *_dst = (uint8_t*)(dst), *_src = (uint8_t*)(src); \
561 for(_i = 0; _i < size; _i++) { \
562 WRITE((img), _dst +_i, READ((img), _src + _i)); \
566 #define MEMSET_WRAPPED(img, dst, val, size) \
569 uint8_t *_dst = (uint8_t*)(dst); \
570 for(_i = 0; _i < (size_t) size; _i++) { \
571 WRITE((img), _dst +_i, (val)); \
577 #define ACCESS(sym) sym
579 #define READ(img, ptr) (*(ptr))
580 #define WRITE(img, ptr, val) (*(ptr) = (val))
581 #define MEMCPY_WRAPPED(img, dst, src, size) \
582 memcpy(dst, src, size)
583 #define MEMSET_WRAPPED(img, dst, val, size) \
584 memset(dst, val, size)
588 #define fbComposeGetSolid(img, res, fmt) \
591 pixman_format_code_t format__; \
592 if (img->type == SOLID) \
594 format__ = PIXMAN_a8r8g8b8; \
595 (res) = img->solid.color; \
599 uint32_t *bits__ = (img)->bits.bits; \
600 format__ = (img)->bits.format; \
602 switch (PIXMAN_FORMAT_BPP((img)->bits.format)) \
605 (res) = READ(img, (uint32_t *)bits__); \
608 (res) = Fetch24(img, (uint8_t *) bits__); \
611 (res) = READ(img, (uint16_t *) bits__); \
612 (res) = cvt0565to0888(res); \
615 (res) = READ(img, (uint8_t *) bits__); \
616 (res) = (res) << 24; \
619 (res) = READ(img, (uint32_t *) bits__); \
620 (res) = FbLeftStipBits((res),1) ? 0xff000000 : 0x00000000; \
625 /* manage missing src alpha */ \
626 if (!PIXMAN_FORMAT_A((img)->bits.format)) \
627 (res) |= 0xff000000; \
630 /* If necessary, convert RGB <--> BGR. */ \
631 if (PIXMAN_FORMAT_TYPE (format__) != PIXMAN_FORMAT_TYPE(fmt)) \
633 (res) = ((((res) & 0xff000000) >> 0) | \
634 (((res) & 0x00ff0000) >> 16) | \
635 (((res) & 0x0000ff00) >> 0) | \
636 (((res) & 0x000000ff) << 16)); \
641 #define fbComposeGetStart(pict,x,y,type,out_stride,line,mul) do { \
642 uint32_t *__bits__; \
646 __bits__ = pict->bits.bits; \
647 __stride__ = pict->bits.rowstride; \
648 __bpp__ = PIXMAN_FORMAT_BPP(pict->bits.format); \
649 (out_stride) = __stride__ * (int) sizeof (uint32_t) / (int) sizeof (type); \
650 (line) = ((type *) __bits__) + \
651 (out_stride) * (y) + (mul) * (x); \
655 #define PIXMAN_FORMAT_16BPC(f) (PIXMAN_FORMAT_A(f) > 8 || \
656 PIXMAN_FORMAT_R(f) > 8 || \
657 PIXMAN_FORMAT_G(f) > 8 || \
658 PIXMAN_FORMAT_B(f) > 8)
663 #define MAX_ALPHA(n) ((1 << (n)) - 1)
664 #define N_Y_FRAC(n) ((n) == 1 ? 1 : (1 << ((n)/2)) - 1)
665 #define N_X_FRAC(n) ((n) == 1 ? 1 : (1 << ((n)/2)) + 1)
667 #define STEP_Y_SMALL(n) (pixman_fixed_1 / N_Y_FRAC(n))
668 #define STEP_Y_BIG(n) (pixman_fixed_1 - (N_Y_FRAC(n) - 1) * STEP_Y_SMALL(n))
670 #define Y_FRAC_FIRST(n) (STEP_Y_SMALL(n) / 2)
671 #define Y_FRAC_LAST(n) (Y_FRAC_FIRST(n) + (N_Y_FRAC(n) - 1) * STEP_Y_SMALL(n))
673 #define STEP_X_SMALL(n) (pixman_fixed_1 / N_X_FRAC(n))
674 #define STEP_X_BIG(n) (pixman_fixed_1 - (N_X_FRAC(n) - 1) * STEP_X_SMALL(n))
676 #define X_FRAC_FIRST(n) (STEP_X_SMALL(n) / 2)
677 #define X_FRAC_LAST(n) (X_FRAC_FIRST(n) + (N_X_FRAC(n) - 1) * STEP_X_SMALL(n))
679 #define RenderSamplesX(x,n) ((n) == 1 ? 0 : (pixman_fixed_frac (x) + X_FRAC_FIRST(n)) / STEP_X_SMALL(n))
682 * Step across a small sample grid gap
684 #define RenderEdgeStepSmall(edge) { \
685 edge->x += edge->stepx_small; \
686 edge->e += edge->dx_small; \
689 edge->e -= edge->dy; \
690 edge->x += edge->signdx; \
695 * Step across a large sample grid gap
697 #define RenderEdgeStepBig(edge) { \
698 edge->x += edge->stepx_big; \
699 edge->e += edge->dx_big; \
702 edge->e -= edge->dy; \
703 edge->x += edge->signdx; \
708 pixman_rasterize_edges_accessors (pixman_image_t *image,
715 pixman_image_is_opaque(pixman_image_t *image);
718 pixman_image_can_get_solid (pixman_image_t *image);
721 pixman_compute_composite_region32 (pixman_region32_t * pRegion,
722 pixman_image_t * pSrc,
723 pixman_image_t * pMask,
724 pixman_image_t * pDst,
735 #if defined(__GNUC__) && __GNUC__ >= 4
736 #define PIXMAN_EXPORT __attribute__ ((visibility("default")))
737 /* Sun Studio 8 visibility */
738 #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
739 #define PIXMAN_EXPORT __global
741 #define PIXMAN_EXPORT
745 pixman_bool_t pixman_region32_copy_from_region16 (pixman_region32_t *dst,
746 pixman_region16_t *src);
747 pixman_bool_t pixman_region16_copy_from_region32 (pixman_region16_t *dst,
748 pixman_region32_t *src);
749 void pixman_region_internal_set_static_pointers (pixman_box16_t *empty_box,
750 pixman_region16_data_t *empty_data,
751 pixman_region16_data_t *broken_data);
756 static inline uint64_t
757 oil_profile_stamp_rdtsc (void)
760 __asm__ __volatile__("rdtsc\n" : "=A" (ts));
763 #define OIL_STAMP oil_profile_stamp_rdtsc
765 typedef struct PixmanTimer PixmanTimer;
776 extern int timer_defined;
777 void pixman_timer_register (PixmanTimer *timer);
779 #define TIMER_BEGIN(tname) \
781 static PixmanTimer timer##tname; \
782 uint64_t begin##tname; \
784 if (!timer##tname.initialized) \
786 timer##tname.initialized = 1; \
787 timer##tname.name = #tname; \
788 pixman_timer_register (&timer##tname); \
791 timer##tname.n_times++; \
792 begin##tname = OIL_STAMP();
794 #define TIMER_END(tname) \
795 timer##tname.total += OIL_STAMP() - begin##tname; \
798 #endif /* PIXMAN_TIMING */
800 #endif /* PIXMAN_PRIVATE_H */