summaryrefslogtreecommitdiff
path: root/src/lib/evas/common
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-07-12 13:17:08 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-07-12 13:17:08 +0900
commit59db1cd0e25e830dd49013489bfc0d7527126b9c (patch)
treef1bc33012c85ba2f0d91b2fe9e4566500666680a /src/lib/evas/common
parent8b3c3b5a7fbefb15c846a99b58af4a4336f387be (diff)
evas - unload/scalecache self-feeding loop unload/reload fix
i was runing perf top and noticed that evas_image_load_file_data_eet(0 was being called. in fact - it was #1 on the list of functions being called. why? it didn't make sense. i found out. just a blinking cursor in terminology was causing the background to be unloaded and re-loaded. the new "actually unload" changes for 1.15 made this happen and thus we kept sucking in new data all the time even if the scalecache already had the data - and that was the problem. so now calcecache prepare tells you if you don't have cached data and if you likely then have to ensure the data is loaded. this cuts down quite a bit of work. while i'm at it... we definitely need to clean house on the internals of evas. a decade+ of features, mess, optimizations needs to be fixed. i mean really house-cleaned. rewritten clenl;y re-using existing code where appropriate.
Diffstat (limited to 'src/lib/evas/common')
-rw-r--r--src/lib/evas/common/evas_image.h2
-rw-r--r--src/lib/evas/common/evas_image_scalecache.c14
2 files changed, 9 insertions, 7 deletions
diff --git a/src/lib/evas/common/evas_image.h b/src/lib/evas/common/evas_image.h
index a625bba..f21cd6c 100644
--- a/src/lib/evas/common/evas_image.h
+++ b/src/lib/evas/common/evas_image.h
@@ -46,7 +46,7 @@ EAPI unsigned int evas_common_rgba_image_scalecache_size_get(void);
46EAPI void evas_common_rgba_image_scalecache_flush(void); 46EAPI void evas_common_rgba_image_scalecache_flush(void);
47EAPI void evas_common_rgba_image_scalecache_dump(void); 47EAPI void evas_common_rgba_image_scalecache_dump(void);
48EAPI void evas_common_rgba_image_scalecache_prune(void); 48EAPI void evas_common_rgba_image_scalecache_prune(void);
49EAPI void 49EAPI Eina_Bool
50 evas_common_rgba_image_scalecache_prepare(Image_Entry *ie, RGBA_Image *dst, 50 evas_common_rgba_image_scalecache_prepare(Image_Entry *ie, RGBA_Image *dst,
51 RGBA_Draw_Context *dc, int smooth, 51 RGBA_Draw_Context *dc, int smooth,
52 int src_region_x, int src_region_y, 52 int src_region_x, int src_region_y,
diff --git a/src/lib/evas/common/evas_image_scalecache.c b/src/lib/evas/common/evas_image_scalecache.c
index 1a8229f..16c4451 100644
--- a/src/lib/evas/common/evas_image_scalecache.c
+++ b/src/lib/evas/common/evas_image_scalecache.c
@@ -497,7 +497,7 @@ evas_common_rgba_image_scalecache_flush(void)
497#endif 497#endif
498} 498}
499 499
500EAPI void 500EAPI Eina_Bool
501evas_common_rgba_image_scalecache_prepare(Image_Entry *ie, RGBA_Image *dst EINA_UNUSED, 501evas_common_rgba_image_scalecache_prepare(Image_Entry *ie, RGBA_Image *dst EINA_UNUSED,
502 RGBA_Draw_Context *dc, int smooth, 502 RGBA_Draw_Context *dc, int smooth,
503 int src_region_x, int src_region_y, 503 int src_region_x, int src_region_y,
@@ -510,9 +510,9 @@ evas_common_rgba_image_scalecache_prepare(Image_Entry *ie, RGBA_Image *dst EINA_
510 Eina_Lock_Result ret; 510 Eina_Lock_Result ret;
511 RGBA_Image *im = (RGBA_Image *)ie; 511 RGBA_Image *im = (RGBA_Image *)ie;
512 Scaleitem *sci; 512 Scaleitem *sci;
513 if (!im->image.data) return; 513
514 if ((dst_region_w == 0) || (dst_region_h == 0) || 514 if ((dst_region_w == 0) || (dst_region_h == 0) ||
515 (src_region_w == 0) || (src_region_h == 0)) return; 515 (src_region_w == 0) || (src_region_h == 0)) return EINA_TRUE;
516 // was having major lock issues here - SLKL was deadlocking. what was 516 // was having major lock issues here - SLKL was deadlocking. what was
517 // going on? it may have been an eina treads badness but this will stay here 517 // going on? it may have been an eina treads badness but this will stay here
518 // for now for debug 518 // for now for debug
@@ -563,7 +563,7 @@ evas_common_rgba_image_scalecache_prepare(Image_Entry *ie, RGBA_Image *dst EINA_
563 im->cache.orig_usage++; 563 im->cache.orig_usage++;
564 im->cache.usage_count = use_counter; 564 im->cache.usage_count = use_counter;
565 if (locked) SLKU(im->cache.lock); 565 if (locked) SLKU(im->cache.lock);
566 return; 566 return EINA_FALSE;
567 } 567 }
568 if ((!im->cache_entry.flags.alpha) && (!smooth)) 568 if ((!im->cache_entry.flags.alpha) && (!smooth))
569 { 569 {
@@ -572,7 +572,7 @@ evas_common_rgba_image_scalecache_prepare(Image_Entry *ie, RGBA_Image *dst EINA_
572 im->cache.orig_usage++; 572 im->cache.orig_usage++;
573 im->cache.usage_count = use_counter; 573 im->cache.usage_count = use_counter;
574 if (locked) SLKU(im->cache.lock); 574 if (locked) SLKU(im->cache.lock);
575 return; 575 return EINA_FALSE;
576 } 576 }
577 SLKL(cache_lock); 577 SLKL(cache_lock);
578 sci = _sci_find(im, dc, smooth, 578 sci = _sci_find(im, dc, smooth,
@@ -582,7 +582,7 @@ evas_common_rgba_image_scalecache_prepare(Image_Entry *ie, RGBA_Image *dst EINA_
582 { 582 {
583 SLKU(cache_lock); 583 SLKU(cache_lock);
584 if (locked) SLKU(im->cache.lock); 584 if (locked) SLKU(im->cache.lock);
585 return; 585 return EINA_FALSE;
586 } 586 }
587// INF("%10i | %4i %4i %4ix%4i -> %4i %4i %4ix%4i | %i", 587// INF("%10i | %4i %4i %4ix%4i -> %4i %4i %4ix%4i | %i",
588// (int)use_counter, 588// (int)use_counter,
@@ -620,6 +620,8 @@ evas_common_rgba_image_scalecache_prepare(Image_Entry *ie, RGBA_Image *dst EINA_
620// INF(" -------------- used %8i#, %8i@", (int)sci->usage, (int)sci->usage_count); 620// INF(" -------------- used %8i#, %8i@", (int)sci->usage, (int)sci->usage_count);
621 if (locked) SLKU(im->cache.lock); 621 if (locked) SLKU(im->cache.lock);
622#endif 622#endif
623 if ((!im->image.data) && (sci->populate_me)) return EINA_FALSE;
624 return EINA_TRUE;
623} 625}
624 626
625#ifdef SCALECACHE 627#ifdef SCALECACHE