5 # include "config.h" /* so that EAPI in Evas.h is correctly defined */
16 #include <sys/types.h>
20 /* macros needed to log message through eina_log */
21 extern EAPI int _evas_log_dom_global;
22 #ifdef _EVAS_DEFAULT_LOG_DOM
23 # undef _EVAS_DEFAULT_LOG_DOM
25 #define _EVAS_DEFAULT_LOG_DOM _evas_log_dom_global
27 #ifdef EVAS_DEFAULT_LOG_COLOR
28 # undef EVAS_DEFAULT_LOG_COLOR
30 #define EVAS_DEFAULT_LOG_COLOR EINA_COLOR_BLUE
35 #define ERR(...) EINA_LOG_DOM_ERR(_EVAS_DEFAULT_LOG_DOM, __VA_ARGS__)
40 #define DBG(...) EINA_LOG_DOM_DBG(_EVAS_DEFAULT_LOG_DOM, __VA_ARGS__)
45 #define INF(...) EINA_LOG_DOM_INFO(_EVAS_DEFAULT_LOG_DOM, __VA_ARGS__)
50 #define WRN(...) EINA_LOG_DOM_WARN(_EVAS_DEFAULT_LOG_DOM, __VA_ARGS__)
55 #define CRIT(...) EINA_LOG_DOM_CRIT(_EVAS_DEFAULT_LOG_DOM, __VA_ARGS__)
57 #include "evas_options.h"
59 #if defined(__ARM_ARCH_3M__)
60 # define __ARM_ARCH__ 40
62 #if defined(__ARM_ARCH_4__)
63 # define __ARM_ARCH__ 40
65 #if defined(__ARM_ARCH_4T__)
66 # define __ARM_ARCH__ 41
69 #if defined(__ARM_ARCH_5__)
70 # define __ARM_ARCH__ 50
72 #if defined(__ARM_ARCH_5T__)
73 # define __ARM_ARCH__ 51
75 #if defined(__ARM_ARCH_5E__)
76 # define __ARM_ARCH__ 52
78 #if defined(__ARM_ARCH_5TE__)
79 # define __ARM_ARCH__ 53
81 #if defined(__ARM_ARCH_5TEJ__)
82 # define __ARM_ARCH__ 54
85 #if defined(__ARM_ARCH_6__)
86 # define __ARM_ARCH__ 60
88 #if defined(__ARM_ARCH_6J__)
89 # define __ARM_ARCH__ 61
91 #if defined(__ARM_ARCH_6K__)
92 # define __ARM_ARCH__ 62
94 #if defined(__ARM_ARCH_6Z__)
95 # define __ARM_ARCH__ 63
97 #if defined(__ARM_ARCH_6ZK__)
98 # define __ARM_ARCH__ 64
100 #if defined(__ARM_ARCH_6T2__)
101 # define __ARM_ARCH__ 65
104 #if defined(__ARM_ARCH_7__)
105 # define __ARM_ARCH__ 70
107 #if defined(__ARM_ARCH_7A__)
108 # define __ARM_ARCH__ 71
110 #if defined(__ARM_ARCH_7R__)
111 # define __ARM_ARCH__ 72
113 #if defined(__ARM_ARCH_7M__)
114 # define __ARM_ARCH__ 73
117 #ifndef BUILD_PTHREAD
118 # undef BUILD_PIPE_RENDER
121 #if defined(BUILD_ASYNC_PRELOAD) && !defined(BUILD_PTHREAD)
122 # define BUILD_PTHREAD
131 # include <pthread.h>
134 # include <sys/time.h>
135 # include <sys/resource.h>
142 EAPI Eina_Bool lockdebug;
146 #define LK(x) pthread_mutex_t x
147 #ifndef EVAS_FRAME_QUEUING
148 # define LKI(x) pthread_mutex_init(&(x), NULL)
150 # define LKI(x) do {pthread_mutexattr_t __attr;\
151 pthread_mutexattr_init(&__attr); \
152 pthread_mutexattr_settype(&__attr, PTHREAD_MUTEX_RECURSIVE); \
153 pthread_mutex_init(&(x), &__attr);} while (0)
155 # define LKD(x) pthread_mutex_destroy(&(x))
160 struct timeval t0, t1; \
162 gettimeofday(&t0, NULL); \
163 pthread_mutex_lock(&(x)); \
164 gettimeofday(&t1, NULL); \
165 dt = (t1.tv_sec - t0.tv_sec) * 1000000; \
166 if (t1.tv_usec > t0.tv_usec) dt += (t1.tv_usec - t0.tv_usec); \
167 else dt -= t0.tv_usec - t1.tv_usec; \
169 if (dt > lockmax) { \
170 fprintf(stderr, "HANG %ims - %s:%i - %s()\n", \
171 dt, __FILE__, __LINE__, __FUNCTION__); \
175 pthread_mutex_lock(&(x)); \
179 # define LKL(x) pthread_mutex_lock(&(x))
181 # define LKT(x) pthread_mutex_trylock(&(x))
182 # define LKU(x) pthread_mutex_unlock(&(x))
183 # define TH(x) pthread_t x
184 # define THI(x) int x
188 #define RWLK(x) pthread_rwlock_t x
189 #define RWLKI(x) pthread_rwlock_init(&(x), NULL);
190 #define RWLKD(x) pthread_rwlock_destroy(&(x));
191 #define RDLKL(x) pthread_rwlock_rdlock(&(x));
192 #define WRLKL(x) pthread_rwlock_wrlock(&(x));
193 #define RWLKU(x) pthread_rwlock_unlock(&(x));
196 // even though in theory having every Nth rendered line done by a different
197 // thread might even out load across threads - it actually slows things down.
223 #elif defined __GNUC__
224 # define alloca __builtin_alloca
226 # define alloca __alloca
227 #elif defined _MSC_VER
229 # define alloca _alloca
235 void *alloca (size_t);
241 #include <sys/types.h>
242 #include <sys/stat.h>
250 #include <ft2build.h>
251 #include FT_FREETYPE_H
258 // BROKEN in gcc 4 on amd64
259 //# pragma GCC visibility push(hidden)
261 #define LIKELY(x) __builtin_expect(!!(x), 1)
262 #define UNLIKELY(x) __builtin_expect(!!(x), 0)
264 #define LIKELY(x) (x)
265 #define UNLIKELY(x) (x)
268 /*****************************************************************************/
270 /* use exact rects for updates not tiles */
271 /* #define RECTUPDATE */
273 #define IMG_MAX_SIZE 65000
275 #define IMG_TOO_BIG(w, h) \
276 ((((unsigned long long)w) * ((unsigned long long)h)) >= \
277 ((1ULL << (29 * (sizeof(void *) / 4))) - 2048))
279 #ifdef BUILD_SMALL_DITHER_MASK
280 # define DM_TABLE _evas_dither_44
284 # define USE_DITHER_44 1
286 # define DM_TABLE _evas_dither_128128
290 # define USE_DITHER_128128 1
293 #define DM_MSK (DM_SIZE - 1)
294 #define DM_SHF(_b) (DM_BITS - (8 - _b))
295 /* Supports negative right shifts */
296 #define DM_SHR(x, _b) ((DM_SHF(_b) >= 0) ? \
297 ((x) >> DM_SHF(_b)) : ((x) << -DM_SHF(_b)))
299 /* if more than 1/ALPHA_SPARSE_INV_FRACTION is "alpha" (1-254) then sparse
300 * alpha flag gets set */
301 #define ALPHA_SPARSE_INV_FRACTION 3
303 /*****************************************************************************/
305 #if defined(__ARM_ARCH_3M__)
306 # define __ARM_ARCH__ 40
308 #if defined(__ARM_ARCH_4__)
309 # define __ARM_ARCH__ 40
311 #if defined(__ARM_ARCH_4T__)
312 # define __ARM_ARCH__ 41
315 #if defined(__ARM_ARCH_5__)
316 # define __ARM_ARCH__ 50
318 #if defined(__ARM_ARCH_5T__)
319 # define __ARM_ARCH__ 51
321 #if defined(__ARM_ARCH_5E__)
322 # define __ARM_ARCH__ 52
324 #if defined(__ARM_ARCH_5TE__)
325 # define __ARM_ARCH__ 53
327 #if defined(__ARM_ARCH_5TEJ__)
328 # define __ARM_ARCH__ 54
331 #if defined(__ARM_ARCH_6__)
332 # define __ARM_ARCH__ 60
334 #if defined(__ARM_ARCH_6J__)
335 # define __ARM_ARCH__ 61
337 #if defined(__ARM_ARCH_6K__)
338 # define __ARM_ARCH__ 62
340 #if defined(__ARM_ARCH_6Z__)
341 # define __ARM_ARCH__ 63
343 #if defined(__ARM_ARCH_6ZK__)
344 # define __ARM_ARCH__ 64
346 #if defined(__ARM_ARCH_6T2__)
347 # define __ARM_ARCH__ 65
350 #if defined(__ARM_ARCH_7__)
351 # define __ARM_ARCH__ 70
353 #if defined(__ARM_ARCH_7A__)
354 # define __ARM_ARCH__ 71
356 #if defined(__ARM_ARCH_7R__)
357 # define __ARM_ARCH__ 72
359 #if defined(__ARM_ARCH_7M__)
360 # define __ARM_ARCH__ 73
363 #if defined(__ARM_ARCH__) && (__ARM_ARCH__ >= 52)
364 /* tested on ARMv6 (arm1136j-s), Nokia N800 CPU */
365 #define pld(addr, off) \
366 __asm__("pld [%[address], %[offset]]":: \
367 [address] "r" (addr), [offset] "i" (off))
369 #define pld(addr, off)
370 #endif /* __ARMEL__ */
372 /*****************************************************************************/
374 #define UNROLL2(op...) op op
375 #define UNROLL4(op...) UNROLL2(op) UNROLL2(op)
376 #define UNROLL8(op...) UNROLL4(op) UNROLL4(op)
377 #define UNROLL16(op...) UNROLL8(op) UNROLL8(op)
379 #define UNROLL8_PLD_WHILE(start, size, end, op) \
381 end = start + (size & ~7); \
382 while (start < end) \
389 while (start < end) \
394 /*****************************************************************************/
396 typedef unsigned long long DATA64;
397 typedef unsigned int DATA32;
398 typedef unsigned short DATA16;
399 typedef unsigned char DATA8;
401 typedef struct _Image_Entry Image_Entry;
402 typedef struct _Image_Entry_Flags Image_Entry_Flags;
403 typedef struct _Image_Timestamp Image_Timestamp;
404 typedef struct _Engine_Image_Entry Engine_Image_Entry;
405 typedef struct _Evas_Cache_Target Evas_Cache_Target;
406 typedef struct _Evas_Preload_Pthread Evas_Preload_Pthread;
408 typedef struct _RGBA_Image_Loadopts RGBA_Image_Loadopts;
409 #ifdef BUILD_PIPE_RENDER
410 typedef struct _RGBA_Pipe_Op RGBA_Pipe_Op;
411 typedef struct _RGBA_Pipe RGBA_Pipe;
412 typedef struct _RGBA_Pipe_Thread_Info RGBA_Pipe_Thread_Info;
414 typedef struct _RGBA_Image RGBA_Image;
415 typedef struct _RGBA_Image_Span RGBA_Image_Span;
416 typedef struct _RGBA_Draw_Context RGBA_Draw_Context;
417 typedef struct _RGBA_Polygon_Point RGBA_Polygon_Point;
418 typedef struct _RGBA_Map_Point RGBA_Map_Point;
419 typedef struct _RGBA_Font RGBA_Font;
420 typedef struct _RGBA_Font_Int RGBA_Font_Int;
421 typedef struct _RGBA_Font_Source RGBA_Font_Source;
422 typedef struct _RGBA_Font_Glyph RGBA_Font_Glyph;
423 typedef struct _RGBA_Gfx_Compositor RGBA_Gfx_Compositor;
425 typedef struct _Cutout_Rect Cutout_Rect;
426 typedef struct _Cutout_Rects Cutout_Rects;
428 typedef struct _Convert_Pal Convert_Pal;
430 typedef struct _Tilebuf Tilebuf;
431 typedef struct _Tilebuf_Tile Tilebuf_Tile;
432 typedef struct _Tilebuf_Rect Tilebuf_Rect;
434 typedef struct _Evas_Common_Transform Evas_Common_Transform;
437 // all coords are 20.12
438 // fp type - an int for now
440 // fp # of bits of float accuracy
442 // fp half (half of an fp unit)
443 #define FPH (1 << (FP - 1))
445 #define FP1 (1 << (FP))
448 typedef struct _Regionbuf Regionbuf;
449 typedef struct _Regionspan Regionspan;
452 typedef void (*RGBA_Gfx_Func) (DATA32 *src, DATA8 *mask, DATA32 col, DATA32 *dst, int len);
453 typedef void (*RGBA_Gfx_Pt_Func) (DATA32 src, DATA8 mask, DATA32 col, DATA32 *dst);
454 typedef void (*Gfx_Func_Copy) (DATA32 *src, DATA32 *dst, int len);
456 typedef void (*Gfx_Func_Convert) (DATA32 *src, DATA8 *dst, int src_jump, int dst_jump, int w, int h, int dith_x, int dith_y, DATA8 *pal);
458 #include "../cache/evas_cache.h"
460 /*****************************************************************************/
462 typedef enum _RGBA_Image_Flags
464 RGBA_IMAGE_NOTHING = (0),
465 /* RGBA_IMAGE_HAS_ALPHA = (1 << 0), */
466 RGBA_IMAGE_IS_DIRTY = (1 << 1),
467 RGBA_IMAGE_INDEXED = (1 << 2),
468 RGBA_IMAGE_ALPHA_ONLY = (1 << 3),
469 RGBA_IMAGE_ALPHA_TILES = (1 << 4),
470 /* RGBA_IMAGE_ALPHA_SPARSE = (1 << 5), */
471 /* RGBA_IMAGE_LOADED = (1 << 6), */
472 /* RGBA_IMAGE_NEED_DATA = (1 << 7) */
473 RGBA_IMAGE_TODO_LOAD = (1 << 8),
476 typedef enum _Convert_Pal_Mode
494 typedef enum _CPU_Features
497 CPU_FEATURE_MMX = (1 << 0),
498 CPU_FEATURE_MMX2 = (1 << 1),
499 CPU_FEATURE_SSE = (1 << 2),
500 CPU_FEATURE_ALTIVEC = (1 << 3),
501 CPU_FEATURE_VIS = (1 << 4),
502 CPU_FEATURE_VIS2 = (1 << 5),
503 CPU_FEATURE_NEON = (1 << 6)
506 typedef enum _Font_Hint_Flags
513 typedef enum _Font_Rend_Flags
515 FONT_REND_REGULAR = 0,
516 FONT_REND_ITALIC = (1 << 0),
517 FONT_REND_BOLD = (1 << 1),
520 /*****************************************************************************/
522 typedef struct _Filtered_Image Filtered_Image;
524 struct _RGBA_Image_Loadopts
526 int scale_down_by; // if > 1 then use this
527 double dpi; // if > 0.0 use this
528 unsigned int w, h; // if > 0 use this
530 unsigned int x, y, w, h;
534 struct _Image_Entry_Flags
536 Eina_Bool loaded : 1;
537 Eina_Bool in_progress : 1;
541 Eina_Bool need_data : 1;
542 Eina_Bool lru_nodata : 1;
543 Eina_Bool cached : 1;
547 Eina_Bool alpha_sparse : 1;
548 #ifdef BUILD_ASYNC_PRELOAD
549 Eina_Bool preload_done : 1;
550 Eina_Bool delete_me : 1;
551 Eina_Bool pending : 1;
555 struct _Evas_Cache_Target
562 struct _Image_Timestamp
567 #ifdef _STAT_VER_LINUX
568 unsigned long int mtime_nsec;
576 Evas_Cache_Image *cache;
578 const char *cache_key;
583 Evas_Cache_Target *targets;
584 Evas_Preload_Pthread *preload;
586 Image_Timestamp tstamp;
589 #ifdef EVAS_FRAME_QUEUING
590 LK(lock_references); // needed for accessing references
593 #ifdef BUILD_PIPE_RENDER
595 #ifdef EVAS_FRAME_QUEUING
598 pthread_cond_t cond_fq_del;
599 int ref_fq[2]; // ref_fq[0] is for addition, ref_fq[1] is for deletion
605 RGBA_Image_Loadopts load_opts;
622 #ifdef BUILD_ASYNC_PRELOAD
625 Eina_Bool unload_cancel : 1;
628 Image_Entry_Flags flags;
629 Evas_Image_Scale_Hint scale_hint;
636 struct _Engine_Image_Entry
640 /* Upper Engine data. */
644 Evas_Cache_Engine_Image *cache;
645 const char *cache_key;
649 Eina_Bool cached : 1;
652 Eina_Bool loaded : 1;
653 Eina_Bool need_parent : 1;
673 struct _Evas_Common_Transform
680 struct _RGBA_Draw_Context
689 struct RGBA_Draw_Context_clip {
700 void *(*gl_new) (void *data, RGBA_Font_Glyph *fg);
701 void (*gl_free) (void *ext_dat);
702 void (*gl_draw) (void *data, void *dest, void *context, RGBA_Font_Glyph *fg, int x, int y);
713 Eina_Bool anti_alias : 1;
716 #ifdef BUILD_PIPE_RENDER
717 #include "../engines/common/evas_map_image.h"
718 #include "../engines/common/evas_text_utils.h"
722 RGBA_Draw_Context context;
723 void (*op_func) (RGBA_Image *dst, RGBA_Pipe_Op *op, RGBA_Pipe_Thread_Info *info);
724 void (*free_func) (RGBA_Pipe_Op *op);
734 RGBA_Polygon_Point *points;
740 Evas_Text_Props intl_props;
744 int sx, sy, sw, sh, dx, dy, dw, dh;
764 RGBA_Pipe_Op op[PIPE_LEN];
767 struct _RGBA_Pipe_Thread_Info
776 Image_Entry cache_entry;
778 RGBA_Image_Flags flags;
783 /* char *real_file; */
791 /* unsigned char scale; */
793 /* Colorspace stuff. */
796 Eina_Bool no_free : 1;
803 Eina_Bool no_free : 1;
816 unsigned long long orig_usage;
817 unsigned long long usage_count;
819 unsigned long long newest_usage;
820 unsigned long long newest_usage_count;
824 struct _RGBA_Polygon_Point
830 struct _RGBA_Map_Point
832 FPc x, y; // x, y screenspace
833 float fx, fy, fz; // x, y, z in floats
834 // FPc x3, y3; // x, y 3d space
835 FPc z; // z in world space. optional
836 FPc u, v; // u, v in tex coords
837 DATA32 col; // color at this point
838 // for perspective correctness - only point 0 has relevant info
842 struct _Filtered_Image
852 typedef struct _Fash_Item_Index_Map Fash_Item_Index_Map;
853 typedef struct _Fash_Int_Map Fash_Int_Map;
854 typedef struct _Fash_Int_Map2 Fash_Int_Map2;
855 typedef struct _Fash_Int Fash_Int;
856 struct _Fash_Item_Index_Map
863 Fash_Item_Index_Map item[256];
865 struct _Fash_Int_Map2
867 Fash_Int_Map *bucket[256];
871 Fash_Int_Map2 *bucket[256];
872 void (*freeme) (Fash_Int *fash);
876 typedef struct _Fash_Glyph_Map Fash_Glyph_Map;
877 typedef struct _Fash_Glyph_Map2 Fash_Glyph_Map2;
878 typedef struct _Fash_Glyph Fash_Glyph;
879 struct _Fash_Glyph_Map
881 RGBA_Font_Glyph *item[256];
883 struct _Fash_Glyph_Map2
885 Fash_Glyph_Map *bucket[256];
889 Fash_Glyph_Map2 *bucket[256];
890 void (*freeme) (Fash_Glyph *fash);
898 Font_Hint_Flags hinting;
900 #ifdef EVAS_FRAME_QUEUING
901 int ref_fq[2]; //ref_fq[0] is for addition, ref_fq[1] is for deletion
902 pthread_cond_t cond_fq_del;
907 unsigned char sizeok : 1;
910 struct _RGBA_Font_Int
913 RGBA_Font_Source *src;
925 Font_Hint_Flags hinting;
926 Font_Rend_Flags wanted_rend; /* The wanted rendering style */
927 Font_Rend_Flags runtime_rend; /* The rendering we need to do on runtime
928 in order to comply with the wanted_rend. */
929 unsigned char sizeok : 1;
930 unsigned char inuse : 1;
933 #include "../engines/common/evas_font_ot.h"
935 struct _RGBA_Font_Source
940 unsigned int current_size;
954 struct _RGBA_Font_Glyph
958 FT_BitmapGlyph glyph_out;
959 /* this is a problem - only 1 engine at a time can extend such a font... grrr */
961 void (*ext_dat_free) (void *ext_dat);
965 struct _RGBA_Gfx_Compositor
970 void (*shutdown)(void);
972 RGBA_Gfx_Func (*composite_pixel_span_get)(RGBA_Image *src, RGBA_Image *dst, int pixels);
973 RGBA_Gfx_Func (*composite_color_span_get)(DATA32 col, RGBA_Image *dst, int pixels);
974 RGBA_Gfx_Func (*composite_pixel_color_span_get)(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels);
975 RGBA_Gfx_Func (*composite_mask_color_span_get)(DATA32 col, RGBA_Image *dst, int pixels);
976 RGBA_Gfx_Func (*composite_pixel_mask_span_get)(RGBA_Image *src, RGBA_Image *dst, int pixels);
978 RGBA_Gfx_Pt_Func (*composite_pixel_pt_get)(Image_Entry_Flags src_flags, RGBA_Image *dst);
979 RGBA_Gfx_Pt_Func (*composite_color_pt_get)(DATA32 col, RGBA_Image *dst);
980 RGBA_Gfx_Pt_Func (*composite_pixel_color_pt_get)(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst);
981 RGBA_Gfx_Pt_Func (*composite_mask_color_pt_get)(DATA32 col, RGBA_Image *dst);
982 RGBA_Gfx_Pt_Func (*composite_pixel_mask_pt_get)(Image_Entry_Flags src_flags, RGBA_Image *dst);
985 #define EVAS_RECT_SPLIT 1
986 #ifdef EVAS_RECT_SPLIT
987 typedef struct list_node list_node_t;
988 typedef struct list list_t;
989 typedef struct rect rect_t;
990 typedef struct rect_node rect_node_t;
994 struct list_node *next;
999 struct list_node *head;
1000 struct list_node *tail;
1016 struct list_node _lst;
1020 void rect_list_node_pool_set_max(int max);
1021 void rect_list_node_pool_flush(void);
1022 list_node_t *rect_list_node_pool_get(void);
1023 void rect_list_node_pool_put(list_node_t *node);
1025 void rect_init(rect_t *r, int x, int y, int w, int h);
1026 void rect_list_append_node(list_t *rects, list_node_t *node);
1027 void rect_list_append(list_t *rects, const rect_t r);
1028 void rect_list_append_xywh(list_t *rects, int x, int y, int w, int h);
1029 void rect_list_concat(list_t *rects, list_t *other);
1030 list_node_t *rect_list_unlink_next(list_t *rects, list_node_t *parent_node);
1031 void rect_list_del_next(list_t *rects, list_node_t *parent_node);
1032 void rect_list_clear(list_t *rects);
1033 void rect_list_del_split_strict(list_t *rects, const rect_t del_r);
1034 void rect_list_add_split_strict(list_t *rects, list_node_t *node);
1035 list_node_t *rect_list_add_split_fuzzy(list_t *rects, list_node_t *node, int accepted_error);
1036 void rect_list_merge_rects(list_t *rects, list_t *to_merge, int accepted_error);void rect_list_add_split_fuzzy_and_merge(list_t *rects, list_node_t *node, int split_accepted_error, int merge_accepted_error);
1038 void rect_print(const rect_t r);
1039 void rect_list_print(const list_t rects);
1040 #endif /* EVAS_RECT_SPLIT */
1053 #elif defined(EVAS_RECT_SPLIT)
1059 Tilebuf_Tile *tiles;
1064 struct _Tilebuf_Tile
1066 Eina_Bool redraw : 1;
1067 /* FIXME: need these flags later - but not now */
1079 struct _Tilebuf_Rect
1102 Convert_Pal_Mode colors;
1109 /*****************************************************************************/
1110 #include "evas_macros.h"
1112 #ifndef WORDS_BIGENDIAN
1114 #define A_VAL(p) (((DATA8 *)(p))[3])
1115 #define R_VAL(p) (((DATA8 *)(p))[2])
1116 #define G_VAL(p) (((DATA8 *)(p))[1])
1117 #define B_VAL(p) (((DATA8 *)(p))[0])
1118 #define AR_VAL(p) ((DATA16 *)(p)[1])
1119 #define GB_VAL(p) ((DATA16 *)(p)[0])
1122 #define A_VAL(p) (((DATA8 *)(p))[0])
1123 #define R_VAL(p) (((DATA8 *)(p))[1])
1124 #define G_VAL(p) (((DATA8 *)(p))[2])
1125 #define B_VAL(p) (((DATA8 *)(p))[3])
1126 #define AR_VAL(p) ((DATA16 *)(p)[0])
1127 #define GB_VAL(p) ((DATA16 *)(p)[1])
1130 #define RGB_JOIN(r,g,b) \
1131 (((r) << 16) + ((g) << 8) + (b))
1133 #define ARGB_JOIN(a,r,g,b) \
1134 (((a) << 24) + ((r) << 16) + ((g) << 8) + (b))
1136 #include "evas_blend_ops.h"
1138 #define _EVAS_RENDER_FILL -1
1139 #define _EVAS_RENDER_BLEND 0
1140 #define _EVAS_RENDER_BLEND_REL 1
1141 #define _EVAS_RENDER_COPY 2
1142 #define _EVAS_RENDER_COPY_REL 3
1143 #define _EVAS_RENDER_ADD 4
1144 #define _EVAS_RENDER_ADD_REL 5
1145 #define _EVAS_RENDER_SUB 6
1146 #define _EVAS_RENDER_SUB_REL 7
1147 #define _EVAS_RENDER_TINT 8
1148 #define _EVAS_RENDER_TINT_REL 9
1149 #define _EVAS_RENDER_MASK 10
1150 #define _EVAS_RENDER_MUL 11
1151 #define _EVAS_RENDER_CLIP 12
1153 #define _EVAS_TEXTURE_REFLECT 0
1154 #define _EVAS_TEXTURE_REPEAT 1
1155 #define _EVAS_TEXTURE_RESTRICT 2
1156 #define _EVAS_TEXTURE_RESTRICT_REFLECT 3
1157 #define _EVAS_TEXTURE_RESTRICT_REPEAT 4
1158 #define _EVAS_TEXTURE_PAD 5
1160 #define _EVAS_COLOR_SPACE_ARGB 0
1161 #define _EVAS_COLOR_SPACE_AHSV 1
1163 /*****************************************************************************/
1170 void evas_common_init (void);
1171 void evas_common_shutdown (void);
1173 EAPI void evas_common_cpu_init (void);
1175 int evas_common_cpu_have_cpuid (void);
1176 int evas_common_cpu_has_feature (unsigned int feature);
1177 EAPI void evas_common_cpu_can_do (int *mmx, int *sse, int *sse2);
1178 EAPI void evas_common_cpu_end_opt (void);
1181 #include "../engines/common/evas_blend.h"
1183 EAPI Gfx_Func_Copy evas_common_draw_func_copy_get (int pixels, int reverse);
1186 #include "../engines/common/evas_convert_color.h"
1187 #include "../engines/common/evas_convert_colorspace.h"
1188 #include "../engines/common/evas_convert_main.h"
1189 #include "../engines/common/evas_convert_yuv.h"
1190 #include "../engines/common/evas_scale_main.h"
1191 #include "../engines/common/evas_scale_smooth.h"
1192 #include "../engines/common/evas_scale_span.h"
1195 #include "../engines/common/evas_image.h"
1198 #include "../engines/common/evas_line.h"
1199 #include "../engines/common/evas_polygon.h"
1200 #include "../engines/common/evas_rectangle.h"
1203 EAPI void evas_common_blit_init (void);
1205 EAPI void evas_common_blit_rectangle (const RGBA_Image *src, RGBA_Image *dst, int src_x, int src_y, int w, int h, int dst_x, int dst_y);
1208 #include "../engines/common/evas_font.h"
1211 EAPI void evas_common_tilebuf_init (void);
1213 EAPI Tilebuf *evas_common_tilebuf_new (int w, int h);
1214 EAPI void evas_common_tilebuf_free (Tilebuf *tb);
1215 EAPI void evas_common_tilebuf_set_tile_size (Tilebuf *tb, int tw, int th);
1216 EAPI void evas_common_tilebuf_get_tile_size (Tilebuf *tb, int *tw, int *th);
1217 EAPI int evas_common_tilebuf_add_redraw (Tilebuf *tb, int x, int y, int w, int h);
1218 EAPI int evas_common_tilebuf_del_redraw (Tilebuf *tb, int x, int y, int w, int h);
1219 EAPI int evas_common_tilebuf_add_motion_vector (Tilebuf *tb, int x, int y, int w, int h, int dx, int dy, int alpha);
1220 EAPI void evas_common_tilebuf_clear (Tilebuf *tb);
1221 EAPI Tilebuf_Rect *evas_common_tilebuf_get_render_rects (Tilebuf *tb);
1222 EAPI void evas_common_tilebuf_free_render_rects (Tilebuf_Rect *rects);
1225 Regionbuf *evas_common_regionbuf_new (int w, int h);
1226 void evas_common_regionbuf_free (Regionbuf *rb);
1227 void evas_common_regionbuf_clear (Regionbuf *rb);
1228 void evas_common_regionbuf_span_add (Regionbuf *rb, int x1, int x2, int y);
1229 void evas_common_regionbuf_span_del (Regionbuf *rb, int x1, int x2, int y);
1230 Tilebuf_Rect *evas_common_regionbuf_rects_get (Regionbuf *rb);
1234 #include "../engines/common/evas_draw.h"
1236 #include "../engines/common/evas_map_image.h"
1239 #ifdef BUILD_PIPE_RENDER
1240 # include "../engines/common/evas_pipe.h"
1243 void evas_font_dir_cache_free(void);
1247 /*****************************************************************************/