cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=68470a50fe5483c06924e41488679f1e9bd93565

commit 68470a50fe5483c06924e41488679f1e9bd93565
Author: Cedric BAIL <ced...@osg.samsung.com>
Date:   Tue Dec 6 16:24:59 2016 -0800

    evas: as an example make PMAPS decoding interruptible.
---
 .../evas/image_loaders/pmaps/evas_image_load_pmaps.c  | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/modules/evas/image_loaders/pmaps/evas_image_load_pmaps.c 
b/src/modules/evas/image_loaders/pmaps/evas_image_load_pmaps.c
index 0a15181..afd2e5f 100644
--- a/src/modules/evas/image_loaders/pmaps/evas_image_load_pmaps.c
+++ b/src/modules/evas/image_loaders/pmaps/evas_image_load_pmaps.c
@@ -107,6 +107,7 @@ evas_image_load_file_data_pmaps(void *loader_data,
    Pmaps_Buffer b;
    int size;
    DATA32 *ptr;
+   unsigned short count = 0;
    Eina_Bool r = EINA_FALSE;
 
    if (!pmaps_buffer_open(&b, f, EINA_FALSE, error))
@@ -123,11 +124,13 @@ evas_image_load_file_data_pmaps(void *loader_data,
    ptr = pixels;
    if (b.type[1] != '4')
      {
-       while (size > 0 && b.color_get(&b, ptr))
-         {
-            size--;
-            ptr++;
-         }
+        while (size > 0 && b.color_get(&b, ptr))
+          {
+             size--;
+             ptr++;
+
+             EVAS_MODULE_TASK_CHECK(count, 0x3FF, error, on_error);
+          }
      }
    else
      {
@@ -145,8 +148,10 @@ evas_image_load_file_data_pmaps(void *loader_data,
                  ptr++;
                  size--;
               }
-            b.current++;
-         }
+             b.current++;
+
+             EVAS_MODULE_TASK_CHECK(count, 0x3FF, error, on_error);
+          }
      }
 
    /* if there are some pix missing, give them a proper default */

-- 


Reply via email to