summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJean-Philippe Andre <jp.andre@samsung.com>2013-09-09 13:57:45 +0900
committerJean-Philippe Andre <jp.andre@samsung.com>2013-10-28 15:47:15 +0900
commitfc73405c40653a5fc0166690e3657ffd87069efc (patch)
treeb6fc15bc9e1babdbfed3ea0566d35c5f2d5c6b65
parent0d506a7b7369aad8376336497e755092cbe8cb40 (diff)
evas/cserve2: Add cache hit count on image data
-rw-r--r--src/lib/evas/cache2/evas_cache2.c5
-rw-r--r--src/lib/evas/cserve2/evas_cs2_image_data.c9
-rw-r--r--src/lib/evas/cserve2/evas_cs2_private.h2
3 files changed, 15 insertions, 1 deletions
diff --git a/src/lib/evas/cache2/evas_cache2.c b/src/lib/evas/cache2/evas_cache2.c
index 0444741289..fc7982d5ba 100644
--- a/src/lib/evas/cache2/evas_cache2.c
+++ b/src/lib/evas/cache2/evas_cache2.c
@@ -982,7 +982,10 @@ evas_cache2_image_load_data(Image_Entry *ie)
982 int error = EVAS_LOAD_ERROR_NONE; 982 int error = EVAS_LOAD_ERROR_NONE;
983 983
984 if ((ie->flags.loaded) && (!ie->animated.animated)) 984 if ((ie->flags.loaded) && (!ie->animated.animated))
985 return error; 985 {
986 evas_cserve2_image_hit(ie);
987 return EVAS_LOAD_ERROR_NONE;
988 }
986 989
987 ie->flags.in_progress = EINA_TRUE; 990 ie->flags.in_progress = EINA_TRUE;
988 991
diff --git a/src/lib/evas/cserve2/evas_cs2_image_data.c b/src/lib/evas/cserve2/evas_cs2_image_data.c
index a5e49da396..845107e55b 100644
--- a/src/lib/evas/cserve2/evas_cs2_image_data.c
+++ b/src/lib/evas/cserve2/evas_cs2_image_data.c
@@ -20,4 +20,13 @@ evas_cserve2_image_data_get(Image_Entry *ie)
20 return dentry->shm.data; 20 return dentry->shm.data;
21} 21}
22 22
23unsigned int
24evas_cserve2_image_hit(Image_Entry *ie)
25{
26 Data_Entry *dentry = ie->data2;
27
28 if (!dentry) return 0;
29 return ++dentry->hit_count;
30}
31
23#endif 32#endif
diff --git a/src/lib/evas/cserve2/evas_cs2_private.h b/src/lib/evas/cserve2/evas_cs2_private.h
index 8d12e693c7..c0ed575f81 100644
--- a/src/lib/evas/cserve2/evas_cs2_private.h
+++ b/src/lib/evas/cserve2/evas_cs2_private.h
@@ -14,6 +14,7 @@ typedef struct _Shared_Buffer Shared_Buffer;
14struct _Data_Entry 14struct _Data_Entry
15{ 15{
16 unsigned int image_id; 16 unsigned int image_id;
17 unsigned int hit_count;
17 void (*preloaded_cb)(void *, Eina_Bool); 18 void (*preloaded_cb)(void *, Eina_Bool);
18 struct { 19 struct {
19 const char *path; 20 const char *path;
@@ -81,6 +82,7 @@ Eina_Bool evas_cserve2_image_preload(Image_Entry *ie, void (*preloaded_cb)(void
81void evas_cserve2_dispatch(void); 82void evas_cserve2_dispatch(void);
82 83
83void *evas_cserve2_image_data_get(Image_Entry *ie); 84void *evas_cserve2_image_data_get(Image_Entry *ie);
85unsigned int evas_cserve2_image_hit(Image_Entry *ie);
84 86
85Font_Entry *evas_cserve2_font_load(const char *source, const char *name, int size, int dpi, Font_Rend_Flags wanted_rend); 87Font_Entry *evas_cserve2_font_load(const char *source, const char *name, int size, int dpi, Font_Rend_Flags wanted_rend);
86EAPI int evas_cserve2_font_load_wait(Font_Entry *fe); 88EAPI int evas_cserve2_font_load_wait(Font_Entry *fe);