* evas: Loader can now tell if they could be used in another thread or not.

xpm and svg loader don't allow preload at this time.


SVN revision: 44714
This commit is contained in:
Cedric BAIL 2009-12-24 13:15:34 +00:00
parent 56ec4c946f
commit 7c00860cc1
11 changed files with 13 additions and 3 deletions

View File

@ -339,7 +339,7 @@ _evas_cache_image_async_heavy(void *data)
current->channel++; current->channel++;
cache = current->cache; cache = current->cache;
if (!current->flags.loaded) if (!current->flags.loaded && ((Evas_Image_Load_Func*) current->info.module)->threadable)
{ {
error = cache->func.load(current); error = cache->func.load(current);
if (cache->func.debug) if (cache->func.debug)
@ -368,7 +368,7 @@ _evas_cache_image_async_end(void *data)
ie->cache->pending = eina_list_remove(ie->cache->pending, ie); ie->cache->pending = eina_list_remove(ie->cache->pending, ie);
ie->preload = NULL; ie->preload = NULL;
ie->flags.preload_done = 1; ie->flags.preload_done = ie->flags.loaded;
while (ie->targets) while (ie->targets)
{ {
tmp = ie->targets; tmp = ie->targets;
@ -427,7 +427,7 @@ _evas_cache_image_entry_preload_add(Image_Entry *ie,
{ {
ie->cache->preload = eina_list_append(ie->cache->preload, ie); ie->cache->preload = eina_list_append(ie->cache->preload, ie);
ie->flags.pending = 0; ie->flags.pending = 0;
ie->preload = evas_preload_thread_run(_evas_cache_image_async_heavy, ie->preload = evas_preload_thread_run(_evas_cache_image_async_heavy,
_evas_cache_image_async_end, _evas_cache_image_async_end,
_evas_cache_image_async_cancel, _evas_cache_image_async_cancel,

View File

@ -707,6 +707,7 @@ struct _Evas_Func
struct _Evas_Image_Load_Func struct _Evas_Image_Load_Func
{ {
Eina_Bool threadable;
Eina_Bool (*file_head) (Image_Entry *ie, const char *file, const char *key, int *error); Eina_Bool (*file_head) (Image_Entry *ie, const char *file, const char *key, int *error);
Eina_Bool (*file_data) (Image_Entry *ie, const char *file, const char *key, int *error); Eina_Bool (*file_data) (Image_Entry *ie, const char *file, const char *key, int *error);
}; };

View File

@ -13,6 +13,7 @@ static Eina_Bool evas_image_load_file_data_edb(Image_Entry *ie, const char *file
static Evas_Image_Load_Func evas_image_load_edb_func = static Evas_Image_Load_Func evas_image_load_edb_func =
{ {
EINA_TRUE,
evas_image_load_file_head_edb, evas_image_load_file_head_edb,
evas_image_load_file_data_edb evas_image_load_file_data_edb
}; };

View File

@ -13,6 +13,7 @@ static Eina_Bool evas_image_load_file_data_eet(Image_Entry *ie, const char *file
Evas_Image_Load_Func evas_image_load_eet_func = Evas_Image_Load_Func evas_image_load_eet_func =
{ {
EINA_TRUE,
evas_image_load_file_head_eet, evas_image_load_file_head_eet,
evas_image_load_file_data_eet evas_image_load_file_data_eet
}; };

View File

@ -12,6 +12,7 @@ static Eina_Bool evas_image_load_file_data_gif(Image_Entry *ie, const char *file
static Evas_Image_Load_Func evas_image_load_gif_func = static Evas_Image_Load_Func evas_image_load_gif_func =
{ {
EINA_TRUE,
evas_image_load_file_head_gif, evas_image_load_file_head_gif,
evas_image_load_file_data_gif evas_image_load_file_data_gif
}; };

View File

@ -36,6 +36,7 @@ static Eina_Bool evas_image_load_file_data_jpeg(Image_Entry *ie, const char *fil
static Evas_Image_Load_Func evas_image_load_jpeg_func = static Evas_Image_Load_Func evas_image_load_jpeg_func =
{ {
EINA_TRUE,
evas_image_load_file_head_jpeg, evas_image_load_file_head_jpeg,
evas_image_load_file_data_jpeg evas_image_load_file_data_jpeg
}; };

View File

@ -21,6 +21,7 @@ static Eina_Bool evas_image_load_file_head_pmaps(Image_Entry *ie, const char *fi
static Eina_Bool evas_image_load_file_data_pmaps(Image_Entry *ie, const char *file, const char *key, int *error) EINA_ARG_NONNULL(1, 2, 4); static Eina_Bool evas_image_load_file_data_pmaps(Image_Entry *ie, const char *file, const char *key, int *error) EINA_ARG_NONNULL(1, 2, 4);
Evas_Image_Load_Func evas_image_load_pmaps_func = { Evas_Image_Load_Func evas_image_load_pmaps_func = {
EINA_TRUE,
evas_image_load_file_head_pmaps, evas_image_load_file_head_pmaps,
evas_image_load_file_data_pmaps evas_image_load_file_data_pmaps
}; };

View File

@ -37,6 +37,7 @@ static Eina_Bool evas_image_load_file_data_png(Image_Entry *ie, const char *file
static Evas_Image_Load_Func evas_image_load_png_func = static Evas_Image_Load_Func evas_image_load_png_func =
{ {
EINA_TRUE,
evas_image_load_file_head_png, evas_image_load_file_head_png,
evas_image_load_file_data_png evas_image_load_file_data_png
}; };

View File

@ -10,6 +10,7 @@ static Eina_Bool evas_image_load_file_data_svg(Image_Entry *ie, const char *file
Evas_Image_Load_Func evas_image_load_svg_func = Evas_Image_Load_Func evas_image_load_svg_func =
{ {
EINA_FALSE,
evas_image_load_file_head_svg, evas_image_load_file_head_svg,
evas_image_load_file_data_svg evas_image_load_file_data_svg
}; };

View File

@ -18,6 +18,7 @@ static Eina_Bool evas_image_load_file_data_tiff(Image_Entry *ie, const char *fil
static Evas_Image_Load_Func evas_image_load_tiff_func = static Evas_Image_Load_Func evas_image_load_tiff_func =
{ {
EINA_TRUE,
evas_image_load_file_head_tiff, evas_image_load_file_head_tiff,
evas_image_load_file_data_tiff evas_image_load_file_data_tiff
}; };

View File

@ -15,6 +15,7 @@ static Eina_Bool evas_image_load_file_data_xpm(Image_Entry *ie, const char *file
static Evas_Image_Load_Func evas_image_load_xpm_func = static Evas_Image_Load_Func evas_image_load_xpm_func =
{ {
EINA_FALSE,
evas_image_load_file_head_xpm, evas_image_load_file_head_xpm,
evas_image_load_file_data_xpm evas_image_load_file_data_xpm
}; };