forked from enlightenment/efl
evas: move flags and attribute around.
This commit is contained in:
parent
2b61da5a5a
commit
c5b0d28d73
|
@ -321,9 +321,9 @@ _evas_cache_image_async_heavy(void *data)
|
|||
current->channel = pchannel;
|
||||
// check the unload cancel flag
|
||||
LKL(current->lock_cancel);
|
||||
if (current->unload_cancel)
|
||||
if (current->flags.unload_cancel)
|
||||
{
|
||||
current->unload_cancel = EINA_FALSE;
|
||||
current->flags.unload_cancel = EINA_FALSE;
|
||||
cache->func.surface_delete(current);
|
||||
current->flags.loaded = 0;
|
||||
current->flags.preload_done = 0;
|
||||
|
@ -963,7 +963,7 @@ evas_cache_image_load_data(Image_Entry *im)
|
|||
Eina_Bool preload = EINA_FALSE;
|
||||
int error = EVAS_LOAD_ERROR_NONE;
|
||||
|
||||
if ((im->flags.loaded) && (!im->flags.animated)) return error;
|
||||
if ((im->flags.loaded) && (!im->animated.animated)) return error;
|
||||
if (im->preload)
|
||||
{
|
||||
preload = EINA_TRUE;
|
||||
|
@ -987,7 +987,7 @@ evas_cache_image_load_data(Image_Entry *im)
|
|||
LKU(wakeup);
|
||||
}
|
||||
|
||||
if ((im->flags.loaded) && (!im->flags.animated)) return error;
|
||||
if ((im->flags.loaded) && (!im->animated.animated)) return error;
|
||||
|
||||
LKL(im->lock);
|
||||
im->flags.in_progress = EINA_TRUE;
|
||||
|
@ -1015,7 +1015,7 @@ evas_cache_image_unload_data(Image_Entry *im)
|
|||
LKL(im->lock_cancel);
|
||||
if (LKT(im->lock) == EINA_FALSE) /* can't get image lock - busy async load */
|
||||
{
|
||||
im->unload_cancel = EINA_TRUE;
|
||||
im->flags.unload_cancel = EINA_TRUE;
|
||||
LKU(im->lock_cancel);
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -935,7 +935,7 @@ evas_cache2_image_load_data(Image_Entry *ie)
|
|||
{
|
||||
int error = EVAS_LOAD_ERROR_NONE;
|
||||
|
||||
if ((ie->flags.loaded) && (!ie->flags.animated))
|
||||
if ((ie->flags.loaded) && (!ie->animated.animated))
|
||||
return error;
|
||||
|
||||
ie->flags.in_progress = EINA_TRUE;
|
||||
|
|
|
@ -203,11 +203,11 @@ _evas_common_rgba_image_delete(Image_Entry *ie)
|
|||
// if (ie->data1) evas_cserve2_image_free(ie);
|
||||
#endif
|
||||
|
||||
if (ie->frames)
|
||||
if (ie->animated.frames)
|
||||
{
|
||||
Eina_List *l;
|
||||
Image_Entry_Frame *frame;
|
||||
EINA_LIST_FOREACH(ie->frames, l, frame)
|
||||
EINA_LIST_FOREACH(ie->animated.frames, l, frame)
|
||||
{
|
||||
if (frame)
|
||||
{
|
||||
|
|
|
@ -849,7 +849,7 @@ evas_common_rgba_image_scalecache_do_cbs(Image_Entry *ie, RGBA_Image *dst,
|
|||
didpop = 1;
|
||||
}
|
||||
}
|
||||
if (sci->im && !ie->flags.animated)
|
||||
if (sci->im && !ie->animated.animated)
|
||||
{
|
||||
if (!didpop)
|
||||
{
|
||||
|
|
|
@ -339,9 +339,9 @@ _image_opened_cb(void *data, const void *msg_received)
|
|||
ie->w = msg->image.w;
|
||||
ie->h = msg->image.h;
|
||||
ie->flags.alpha = msg->image.alpha;
|
||||
ie->loop_hint = msg->image.loop_hint;
|
||||
ie->loop_count = msg->image.loop_count;
|
||||
ie->frame_count = msg->image.frame_count;
|
||||
ie->animated.loop_hint = msg->image.loop_hint;
|
||||
ie->animated.loop_count = msg->image.loop_count;
|
||||
ie->animated.frame_count = msg->image.frame_count;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -352,6 +352,8 @@ typedef unsigned short DATA16;
|
|||
typedef unsigned char DATA8;
|
||||
|
||||
typedef struct _Image_Entry Image_Entry;
|
||||
typedef struct _Image_Entry_Property Image_Entry_Property;
|
||||
typedef struct _Image_Entry_Animated Image_Entry_Animated;
|
||||
typedef struct _Image_Entry_Flags Image_Entry_Flags;
|
||||
typedef struct _Image_Entry_Frame Image_Entry_Frame;
|
||||
typedef struct _Image_Timestamp Image_Timestamp;
|
||||
|
@ -514,24 +516,24 @@ struct _RGBA_Image_Loadopts
|
|||
|
||||
struct _Image_Entry_Flags
|
||||
{
|
||||
Eina_Bool loaded : 1;
|
||||
Eina_Bool in_progress : 1;
|
||||
Eina_Bool dirty : 1;
|
||||
Eina_Bool activ : 1;
|
||||
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 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 lru : 1;
|
||||
Eina_Bool alpha_sparse : 1;
|
||||
Eina_Bool preload_done : 1;
|
||||
Eina_Bool delete_me : 1;
|
||||
|
||||
Eina_Bool pending : 1;
|
||||
Eina_Bool animated : 1;
|
||||
Eina_Bool rotated : 1;
|
||||
Eina_Bool pending : 1;
|
||||
Eina_Bool rotated : 1;
|
||||
Eina_Bool unload_cancel : 1;
|
||||
};
|
||||
|
||||
struct _Image_Entry_Frame
|
||||
|
@ -542,6 +544,17 @@ struct _Image_Entry_Frame
|
|||
Eina_Bool loaded : 1;
|
||||
};
|
||||
|
||||
struct _Image_Entry_Animated
|
||||
{
|
||||
Eina_List *frames;
|
||||
Evas_Image_Animated_Loop_Hint loop_hint;
|
||||
int frame_count;
|
||||
int loop_count;
|
||||
int cur_frame;
|
||||
|
||||
Eina_Bool animated : 1;
|
||||
};
|
||||
|
||||
struct _Evas_Cache_Target
|
||||
{
|
||||
EINA_INLIST;
|
||||
|
@ -559,6 +572,16 @@ struct _Image_Timestamp
|
|||
#endif
|
||||
};
|
||||
|
||||
struct _Image_Entry_Property
|
||||
{
|
||||
unsigned int w;
|
||||
unsigned int h;
|
||||
|
||||
unsigned char scale;
|
||||
|
||||
Eina_Bool alpha;
|
||||
};
|
||||
|
||||
struct _Image_Entry
|
||||
{
|
||||
EINA_INLIST;
|
||||
|
@ -584,13 +607,14 @@ struct _Image_Entry
|
|||
RGBA_Pipe *pipe;
|
||||
#endif
|
||||
|
||||
unsigned char scale;
|
||||
|
||||
RGBA_Image_Loadopts load_opts;
|
||||
int space;
|
||||
|
||||
unsigned int w;
|
||||
unsigned int h;
|
||||
|
||||
unsigned char scale;
|
||||
|
||||
struct
|
||||
{
|
||||
unsigned int w;
|
||||
|
@ -605,7 +629,6 @@ struct _Image_Entry
|
|||
|
||||
LK(lock);
|
||||
LK(lock_cancel);
|
||||
Eina_Bool unload_cancel : 1;
|
||||
|
||||
Image_Entry_Flags flags;
|
||||
Evas_Image_Scale_Hint scale_hint;
|
||||
|
@ -619,11 +642,7 @@ struct _Image_Entry
|
|||
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;
|
||||
Image_Entry_Animated animated;
|
||||
};
|
||||
|
||||
struct _Engine_Image_Entry
|
||||
|
|
|
@ -556,7 +556,7 @@ evas_gl_common_image_update(Evas_Engine_GL_Context *gc, Evas_GL_Image *im)
|
|||
{
|
||||
case EVAS_COLORSPACE_ARGB8888:
|
||||
if ((im->tex) &&
|
||||
((im->dirty) || (ie->flags.animated)))
|
||||
((im->dirty) || (ie->animated.animated)))
|
||||
{
|
||||
evas_cache_image_load_data(&im->im->cache_entry);
|
||||
evas_gl_common_texture_update(im->tex, im->im);
|
||||
|
|
|
@ -3074,7 +3074,7 @@ eng_image_animated_get(void *data EINA_UNUSED, void *image)
|
|||
im = (Image_Entry *)gim->im;
|
||||
if (!im) return EINA_FALSE;
|
||||
|
||||
return im->flags.animated;
|
||||
return im->animated.animated;
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -3087,8 +3087,8 @@ eng_image_animated_frame_count_get(void *data EINA_UNUSED, void *image)
|
|||
im = (Image_Entry *)gim->im;
|
||||
if (!im) return -1;
|
||||
|
||||
if (!im->flags.animated) return -1;
|
||||
return im->frame_count;
|
||||
if (!im->animated.animated) return -1;
|
||||
return im->animated.frame_count;
|
||||
}
|
||||
|
||||
static Evas_Image_Animated_Loop_Hint
|
||||
|
@ -3101,8 +3101,8 @@ eng_image_animated_loop_type_get(void *data EINA_UNUSED, void *image)
|
|||
im = (Image_Entry *)gim->im;
|
||||
if (!im) return EVAS_IMAGE_ANIMATED_HINT_NONE;
|
||||
|
||||
if (!im->flags.animated) return EVAS_IMAGE_ANIMATED_HINT_NONE;
|
||||
return im->loop_hint;
|
||||
if (!im->animated.animated) return EVAS_IMAGE_ANIMATED_HINT_NONE;
|
||||
return im->animated.loop_hint;
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -3115,8 +3115,8 @@ eng_image_animated_loop_count_get(void *data EINA_UNUSED, void *image)
|
|||
im = (Image_Entry *)gim->im;
|
||||
if (!im) return -1;
|
||||
|
||||
if (!im->flags.animated) return -1;
|
||||
return im->loop_count;
|
||||
if (!im->animated.animated) return -1;
|
||||
return im->animated.loop_count;
|
||||
}
|
||||
|
||||
static double
|
||||
|
@ -3129,7 +3129,7 @@ eng_image_animated_frame_duration_get(void *data EINA_UNUSED, void *image, int s
|
|||
im = (Image_Entry *)gim->im;
|
||||
if (!im) return -1;
|
||||
|
||||
if (!im->flags.animated) return -1;
|
||||
if (!im->animated.animated) return -1;
|
||||
return evas_common_load_rgba_image_frame_duration_from_file(im, start_frame, frame_num);
|
||||
}
|
||||
|
||||
|
@ -3143,10 +3143,10 @@ eng_image_animated_frame_set(void *data EINA_UNUSED, void *image, int frame_inde
|
|||
im = (Image_Entry *)gim->im;
|
||||
if (!im) return EINA_FALSE;
|
||||
|
||||
if (!im->flags.animated) return EINA_FALSE;
|
||||
if (im->cur_frame == frame_index) return EINA_FALSE;
|
||||
if (!im->animated.animated) return EINA_FALSE;
|
||||
if (im->animated.cur_frame == frame_index) return EINA_FALSE;
|
||||
|
||||
im->cur_frame = frame_index;
|
||||
im->animated.cur_frame = frame_index;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
|
|
|
@ -1711,7 +1711,7 @@ eng_image_animated_get(void *data EINA_UNUSED, void *image)
|
|||
|
||||
if (!image) return EINA_FALSE;
|
||||
im = image;
|
||||
return im->flags.animated;
|
||||
return im->animated.animated;
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -1721,8 +1721,8 @@ eng_image_animated_frame_count_get(void *data EINA_UNUSED, void *image)
|
|||
|
||||
if (!image) return -1;
|
||||
im = image;
|
||||
if (!im->flags.animated) return -1;
|
||||
return im->frame_count;
|
||||
if (!im->animated.animated) return -1;
|
||||
return im->animated.frame_count;
|
||||
}
|
||||
|
||||
static Evas_Image_Animated_Loop_Hint
|
||||
|
@ -1732,8 +1732,8 @@ eng_image_animated_loop_type_get(void *data EINA_UNUSED, void *image)
|
|||
|
||||
if (!image) return EVAS_IMAGE_ANIMATED_HINT_NONE;
|
||||
im = image;
|
||||
if (!im->flags.animated) return EVAS_IMAGE_ANIMATED_HINT_NONE;
|
||||
return im->loop_hint;
|
||||
if (!im->animated.animated) return EVAS_IMAGE_ANIMATED_HINT_NONE;
|
||||
return im->animated.loop_hint;
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -1743,8 +1743,8 @@ eng_image_animated_loop_count_get(void *data EINA_UNUSED, void *image)
|
|||
|
||||
if (!image) return -1;
|
||||
im = image;
|
||||
if (!im->flags.animated) return -1;
|
||||
return im->loop_count;
|
||||
if (!im->animated.animated) return -1;
|
||||
return im->animated.loop_count;
|
||||
}
|
||||
|
||||
static double
|
||||
|
@ -1754,7 +1754,7 @@ eng_image_animated_frame_duration_get(void *data EINA_UNUSED, void *image, int s
|
|||
|
||||
if (!image) return -1;
|
||||
im = image;
|
||||
if (!im->flags.animated) return -1;
|
||||
if (!im->animated.animated) return -1;
|
||||
return evas_common_load_rgba_image_frame_duration_from_file(im, start_frame, frame_num);
|
||||
}
|
||||
|
||||
|
@ -1765,9 +1765,9 @@ eng_image_animated_frame_set(void *data EINA_UNUSED, void *image, int frame_inde
|
|||
|
||||
if (!image) return EINA_FALSE;
|
||||
im = image;
|
||||
if (!im->flags.animated) return EINA_FALSE;
|
||||
if (im->cur_frame == frame_index) return EINA_FALSE;
|
||||
im->cur_frame = frame_index;
|
||||
if (!im->animated.animated) return EINA_FALSE;
|
||||
if (im->animated.cur_frame == frame_index) return EINA_FALSE;
|
||||
im->animated.cur_frame = frame_index;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue