5 #include "config.h" /* so that EAPI in Evas.h is correctly defined */
20 # define alloca __builtin_alloca
22 # define alloca __alloca
23 # elif defined _MSC_VER
25 # define alloca _alloca
26 # elif !defined HAVE_ALLOCA
30 void *alloca (size_t);
37 #include <sys/types.h>
59 #include <sys/types.h>
69 //#include "Evas_GL.h"
72 /* right now i dont care about rendering bugs on platforms without lround
73 (e.g. windows/vc++... yay!)
74 FIXME: http://cgit.freedesktop.org/cairo/tree/src/cairo-misc.c#n487
76 #define lround(x) (((x) < 0) ? (long int)ceil((x) - 0.5) : (long int)floor((x) + 0.5))
79 /* macros needed to log message through eina_log */
80 extern EAPI int _evas_log_dom_global;
81 #ifdef _EVAS_DEFAULT_LOG_DOM
82 # undef _EVAS_DEFAULT_LOG_DOM
84 #define _EVAS_DEFAULT_LOG_DOM _evas_log_dom_global
86 #ifdef EVAS_DEFAULT_LOG_COLOR
87 # undef EVAS_DEFAULT_LOG_COLOR
89 #define EVAS_DEFAULT_LOG_COLOR EINA_COLOR_BLUE
94 #define ERR(...) EINA_LOG_DOM_ERR(_EVAS_DEFAULT_LOG_DOM, __VA_ARGS__)
99 #define DBG(...) EINA_LOG_DOM_DBG(_EVAS_DEFAULT_LOG_DOM, __VA_ARGS__)
104 #define INF(...) EINA_LOG_DOM_INFO(_EVAS_DEFAULT_LOG_DOM, __VA_ARGS__)
109 #define WRN(...) EINA_LOG_DOM_WARN(_EVAS_DEFAULT_LOG_DOM, __VA_ARGS__)
114 #define CRIT(...) EINA_LOG_DOM_CRIT(_EVAS_DEFAULT_LOG_DOM, __VA_ARGS__)
116 #include "evas_options.h"
118 #if defined(__ARM_ARCH_3M__)
119 # define __ARM_ARCH__ 40
121 #if defined(__ARM_ARCH_4__)
122 # define __ARM_ARCH__ 40
124 #if defined(__ARM_ARCH_4T__)
125 # define __ARM_ARCH__ 41
128 #if defined(__ARM_ARCH_5__)
129 # define __ARM_ARCH__ 50
131 #if defined(__ARM_ARCH_5T__)
132 # define __ARM_ARCH__ 51
134 #if defined(__ARM_ARCH_5E__)
135 # define __ARM_ARCH__ 52
137 #if defined(__ARM_ARCH_5TE__)
138 # define __ARM_ARCH__ 53
140 #if defined(__ARM_ARCH_5TEJ__)
141 # define __ARM_ARCH__ 54
144 #if defined(__ARM_ARCH_6__)
145 # define __ARM_ARCH__ 60
147 #if defined(__ARM_ARCH_6J__)
148 # define __ARM_ARCH__ 61
150 #if defined(__ARM_ARCH_6K__)
151 # define __ARM_ARCH__ 62
153 #if defined(__ARM_ARCH_6Z__)
154 # define __ARM_ARCH__ 63
156 #if defined(__ARM_ARCH_6ZK__)
157 # define __ARM_ARCH__ 64
159 #if defined(__ARM_ARCH_6T2__)
160 # define __ARM_ARCH__ 65
163 #if defined(__ARM_ARCH_7__)
164 # define __ARM_ARCH__ 70
166 #if defined(__ARM_ARCH_7A__)
167 # define __ARM_ARCH__ 71
169 #if defined(__ARM_ARCH_7R__)
170 # define __ARM_ARCH__ 72
172 #if defined(__ARM_ARCH_7M__)
173 # define __ARM_ARCH__ 73
176 #ifndef BUILD_PTHREAD
177 # undef BUILD_PIPE_RENDER
180 #if defined(BUILD_ASYNC_PRELOAD) && !defined(BUILD_PTHREAD)
181 # define BUILD_PTHREAD
184 #define LK(x) Eina_Lock x
185 #define LKI(x) eina_lock_new(&(x))
186 #define LKD(x) eina_lock_free(&(x))
187 #define LKL(x) eina_lock_take(&(x))
188 #define LKT(x) eina_lock_take_try(&(x))
189 #define LKU(x) eina_lock_release(&(x))
190 #define LKDBG(x) eina_lock_debug(&(x))
193 #define RWLK(x) Eina_RWLock x
194 #define RWLKI(x) eina_rwlock_new(&(x))
195 #define RWLKD(x) eina_rwlock_free(&(x))
196 #define RDLKL(x) eina_rwlock_take_read(&(x))
197 #define WRLKL(x) eina_rwlock_take_write(&(x))
198 #define RWLKU(x) eina_rwlock_release(&(x))
202 # define TH(x) pthread_t x
203 # define THI(x) int x
213 #include <ft2build.h>
214 #include FT_FREETYPE_H
221 // BROKEN in gcc 4 on amd64
222 //# pragma GCC visibility push(hidden)
224 #define LIKELY(x) __builtin_expect(!!(x), 1)
225 #define UNLIKELY(x) __builtin_expect(!!(x), 0)
227 #define LIKELY(x) (x)
228 #define UNLIKELY(x) (x)
231 /*****************************************************************************/
233 /* use exact rects for updates not tiles */
234 /* #define RECTUPDATE */
236 #define IMG_MAX_SIZE 65000
238 #define IMG_TOO_BIG(w, h) \
239 ((((unsigned long long)w) * ((unsigned long long)h)) >= \
240 ((1ULL << (29 * (sizeof(void *) / 4))) - 2048))
242 #ifdef BUILD_SMALL_DITHER_MASK
243 # define DM_TABLE _evas_dither_44
247 # define USE_DITHER_44 1
249 # define DM_TABLE _evas_dither_128128
253 # define USE_DITHER_128128 1
256 #define DM_MSK (DM_SIZE - 1)
257 #define DM_SHF(_b) (DM_BITS - (8 - _b))
258 /* Supports negative right shifts */
259 #define DM_SHR(x, _b) ((DM_SHF(_b) >= 0) ? \
260 ((x) >> DM_SHF(_b)) : ((x) << -DM_SHF(_b)))
262 /* if more than 1/ALPHA_SPARSE_INV_FRACTION is "alpha" (1-254) then sparse
263 * alpha flag gets set */
264 #define ALPHA_SPARSE_INV_FRACTION 3
266 /*****************************************************************************/
268 #if defined(__ARM_ARCH_3M__)
269 # define __ARM_ARCH__ 40
271 #if defined(__ARM_ARCH_4__)
272 # define __ARM_ARCH__ 40
274 #if defined(__ARM_ARCH_4T__)
275 # define __ARM_ARCH__ 41
278 #if defined(__ARM_ARCH_5__)
279 # define __ARM_ARCH__ 50
281 #if defined(__ARM_ARCH_5T__)
282 # define __ARM_ARCH__ 51
284 #if defined(__ARM_ARCH_5E__)
285 # define __ARM_ARCH__ 52
287 #if defined(__ARM_ARCH_5TE__)
288 # define __ARM_ARCH__ 53
290 #if defined(__ARM_ARCH_5TEJ__)
291 # define __ARM_ARCH__ 54
294 #if defined(__ARM_ARCH_6__)
295 # define __ARM_ARCH__ 60
297 #if defined(__ARM_ARCH_6J__)
298 # define __ARM_ARCH__ 61
300 #if defined(__ARM_ARCH_6K__)
301 # define __ARM_ARCH__ 62
303 #if defined(__ARM_ARCH_6Z__)
304 # define __ARM_ARCH__ 63
306 #if defined(__ARM_ARCH_6ZK__)
307 # define __ARM_ARCH__ 64
309 #if defined(__ARM_ARCH_6T2__)
310 # define __ARM_ARCH__ 65
313 #if defined(__ARM_ARCH_7__)
314 # define __ARM_ARCH__ 70
316 #if defined(__ARM_ARCH_7A__)
317 # define __ARM_ARCH__ 71
319 #if defined(__ARM_ARCH_7R__)
320 # define __ARM_ARCH__ 72
322 #if defined(__ARM_ARCH_7M__)
323 # define __ARM_ARCH__ 73
326 #if defined(__ARM_ARCH__) && (__ARM_ARCH__ >= 52)
327 /* tested on ARMv6 (arm1136j-s), Nokia N800 CPU */
328 #define pld(addr, off) \
329 __asm__("pld [%[address], %[offset]]":: \
330 [address] "r" (addr), [offset] "i" (off))
332 #define pld(addr, off)
333 #endif /* __ARMEL__ */
335 // these here are in config.h - just here for documentation
336 //#ifdef __ARM_ARCH__
337 // *IF* you enable pixman, this determines which things pixman will do
338 ////#define PIXMAN_FONT 1
339 ////#define PIXMAN_RECT 1
340 ////#define PIXMAN_LINE 1
341 ////#define PIXMAN_POLY 1
342 //#define PIXMAN_IMAGE 1
343 //#define PIXMAN_IMAGE_SCALE_SAMPLE 1
345 // not related to pixman but an alternate rotate code
346 //#define TILE_ROTATE 1
348 #define TILE_CACHE_LINE_SIZE 64
350 /*****************************************************************************/
352 #define UNROLL2(op...) op op
353 #define UNROLL4(op...) UNROLL2(op) UNROLL2(op)
354 #define UNROLL8(op...) UNROLL4(op) UNROLL4(op)
355 #define UNROLL16(op...) UNROLL8(op) UNROLL8(op)
357 #define UNROLL8_PLD_WHILE(start, size, end, op) \
359 end = start + (size & ~7); \
360 while (start < end) \
367 while (start < end) \
372 /*****************************************************************************/
374 typedef unsigned long long DATA64;
375 typedef unsigned int DATA32;
376 typedef unsigned short DATA16;
377 typedef unsigned char DATA8;
379 typedef struct _Image_Entry Image_Entry;
380 typedef struct _Image_Entry_Flags Image_Entry_Flags;
381 typedef struct _Image_Entry_Frame Image_Entry_Frame;
382 typedef struct _Image_Timestamp Image_Timestamp;
383 typedef struct _Engine_Image_Entry Engine_Image_Entry;
384 typedef struct _Evas_Cache_Target Evas_Cache_Target;
385 typedef struct _Evas_Preload_Pthread Evas_Preload_Pthread;
387 typedef struct _RGBA_Image_Loadopts RGBA_Image_Loadopts;
388 #ifdef BUILD_PIPE_RENDER
389 typedef struct _RGBA_Pipe_Op RGBA_Pipe_Op;
390 typedef struct _RGBA_Pipe RGBA_Pipe;
391 typedef struct _RGBA_Pipe_Thread_Info RGBA_Pipe_Thread_Info;
393 typedef struct _RGBA_Image RGBA_Image;
394 typedef struct _RGBA_Image_Span RGBA_Image_Span;
395 typedef struct _RGBA_Draw_Context RGBA_Draw_Context;
396 typedef struct _RGBA_Polygon_Point RGBA_Polygon_Point;
397 typedef struct _RGBA_Map_Point RGBA_Map_Point;
398 typedef struct _RGBA_Map RGBA_Map;
399 typedef struct _RGBA_Font RGBA_Font;
400 typedef struct _RGBA_Font_Int RGBA_Font_Int;
401 typedef struct _RGBA_Font_Source RGBA_Font_Source;
402 typedef struct _RGBA_Font_Glyph RGBA_Font_Glyph;
403 typedef struct _RGBA_Font_Glyph_Out RGBA_Font_Glyph_Out;
404 typedef struct _RGBA_Gfx_Compositor RGBA_Gfx_Compositor;
406 typedef struct _Cutout_Rect Cutout_Rect;
407 typedef struct _Cutout_Rects Cutout_Rects;
409 typedef struct _Convert_Pal Convert_Pal;
411 typedef struct _Tilebuf Tilebuf;
412 typedef struct _Tilebuf_Tile Tilebuf_Tile;
413 typedef struct _Tilebuf_Rect Tilebuf_Rect;
415 typedef struct _Evas_Common_Transform Evas_Common_Transform;
418 // all coords are 20.12
419 // fp type - an int for now
421 // fp # of bits of float accuracy
423 // fp half (half of an fp unit)
424 #define FPH (1 << (FP - 1))
426 #define FP1 (1 << (FP))
429 typedef struct _Regionbuf Regionbuf;
430 typedef struct _Regionspan Regionspan;
433 typedef void (*RGBA_Gfx_Func) (DATA32 *src, DATA8 *mask, DATA32 col, DATA32 *dst, int len);
434 typedef void (*RGBA_Gfx_Pt_Func) (DATA32 src, DATA8 mask, DATA32 col, DATA32 *dst);
435 typedef void (*Gfx_Func_Copy) (DATA32 *src, DATA32 *dst, int len);
437 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);
439 #include "../cache/evas_cache.h"
441 #include "../cache2/evas_cache2.h"
444 /*****************************************************************************/
446 typedef enum _RGBA_Image_Flags
448 RGBA_IMAGE_NOTHING = (0),
449 /* RGBA_IMAGE_HAS_ALPHA = (1 << 0), */
450 RGBA_IMAGE_IS_DIRTY = (1 << 1),
451 RGBA_IMAGE_INDEXED = (1 << 2),
452 RGBA_IMAGE_ALPHA_ONLY = (1 << 3),
453 RGBA_IMAGE_ALPHA_TILES = (1 << 4),
454 /* RGBA_IMAGE_ALPHA_SPARSE = (1 << 5), */
455 /* RGBA_IMAGE_LOADED = (1 << 6), */
456 /* RGBA_IMAGE_NEED_DATA = (1 << 7) */
457 RGBA_IMAGE_TODO_LOAD = (1 << 8),
460 typedef enum _Convert_Pal_Mode
478 typedef enum _CPU_Features
481 CPU_FEATURE_MMX = (1 << 0),
482 CPU_FEATURE_MMX2 = (1 << 1),
483 CPU_FEATURE_SSE = (1 << 2),
484 CPU_FEATURE_ALTIVEC = (1 << 3),
485 CPU_FEATURE_VIS = (1 << 4),
486 CPU_FEATURE_VIS2 = (1 << 5),
487 CPU_FEATURE_NEON = (1 << 6),
488 CPU_FEATURE_SSE3 = (1 << 7)
491 typedef enum _Font_Hint_Flags
498 typedef enum _Font_Rend_Flags
500 FONT_REND_REGULAR = 0,
501 FONT_REND_SLANT = (1 << 0),
502 FONT_REND_WEIGHT = (1 << 1),
505 /*****************************************************************************/
507 #if 0 // filtering disabled
508 typedef struct _Filtered_Image Filtered_Image;
511 struct _RGBA_Image_Loadopts
513 int scale_down_by; // if > 1 then use this
514 double dpi; // if > 0.0 use this
515 unsigned int w, h; // if > 0 use this
516 unsigned int degree;//if>0 there is some info related with rotation
518 unsigned int x, y, w, h;
521 Eina_Bool orientation; // if EINA_TRUE => should honor orientation information provided by file (like jpeg exif info)
524 struct _Image_Entry_Flags
526 Eina_Bool loaded : 1;
527 Eina_Bool in_progress : 1;
531 Eina_Bool need_data : 1;
532 Eina_Bool lru_nodata : 1;
533 Eina_Bool cached : 1;
537 Eina_Bool alpha_sparse : 1;
538 #ifdef BUILD_ASYNC_PRELOAD
539 Eina_Bool preload_done : 1;
540 Eina_Bool delete_me : 1;
541 Eina_Bool pending : 1;
543 Eina_Bool animated : 1;
544 Eina_Bool rotated : 1;
547 struct _Image_Entry_Frame
550 DATA32 *data; /* frame decoding data */
551 void *info; /* special image type info */
552 Eina_Bool loaded : 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;
581 const char *cache_key;
586 Evas_Cache_Target *targets;
587 Evas_Preload_Pthread *preload;
589 Image_Timestamp tstamp;
593 #ifdef BUILD_PIPE_RENDER
599 RGBA_Image_Loadopts load_opts;
616 #ifdef BUILD_ASYNC_PRELOAD
619 Eina_Bool unload_cancel : 1;
622 Image_Entry_Flags flags;
623 Evas_Image_Scale_Hint scale_hint;
626 unsigned int open_rid, load_rid, preload_rid;
633 /* for animation feature */
635 Evas_Image_Animated_Loop_Hint loop_hint;
641 struct _Engine_Image_Entry
645 /* Upper Engine data. */
649 Evas_Cache_Engine_Image *cache;
650 const char *cache_key;
654 Eina_Bool cached : 1;
657 Eina_Bool loaded : 1;
658 Eina_Bool need_parent : 1;
678 struct _Evas_Common_Transform
685 struct _RGBA_Draw_Context
693 pixman_image_t *pixman_color_image;
697 struct RGBA_Draw_Context_clip {
708 void *(*gl_new) (void *data, RGBA_Font_Glyph *fg);
709 void (*gl_free) (void *ext_dat);
710 void (*gl_draw) (void *data, void *dest, void *context, RGBA_Font_Glyph *fg, int x, int y);
721 Eina_Bool anti_alias : 1;
724 #ifdef BUILD_PIPE_RENDER
725 #include "../engines/common/evas_map_image.h"
726 #include "../engines/common/evas_text_utils.h"
730 RGBA_Draw_Context context;
731 Eina_Bool (*prepare_func) (void *data, RGBA_Image *dst, RGBA_Pipe_Op *op);
732 void (*op_func) (RGBA_Image *dst, const RGBA_Pipe_Op *op, const RGBA_Pipe_Thread_Info *info);
733 void (*free_func) (RGBA_Pipe_Op *op);
745 RGBA_Polygon_Point *points;
749 Evas_Text_Props *intl_props;
754 int sx, sy, sw, sh, dx, dy, dw, dh;
767 Eina_Bool render : 1;
776 RGBA_Pipe_Op op[PIPE_LEN];
779 struct _RGBA_Pipe_Thread_Info
788 Image_Entry cache_entry;
790 RGBA_Image_Flags flags;
795 /* char *real_file; */
803 /* unsigned char scale; */
805 /* Colorspace stuff. */
808 Eina_Bool no_free : 1;
815 Eina_Bool no_free : 1;
823 #if 0 // filtering disabled
830 unsigned long long orig_usage;
831 unsigned long long usage_count;
833 unsigned long long newest_usage;
834 unsigned long long newest_usage_count;
844 struct _RGBA_Polygon_Point
850 struct _RGBA_Map_Point
852 FPc x, y; // x, y screenspace
853 float fx, fy, fz; // x, y, z in floats
854 // FPc x3, y3; // x, y 3d space
855 FPc z; // z in world space. optional
856 FPc u, v; // u, v in tex coords
857 DATA32 col; // color at this point
858 // for perspective correctness - only point 0 has relevant info
873 RGBA_Map_Point pts[1];
876 #if 0 // filtering disabled
877 struct _Filtered_Image
888 typedef struct _Fash_Item_Index_Map Fash_Item_Index_Map;
889 typedef struct _Fash_Int_Map Fash_Int_Map;
890 typedef struct _Fash_Int_Map2 Fash_Int_Map2;
891 typedef struct _Fash_Int Fash_Int;
892 struct _Fash_Item_Index_Map
899 Fash_Item_Index_Map item[256];
901 struct _Fash_Int_Map2
903 Fash_Int_Map *bucket[256];
907 Fash_Int_Map2 *bucket[256];
908 void (*freeme) (Fash_Int *fash);
912 typedef struct _Fash_Glyph_Map Fash_Glyph_Map;
913 typedef struct _Fash_Glyph_Map2 Fash_Glyph_Map2;
914 typedef struct _Fash_Glyph Fash_Glyph;
915 struct _Fash_Glyph_Map
917 RGBA_Font_Glyph *item[256];
919 struct _Fash_Glyph_Map2
921 Fash_Glyph_Map *bucket[256];
925 Fash_Glyph_Map2 *bucket[256];
926 void (*freeme) (Fash_Glyph *fash);
934 Font_Hint_Flags hinting;
937 unsigned char sizeok : 1;
940 #include "../engines/common/evas_font_ot.h"
942 struct _RGBA_Font_Int
945 RGBA_Font_Source *src;
960 Font_Hint_Flags hinting;
961 Font_Rend_Flags wanted_rend; /* The wanted rendering style */
962 Font_Rend_Flags runtime_rend; /* The rendering we need to do on runtime
963 in order to comply with the wanted_rend. */
972 unsigned char sizeok : 1;
973 unsigned char inuse : 1;
976 struct _RGBA_Font_Source
981 unsigned int current_size;
991 * laziness wins for now. The parts used from the freetpye struct are
992 * kept intact to avoid changing the code using it until we know exactly
993 * what needs to be changed
995 struct _RGBA_Font_Glyph_Out
1001 unsigned char *buffer;
1007 struct _RGBA_Font_Glyph
1014 RGBA_Font_Glyph_Out *glyph_out;
1015 void (*glyph_out_free)(void *);
1016 /* this is a problem - only 1 engine at a time can extend such a font... grrr */
1018 void (*ext_dat_free) (void *ext_dat);
1022 struct _RGBA_Gfx_Compositor
1027 void (*shutdown)(void);
1029 RGBA_Gfx_Func (*composite_pixel_span_get)(RGBA_Image *src, RGBA_Image *dst, int pixels);
1030 RGBA_Gfx_Func (*composite_color_span_get)(DATA32 col, RGBA_Image *dst, int pixels);
1031 RGBA_Gfx_Func (*composite_pixel_color_span_get)(RGBA_Image *src, DATA32 col, RGBA_Image *dst, int pixels);
1032 RGBA_Gfx_Func (*composite_mask_color_span_get)(DATA32 col, RGBA_Image *dst, int pixels);
1033 RGBA_Gfx_Func (*composite_pixel_mask_span_get)(RGBA_Image *src, RGBA_Image *dst, int pixels);
1035 RGBA_Gfx_Pt_Func (*composite_pixel_pt_get)(Image_Entry_Flags src_flags, RGBA_Image *dst);
1036 RGBA_Gfx_Pt_Func (*composite_color_pt_get)(DATA32 col, RGBA_Image *dst);
1037 RGBA_Gfx_Pt_Func (*composite_pixel_color_pt_get)(Image_Entry_Flags src_flags, DATA32 col, RGBA_Image *dst);
1038 RGBA_Gfx_Pt_Func (*composite_mask_color_pt_get)(DATA32 col, RGBA_Image *dst);
1039 RGBA_Gfx_Pt_Func (*composite_pixel_mask_pt_get)(Image_Entry_Flags src_flags, RGBA_Image *dst);
1042 #define EVAS_RECT_SPLIT 1
1043 #ifdef EVAS_RECT_SPLIT
1044 typedef struct list_node list_node_t;
1045 typedef struct list list_t;
1046 typedef struct rect rect_t;
1047 typedef struct rect_node rect_node_t;
1051 struct list_node *next;
1056 struct list_node *head;
1057 struct list_node *tail;
1073 struct list_node _lst;
1076 #endif /* EVAS_RECT_SPLIT */
1089 } prev_add, prev_del;
1094 #elif defined(EVAS_RECT_SPLIT)
1101 Tilebuf_Tile *tiles;
1107 struct _Tilebuf_Tile
1109 Eina_Bool redraw : 1;
1110 /* FIXME: need these flags later - but not now */
1122 struct _Tilebuf_Rect
1145 Convert_Pal_Mode colors;
1152 /*****************************************************************************/
1153 #include "evas_macros.h"
1155 #ifndef WORDS_BIGENDIAN
1157 #define A_VAL(p) (((DATA8 *)(p))[3])
1158 #define R_VAL(p) (((DATA8 *)(p))[2])
1159 #define G_VAL(p) (((DATA8 *)(p))[1])
1160 #define B_VAL(p) (((DATA8 *)(p))[0])
1161 #define AR_VAL(p) ((DATA16 *)(p)[1])
1162 #define GB_VAL(p) ((DATA16 *)(p)[0])
1165 #define A_VAL(p) (((DATA8 *)(p))[0])
1166 #define R_VAL(p) (((DATA8 *)(p))[1])
1167 #define G_VAL(p) (((DATA8 *)(p))[2])
1168 #define B_VAL(p) (((DATA8 *)(p))[3])
1169 #define AR_VAL(p) ((DATA16 *)(p)[0])
1170 #define GB_VAL(p) ((DATA16 *)(p)[1])
1173 #define RGB_JOIN(r,g,b) \
1174 (((r) << 16) + ((g) << 8) + (b))
1176 #define ARGB_JOIN(a,r,g,b) \
1177 (((a) << 24) + ((r) << 16) + ((g) << 8) + (b))
1179 #include "evas_blend_ops.h"
1181 #define _EVAS_RENDER_FILL -1
1182 #define _EVAS_RENDER_BLEND 0
1183 #define _EVAS_RENDER_BLEND_REL 1
1184 #define _EVAS_RENDER_COPY 2
1185 #define _EVAS_RENDER_COPY_REL 3
1186 #define _EVAS_RENDER_ADD 4
1187 #define _EVAS_RENDER_ADD_REL 5
1188 #define _EVAS_RENDER_SUB 6
1189 #define _EVAS_RENDER_SUB_REL 7
1190 #define _EVAS_RENDER_TINT 8
1191 #define _EVAS_RENDER_TINT_REL 9
1192 #define _EVAS_RENDER_MASK 10
1193 #define _EVAS_RENDER_MUL 11
1194 #define _EVAS_RENDER_CLIP 12
1196 #define _EVAS_TEXTURE_REFLECT 0
1197 #define _EVAS_TEXTURE_REPEAT 1
1198 #define _EVAS_TEXTURE_RESTRICT 2
1199 #define _EVAS_TEXTURE_RESTRICT_REFLECT 3
1200 #define _EVAS_TEXTURE_RESTRICT_REPEAT 4
1201 #define _EVAS_TEXTURE_PAD 5
1203 #define _EVAS_COLOR_SPACE_ARGB 0
1204 #define _EVAS_COLOR_SPACE_AHSV 1
1206 /*****************************************************************************/
1208 #define SCALE_SIZE_MAX ((1 << 15) - 1)
1215 void evas_common_init (void);
1216 void evas_common_shutdown (void);
1218 EAPI void evas_common_cpu_init (void);
1220 int evas_common_cpu_have_cpuid (void);
1221 int evas_common_cpu_has_feature (unsigned int feature);
1222 EAPI void evas_common_cpu_can_do (int *mmx, int *sse, int *sse2);
1223 EAPI void evas_common_cpu_end_opt (void);
1226 #include "../engines/common/evas_blend.h"
1228 EAPI Gfx_Func_Copy evas_common_draw_func_copy_get (int pixels, int reverse);
1231 #include "../engines/common/evas_convert_color.h"
1232 #include "../engines/common/evas_convert_colorspace.h"
1233 #include "../engines/common/evas_convert_main.h"
1234 #include "../engines/common/evas_convert_yuv.h"
1235 #include "../engines/common/evas_scale_main.h"
1236 #include "../engines/common/evas_scale_smooth.h"
1237 #include "../engines/common/evas_scale_span.h"
1240 #include "../engines/common/evas_image.h"
1243 #include "../engines/common/evas_line.h"
1244 #include "../engines/common/evas_polygon.h"
1245 #include "../engines/common/evas_rectangle.h"
1248 EAPI void evas_common_blit_init (void);
1250 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);
1253 #include "../engines/common/evas_font.h"
1256 EAPI void evas_common_tilebuf_init (void);
1258 EAPI Tilebuf *evas_common_tilebuf_new (int w, int h);
1259 EAPI void evas_common_tilebuf_free (Tilebuf *tb);
1260 EAPI void evas_common_tilebuf_set_tile_size (Tilebuf *tb, int tw, int th);
1261 EAPI void evas_common_tilebuf_get_tile_size (Tilebuf *tb, int *tw, int *th);
1262 EAPI int evas_common_tilebuf_add_redraw (Tilebuf *tb, int x, int y, int w, int h);
1263 EAPI int evas_common_tilebuf_del_redraw (Tilebuf *tb, int x, int y, int w, int h);
1264 EAPI int evas_common_tilebuf_add_motion_vector (Tilebuf *tb, int x, int y, int w, int h, int dx, int dy, int alpha);
1265 EAPI void evas_common_tilebuf_clear (Tilebuf *tb);
1266 EAPI Tilebuf_Rect *evas_common_tilebuf_get_render_rects (Tilebuf *tb);
1267 EAPI void evas_common_tilebuf_free_render_rects (Tilebuf_Rect *rects);
1270 Regionbuf *evas_common_regionbuf_new (int w, int h);
1271 void evas_common_regionbuf_free (Regionbuf *rb);
1272 void evas_common_regionbuf_clear (Regionbuf *rb);
1273 void evas_common_regionbuf_span_add (Regionbuf *rb, int x1, int x2, int y);
1274 void evas_common_regionbuf_span_del (Regionbuf *rb, int x1, int x2, int y);
1275 Tilebuf_Rect *evas_common_regionbuf_rects_get (Regionbuf *rb);
1279 #include "../engines/common/evas_draw.h"
1281 #include "../engines/common/evas_map_image.h"
1284 #include "../engines/common/evas_pipe.h"
1286 void evas_font_dir_cache_free(void);
1290 /*****************************************************************************/