2 # error config.h must be included before pixman-private.h
5 #ifndef PIXMAN_PRIVATE_H
6 #define PIXMAN_PRIVATE_H
23 #ifdef WORDS_BIGENDIAN
24 # define IMAGE_BYTE_ORDER MSBFirst
25 # define BITMAP_BIT_ORDER MSBFirst
27 # define IMAGE_BYTE_ORDER LSBFirst
28 # define BITMAP_BIT_ORDER LSBFirst
34 #if defined (__GNUC__)
35 # define FUNC ((const char*) (__PRETTY_FUNCTION__))
36 #elif defined (__sun) || (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
37 # define FUNC ((const char*) (__func__))
39 # define FUNC ((const char*) ("???"))
43 # define INT16_MIN (-32767-1)
47 # define INT16_MAX (32767)
51 # define INT32_MIN (-2147483647-1)
55 # define INT32_MAX (2147483647)
59 # define UINT32_MIN (0)
63 # define UINT32_MAX (4294967295U)
67 # define M_PI 3.14159265358979323846
71 /* 'inline' is available only in C++ in MSVC */
72 # define inline __inline
73 # define force_inline __forceinline
74 #elif defined __GNUC__ || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
75 # define inline __inline__
76 # define force_inline __inline__ __attribute__ ((__always_inline__))
79 # define force_inline inline
84 #define FB_UNIT (1 << FB_SHIFT)
85 #define FB_HALFUNIT (1 << (FB_SHIFT-1))
86 #define FB_MASK (FB_UNIT - 1)
87 #define FB_ALLONES ((uint32_t) -1)
89 /* Memory allocation helpers */
90 void *pixman_malloc_ab (unsigned int n, unsigned int b);
91 void *pixman_malloc_abc (unsigned int a, unsigned int b, unsigned int c);
92 pixman_bool_t pixman_multiply_overflows_int (unsigned int a, unsigned int b);
93 pixman_bool_t pixman_addition_overflows_int (unsigned int a, unsigned int b);
97 #define return_if_fail(expr) \
102 fprintf(stderr, "In %s: %s failed\n", FUNC, #expr); \
108 #define return_val_if_fail(expr, retval) \
113 fprintf(stderr, "In %s: %s failed\n", FUNC, #expr); \
121 #define return_if_fail(expr) \
129 #define return_val_if_fail(expr, retval) \
139 typedef struct image_common image_common_t;
140 typedef struct source_image source_image_t;
141 typedef struct solid_fill solid_fill_t;
142 typedef struct gradient gradient_t;
143 typedef struct linear_gradient linear_gradient_t;
144 typedef struct horizontal_gradient horizontal_gradient_t;
145 typedef struct vertical_gradient vertical_gradient_t;
146 typedef struct conical_gradient conical_gradient_t;
147 typedef struct radial_gradient radial_gradient_t;
148 typedef struct bits_image bits_image_t;
149 typedef struct circle circle_t;
150 typedef struct point point_t;
152 typedef void (* CompositeFunc) (pixman_op_t,
153 pixman_image_t *, pixman_image_t *, pixman_image_t *,
154 int16_t, int16_t, int16_t, int16_t, int16_t, int16_t,
158 /* These "formats" both have depth 0, so they
159 * will never clash with any real ones
161 #define PIXMAN_null PIXMAN_FORMAT(0,0,0,0,0,0)
162 #define PIXMAN_solid PIXMAN_FORMAT(0,1,0,0,0,0)
164 #define NEED_COMPONENT_ALPHA (1 << 0)
165 #define NEED_PIXBUF (1 << 1)
166 #define NEED_SOLID_MASK (1 << 2)
171 pixman_format_code_t src_format;
172 pixman_format_code_t mask_format;
173 pixman_format_code_t dest_format;
178 extern const FastPathInfo *const c_fast_paths;
180 /* FIXME - the types and structures below should be give proper names
184 typedef FASTCALL void (*CombineFunc32) (uint32_t *dest, const uint32_t *src, const uint32_t *mask, int width);
185 typedef FASTCALL void (*fetchProc32)(bits_image_t *pict, int x, int y, int width,
187 typedef FASTCALL uint32_t (*fetchPixelProc32)(bits_image_t *pict, int offset, int line);
188 typedef FASTCALL void (*storeProc32)(pixman_image_t *, uint32_t *bits,
189 const uint32_t *values, int x, int width,
190 const pixman_indexed_t *);
192 typedef FASTCALL void (*CombineFunc64) (uint64_t *dest, const uint64_t *src, const uint64_t *mask, int width);
193 typedef FASTCALL void (*fetchProc64)(bits_image_t *pict, int x, int y, int width,
195 typedef FASTCALL uint64_t (*fetchPixelProc64)(bits_image_t *pict, int offset, int line);
196 typedef FASTCALL void (*storeProc64)(pixman_image_t *, uint32_t *bits,
197 const uint64_t *values, int x, int width,
198 const pixman_indexed_t *);
200 typedef struct _FbComposeData {
203 pixman_image_t *mask;
204 pixman_image_t *dest;
215 typedef struct _FbComposeFunctions32 {
216 CombineFunc32 *combineU;
217 CombineFunc32 *combineC;
218 } FbComposeFunctions32;
220 typedef struct _FbComposeFunctions64 {
221 CombineFunc64 *combineU;
222 CombineFunc64 *combineC;
223 } FbComposeFunctions64;
225 extern FbComposeFunctions32 pixman_composeFunctions;
226 extern FbComposeFunctions64 pixman_composeFunctions64;
228 void pixman_composite_rect_general_accessors (const FbComposeData *data,
233 void pixman_composite_rect_general (const FbComposeData *data);
235 fetchProc32 pixman_fetchProcForPicture32 (bits_image_t *);
236 fetchPixelProc32 pixman_fetchPixelProcForPicture32 (bits_image_t *);
237 storeProc32 pixman_storeProcForPicture32 (bits_image_t *);
238 fetchProc32 pixman_fetchProcForPicture32_accessors (bits_image_t *);
239 fetchPixelProc32 pixman_fetchPixelProcForPicture32_accessors (bits_image_t *);
240 storeProc32 pixman_storeProcForPicture32_accessors (bits_image_t *);
242 fetchProc64 pixman_fetchProcForPicture64 (bits_image_t *);
243 fetchPixelProc64 pixman_fetchPixelProcForPicture64 (bits_image_t *);
244 storeProc64 pixman_storeProcForPicture64 (bits_image_t *);
245 fetchProc64 pixman_fetchProcForPicture64_accessors (bits_image_t *);
246 fetchPixelProc64 pixman_fetchPixelProcForPicture64_accessors (bits_image_t *);
247 storeProc64 pixman_storeProcForPicture64_accessors (bits_image_t *);
249 void pixman_expand(uint64_t *dst, const uint32_t *src, pixman_format_code_t, int width);
250 void pixman_contract(uint32_t *dst, const uint64_t *src, int width);
252 void pixmanFetchGradient (gradient_t *, int x, int y, int width,
253 uint32_t *buffer, uint32_t *mask, uint32_t maskBits);
254 void _pixman_image_get_scanline_64_generic (pixman_image_t * pict, int x, int y, int width,
255 uint64_t *buffer, uint64_t *mask, uint32_t maskBits);
256 void fbFetchTransformed(bits_image_t *, int x, int y, int width,
257 uint32_t *buffer, uint32_t *mask, uint32_t maskBits);
258 void fbFetchExternalAlpha(bits_image_t *, int x, int y, int width,
259 uint32_t *buffer, uint32_t *mask, uint32_t maskBits);
261 void fbFetchTransformed_accessors(bits_image_t *, int x, int y, int width,
262 uint32_t *buffer, uint32_t *mask,
264 void fbStoreExternalAlpha_accessors(bits_image_t *, int x, int y, int width,
266 void fbFetchExternalAlpha_accessors(bits_image_t *, int x, int y, int width,
267 uint32_t *buffer, uint32_t *mask,
281 #define IS_SOURCE_IMAGE(img) (((image_common_t *)img)->type > BITS)
285 SOURCE_IMAGE_CLASS_UNKNOWN,
286 SOURCE_IMAGE_CLASS_HORIZONTAL,
287 SOURCE_IMAGE_CLASS_VERTICAL,
288 } source_pict_class_t;
290 typedef void (*scanStoreProc)(bits_image_t *img, int x, int y, int width, uint32_t *buffer);
291 typedef void (*scanFetchProc)(pixman_image_t *, int, int, int, uint32_t *,
292 uint32_t *, uint32_t);
294 source_pict_class_t _pixman_image_classify (pixman_image_t *image,
301 _pixman_image_get_scanline_32 (pixman_image_t *image, int x, int y, int width,
302 uint32_t *buffer, uint32_t *mask, uint32_t mask_bits);
304 /* Even thought the type of buffer is uint32_t *, the function actually expects
305 * a uint64_t *buffer.
308 _pixman_image_get_scanline_64 (pixman_image_t *image, int x, int y, int width,
309 uint32_t *buffer, uint32_t *unused, uint32_t unused2);
312 _pixman_image_store_scanline_32 (bits_image_t *image, int x, int y, int width,
314 /* Even thought the type of buffer is uint32_t *, the function actually expects
315 * a uint64_t *buffer.
318 _pixman_image_store_scanline_64 (bits_image_t *image, int x, int y, int width,
322 _pixman_image_allocate (void);
325 _pixman_init_gradient (gradient_t *gradient,
326 const pixman_gradient_stop_t *stops,
329 _pixman_image_reset_clip_region (pixman_image_t *image);
336 typedef source_pict_class_t (* classify_func_t) (pixman_image_t *image,
341 typedef void (* property_changed_func_t) (pixman_image_t *image);
347 pixman_region32_t full_region;
348 pixman_region32_t clip_region;
349 pixman_region32_t *src_clip;
350 pixman_bool_t has_client_clip;
351 pixman_transform_t *transform;
352 pixman_repeat_t repeat;
353 pixman_filter_t filter;
354 pixman_fixed_t *filter_params;
356 bits_image_t *alpha_map;
357 point_t alpha_origin;
358 pixman_bool_t component_alpha;
359 pixman_read_memory_func_t read_func;
360 pixman_write_memory_func_t write_func;
361 classify_func_t classify;
362 property_changed_func_t property_changed;
363 scanFetchProc get_scanline_32;
364 scanFetchProc get_scanline_64;
369 image_common_t common;
370 source_pict_class_t class;
375 source_image_t common;
376 uint32_t color; /* FIXME: shouldn't this be a pixman_color_t? */
381 source_image_t common;
383 pixman_gradient_stop_t * stops;
385 uint32_t * color_table;
386 int color_table_size;
389 struct linear_gradient
392 pixman_point_fixed_t p1;
393 pixman_point_fixed_t p2;
400 pixman_fixed_t radius;
403 struct radial_gradient
415 struct conical_gradient
418 pixman_point_fixed_t center;
419 pixman_fixed_t angle;
424 image_common_t common;
425 pixman_format_code_t format;
426 const pixman_indexed_t *indexed;
431 int rowstride; /* in number of uint32_t's */
433 scanStoreProc store_scanline_32;
434 scanStoreProc store_scanline_64;
440 image_common_t common;
442 source_image_t source;
444 linear_gradient_t linear;
445 conical_gradient_t conical;
446 radial_gradient_t radial;
462 pixman_gradient_stop_t *stops;
470 _pixman_gradient_walker_init (GradientWalker *walker,
471 gradient_t *gradient,
472 unsigned int spread);
475 _pixman_gradient_walker_reset (GradientWalker *walker,
476 pixman_fixed_32_32_t pos);
479 _pixman_gradient_walker_pixel (GradientWalker *walker,
480 pixman_fixed_32_32_t x);
484 #define LOG2_BITMAP_PAD 5
485 #define FB_STIP_SHIFT LOG2_BITMAP_PAD
486 #define FB_STIP_UNIT (1 << FB_STIP_SHIFT)
487 #define FB_STIP_MASK (FB_STIP_UNIT - 1)
488 #define FB_STIP_ALLONES ((uint32_t) -1)
490 #if BITMAP_BIT_ORDER == LSBFirst
491 #define FbScrLeft(x,n) ((x) >> (n))
492 #define FbScrRight(x,n) ((x) << (n))
493 #define FbLeftStipBits(x,n) ((x) & ((((uint32_t) 1) << (n)) - 1))
495 #define FbScrLeft(x,n) ((x) << (n))
496 #define FbScrRight(x,n) ((x) >> (n))
497 #define FbLeftStipBits(x,n) ((x) >> (FB_STIP_UNIT - (n)))
500 #define FbStipLeft(x,n) FbScrLeft(x,n)
501 #define FbStipRight(x,n) FbScrRight(x,n)
502 #define FbStipMask(x,w) (FbStipRight(FB_STIP_ALLONES,(x) & FB_STIP_MASK) & \
503 FbStipLeft(FB_STIP_ALLONES,(FB_STIP_UNIT - ((x)+(w))) & FB_STIP_MASK))
505 #define FbLeftMask(x) ( ((x) & FB_MASK) ? \
506 FbScrRight(FB_ALLONES,(x) & FB_MASK) : 0)
507 #define FbRightMask(x) ( ((FB_UNIT - (x)) & FB_MASK) ? \
508 FbScrLeft(FB_ALLONES,(FB_UNIT - (x)) & FB_MASK) : 0)
510 #define FbMaskBits(x,w,l,n,r) { \
512 r = FbRightMask((x)+n); \
515 n -= FB_UNIT - ((x) & FB_MASK); \
525 #if IMAGE_BYTE_ORDER == MSBFirst
526 #define Fetch24(img, a) ((unsigned long) (a) & 1 ? \
527 ((READ(img, a) << 16) | READ(img, (uint16_t *) ((a)+1))) : \
528 ((READ(img, (uint16_t *) (a)) << 8) | READ(img, (a)+2)))
529 #define Store24(img,a,v) ((unsigned long) (a) & 1 ? \
530 (WRITE(img, a, (uint8_t) ((v) >> 16)), \
531 WRITE(img, (uint16_t *) ((a)+1), (uint16_t) (v))) : \
532 (WRITE(img, (uint16_t *) (a), (uint16_t) ((v) >> 8)), \
533 WRITE(img, (a)+2, (uint8_t) (v))))
535 #define Fetch24(img,a) ((unsigned long) (a) & 1 ? \
536 (READ(img, a) | (READ(img, (uint16_t *) ((a)+1)) << 8)) : \
537 (READ(img, (uint16_t *) (a)) | (READ(img, (a)+2) << 16)))
538 #define Store24(img,a,v) ((unsigned long) (a) & 1 ? \
539 (WRITE(img, a, (uint8_t) (v)), \
540 WRITE(img, (uint16_t *) ((a)+1), (uint16_t) ((v) >> 8))) : \
541 (WRITE(img, (uint16_t *) (a), (uint16_t) (v)), \
542 WRITE(img, (a)+2, (uint8_t) ((v) >> 16))))
545 #define CvtR8G8B8toY15(s) (((((s) >> 16) & 0xff) * 153 + \
546 (((s) >> 8) & 0xff) * 301 + \
547 (((s) ) & 0xff) * 58) >> 2)
548 #define miCvtR8G8B8to15(s) ((((s) >> 3) & 0x001f) | \
549 (((s) >> 6) & 0x03e0) | \
550 (((s) >> 9) & 0x7c00))
551 #define miIndexToEnt15(mif,rgb15) ((mif)->ent[rgb15])
552 #define miIndexToEnt24(mif,rgb24) miIndexToEnt15(mif,miCvtR8G8B8to15(rgb24))
554 #define miIndexToEntY24(mif,rgb24) ((mif)->ent[CvtR8G8B8toY15(rgb24)])
557 #define FbIntMult(a,b,t) ( (t) = (a) * (b) + 0x80, ( ( ( (t)>>8 ) + (t) )>>8 ) )
558 #define FbIntDiv(a,b) (((uint16_t) (a) * 255) / (b))
560 #define FbGet8(v,i) ((uint16_t) (uint8_t) ((v) >> i))
563 #define cvt8888to0565(s) ((((s) >> 3) & 0x001f) | \
564 (((s) >> 5) & 0x07e0) | \
565 (((s) >> 8) & 0xf800))
566 #define cvt0565to0888(s) (((((s) << 3) & 0xf8) | (((s) >> 2) & 0x7)) | \
567 ((((s) << 5) & 0xfc00) | (((s) >> 1) & 0x300)) | \
568 ((((s) << 8) & 0xf80000) | (((s) << 3) & 0x70000)))
571 * There are two ways of handling alpha -- either as a single unified value or
572 * a separate value for each component, hence each macro must have two
573 * versions. The unified alpha version has a 'U' at the end of the name,
574 * the component version has a 'C'. Similarly, functions which deal with
575 * this difference will have two versions using the same convention.
578 #define FbOverU(x,y,i,a,t) ((t) = FbIntMult(FbGet8(y,i),(a),(t)) + FbGet8(x,i), \
579 (uint32_t) ((uint8_t) ((t) | (0 - ((t) >> 8)))) << (i))
581 #define FbOverC(x,y,i,a,t) ((t) = FbIntMult(FbGet8(y,i),FbGet8(a,i),(t)) + FbGet8(x,i), \
582 (uint32_t) ((uint8_t) ((t) | (0 - ((t) >> 8)))) << (i))
584 #define FbInU(x,i,a,t) ((uint32_t) FbIntMult(FbGet8(x,i),(a),(t)) << (i))
586 #define FbInC(x,i,a,t) ((uint32_t) FbIntMult(FbGet8(x,i),FbGet8(a,i),(t)) << (i))
588 #define FbAdd(x,y,i,t) ((t) = FbGet8(x,i) + FbGet8(y,i), \
589 (uint32_t) ((uint8_t) ((t) | (0 - ((t) >> 8)))) << (i))
591 #define div_255(x) (((x) + 0x80 + (((x) + 0x80) >> 8)) >> 8)
592 #define div_65535(x) (((x) + 0x8000 + (((x) + 0x8000) >> 16)) >> 16)
594 #define MOD(a,b) ((a) < 0 ? ((b) - ((-(a) - 1) % (b))) - 1 : (a) % (b))
596 #define DIV(a,b) ((((a) < 0) == ((b) < 0)) ? (a) / (b) : \
597 ((a) - (b) + 1 - (((b) < 0) << 1)) / (b))
599 #define CLIP(a,b,c) ((a) < (b) ? (b) : ((a) > (c) ? (c) : (a)))
602 /* FIXME: the MOD macro above is equivalent, but faster I think */
603 #define mod(a,b) ((b) == 1 ? 0 : (a) >= 0 ? (a) % (b) : (b) - (-a) % (b))
606 /* FIXME: the (void)__read_func hides lots of warnings (which is what they
607 * are supposed to do), but some of them are real. For example the one
608 * where Fetch4 doesn't have a READ
612 /* Framebuffer access support macros */
613 #define ACCESS_MEM(code) \
615 const image_common_t *const com__ = \
616 (image_common_t *)image; \
618 if (!com__->read_func && !com__->write_func) \
620 const int do_access__ = 0; \
621 const pixman_read_memory_func_t read_func__ = NULL; \
622 const pixman_write_memory_func_t write_func__ = NULL; \
624 (void)write_func__; \
631 const int do_access__ = 1; \
632 const pixman_read_memory_func_t read_func__ = \
634 const pixman_write_memory_func_t write_func__ = \
637 (void)write_func__; \
645 #ifdef PIXMAN_FB_ACCESSORS
647 #define ACCESS(sym) sym##_accessors
649 #define READ(img, ptr) \
650 ((img)->common.read_func ((ptr), sizeof(*(ptr))))
651 #define WRITE(img, ptr,val) \
652 ((img)->common.write_func ((ptr), (val), sizeof (*(ptr))))
654 #define MEMCPY_WRAPPED(img, dst, src, size) \
657 uint8_t *_dst = (uint8_t*)(dst), *_src = (uint8_t*)(src); \
658 for(_i = 0; _i < size; _i++) { \
659 WRITE((img), _dst +_i, READ((img), _src + _i)); \
663 #define MEMSET_WRAPPED(img, dst, val, size) \
666 uint8_t *_dst = (uint8_t*)(dst); \
667 for(_i = 0; _i < (size_t) size; _i++) { \
668 WRITE((img), _dst +_i, (val)); \
674 #define ACCESS(sym) sym
676 #define READ(img, ptr) (*(ptr))
677 #define WRITE(img, ptr, val) (*(ptr) = (val))
678 #define MEMCPY_WRAPPED(img, dst, src, size) \
679 memcpy(dst, src, size)
680 #define MEMSET_WRAPPED(img, dst, val, size) \
681 memset(dst, val, size)
685 #define fbComposeGetSolid(img, res, fmt) \
688 pixman_format_code_t format__; \
689 if (img->type == SOLID) \
691 format__ = PIXMAN_a8r8g8b8; \
692 (res) = img->solid.color; \
696 uint32_t *bits__ = (img)->bits.bits; \
697 format__ = (img)->bits.format; \
699 switch (PIXMAN_FORMAT_BPP((img)->bits.format)) \
702 (res) = READ(img, (uint32_t *)bits__); \
705 (res) = Fetch24(img, (uint8_t *) bits__); \
708 (res) = READ(img, (uint16_t *) bits__); \
709 (res) = cvt0565to0888(res); \
712 (res) = READ(img, (uint8_t *) bits__); \
713 (res) = (res) << 24; \
716 (res) = READ(img, (uint32_t *) bits__); \
717 (res) = FbLeftStipBits((res),1) ? 0xff000000 : 0x00000000; \
722 /* manage missing src alpha */ \
723 if (!PIXMAN_FORMAT_A((img)->bits.format)) \
724 (res) |= 0xff000000; \
727 /* If necessary, convert RGB <--> BGR. */ \
728 if (PIXMAN_FORMAT_TYPE (format__) != PIXMAN_FORMAT_TYPE(fmt)) \
730 (res) = ((((res) & 0xff000000) >> 0) | \
731 (((res) & 0x00ff0000) >> 16) | \
732 (((res) & 0x0000ff00) >> 0) | \
733 (((res) & 0x000000ff) << 16)); \
738 #define fbComposeGetStart(pict,x,y,type,out_stride,line,mul) do { \
739 uint32_t *__bits__; \
743 __bits__ = pict->bits.bits; \
744 __stride__ = pict->bits.rowstride; \
745 __bpp__ = PIXMAN_FORMAT_BPP(pict->bits.format); \
746 (out_stride) = __stride__ * (int) sizeof (uint32_t) / (int) sizeof (type); \
747 (line) = ((type *) __bits__) + \
748 (out_stride) * (y) + (mul) * (x); \
752 #define PIXMAN_FORMAT_16BPC(f) (PIXMAN_FORMAT_A(f) > 8 || \
753 PIXMAN_FORMAT_R(f) > 8 || \
754 PIXMAN_FORMAT_G(f) > 8 || \
755 PIXMAN_FORMAT_B(f) > 8)
760 #define MAX_ALPHA(n) ((1 << (n)) - 1)
761 #define N_Y_FRAC(n) ((n) == 1 ? 1 : (1 << ((n)/2)) - 1)
762 #define N_X_FRAC(n) ((n) == 1 ? 1 : (1 << ((n)/2)) + 1)
764 #define STEP_Y_SMALL(n) (pixman_fixed_1 / N_Y_FRAC(n))
765 #define STEP_Y_BIG(n) (pixman_fixed_1 - (N_Y_FRAC(n) - 1) * STEP_Y_SMALL(n))
767 #define Y_FRAC_FIRST(n) (STEP_Y_SMALL(n) / 2)
768 #define Y_FRAC_LAST(n) (Y_FRAC_FIRST(n) + (N_Y_FRAC(n) - 1) * STEP_Y_SMALL(n))
770 #define STEP_X_SMALL(n) (pixman_fixed_1 / N_X_FRAC(n))
771 #define STEP_X_BIG(n) (pixman_fixed_1 - (N_X_FRAC(n) - 1) * STEP_X_SMALL(n))
773 #define X_FRAC_FIRST(n) (STEP_X_SMALL(n) / 2)
774 #define X_FRAC_LAST(n) (X_FRAC_FIRST(n) + (N_X_FRAC(n) - 1) * STEP_X_SMALL(n))
776 #define RenderSamplesX(x,n) ((n) == 1 ? 0 : (pixman_fixed_frac (x) + X_FRAC_FIRST(n)) / STEP_X_SMALL(n))
779 * Step across a small sample grid gap
781 #define RenderEdgeStepSmall(edge) { \
782 edge->x += edge->stepx_small; \
783 edge->e += edge->dx_small; \
786 edge->e -= edge->dy; \
787 edge->x += edge->signdx; \
792 * Step across a large sample grid gap
794 #define RenderEdgeStepBig(edge) { \
795 edge->x += edge->stepx_big; \
796 edge->e += edge->dx_big; \
799 edge->e -= edge->dy; \
800 edge->x += edge->signdx; \
805 pixman_rasterize_edges_accessors (pixman_image_t *image,
812 pixman_image_is_opaque(pixman_image_t *image);
815 pixman_image_can_get_solid (pixman_image_t *image);
818 pixman_compute_composite_region32 (pixman_region32_t * pRegion,
819 pixman_image_t * pSrc,
820 pixman_image_t * pMask,
821 pixman_image_t * pDst,
832 #if defined(__GNUC__) && __GNUC__ >= 4
833 #define PIXMAN_EXPORT __attribute__ ((visibility("default")))
834 /* Sun Studio 8 visibility */
835 #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
836 #define PIXMAN_EXPORT __global
838 #define PIXMAN_EXPORT
842 pixman_bool_t pixman_region32_copy_from_region16 (pixman_region32_t *dst,
843 pixman_region16_t *src);
844 pixman_bool_t pixman_region16_copy_from_region32 (pixman_region16_t *dst,
845 pixman_region32_t *src);
846 void pixman_region_internal_set_static_pointers (pixman_box16_t *empty_box,
847 pixman_region16_data_t *empty_data,
848 pixman_region16_data_t *broken_data);
853 static inline uint64_t
854 oil_profile_stamp_rdtsc (void)
857 __asm__ __volatile__("rdtsc\n" : "=A" (ts));
860 #define OIL_STAMP oil_profile_stamp_rdtsc
862 typedef struct PixmanTimer PixmanTimer;
873 extern int timer_defined;
874 void pixman_timer_register (PixmanTimer *timer);
876 #define TIMER_BEGIN(tname) \
878 static PixmanTimer timer##tname; \
879 uint64_t begin##tname; \
881 if (!timer##tname.initialized) \
883 timer##tname.initialized = 1; \
884 timer##tname.name = #tname; \
885 pixman_timer_register (&timer##tname); \
888 timer##tname.n_times++; \
889 begin##tname = OIL_STAMP();
891 #define TIMER_END(tname) \
892 timer##tname.total += OIL_STAMP() - begin##tname; \
895 #endif /* PIXMAN_TIMING */
897 #endif /* PIXMAN_PRIVATE_H */