* evas: Loader can now tell if they could be used in another thread or not.
authorcedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 24 Dec 2009 13:15:34 +0000 (13:15 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Thu, 24 Dec 2009 13:15:34 +0000 (13:15 +0000)
xpm and svg loader don't allow preload at this time.

git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@44714 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/cache/evas_cache_image.c
src/lib/include/evas_private.h
src/modules/loaders/edb/evas_image_load_edb.c
src/modules/loaders/eet/evas_image_load_eet.c
src/modules/loaders/gif/evas_image_load_gif.c
src/modules/loaders/jpeg/evas_image_load_jpeg.c
src/modules/loaders/pmaps/evas_image_load_pmaps.c
src/modules/loaders/png/evas_image_load_png.c
src/modules/loaders/svg/evas_image_load_svg.c
src/modules/loaders/tiff/evas_image_load_tiff.c
src/modules/loaders/xpm/evas_image_load_xpm.c

index 17d4097..534130d 100644 (file)
@@ -339,7 +339,7 @@ _evas_cache_image_async_heavy(void *data)
    current->channel++;
    cache = current->cache;
 
-   if (!current->flags.loaded)
+   if (!current->flags.loaded && ((Evas_Image_Load_Func*) current->info.module)->threadable)
      {
        error = cache->func.load(current);
        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->preload = NULL;
-   ie->flags.preload_done = 1;
+   ie->flags.preload_done = ie->flags.loaded;
    while (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->flags.pending = 0;
-        
+
         ie->preload = evas_preload_thread_run(_evas_cache_image_async_heavy,
                                               _evas_cache_image_async_end,
                                               _evas_cache_image_async_cancel,
index 154db59..8eda2f0 100644 (file)
@@ -707,6 +707,7 @@ struct _Evas_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_data) (Image_Entry *ie, const char *file, const char *key, int *error);
 };
index c3d6a59..239a072 100644 (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 =
 {
+  EINA_TRUE,
   evas_image_load_file_head_edb,
   evas_image_load_file_data_edb
 };
index 93fb592..0e6407a 100644 (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 =
 {
+  EINA_TRUE,
   evas_image_load_file_head_eet,
   evas_image_load_file_data_eet
 };
index 63485f2..1bf75b9 100644 (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 =
 {
+  EINA_TRUE,
   evas_image_load_file_head_gif,
   evas_image_load_file_data_gif
 };
index 560215f..b181a0e 100644 (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 =
 {
+  EINA_TRUE,
   evas_image_load_file_head_jpeg,
   evas_image_load_file_data_jpeg
 };
index 0884058..4c7e709 100644 (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);
 
 Evas_Image_Load_Func evas_image_load_pmaps_func = {
+   EINA_TRUE,
    evas_image_load_file_head_pmaps,
    evas_image_load_file_data_pmaps
 };
index 2b88511..e541a41 100644 (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 =
 {
+  EINA_TRUE,
   evas_image_load_file_head_png,
   evas_image_load_file_data_png
 };
index 75bbf31..5e7e1f1 100644 (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 =
 {
+  EINA_FALSE,
   evas_image_load_file_head_svg,
   evas_image_load_file_data_svg
 };
index 1428c27..57d0cfb 100644 (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 =
 {
+  EINA_TRUE,
   evas_image_load_file_head_tiff,
   evas_image_load_file_data_tiff
 };
index b7af63e..a4d3534 100644 (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 =
 {
+  EINA_FALSE,
   evas_image_load_file_head_xpm,
   evas_image_load_file_data_xpm
 };