|
|
|
#ifndef EVAS_COMMON_H
|
|
|
|
#define EVAS_COMMON_H
|
|
|
|
|
|
|
|
//#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
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <time.h>
|
|
|
|
#include <ctype.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
#ifdef HAVE_PIXMAN
|
|
|
|
#include <pixman.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/stat.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
#include <Eina.h>
|
|
|
|
#include <Eo.h>
|
|
|
|
#include <Ector.h>
|
|
|
|
|
|
|
|
#ifdef BUILD_LOADER_EET
|
|
|
|
# include <Eet.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef EFL_CANVAS_OBJECT_PROTECTED
|
|
|
|
# define EFL_CANVAS_OBJECT_PROTECTED
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "Evas.h"
|
|
|
|
|
|
|
|
#define EFL_INTERNAL_UNSTABLE
|
|
|
|
#include "Evas_Internal.h"
|
|
|
|
|
|
|
|
#include "../common/evas_font.h"
|
|
|
|
|
|
|
|
#ifdef EAPI
|
|
|
|
# undef EAPI
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
# ifdef EFL_BUILD
|
|
|
|
# ifdef DLL_EXPORT
|
|
|
|
# define EAPI __declspec(dllexport)
|
|
|
|
# else
|
|
|
|
# define EAPI
|
|
|
|
# endif
|
|
|
|
# else
|
|
|
|
# define EAPI __declspec(dllimport)
|
|
|
|
# endif
|
|
|
|
#else
|
|
|
|
# ifdef __GNUC__
|
|
|
|
# if __GNUC__ >= 4
|
|
|
|
# define EAPI __attribute__ ((visibility("default")))
|
|
|
|
# else
|
|
|
|
# define EAPI
|
|
|
|
# endif
|
|
|
|
# else
|
|
|
|
# define EAPI
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#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 */
|
|
|
|
EAPI extern int _evas_log_dom_global;
|
|
|
|
#ifdef _EVAS_DEFAULT_LOG_DOM
|
|
|
|
# undef _EVAS_DEFAULT_LOG_DOM
|
|
|
|
#endif
|
|
|
|
#define _EVAS_DEFAULT_LOG_DOM _evas_log_dom_global
|
|
|
|
|
|
|
|
#ifdef EVAS_DEFAULT_LOG_COLOR
|
|
|
|
# undef EVAS_DEFAULT_LOG_COLOR
|
|
|
|
#endif
|
|
|
|
#define EVAS_DEFAULT_LOG_COLOR EINA_COLOR_BLUE
|
|
|
|
|
|
|
|
#ifdef ERR
|
|
|
|
# undef ERR
|
|
|
|
#endif
|
|
|
|
#define ERR(...) EINA_LOG_DOM_ERR(_EVAS_DEFAULT_LOG_DOM, __VA_ARGS__)
|
|
|
|
|
|
|
|
#ifdef DBG
|
|
|
|
# undef DBG
|
|
|
|
#endif
|
|
|
|
#define DBG(...) EINA_LOG_DOM_DBG(_EVAS_DEFAULT_LOG_DOM, __VA_ARGS__)
|
|
|
|
|
|
|
|
#ifdef INF
|
|
|
|
# undef INF
|
|
|
|
#endif
|
|
|
|
#define INF(...) EINA_LOG_DOM_INFO(_EVAS_DEFAULT_LOG_DOM, __VA_ARGS__)
|
|
|
|
|
|
|
|
#ifdef WRN
|
|
|
|
# undef WRN
|
|
|
|
#endif
|
|
|
|
#define WRN(...) EINA_LOG_DOM_WARN(_EVAS_DEFAULT_LOG_DOM, __VA_ARGS__)
|
|
|
|
|
|
|
|
#ifdef CRI
|
|
|
|
# undef CRI
|
|
|
|
#endif
|
|
|
|
#define CRI(...) EINA_LOG_DOM_CRIT(_EVAS_DEFAULT_LOG_DOM, __VA_ARGS__)
|
|
|
|
|
|
|
|
#include "evas_options.h"
|
|
|
|
|
|
|
|
#if defined(__ARM_ARCH_3M__)
|
|
|
|
# define __ARM_ARCH__ 40
|
|
|
|
#endif
|
|
|
|
#if defined(__ARM_ARCH_4__)
|
|
|
|
# define __ARM_ARCH__ 40
|
|
|
|
#endif
|
|
|
|
#if defined(__ARM_ARCH_4T__)
|
|
|
|
# define __ARM_ARCH__ 41
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__ARM_ARCH_5__)
|
|
|
|
# define __ARM_ARCH__ 50
|
|
|
|
#endif
|
|
|
|
#if defined(__ARM_ARCH_5T__)
|
|
|
|
# define __ARM_ARCH__ 51
|
|
|
|
#endif
|
|
|
|
#if defined(__ARM_ARCH_5E__)
|
|
|
|
# define __ARM_ARCH__ 52
|
|
|
|
#endif
|
|
|
|
#if defined(__ARM_ARCH_5TE__)
|
|
|
|
# define __ARM_ARCH__ 53
|
|
|
|
#endif
|
|
|
|
#if defined(__ARM_ARCH_5TEJ__)
|
|
|
|
# define __ARM_ARCH__ 54
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__ARM_ARCH_6__)
|
|
|
|
# define __ARM_ARCH__ 60
|
|
|
|
#endif
|
|
|
|
#if defined(__ARM_ARCH_6J__)
|
|
|
|
# define __ARM_ARCH__ 61
|
|
|
|
#endif
|
|
|
|
#if defined(__ARM_ARCH_6K__)
|
|
|
|
# define __ARM_ARCH__ 62
|
|
|
|
#endif
|
|
|
|
#if defined(__ARM_ARCH_6Z__)
|
|
|
|
# define __ARM_ARCH__ 63
|
|
|
|
#endif
|
|
|
|
#if defined(__ARM_ARCH_6ZK__)
|
|
|
|
# define __ARM_ARCH__ 64
|
|
|
|
#endif
|
|
|
|
#if defined(__ARM_ARCH_6T2__)
|
|
|
|
# define __ARM_ARCH__ 65
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__ARM_ARCH_7__)
|
|
|
|
# define __ARM_ARCH__ 70
|
|
|
|
#endif
|
|
|
|
#if defined(__ARM_ARCH_7A__)
|
|
|
|
# define __ARM_ARCH__ 71
|
|
|
|
#endif
|
|
|
|
#if defined(__ARM_ARCH_7R__)
|
|
|
|
# define __ARM_ARCH__ 72
|
|
|
|
#endif
|
|
|
|
#if defined(__ARM_ARCH_7M__)
|
|
|
|
# define __ARM_ARCH__ 73
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define SLK(x) Eina_Spinlock x
|
|
|
|
#define SLKI(x) eina_spinlock_new(&(x))
|
|
|
|
#define SLKD(x) eina_spinlock_free(&(x))
|
|
|
|
#define SLKL(x) eina_spinlock_take(&(x))
|
|
|
|
#define SLKT(x) eina_spinlock_take_try(&(x))
|
|
|
|
#define SLKU(x) eina_spinlock_release(&(x))
|
|
|
|
|
|
|
|
#define LK(x) Eina_Lock x
|
|
|
|
#define LKI(x) eina_lock_new(&(x))
|
|
|
|
#define LKD(x) eina_lock_free(&(x))
|
|
|
|
#define LKL(x) eina_lock_take(&(x))
|
|
|
|
#define LKT(x) eina_lock_take_try(&(x))
|
|
|
|
#define LKU(x) eina_lock_release(&(x))
|
|
|
|
#define LKDBG(x) eina_lock_debug(&(x))
|
|
|
|
|
|
|
|
/* for rwlocks */
|
|
|
|
#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))
|
|
|
|
|
|
|
|
# define TH(x) pthread_t x
|
|
|
|
# define THI(x) int x
|
|
|
|
# define TH_MAX 8
|
|
|
|
|
|
|
|
#ifdef __GNUC__
|
|
|
|
# if __GNUC__ >= 4
|
|
|
|
// BROKEN in gcc 4 on amd64
|
|
|
|
//# pragma GCC visibility push(hidden)
|
|
|
|
# endif
|
|
|
|
#define LIKELY(x) __builtin_expect(!!(x), 1)
|
|
|
|
#define UNLIKELY(x) __builtin_expect(!!(x), 0)
|
|
|
|
#else
|
|
|
|
#define LIKELY(x) (x)
|
|
|
|
#define UNLIKELY(x) (x)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
/* use exact rects for updates not tiles */
|
|
|
|
//#define NEWTILER
|
|
|
|
#define TILESIZE 8
|
|
|
|
#define IMG_MAX_SIZE 65000
|
|
|
|
|
|
|
|
#define IMG_TOO_BIG(w, h) \
|
|
|
|
((((unsigned long long)w) * ((unsigned long long)h)) >= \
|
|
|
|
((1ULL << (29 * (sizeof(void *) / 4))) - 2048))
|
|
|
|
|
|
|
|
/* not every converter supports no-dither or line-dither, then they will
|
|
|
|
* fallback to table version, in these cases default to small table.
|
|
|
|
*/
|
|
|
|
#if defined(BUILD_NO_DITHER_MASK) || defined(BUILD_LINE_DITHER_MASK)
|
|
|
|
#ifndef BUILD_SMALL_DITHER_MASK
|
|
|
|
#define BUILD_SMALL_DITHER_MASK 1
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef BUILD_SMALL_DITHER_MASK
|
|
|
|
# define DM_TABLE _evas_dither_44
|
|
|
|
# define DM_SIZE 4
|
|
|
|
# define DM_BITS 4
|
|
|
|
# define DM_DIV 16
|
|
|
|
# define USE_DITHER_44 1
|
|
|
|
#else
|
|
|
|
# define DM_TABLE _evas_dither_128128
|
|
|
|
# define DM_SIZE 128
|
|
|
|
# define DM_BITS 6
|
|
|
|
# define DM_DIV 64
|
|
|
|
# define USE_DITHER_128128 1
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define DM_MSK (DM_SIZE - 1)
|
|
|
|
#define DM_SHF(_b) (DM_BITS - (8 - _b))
|
|
|
|
/* Supports negative right shifts */
|
|
|
|
#define DM_SHR(x, _b) ((DM_SHF(_b) >= 0) ? \
|
|
|
|
((x) >> DM_SHF(_b)) : ((x) << -DM_SHF(_b)))
|
|
|
|
|
|
|
|
/* if more than 1/ALPHA_SPARSE_INV_FRACTION is "alpha" (1-254) then sparse
|
|
|
|
* alpha flag gets set */
|
|
|
|
#define ALPHA_SPARSE_INV_FRACTION 3
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
#if defined(__ARM_ARCH_3M__)
|
|
|
|
# define __ARM_ARCH__ 40
|
|
|
|
#endif
|
|
|
|
#if defined(__ARM_ARCH_4__)
|
|
|
|
# define __ARM_ARCH__ 40
|
|
|
|
#endif
|
|
|
|
#if defined(__ARM_ARCH_4T__)
|
|
|
|
# define __ARM_ARCH__ 41
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__ARM_ARCH_5__)
|
|
|
|
# define __ARM_ARCH__ 50
|
|
|
|
#endif
|
|
|
|
#if defined(__ARM_ARCH_5T__)
|
|
|
|
# define __ARM_ARCH__ 51
|
|
|
|
#endif
|
|
|
|
#if defined(__ARM_ARCH_5E__)
|
|
|
|
# define __ARM_ARCH__ 52
|
|
|
|
#endif
|
|
|
|
#if defined(__ARM_ARCH_5TE__)
|
|
|
|
# define __ARM_ARCH__ 53
|
|
|
|
#endif
|
|
|
|
#if defined(__ARM_ARCH_5TEJ__)
|
|
|
|
# define __ARM_ARCH__ 54
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__ARM_ARCH_6__)
|
|
|
|
# define __ARM_ARCH__ 60
|
|
|
|
#endif
|
|
|
|
#if defined(__ARM_ARCH_6J__)
|
|
|
|
# define __ARM_ARCH__ 61
|
|
|
|
#endif
|
|
|
|
#if defined(__ARM_ARCH_6K__)
|
|
|
|
# define __ARM_ARCH__ 62
|
|
|
|
#endif
|
|
|
|
#if defined(__ARM_ARCH_6Z__)
|
|
|
|
# define __ARM_ARCH__ 63
|
|
|
|
#endif
|
|
|
|
#if defined(__ARM_ARCH_6ZK__)
|
|
|
|
# define __ARM_ARCH__ 64
|
|
|
|
#endif
|
|
|
|
#if defined(__ARM_ARCH_6T2__)
|
|
|
|
# define __ARM_ARCH__ 65
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__ARM_ARCH_7__)
|
|
|
|
# define __ARM_ARCH__ 70
|
|
|
|
#endif
|
|
|
|
#if defined(__ARM_ARCH_7A__)
|
|
|
|
# define __ARM_ARCH__ 71
|
|
|
|
#endif
|
|
|
|
#if defined(__ARM_ARCH_7R__)
|
|
|
|
# define __ARM_ARCH__ 72
|
|
|
|
#endif
|
|
|
|
#if defined(__ARM_ARCH_7M__)
|
|
|
|
# define __ARM_ARCH__ 73
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(__ARM_ARCH__) && (__ARM_ARCH__ >= 52)
|
|
|
|
/* tested on ARMv6 (arm1136j-s), Nokia N800 CPU */
|
|
|
|
#define pld(addr, off) \
|
|
|
|
__asm__("pld [%[address], %[offset]]":: \
|
|
|
|
[address] "r" (addr), [offset] "i" (off))
|
|
|
|
#else
|
|
|
|
#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 RGBA_PLANE_MAX 3
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
#define UNROLL2(op...) op op
|
|
|
|
#define UNROLL4(op...) UNROLL2(op) UNROLL2(op)
|
|
|
|
#define UNROLL8(op...) UNROLL4(op) UNROLL4(op)
|
|
|
|
#define UNROLL16(op...) UNROLL8(op) UNROLL8(op)
|
|
|
|
|
|
|
|
#define UNROLL8_PLD_WHILE(start, size, end, op) \
|
|
|
|
pld(start, 0); \
|
|
|
|
end = start + (size & ~7); \
|
|
|
|
while (start < end) \
|
|
|
|
{ \
|
|
|
|
pld(start, 32); \
|
|
|
|
UNROLL8(op); \
|
|
|
|
} \
|
|
|
|
end += (size & 7); \
|
|
|
|
pld(start, 32); \
|
|
|
|
while (start < end) \
|
|
|
|
{ \
|
|
|
|
op; \
|
|
|
|
}
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
#include "../file/evas_module.h"
|
|
|
|
|
|
|
|
#include "evas_common_types.h"
|
|
|
|
|
|
|
|
typedef struct _Image_Entry Image_Entry;
|
|
|
|
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 struct _Evas_Preload_Pthread Evas_Preload_Pthread;
|
|
|
|
|
|
|
|
#ifdef BUILD_PIPE_RENDER
|
|
|
|
typedef struct _RGBA_Pipe_Op RGBA_Pipe_Op;
|
|
|
|
typedef struct _RGBA_Pipe RGBA_Pipe;
|
|
|
|
typedef struct _RGBA_Pipe_Thread_Info RGBA_Pipe_Thread_Info;
|
|
|
|
#endif
|
|
|
|
typedef struct _RGBA_Image RGBA_Image;
|
|
|
|
typedef struct _RGBA_Draw_Context RGBA_Draw_Context;
|
|
|
|
typedef struct _RGBA_Polygon_Point RGBA_Polygon_Point;
|
|
|
|
typedef struct _RGBA_Map_Point RGBA_Map_Point;
|
|
|
|
typedef struct _RGBA_Map RGBA_Map;
|
|
|
|
typedef struct _RGBA_Gfx_Compositor RGBA_Gfx_Compositor;
|
|
|
|
typedef struct _RGBA_Image_Data_Map RGBA_Image_Data_Map;
|
|
|
|
|
|
|
|
typedef struct _Cutout_Rect Cutout_Rect;
|
|
|
|
typedef struct _Cutout_Rects Cutout_Rects;
|
|
|
|
|
|
|
|
typedef struct _Convert_Pal Convert_Pal;
|
|
|
|
|
|
|
|
typedef struct _Tilebuf Tilebuf;
|
|
|
|
typedef struct _Tilebuf_Rect Tilebuf_Rect;
|
|
|
|
|
|
|
|
#ifndef NEWTILER
|
|
|
|
typedef struct _Tilebuf_Tile Tilebuf_Tile;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef struct _Evas_Common_Transform Evas_Common_Transform;
|
|
|
|
|
|
|
|
// RGBA_Map_Point
|
|
|
|
// all coords are 20.12
|
|
|
|
// fp type - an int for now
|
|
|
|
typedef int FPc;
|
|
|
|
// fp # of bits of float accuracy
|
|
|
|
#define FP 8
|
|
|
|
// fp half (half of an fp unit)
|
|
|
|
#define FPH (1 << (FP - 1))
|
|
|
|
// one fp unit
|
|
|
|
#define FP1 (1 << (FP))
|
|
|
|
|
|
|
|
typedef void (*Gfx_Func_Copy) (DATA32 *src, DATA32 *dst, int len);
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
|
|
typedef void (*Evas_Render_Done_Cb)(void *);
|
|
|
|
|
|
|
|
#include "../cache/evas_cache.h"
|
|
|
|
#include "../common/evas_font_draw.h"
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
typedef void (*Evas_Thread_Command_Cb)(void *data);
|
|
|
|
typedef struct _Evas_Thread_Command Evas_Thread_Command;
|
|
|
|
|
|
|
|
struct _Evas_Thread_Command
|
|
|
|
{
|
|
|
|
Evas_Thread_Command_Cb cb;
|
|
|
|
void *data;
|
|
|
|
};
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
typedef enum _RGBA_Image_Flags
|
|
|
|
{
|
|
|
|
RGBA_IMAGE_NOTHING = (0),
|
|
|
|
/* RGBA_IMAGE_HAS_ALPHA = (1 << 0), */
|
|
|
|
RGBA_IMAGE_IS_DIRTY = (1 << 1),
|
|
|
|
RGBA_IMAGE_INDEXED = (1 << 2),
|
|
|
|
/* RGBA_IMAGE_ALPHA_ONLY = (1 << 3), */
|
|
|
|
RGBA_IMAGE_ALPHA_TILES = (1 << 4),
|
|
|
|
/* RGBA_IMAGE_ALPHA_SPARSE = (1 << 5), */
|
|
|
|
/* RGBA_IMAGE_LOADED = (1 << 6), */
|
|
|
|
/* RGBA_IMAGE_NEED_DATA = (1 << 7) */
|
|
|
|
RGBA_IMAGE_TODO_LOAD = (1 << 8),
|
|
|
|
} RGBA_Image_Flags;
|
|
|
|
|
|
|
|
typedef enum _Convert_Pal_Mode
|
|
|
|
{
|
|
|
|
PAL_MODE_NONE,
|
|
|
|
PAL_MODE_MONO,
|
|
|
|
PAL_MODE_GRAY4,
|
|
|
|
PAL_MODE_GRAY16,
|
|
|
|
PAL_MODE_GRAY64,
|
|
|
|
PAL_MODE_GRAY256,
|
|
|
|
PAL_MODE_RGB111,
|
|
|
|
PAL_MODE_RGB121,
|
|
|
|
PAL_MODE_RGB221,
|
|
|
|
PAL_MODE_RGB222,
|
|
|
|
PAL_MODE_RGB232,
|
|
|
|
PAL_MODE_RGB332,
|
|
|
|
PAL_MODE_RGB666,
|
|
|
|
PAL_MODE_LAST
|
|
|
|
} Convert_Pal_Mode;
|
|
|
|
|
|
|
|
typedef enum _CPU_Features
|
|
|
|
{
|
|
|
|
CPU_FEATURE_C = 0,
|
|
|
|
CPU_FEATURE_MMX = (1 << 0),
|
|
|
|
CPU_FEATURE_MMX2 = (1 << 1),
|
|
|
|
CPU_FEATURE_SSE = (1 << 2),
|
|
|
|
CPU_FEATURE_ALTIVEC = (1 << 3),
|
|
|
|
CPU_FEATURE_VIS = (1 << 4),
|
|
|
|
CPU_FEATURE_VIS2 = (1 << 5),
|
|
|
|
CPU_FEATURE_NEON = (1 << 6),
|
|
|
|
CPU_FEATURE_SSE3 = (1 << 7),
|
|
|
|
CPU_FEATURE_SVE = (1 << 8)
|
|
|
|
} CPU_Features;
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
struct _Image_Entry_Flags
|
|
|
|
{
|
|
|
|
Eina_Bool loaded : 1;
|
|
|
|
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;
|
|
|
|
Eina_Bool preload_done : 1;
|
|
|
|
Eina_Bool delete_me : 1;
|
|
|
|
|
|
|
|
Eina_Bool pending : 1;
|
|
|
|
Eina_Bool rotated : 1;
|
|
|
|
Eina_Bool unload_cancel : 1;
|
|
|
|
Eina_Bool given_mmap : 1;
|
|
|
|
|
|
|
|
Eina_Bool updated_data : 1;
|
evas: jpeg loader - support flip, transpose, transverse
Summary:
Previously, jpeg image loader support rotation (90°, 180°, 270°) only.
this patch is about supporting flip(vertical, horizontal), transpose, transverse
@feature
Test Plan: I'm going to make tests in src/tests
Reviewers: cedric, raster, jpeg
CC: seoz, cedric
Differential Revision: https://phab.enlightenment.org/D1126
Signed-off-by: Cedric BAIL <c.bail@partner.samsung.com>
9 years ago
|
|
|
Eina_Bool flipped : 1;
|
|
|
|
Eina_Bool textured : 1;
|
|
|
|
Eina_Bool preload_pending : 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
|
|
|
|
{
|
|
|
|
EINA_INLIST;
|
|
|
|
const Eo *target;
|
|
|
|
void *data;
|
|
|
|
void (*preloaded_cb) (void *data); //Call when preloading done.
|
|
|
|
void *preloaded_data;
|
evas image: fix a bug in image preloading.
Summary:
Current preloading is too buggy since it's on thread-based.
This is a fundamental improvement to fix a bug.
The critical issue here is,
When preloading img object suddenly cancel its preloading,
the object possibly cannot render image next then because
renderer doesn't have any idea when async cancelling is
finished. Renderer just tries to render regardless of
image loading status, and this could occur no-texture(in gl case)
image object.
So, here improvement is, adding a notification for async cancelled
so that putting img objects to redraw images properly after their preloading is
cancelled.
The best scenario to reproduce this bug is this one.
Evas_Object *img2 = evas_object_image_filled_add(evas);
evas_object_image_file_set(img2, "test.jpg", NULL);
evas_object_image_preload(img2, EINA_FALSE);
evas_object_resize(img2, 200, 200);
evas_object_show(img2);
Evas_Object *img = evas_object_image_filled_add(evas);
evas_object_image_file_set(img, "test.jpg", NULL);
evas_object_image_preload(img, EINA_FALSE);
evas_object_move(img, 200, 200);
evas_object_resize(img, 200, 200);
evas_object_show(img);
evas_object_image_preload(img2, EINA_TRUE);
If you run this on gl backend, occasionally happens rendering fail.
Yet there other bugs on preloading feature....
@fix
Reviewers: #committers, raster
Subscribers: cedric, #reviewers, #committers, zmike
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D6919
4 years ago
|
|
|
Eina_Bool delete_me : 1;
|
|
|
|
Eina_Bool preload_cancel : 1;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _Image_Timestamp
|
|
|
|
{
|
|
|
|
time_t mtime;
|
|
|
|
off_t size;
|
|
|
|
ino_t ino;
|
|
|
|
#ifdef _STAT_VER_LINUX
|
|
|
|
unsigned long int mtime_nsec;
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _Image_Entry
|
|
|
|
{
|
|
|
|
EINA_INLIST;
|
|
|
|
|
|
|
|
int magic;
|
|
|
|
|
|
|
|
Evas_Cache_Image *cache;
|
|
|
|
|
|
|
|
const char *cache_key;
|
|
|
|
|
|
|
|
const char *file;
|
|
|
|
const char *key;
|
|
|
|
|
|
|
|
Evas_Cache_Target *targets;
|
|
|
|
Evas_Preload_Pthread *preload;
|
|
|
|
|
|
|
|
Image_Timestamp tstamp;
|
|
|
|
|
|
|
|
int references;
|
|
|
|
|
|
|
|
#ifdef BUILD_PIPE_RENDER
|
|
|
|
RGBA_Pipe *pipe;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
Evas_Image_Load_Opts load_opts;
|
|
|
|
Evas_Colorspace space;
|
|
|
|
const Evas_Colorspace *cspaces; // owned by the loader, live as long as the loader
|
evas: add image orient set/get API in software backend for now.
Summary:
Added API's to rotate(0, 90, 180, 270), flip(horizontal, vertical, transpose, transverse)
evas image object. Also added example to demonstrate this.
Signed-off-by: kabeer khan <kabeer.khan@samsung.com>
Reviewers: raster, stephenmhouston, cedric
Subscribers: stephenmhouston, cedric
Differential Revision: https://phab.enlightenment.org/D1950
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
8 years ago
|
|
|
Evas_Image_Orient orient;
|
|
|
|
|
|
|
|
unsigned int w;
|
|
|
|
unsigned int h;
|
|
|
|
|
|
|
|
unsigned char scale;
|
|
|
|
|
|
|
|
unsigned char need_unload : 1;
|
|
|
|
unsigned char load_failed : 1;
|
|
|
|
unsigned char need_data : 1;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
unsigned int w;
|
|
|
|
unsigned int h;
|
|
|
|
} allocated;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
unsigned char l, r, t, b;
|
|
|
|
} borders; // Duplicated borders for use by GL engines.
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
Evas_Module *module;
|
|
|
|
Evas_Image_Load_Func *loader;
|
|
|
|
} info;
|
|
|
|
|
|
|
|
SLK(lock);
|
|
|
|
SLK(lock_cancel);
|
|
|
|
|
|
|
|
/* for animation feature */
|
|
|
|
Evas_Image_Animated animated;
|
|
|
|
|
|
|
|
/* Reference to the file */
|
|
|
|
Eina_File *f;
|
|
|
|
void *loader_data;
|
|
|
|
|
|
|
|
Image_Entry_Flags flags;
|
|
|
|
Evas_Image_Scale_Hint scale_hint;
|
|
|
|
void *data1, *data2;
|
|
|
|
int server_id;
|
|
|
|
int connect_num;
|
|
|
|
int channel;
|
|
|
|
Evas_Load_Error load_error;
|
|
|
|
|
|
|
|
struct {
|
|
|
|
struct {
|
|
|
|
uint8_t *region;
|
|
|
|
} horizontal, vertical;
|
|
|
|
} stretch;
|
|
|
|
|
|
|
|
Eina_Rectangle content;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _Engine_Image_Entry
|
|
|
|
{
|
|
|
|
EINA_INLIST;
|
|
|
|
|
|
|
|
/* Upper Engine data. */
|
|
|
|
Image_Entry *src;
|
|
|
|
|
|
|
|
/* Cache stuff. */
|
|
|
|
Evas_Cache_Engine_Image *cache;
|
|
|
|
const char *cache_key;
|
|
|
|
|
|
|
|
struct
|
|
|
|
{
|
|
|
|
Eina_Bool cached : 1;
|
|
|
|
Eina_Bool activ : 1;
|
|
|
|
Eina_Bool dirty : 1;
|
|
|
|
Eina_Bool loaded : 1;
|
|
|
|
Eina_Bool need_parent : 1;
|
|
|
|
} flags;
|
|
|
|
|
|
|
|
int references;
|
|
|
|
int w;
|
|
|
|
int h;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _Cutout_Rect
|
|
|
|
{
|
|
|
|
int x, y, w, h;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _Cutout_Rects
|
|
|
|
{
|
|
|
|
Cutout_Rect *rects;
|
|
|
|
int active;
|
|
|
|
int max;
|
|
|
|
struct {
|
|
|
|
int x, w, y, h;
|
|
|
|
} last_add;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _Evas_Common_Transform
|
|
|
|
{
|
|
|
|
float mxx, mxy, mxz;
|
|
|
|
float myx, myy, myz;
|
|
|
|
float mzx, mzy, mzz;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct _RGBA_Draw_Context
|
|
|
|
{
|
|
|
|
struct {
|
|
|
|
struct {
|
|
|
|
void *(*gl_new) (void *data, RGBA_Font_Glyph *fg);
|
|
|
|
void (*gl_free) (void *ext_dat);
|
|
|
|
void (*gl_draw) (void *data, void *dest, void *context, RGBA_Font_Glyph *fg, int x, int y, int w, int h);
|
|
|
|
void *(*gl_image_new) (void *gc, RGBA_Font_Glyph *fg, int alpha, Evas_Colorspace cspace);
|
|
|
|
void (*gl_image_free) (void *image);
|
|
|
|
void (*gl_image_draw) (void *gc, void *im, int dx, int dy, int dw, int dh, int smooth);
|
|
|
|
} func;
|
|
|
|
void *data;
|
|
|
|
} font_ext;
|
|
|
|
struct {
|
|
|
|
int x, y, w, h;
|
|
|
|
} cutout_target;
|
|
|
|
struct RGBA_Draw_Context_clip {
|
|
|
|
Evas_Public_Data *evas; // for async unref
|
|
|
|
void *mask; // RGBA_Image (SW) or Evas_GL_Image (GL)
|
|
|
|
int x, y, w, h;
|
|
|
|
int mask_x, mask_y;
|
|
|
|
Eina_Bool use : 1;
|
|
|
|
Eina_Bool async : 1;
|
|
|
|
Eina_Bool mask_color : 1; // true if masking with color (eg. filters)
|
|
|
|
} clip;
|
|
|
|
struct {
|
|
|
|
#ifdef HAVE_PIXMAN
|
|
|
|
pixman_image_t *pixman_color_image;
|
|
|
|
#endif
|
|
|
|
DATA32 col;
|
|
|
|
} col;
|
|
|
|
Cutout_Rects cutout;
|
|
|
|
struct {
|
|
|
|
DATA32 col;
|
|
|
|
Eina_Bool use : 1;
|
|
|
|
} mul;
|
|
|
|
struct {
|
|
|
|
Cutout_Rects *rects;
|
|
|
|
unsigned int used;
|
|
|
|
} cache;
|
|
|
|
struct {
|
|
|
|
unsigned char color_space;
|
|
|
|
} interpolation;
|
|
|
|
unsigned char render_op;
|
|
|
|
unsigned char anti_alias : 1;
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef BUILD_PIPE_RENDER
|
|
|
|
#include "../common/evas_map_image.h"
|
|
|
|
|
|
|
|
struct _RGBA_Pipe_Op
|
|
|
|
{
|
|
|
|
RGBA_Draw_Context context;
|
|
|
|
Eina_Bool (*prepare_func) (void *data, RGBA_Image *dst, RGBA_Pipe_Op *op);
|
|
|
|
void (*op_func) (RGBA_Image *dst, const RGBA_Pipe_Op *op, const RGBA_Pipe_Thread_Info *info);
|
|
|
|
void (*free_func) (RGBA_Pipe_Op *op);
|
|
|
|
Cutout_Rects *rects;
|
|
|
|
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
int x, y, w, h;
|
|
|
|
} rect;
|
|
|
|
struct {
|
|
|
|
int x0, y0, x1, y1;
|
|
|
|
} line;
|
|
|
|
struct {
|
|
|
|
int x, y;
|
|
|
|
RGBA_Polygon_Point *points;
|
|
|
|
} poly;
|
|
|
|
struct {
|
|
|
|
int x, y;
|
|
|
|
Evas_Text_Props *intl_props;
|
|
|
|
RGBA_Gfx_Func func;
|
|
|
|
} text;
|
|
|
|
struct {
|
|
|
|
RGBA_Image *src;
|
|
|
|
int sx, sy, sw, sh, dx, dy, dw, dh;
|
|
|
|
int smooth;
|
|
|
|
char *text;
|
|
|
|
} image;
|
|
|
|
struct {
|
|
|
|
RGBA_Image *src;
|
|
|
|
RGBA_Map *m;
|
|
|
|
int npoints;
|
|
|
|
int smooth;
|
|
|
|
int level;
|
|
|
|
} map;
|
|