5 # include "config.h" /* so that EAPI in Evas.h is correctly defined */
15 /* macros needed to log message through eina_log */
16 extern EAPI int _evas_log_dom_global;
17 #ifdef _EVAS_DEFAULT_LOG_DOM
18 # undef _EVAS_DEFAULT_LOG_DOM
20 #define _EVAS_DEFAULT_LOG_DOM _evas_log_dom_global
22 #ifdef EVAS_DEFAULT_LOG_COLOR
23 # undef EVAS_DEFAULT_LOG_COLOR
25 #define EVAS_DEFAULT_LOG_COLOR EINA_COLOR_BLUE
30 #define ERR(...) EINA_LOG_DOM_ERR(_EVAS_DEFAULT_LOG_DOM, __VA_ARGS__)
35 #define DBG(...) EINA_LOG_DOM_DBG(_EVAS_DEFAULT_LOG_DOM, __VA_ARGS__)
40 #define INF(...) EINA_LOG_DOM_INFO(_EVAS_DEFAULT_LOG_DOM, __VA_ARGS__)
45 #define WRN(...) EINA_LOG_DOM_WARN(_EVAS_DEFAULT_LOG_DOM, __VA_ARGS__)
50 #define CRIT(...) EINA_LOG_DOM_CRIT(_EVAS_DEFAULT_LOG_DOM, __VA_ARGS__)
52 /************************ Unicode stuff **************************/
53 #include "../engines/common/evas_encoding.h"
54 /*****************************************************************/
56 #include "evas_options.h"
58 #if defined(__ARM_ARCH_3M__)
59 # define __ARM_ARCH__ 40
61 #if defined(__ARM_ARCH_4__)
62 # define __ARM_ARCH__ 40
64 #if defined(__ARM_ARCH_4T__)
65 # define __ARM_ARCH__ 41
68 #if defined(__ARM_ARCH_5__)
69 # define __ARM_ARCH__ 50
71 #if defined(__ARM_ARCH_5T__)
72 # define __ARM_ARCH__ 51
74 #if defined(__ARM_ARCH_5E__)
75 # define __ARM_ARCH__ 52
77 #if defined(__ARM_ARCH_5TE__)
78 # define __ARM_ARCH__ 53
80 #if defined(__ARM_ARCH_5TEJ__)
81 # define __ARM_ARCH__ 54
84 #if defined(__ARM_ARCH_6__)
85 # define __ARM_ARCH__ 60
87 #if defined(__ARM_ARCH_6J__)
88 # define __ARM_ARCH__ 61
90 #if defined(__ARM_ARCH_6K__)
91 # define __ARM_ARCH__ 62
93 #if defined(__ARM_ARCH_6Z__)
94 # define __ARM_ARCH__ 63
96 #if defined(__ARM_ARCH_6ZK__)
97 # define __ARM_ARCH__ 64
99 #if defined(__ARM_ARCH_6T2__)
100 # define __ARM_ARCH__ 65
103 #if defined(__ARM_ARCH_7__)
104 # define __ARM_ARCH__ 70
106 #if defined(__ARM_ARCH_7A__)
107 # define __ARM_ARCH__ 71
109 #if defined(__ARM_ARCH_7R__)
110 # define __ARM_ARCH__ 72
112 #if defined(__ARM_ARCH_7M__)
113 # define __ARM_ARCH__ 73
120 #ifndef BUILD_PTHREAD
121 # undef BUILD_PIPE_RENDER
124 #if defined(BUILD_ASYNC_PRELOAD) && !defined(BUILD_PTHREAD)
125 # define BUILD_PTHREAD
134 # include <pthread.h>
136 # define LK(x) pthread_mutex_t x
137 #ifndef EVAS_FRAME_QUEUING
138 # define LKI(x) pthread_mutex_init(&(x), NULL);
140 # define LKI(x) {pthread_mutexattr_t attr;\
141 pthread_mutexattr_init(&attr); \
142 pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE); \
143 pthread_mutex_init(&(x), &attr);}
145 # define LKD(x) pthread_mutex_destroy(&(x));
146 # define LKL(x) pthread_mutex_lock(&(x));
147 # define LKT(x) pthread_mutex_trylock(&(x));
148 # define LKU(x) pthread_mutex_unlock(&(x));
149 # define TH(x) pthread_t x
150 # define THI(x) int x
154 #define RWLK(x) pthread_rwlock_t x
155 #define RWLKI(x) pthread_rwlock_init(&(x), NULL);
156 #define RWLKD(x) pthread_rwlock_destroy(&(x));
157 #define RDLKL(x) pthread_rwlock_rdlock(&(x));
158 #define WRLKL(x) pthread_rwlock_wrlock(&(x));
159 #define RWLKU(x) pthread_rwlock_unlock(&(x));
162 // even though in theory having every Nth rendered line done by a different
163 // thread might even out load across threads - it actually slows things down.
189 #elif defined __GNUC__
190 # define alloca __builtin_alloca
192 # define alloca __alloca
193 #elif defined _MSC_VER
195 # define alloca _alloca
201 void *alloca (size_t);
207 #include <sys/types.h>
208 #include <sys/stat.h>
216 #include <ft2build.h>
217 #include FT_FREETYPE_H
224 // BROKEN in gcc 4 on amd64
225 //# pragma GCC visibility push(hidden)
227 #define LIKELY(x) __builtin_expect(!!(x), 1)
228 #define UNLIKELY(x) __builtin_expect(!!(x), 0)
230 #define LIKELY(x) (x)
231 #define UNLIKELY(x) (x)
234 /*****************************************************************************/
236 /* use exact rects for updates not tiles */
237 /* #define RECTUPDATE */
239 #define IMG_MAX_SIZE 65000
241 #define IMG_TOO_BIG(w, h) \
242 ((((unsigned long long)w) * ((unsigned long long)h)) >= \
243 ((1ULL << (29 * (sizeof(void *) / 4))) - 2048))
245 #ifdef BUILD_SMALL_DITHER_MASK
246 # define DM_TABLE _evas_dither_44
250 # define USE_DITHER_44 1
251 # define DM_MSK (DM_SIZE - 1)
252 # define DM_SHF(_b) (DM_BITS - (8 - _b))
254 # define DM_TABLE _evas_dither_128128
258 # define USE_DITHER_128128 1
259 # define DM_MSK (DM_SIZE - 1)
260 # define DM_SHF(_b) (DM_BITS - (8 - _b))
263 /* if more than 1/ALPHA_SPARSE_INV_FRACTION is "alpha" (1-254) then sparse
264 * alpha flag gets set */
265 #define ALPHA_SPARSE_INV_FRACTION 3
267 /*****************************************************************************/
269 #if defined(__ARM_ARCH_3M__)
270 # define __ARM_ARCH__ 40
272 #if defined(__ARM_ARCH_4__)
273 # define __ARM_ARCH__ 40
275 #if defined(__ARM_ARCH_4T__)
276 # define __ARM_ARCH__ 41
279 #if defined(__ARM_ARCH_5__)
280 # define __ARM_ARCH__ 50
282 #if defined(__ARM_ARCH_5T__)
283 # define __ARM_ARCH__ 51
285 #if defined(__ARM_ARCH_5E__)
286 # define __ARM_ARCH__ 52
288 #if defined(__ARM_ARCH_5TE__)
289 # define __ARM_ARCH__ 53
291 #if defined(__ARM_ARCH_5TEJ__)
292 # define __ARM_ARCH__ 54
295 #if defined(__ARM_ARCH_6__)
296 # define __ARM_ARCH__ 60
298 #if defined(__ARM_ARCH_6J__)
299 # define __ARM_ARCH__ 61
301 #if defined(__ARM_ARCH_6K__)
302 # define __ARM_ARCH__ 62
304 #if defined(__ARM_ARCH_6Z__)
305 # define __ARM_ARCH__ 63
307 #if defined(__ARM_ARCH_6ZK__)
308 # define __ARM_ARCH__ 64
310 #if defined(__ARM_ARCH_6T2__)
311 # define __ARM_ARCH__ 65
314 #if defined(__ARM_ARCH_7__)
315 # define __ARM_ARCH__ 70
317 #if defined(__ARM_ARCH_7A__)
318 # define __ARM_ARCH__ 71
320 #if defined(__ARM_ARCH_7R__)
321 # define __ARM_ARCH__ 72
323 #if defined(__ARM_ARCH_7M__)
324 # define __ARM_ARCH__ 73
327 #if defined(__ARM_ARCH__) && (__ARM_ARCH__ >= 52)
328 /* tested on ARMv6 (arm1136j-s), Nokia N800 CPU */
329 #define pld(addr, off) \
330 __asm__("pld [%[address], %[offset]]":: \
331 [address] "r" (addr), [offset] "i" (off))
333 #define pld(addr, off)
334 #endif /* __ARMEL__ */
336 /*****************************************************************************/
338 #define UNROLL2(op...) op op
339 #define UNROLL4(op...) UNROLL2(op) UNROLL2(op)
340 #define UNROLL8(op...) UNROLL4(op) UNROLL4(op)
341 #define UNROLL16(op...) UNROLL8(op) UNROLL8(op)
343 #define UNROLL8_PLD_WHILE(start, size, end, op) \
345 end = start + (size & ~7); \
346 while (start < end) \
353 while (start < end) \
358 /*****************************************************************************/
360 typedef unsigned long long DATA64;
361 typedef unsigned int DATA32;
362 typedef unsigned short DATA16;
363 typedef unsigned char DATA8;
365 typedef struct _Image_Entry Image_Entry;
366 typedef struct _Image_Entry_Flags Image_Entry_Flags;
367 typedef struct _Engine_Image_Entry Engine_Image_Entry;
368 typedef struct _Evas_Cache_Target Evas_Cache_Target;
369 typedef struct _Evas_Preload_Pthread Evas_Preload_Pthread;
371 typedef struct _RGBA_Image_Loadopts RGBA_Image_Loadopts;
372 #ifdef BUILD_PIPE_RENDER
373 typedef struct _RGBA_Pipe_Op RGBA_Pipe_Op;
374 typedef struct _RGBA_Pipe RGBA_Pipe;
375 typedef struct _RGBA_Pipe_Thread_Info RGBA_Pipe_Thread_Info;
377 typedef struct _RGBA_Image RGBA_Image;
378 typedef struct _RGBA_Image_Span RGBA_Image_Span;
379 typedef struct _RGBA_Draw_Context RGBA_Draw_Context;
380 typedef struct _RGBA_Gradient RGBA_Gradient;
381 typedef struct _RGBA_Gradient_Color_Stop RGBA_Gradient_Color_Stop;
382 typedef struct _RGBA_Gradient_Alpha_Stop RGBA_Gradient_Alpha_Stop;
383 typedef struct _RGBA_Gradient_Type RGBA_Gradient_Type;
384 typedef struct _RGBA_Gradient2 RGBA_Gradient2;
385 typedef struct _RGBA_Gradient2_Type RGBA_Gradient2_Type;
386 typedef struct _RGBA_Gradient2_Color_Np_Stop RGBA_Gradient2_Color_Np_Stop;
387 typedef struct _RGBA_Polygon_Point RGBA_Polygon_Point;
388 typedef struct _RGBA_Map_Point RGBA_Map_Point;
389 typedef struct _RGBA_Font RGBA_Font;
390 typedef struct _RGBA_Font_Int RGBA_Font_Int;
391 typedef struct _RGBA_Font_Source RGBA_Font_Source;
392 typedef struct _RGBA_Font_Glyph RGBA_Font_Glyph;
393 typedef struct _RGBA_Gfx_Compositor RGBA_Gfx_Compositor;
395 typedef struct _Cutout_Rect Cutout_Rect;
396 typedef struct _Cutout_Rects Cutout_Rects;
398 typedef struct _Convert_Pal Convert_Pal;
400 typedef struct _Tilebuf Tilebuf;
401 typedef struct _Tilebuf_Tile Tilebuf_Tile;
402 typedef struct _Tilebuf_Rect Tilebuf_Rect;
404 typedef struct _Evas_Common_Transform Evas_Common_Transform;
407 // all coords are 20.12
408 // fp type - an int for now
410 // fp # of bits of float accuracy
412 // fp half (half of an fp unit)
413 #define FPH (1 << (FP - 1))
415 #define FP1 (1 << (FP))
418 typedef struct _Regionbuf Regionbuf;
419 typedef struct _Regionspan Regionspan;
422 typedef void (*RGBA_Gfx_Func) (DATA32 *src, DATA8 *mask, DATA32 col, DATA32 *dst, int len);
423 typedef void (*RGBA_Gfx_Pt_Func) (DATA32 src, DATA8 mask, DATA32 col, DATA32 *dst);
424 typedef void (*Gfx_Func_Copy) (DATA32 *src, DATA32 *dst, int len);
426 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);
428 typedef void (*Gfx_Func_Gradient_Fill)(DATA32 *src, int src_len,
429 DATA32 *dst, DATA8 *mask, int len,
430 int x, int y, int axx, int axy, int ayx, int ayy,
433 typedef void (*Gfx_Func_Gradient2_Fill)(DATA32 *src, int src_len,
434 DATA32 *dst, DATA8 *mask, int len,
438 #include "../cache/evas_cache.h"
440 /*****************************************************************************/
442 typedef enum _RGBA_Image_Flags
444 RGBA_IMAGE_NOTHING = (0),
445 /* RGBA_IMAGE_HAS_ALPHA = (1 << 0), */
446 RGBA_IMAGE_IS_DIRTY = (1 << 1),
447 RGBA_IMAGE_INDEXED = (1 << 2),
448 RGBA_IMAGE_ALPHA_ONLY = (1 << 3),
449 RGBA_IMAGE_ALPHA_TILES = (1 << 4),
450 /* RGBA_IMAGE_ALPHA_SPARSE = (1 << 5), */
451 /* RGBA_IMAGE_LOADED = (1 << 6), */
452 /* RGBA_IMAGE_NEED_DATA = (1 << 7) */
453 RGBA_IMAGE_TODO_LOAD = (1 << 8),
456 typedef enum _Convert_Pal_Mode
474 typedef enum _CPU_Features
477 CPU_FEATURE_MMX = (1 << 0),
478 CPU_FEATURE_MMX2 = (1 << 1),
479 CPU_FEATURE_SSE = (1 << 2),
480 CPU_FEATURE_ALTIVEC = (1 << 3),
481 CPU_FEATURE_VIS = (1 << 4),
482 CPU_FEATURE_VIS2 = (1 << 5),
483 CPU_FEATURE_NEON = (1 << 6)
486 typedef enum _Font_Hint_Flags
493 /*****************************************************************************/
495 struct _RGBA_Image_Loadopts
497 int scale_down_by; // if > 1 then use this
498 double dpi; // if > 0.0 use this
499 int w, h; // if > 0 use this
505 struct _Image_Entry_Flags
507 Eina_Bool loaded : 1;
508 Eina_Bool in_progress : 1;
511 Eina_Bool need_data : 1;
512 Eina_Bool lru_nodata : 1;
513 Eina_Bool cached : 1;
515 Eina_Bool alpha_sparse : 1;
516 #ifdef BUILD_ASYNC_PRELOAD
517 Eina_Bool preload_done : 1;
518 Eina_Bool delete_me : 1;
519 Eina_Bool pending : 1;
523 struct _Evas_Cache_Target
534 Evas_Cache_Image *cache;
536 const char *cache_key;
541 Evas_Cache_Target *targets;
542 Evas_Preload_Pthread *preload;
548 #ifdef EVAS_FRAME_QUEUING
549 LK(lock_references); // needed for accessing references
552 #ifdef BUILD_PIPE_RENDER
554 #ifdef EVAS_FRAME_QUEUING
557 pthread_cond_t cond_fq_del;
558 int ref_fq[2]; // ref_fq[0] is for addition, ref_fq[1] is for deletion
564 RGBA_Image_Loadopts load_opts;
581 #ifdef BUILD_ASYNC_PRELOAD
585 Image_Entry_Flags flags;
586 Evas_Image_Scale_Hint scale_hint;
593 struct _Engine_Image_Entry
597 /* Upper Engine data. */
601 Evas_Cache_Engine_Image *cache;
602 const char *cache_key;
606 Eina_Bool cached : 1;
609 Eina_Bool loaded : 1;
610 Eina_Bool need_parent : 1;
630 struct _Evas_Common_Transform
637 struct _RGBA_Draw_Context
646 struct RGBA_Draw_Context_clip {
653 void *(*gl_new) (void *data, RGBA_Font_Glyph *fg);
654 void (*gl_free) (void *ext_dat);
655 void (*gl_draw) (void *data, void *dest, void *context, RGBA_Font_Glyph *fg, int x, int y);
666 Eina_Bool anti_alias : 1;
669 #ifdef BUILD_PIPE_RENDER
670 #include "../engines/common/evas_map_image.h"
671 #include "../engines/common/evas_bidi_utils.h"
675 RGBA_Draw_Context context;
676 void (*op_func) (RGBA_Image *dst, RGBA_Pipe_Op *op, RGBA_Pipe_Thread_Info *info);
677 void (*free_func) (RGBA_Pipe_Op *op);
687 RGBA_Polygon_Point *points;
694 RGBA_Gradient2 *grad;
701 const Evas_BiDi_Props *intl_props;
705 int sx, sy, sw, sh, dx, dy, dw, dh;
724 RGBA_Pipe_Op op[PIPE_LEN];
727 struct _RGBA_Pipe_Thread_Info
736 Image_Entry cache_entry;
738 RGBA_Image_Flags flags;
743 /* char *real_file; */
751 /* unsigned char scale; */
753 /* Colorspace stuff. */
756 Eina_Bool no_free : 1;
763 Eina_Bool no_free : 1;
769 unsigned long long orig_usage;
770 unsigned long long usage_count;
772 unsigned long long newest_usage;
773 unsigned long long newest_usage_count;
777 struct _RGBA_Gradient_Color_Stop
784 struct _RGBA_Gradient_Alpha_Stop
791 struct _RGBA_Gradient
800 Eina_Bool has_alpha : 1;
826 RGBA_Gradient_Type *geometer;
831 #ifdef EVAS_FRAME_QUEUING
834 pthread_cond_t cond_fq_del;
835 int ref_fq[2]; //ref_fq[0] is for addition,
836 //ref_fq[1] is for deletion
839 Eina_Bool imported_data : 1;
840 Eina_Bool has_alpha : 1;
843 struct _RGBA_Gradient_Type
847 void (*shutdown)(void);
848 void (*geom_init)(RGBA_Gradient *gr);
849 void (*geom_set)(RGBA_Gradient *gr);
850 void (*geom_free)(void *gdata);
851 int (*has_alpha)(RGBA_Gradient *gr, int render_op);
852 int (*has_mask)(RGBA_Gradient *gr, int render_op);
853 int (*get_map_len)(RGBA_Gradient *gr);
854 Gfx_Func_Gradient_Fill (*get_fill_func)(RGBA_Gradient *gr, int render_op, unsigned char aa);
857 struct _RGBA_Gradient2_Color_Np_Stop
865 struct _RGBA_Gradient2
871 Eina_Bool has_alpha : 1;
884 Evas_Common_Transform transform;
890 RGBA_Gradient2_Type *geometer;
895 #ifdef EVAS_FRAME_QUEUING
898 pthread_cond_t cond_fq_del;
899 int ref_fq[2]; //ref_fq[0] is for addition,
900 //ref_fq[1] is for deletion
903 Eina_Bool has_alpha : 1;
906 struct _RGBA_Gradient2_Type
910 void (*shutdown)(void);
911 void (*geom_init)(RGBA_Gradient2 *gr);
912 void (*geom_update)(RGBA_Gradient2 *gr);
913 void (*geom_free)(void *gdata);
914 int (*has_alpha)(RGBA_Gradient2 *gr, int render_op);
915 int (*has_mask)(RGBA_Gradient2 *gr, int render_op);
916 int (*get_map_len)(RGBA_Gradient2 *gr);
917 Gfx_Func_Gradient2_Fill (*get_fill_func)(RGBA_Gradient2 *gr, int render_op);
921 struct _RGBA_Polygon_Point
927 struct _RGBA_Map_Point
929 FPc x, y; // x, y screenspace
930 FPc z; // z in world space. optional
931 FPc u, v; // u, v in tex coords
932 DATA32 col; // color at this point
937 typedef struct _Fash_Item_Index_Map Fash_Item_Index_Map;
938 typedef struct _Fash_Int_Map Fash_Int_Map;
939 typedef struct _Fash_Int Fash_Int;
940 struct _Fash_Item_Index_Map
947 Fash_Item_Index_Map item[256];
951 Fash_Int_Map *bucket[256];
952 void (*freeme) (Fash_Int *fash);
956 typedef struct _Fash_Glyph_Map Fash_Glyph_Map;
957 typedef struct _Fash_Glyph Fash_Glyph;
958 struct _Fash_Glyph_Map
960 RGBA_Font_Glyph *item[256];
964 Fash_Glyph_Map *bucket[256];
965 void (*freeme) (Fash_Glyph *fash);
972 Font_Hint_Flags hinting;
975 unsigned char sizeok : 1;
977 #ifdef EVAS_FRAME_QUEUING
980 pthread_cond_t cond_fq_del;
981 int ref_fq[2]; //ref_fq[0] is for addition, ref_fq[1] is for deletion
985 struct _RGBA_Font_Int
987 RGBA_Font_Source *src;
997 // Eina_Hash *glyphs;
1002 // Eina_Hash *indexes;
1005 Font_Hint_Flags hinting;
1010 unsigned char sizeok : 1;
1013 struct _RGBA_Font_Source
1030 struct _RGBA_Font_Glyph
1034 FT_BitmapGlyph glyph_out;
1035 /* this is a problem - only 1 engine at a time can extend such a font... grrr */
1037 void (*ext_dat_free) (void *ext_dat);
1041 struct _RGBA_Gfx_Compositor
1046 void (*shutdown)(void);
1048 RGBA_Gfx_Func (*composite_pixel_span_get)(RGBA_Image *src, RGBA_Image *dst, int pixels);
1049 RGBA_Gfx_Func (*composite_color_span_get)(DATA32 col, RGBA_Image *dst, int pixels);
1050 RGBA_Gfx_Func (*composite_pixel_color_span_get)(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels);
1051 RGBA_Gfx_Func (*composite_mask_color_span_get)(DATA32 col, RGBA_Image *dst, int pixels);
1052 RGBA_Gfx_Func (*composite_pixel_mask_span_get)(RGBA_Image *src, RGBA_Image *dst, int pixels);
1054 RGBA_Gfx_Pt_Func (*composite_pixel_pt_get)(Image_Entry_Flags src_flags, RGBA_Image *dst);
1055 RGBA_Gfx_Pt_Func (*composite_color_pt_get)(DATA32 col, RGBA_Image *dst);
1056 RGBA_Gfx_Pt_Func (*composite_pixel_color_pt_get)(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst);
1057 RGBA_Gfx_Pt_Func (*composite_mask_color_pt_get)(DATA32 col, RGBA_Image *dst);
1058 RGBA_Gfx_Pt_Func (*composite_pixel_mask_pt_get)(Image_Entry_Flags src_flags, RGBA_Image *dst);
1061 #define EVAS_RECT_SPLIT 1
1062 #ifdef EVAS_RECT_SPLIT
1063 typedef struct list_node list_node_t;
1064 typedef struct list list_t;
1065 typedef struct rect rect_t;
1066 typedef struct rect_node rect_node_t;
1070 struct list_node *next;
1075 struct list_node *head;
1076 struct list_node *tail;
1092 struct list_node _lst;
1096 void rect_list_node_pool_set_max(int max);
1097 void rect_list_node_pool_flush(void);
1098 list_node_t *rect_list_node_pool_get(void);
1099 void rect_list_node_pool_put(list_node_t *node);
1101 void rect_init(rect_t *r, int x, int y, int w, int h);
1102 void rect_list_append_node(list_t *rects, list_node_t *node);
1103 void rect_list_append(list_t *rects, const rect_t r);
1104 void rect_list_append_xywh(list_t *rects, int x, int y, int w, int h);
1105 void rect_list_concat(list_t *rects, list_t *other);
1106 list_node_t *rect_list_unlink_next(list_t *rects, list_node_t *parent_node);
1107 void rect_list_del_next(list_t *rects, list_node_t *parent_node);
1108 void rect_list_clear(list_t *rects);
1109 void rect_list_del_split_strict(list_t *rects, const rect_t del_r);
1110 void rect_list_add_split_strict(list_t *rects, list_node_t *node);
1111 list_node_t *rect_list_add_split_fuzzy(list_t *rects, list_node_t *node, int accepted_error);
1112 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);
1114 void rect_print(const rect_t r);
1115 void rect_list_print(const list_t rects);
1116 #endif /* EVAS_RECT_SPLIT */
1129 #elif defined(EVAS_RECT_SPLIT)
1135 Tilebuf_Tile *tiles;
1140 struct _Tilebuf_Tile
1142 Eina_Bool redraw : 1;
1143 /* FIXME: need these flags later - but not now */
1155 struct _Tilebuf_Rect
1178 Convert_Pal_Mode colors;
1185 /*****************************************************************************/
1186 #include "evas_macros.h"
1188 #ifndef WORDS_BIGENDIAN
1190 #define A_VAL(p) ((DATA8 *)(p))[3]
1191 #define R_VAL(p) ((DATA8 *)(p))[2]
1192 #define G_VAL(p) ((DATA8 *)(p))[1]
1193 #define B_VAL(p) ((DATA8 *)(p))[0]
1194 #define AR_VAL(p) ((DATA16 *)(p)[1])
1195 #define GB_VAL(p) ((DATA16 *)(p)[0])
1198 #define A_VAL(p) ((DATA8 *)(p))[0]
1199 #define R_VAL(p) ((DATA8 *)(p))[1]
1200 #define G_VAL(p) ((DATA8 *)(p))[2]
1201 #define B_VAL(p) ((DATA8 *)(p))[3]
1202 #define AR_VAL(p) ((DATA16 *)(p)[0])
1203 #define GB_VAL(p) ((DATA16 *)(p)[1])
1206 #define RGB_JOIN(r,g,b) \
1207 (((r) << 16) + ((g) << 8) + (b))
1209 #define ARGB_JOIN(a,r,g,b) \
1210 (((a) << 24) + ((r) << 16) + ((g) << 8) + (b))
1212 #include "evas_blend_ops.h"
1214 #define _EVAS_RENDER_FILL -1
1215 #define _EVAS_RENDER_BLEND 0
1216 #define _EVAS_RENDER_BLEND_REL 1
1217 #define _EVAS_RENDER_COPY 2
1218 #define _EVAS_RENDER_COPY_REL 3
1219 #define _EVAS_RENDER_ADD 4
1220 #define _EVAS_RENDER_ADD_REL 5
1221 #define _EVAS_RENDER_SUB 6
1222 #define _EVAS_RENDER_SUB_REL 7
1223 #define _EVAS_RENDER_TINT 8
1224 #define _EVAS_RENDER_TINT_REL 9
1225 #define _EVAS_RENDER_MASK 10
1226 #define _EVAS_RENDER_MUL 11
1227 #define _EVAS_RENDER_CLIP 12
1229 #define _EVAS_TEXTURE_REFLECT 0
1230 #define _EVAS_TEXTURE_REPEAT 1
1231 #define _EVAS_TEXTURE_RESTRICT 2
1232 #define _EVAS_TEXTURE_RESTRICT_REFLECT 3
1233 #define _EVAS_TEXTURE_RESTRICT_REPEAT 4
1234 #define _EVAS_TEXTURE_PAD 5
1236 #define _EVAS_COLOR_SPACE_ARGB 0
1237 #define _EVAS_COLOR_SPACE_AHSV 1
1239 /*****************************************************************************/
1246 void evas_common_init (void);
1247 void evas_common_shutdown (void);
1249 EAPI void evas_common_cpu_init (void);
1251 int evas_common_cpu_have_cpuid (void);
1252 int evas_common_cpu_has_feature (unsigned int feature);
1253 EAPI void evas_common_cpu_can_do (int *mmx, int *sse, int *sse2);
1254 EAPI void evas_common_cpu_end_opt (void);
1257 #include "../engines/common/evas_blend.h"
1259 EAPI Gfx_Func_Copy evas_common_draw_func_copy_get (int pixels, int reverse);
1262 #include "../engines/common/evas_convert_color.h"
1263 #include "../engines/common/evas_convert_colorspace.h"
1264 #include "../engines/common/evas_convert_main.h"
1265 #include "../engines/common/evas_convert_yuv.h"
1266 #include "../engines/common/evas_scale_main.h"
1267 #include "../engines/common/evas_scale_smooth.h"
1268 #include "../engines/common/evas_scale_span.h"
1271 #include "../engines/common/evas_image.h"
1274 #include "../engines/common/evas_line.h"
1275 #include "../engines/common/evas_polygon.h"
1276 #include "../engines/common/evas_rectangle.h"
1279 EAPI void evas_common_blit_init (void);
1281 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);
1284 #include "../engines/common/evas_gradient.h"
1285 #include "../engines/common/evas_font.h"
1288 EAPI void evas_common_tilebuf_init (void);
1290 EAPI Tilebuf *evas_common_tilebuf_new (int w, int h);
1291 EAPI void evas_common_tilebuf_free (Tilebuf *tb);
1292 EAPI void evas_common_tilebuf_set_tile_size (Tilebuf *tb, int tw, int th);
1293 EAPI void evas_common_tilebuf_get_tile_size (Tilebuf *tb, int *tw, int *th);
1294 EAPI int evas_common_tilebuf_add_redraw (Tilebuf *tb, int x, int y, int w, int h);
1295 EAPI int evas_common_tilebuf_del_redraw (Tilebuf *tb, int x, int y, int w, int h);
1296 EAPI int evas_common_tilebuf_add_motion_vector (Tilebuf *tb, int x, int y, int w, int h, int dx, int dy, int alpha);
1297 EAPI void evas_common_tilebuf_clear (Tilebuf *tb);
1298 EAPI Tilebuf_Rect *evas_common_tilebuf_get_render_rects (Tilebuf *tb);
1299 EAPI void evas_common_tilebuf_free_render_rects (Tilebuf_Rect *rects);
1302 Regionbuf *evas_common_regionbuf_new (int w, int h);
1303 void evas_common_regionbuf_free (Regionbuf *rb);
1304 void evas_common_regionbuf_clear (Regionbuf *rb);
1305 void evas_common_regionbuf_span_add (Regionbuf *rb, int x1, int x2, int y);
1306 void evas_common_regionbuf_span_del (Regionbuf *rb, int x1, int x2, int y);
1307 Tilebuf_Rect *evas_common_regionbuf_rects_get (Regionbuf *rb);
1311 #include "../engines/common/evas_draw.h"
1313 #include "../engines/common/evas_map_image.h"
1316 #ifdef BUILD_PIPE_RENDER
1317 # include "../engines/common/evas_pipe.h"
1320 void evas_font_dir_cache_free(void);
1324 /*****************************************************************************/
1326 //#if defined(__ARM_ARCH__) && (__ARM_ARCH__ >= 70)
1328 # include <arm_neon.h>