#ifndef EVAS_COMMON_H
#define EVAS_COMMON_H
-#ifdef HAVE_CONFIG_H
-# include "config.h" /* so that EAPI in Evas.h is correctly defined */
+//#ifdef HAVE_CONFIG_H
+#include "config.h" /* so that EAPI in Evas.h is correctly defined */
+//#endif
+
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_ALLOCA_H
+# include <alloca.h>
+#elif !defined alloca
+# ifdef __GNUC__
+# define alloca __builtin_alloca
+# elif defined _AIX
+# define alloca __alloca
+# elif defined _MSC_VER
+# include <malloc.h>
+# define alloca _alloca
+# elif !defined HAVE_ALLOCA
+# ifdef __cplusplus
+extern "C"
+# endif
+void *alloca (size_t);
+# endif
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <time.h>
+#include <ctype.h>
+
+#ifndef _MSC_VER
+# include <stdint.h>
+#include <unistd.h>
#endif
#ifdef HAVE_EVIL
# include <Evil.h>
#endif
-#include <Eina.h>
-#include "Evas.h"
-//#include "Evas_GL.h"
+#ifdef HAVE_ESCAPE
+# include <Escape.h>
+#endif
#ifdef HAVE_PIXMAN
#include <pixman.h>
#include <sys/stat.h>
#include <unistd.h>
+#ifdef HAVE_EXOTIC
+# include <Exotic.h>
+#endif
+
+#include <Eina.h>
+#include "Evas.h"
+//#include "Evas_GL.h"
+
+#ifndef HAVE_LROUND
+/* right now i dont care about rendering bugs on platforms without lround
+ (e.g. windows/vc++... yay!)
+ FIXME: http://cgit.freedesktop.org/cairo/tree/src/cairo-misc.c#n487
+*/
+#define lround(x) (((x) < 0) ? (long int)ceil((x) - 0.5) : (long int)floor((x) + 0.5))
+#endif
+
/* macros needed to log message through eina_log */
extern EAPI int _evas_log_dom_global;
#ifdef _EVAS_DEFAULT_LOG_DOM
# define BUILD_PTHREAD
#endif
-#ifdef BUILD_PTHREAD
-
#define LK(x) Eina_Lock x
#define LKI(x) eina_lock_new(&(x))
#define LKD(x) eina_lock_free(&(x))
#define LKU(x) eina_lock_release(&(x))
#define LKDBG(x) eina_lock_debug(&(x))
-# define TH(x) pthread_t x
-# define THI(x) int x
-# define TH_MAX 8
-
/* for rwlocks */
-#define RWLK(x) pthread_rwlock_t x
-#define RWLKI(x) pthread_rwlock_init(&(x), NULL)
-#define RWLKD(x) pthread_rwlock_destroy(&(x))
-#define RDLKL(x) pthread_rwlock_rdlock(&(x))
-#define WRLKL(x) pthread_rwlock_wrlock(&(x))
-#define RWLKU(x) pthread_rwlock_unlock(&(x))
+#define RWLK(x) Eina_RWLock x
+#define RWLKI(x) eina_rwlock_new(&(x))
+#define RWLKD(x) eina_rwlock_free(&(x))
+#define RDLKL(x) eina_rwlock_take_read(&(x))
+#define WRLKL(x) eina_rwlock_take_write(&(x))
+#define RWLKU(x) eina_rwlock_release(&(x))
+#ifdef BUILD_PTHREAD
-// even though in theory having every Nth rendered line done by a different
-// thread might even out load across threads - it actually slows things down.
-//#define EVAS_SLI 1
+# define TH(x) pthread_t x
+# define THI(x) int x
+# define TH_MAX 8
#else
-# define LK(x)
-# define LKI(x)
-# define LKD(x)
-# define LKL(x)
-# define LKT(x) 0
-# define LKU(x)
# define TH(x)
# define THI(x)
# define TH_MAX 0
-# define LKDBG(x)
-
-/* for rwlocks */
-#define RWLK(x)
-#define RWLKI(x)
-#define RWLKD(x)
-#define RDLKL(x)
-#define WRLKL(x)
-#define RWLKU(x)
#endif
-#ifdef HAVE_ALLOCA_H
-# include <alloca.h>
-#elif defined __GNUC__
-# define alloca __builtin_alloca
-#elif defined _AIX
-# define alloca __alloca
-#elif defined _MSC_VER
-# include <malloc.h>
-# define alloca _alloca
-#else
-# include <stddef.h>
-# ifdef __cplusplus
-extern "C"
-# endif
-void *alloca (size_t);
-#endif
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <time.h>
-#include <ctype.h>
-
-#ifndef _MSC_VER
-# include <stdint.h>
-#endif
-
#include <ft2build.h>
#include FT_FREETYPE_H
#include FT_GLYPH_H
#define pld(addr, off)
#endif /* __ARMEL__ */
+// these here are in config.h - just here for documentation
+//#ifdef __ARM_ARCH__
+// *IF* you enable pixman, this determines which things pixman will do
+////#define PIXMAN_FONT 1
+////#define PIXMAN_RECT 1
+////#define PIXMAN_LINE 1
+////#define PIXMAN_POLY 1
+//#define PIXMAN_IMAGE 1
+//#define PIXMAN_IMAGE_SCALE_SAMPLE 1
+//#endif
+// not related to pixman but an alternate rotate code
+//#define TILE_ROTATE 1
+
+#define TILE_CACHE_LINE_SIZE 64
+
/*****************************************************************************/
#define UNROLL2(op...) op op
typedef unsigned char DATA8;
typedef struct _Image_Entry Image_Entry;
-typedef struct _Image_Entry_Flags Image_Entry_Flags;
+typedef struct _Image_Entry_Flags Image_Entry_Flags;
+typedef struct _Image_Entry_Frame Image_Entry_Frame;
typedef struct _Image_Timestamp Image_Timestamp;
typedef struct _Engine_Image_Entry Engine_Image_Entry;
typedef struct _Evas_Cache_Target Evas_Cache_Target;
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);
#include "../cache/evas_cache.h"
+#ifdef EVAS_CSERVE2
+#include "../cache2/evas_cache2.h"
+#endif
/*****************************************************************************/
CPU_FEATURE_ALTIVEC = (1 << 3),
CPU_FEATURE_VIS = (1 << 4),
CPU_FEATURE_VIS2 = (1 << 5),
- CPU_FEATURE_NEON = (1 << 6)
+ CPU_FEATURE_NEON = (1 << 6),
+ CPU_FEATURE_SSE3 = (1 << 7)
} CPU_Features;
typedef enum _Font_Hint_Flags
typedef enum _Font_Rend_Flags
{
FONT_REND_REGULAR = 0,
- FONT_REND_ITALIC = (1 << 0),
- FONT_REND_BOLD = (1 << 1),
+ FONT_REND_SLANT = (1 << 0),
+ FONT_REND_WEIGHT = (1 << 1),
} Font_Rend_Flags;
/*****************************************************************************/
int scale_down_by; // if > 1 then use this
double dpi; // if > 0.0 use this
unsigned int w, h; // if > 0 use this
+ unsigned int degree;//if>0 there is some info related with rotation
struct {
unsigned int x, y, w, h;
} region;
+
+ Eina_Bool orientation; // if EINA_TRUE => should honor orientation information provided by file (like jpeg exif info)
};
struct _Image_Entry_Flags
Eina_Bool in_progress : 1;
Eina_Bool dirty : 1;
Eina_Bool activ : 1;
-
+
Eina_Bool need_data : 1;
Eina_Bool lru_nodata : 1;
Eina_Bool cached : 1;
Eina_Bool alpha : 1;
-
+
Eina_Bool lru : 1;
Eina_Bool alpha_sparse : 1;
#ifdef BUILD_ASYNC_PRELOAD
Eina_Bool delete_me : 1;
Eina_Bool pending : 1;
#endif
+ Eina_Bool animated : 1;
+ Eina_Bool rotated : 1;
+};
+
+struct _Image_Entry_Frame
+{
+ int index;
+ DATA32 *data; /* frame decoding data */
+ void *info; /* special image type info */
+ Eina_Bool loaded : 1;
};
struct _Evas_Cache_Target
ino_t ino;
#ifdef _STAT_VER_LINUX
unsigned long int mtime_nsec;
-#endif
+#endif
};
struct _Image_Entry
EINA_INLIST;
Evas_Cache_Image *cache;
+#ifdef EVAS_CSERVE2
+ Evas_Cache2 *cache2;
+#endif
const char *cache_key;
Image_Timestamp tstamp;
int references;
-#ifdef EVAS_FRAME_QUEUING
- LK(lock_references); // needed for accessing references
-#endif
#ifdef BUILD_PIPE_RENDER
RGBA_Pipe *pipe;
-#ifdef EVAS_FRAME_QUEUING
- LK(ref_fq_add);
- LK(ref_fq_del);
- Eina_Condition cond_fq_del;
- int ref_fq[2]; // ref_fq[0] is for addition, ref_fq[1] is for deletion
-#endif
#endif
unsigned char scale;
Image_Entry_Flags flags;
Evas_Image_Scale_Hint scale_hint;
void *data1, *data2;
+#ifdef EVAS_CSERVE2
+ unsigned int open_rid, load_rid, preload_rid;
+#endif
int server_id;
int connect_num;
int channel;
int load_error;
+
+ /* for animation feature */
+ int frame_count;
+ Evas_Image_Animated_Loop_Hint loop_hint;
+ int loop_count;
+ int cur_frame;
+ Eina_List *frames;
};
struct _Engine_Image_Entry
DATA32 col;
} mul;
struct {
+#ifdef HAVE_PIXMAN
+ pixman_image_t *pixman_color_image;
+#endif
DATA32 col;
} col;
struct RGBA_Draw_Context_clip {
RGBA_Polygon_Point *points;
} poly;
struct {
- RGBA_Font *font;
int x, y;
Evas_Text_Props intl_props;
} text;
#if 0 // filtering disabled
Eina_List *filtered;
#endif
-
+
struct {
LK(lock);
Eina_List *list;
struct {
pixman_image_t *im;
} pixman;
-#endif
+#endif
};
struct _RGBA_Polygon_Point
Fash_Int *fash;
Font_Hint_Flags hinting;
int references;
-#ifdef EVAS_FRAME_QUEUING
- int ref_fq[2]; //ref_fq[0] is for addition, ref_fq[1] is for deletion
- Eina_Condition cond_fq_del;
- LK(ref_fq_add);
- LK(ref_fq_del);
-#endif
LK(lock);
unsigned char sizeok : 1;
};
+#include "../engines/common/evas_font_ot.h"
+
struct _RGBA_Font_Int
{
EINA_INLIST;
int usage;
struct {
FT_Size size;
+#ifdef USE_HARFBUZZ
+ void *hb_font;
+#endif
} ft;
LK(ft_mutex);
Font_Hint_Flags hinting;
Font_Rend_Flags wanted_rend; /* The wanted rendering style */
Font_Rend_Flags runtime_rend; /* The rendering we need to do on runtime
in order to comply with the wanted_rend. */
+
+ Eina_List *task;
+
+ int generation;
+
unsigned char sizeok : 1;
unsigned char inuse : 1;
};
-#include "../engines/common/evas_font_ot.h"
-
struct _RGBA_Font_Source
{
const char *name;
struct _RGBA_Font_Glyph
{
FT_UInt index;
+ Evas_Coord width;
+ Evas_Coord x_bear;
FT_Glyph glyph;
FT_BitmapGlyph glyph_out;
/* this is a problem - only 1 engine at a time can extend such a font... grrr */
struct rect
{
- short left;
- short top;
- short right;
- short bottom;
- short width;
- short height;
+ int left;
+ int top;
+ int right;
+ int bottom;
+ int width;
+ int height;
int area;
};
struct list_node _lst;
struct rect rect;
};
-
-void rect_list_node_pool_set_max(int max);
-void rect_list_node_pool_flush(void);
-list_node_t *rect_list_node_pool_get(void);
-void rect_list_node_pool_put(list_node_t *node);
-
-void rect_init(rect_t *r, int x, int y, int w, int h);
-void rect_list_append_node(list_t *rects, list_node_t *node);
-void rect_list_append(list_t *rects, const rect_t r);
-void rect_list_append_xywh(list_t *rects, int x, int y, int w, int h);
-void rect_list_concat(list_t *rects, list_t *other);
-list_node_t *rect_list_unlink_next(list_t *rects, list_node_t *parent_node);
-void rect_list_del_next(list_t *rects, list_node_t *parent_node);
-void rect_list_clear(list_t *rects);
-void rect_list_del_split_strict(list_t *rects, const rect_t del_r);
-void rect_list_add_split_strict(list_t *rects, list_node_t *node);
-list_node_t *rect_list_add_split_fuzzy(list_t *rects, list_node_t *node, int accepted_error);
-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);
-
-void rect_print(const rect_t r);
-void rect_list_print(const list_t rects);
#endif /* EVAS_RECT_SPLIT */
struct _Tilebuf
int w, h;
} tile_size;
+ struct {
+ int x, y, w, h;
+ } prev_add, prev_del;
#ifdef RECTUPDATE
+/*
Regionbuf *rb;
+ */
#elif defined(EVAS_RECT_SPLIT)
int need_merge;
list_t rects;
#else
+/*
struct {
int w, h;
Tilebuf_Tile *tiles;
} tiles;
+ */
#endif
};
/*****************************************************************************/
+#define SCALE_SIZE_MAX ((1 << 15) - 1)
+
#ifdef __cplusplus
extern "C" {
#endif