forked from enlightenment/efl
evas/cserve2: Rename _evas_cache_ to _evas_cache2_
This commit is contained in:
parent
45456f8cf0
commit
7bf4394198
|
@ -33,23 +33,23 @@
|
||||||
// Default LRU size. If 0, all scaled images will be dropped instantly.
|
// Default LRU size. If 0, all scaled images will be dropped instantly.
|
||||||
#define DEFAULT_CACHE_LRU_SIZE (4*1024*1024)
|
#define DEFAULT_CACHE_LRU_SIZE (4*1024*1024)
|
||||||
|
|
||||||
static void _evas_cache_image_dirty_add(Image_Entry *im);
|
static void _evas_cache2_image_dirty_add(Image_Entry *im);
|
||||||
static void _evas_cache_image_dirty_del(Image_Entry *im);
|
static void _evas_cache2_image_dirty_del(Image_Entry *im);
|
||||||
static void _evas_cache_image_activ_add(Image_Entry *im);
|
static void _evas_cache2_image_activ_add(Image_Entry *im);
|
||||||
static void _evas_cache_image_activ_del(Image_Entry *im);
|
static void _evas_cache2_image_activ_del(Image_Entry *im);
|
||||||
static void _evas_cache_image_lru_add(Image_Entry *im);
|
static void _evas_cache2_image_lru_add(Image_Entry *im);
|
||||||
static void _evas_cache_image_lru_del(Image_Entry *im);
|
static void _evas_cache2_image_lru_del(Image_Entry *im);
|
||||||
static void _evas_cache2_image_entry_preload_remove(Image_Entry *ie, const void *target);
|
static void _evas_cache2_image_entry_preload_remove(Image_Entry *ie, const void *target);
|
||||||
// static void _evas_cache_image_lru_nodata_add(Image_Entry *im);
|
// static void _evas_cache2_image_lru_nodata_add(Image_Entry *im);
|
||||||
// static void _evas_cache_image_lru_nodata_del(Image_Entry *im);
|
// static void _evas_cache2_image_lru_nodata_del(Image_Entry *im);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_evas_cache_image_dirty_add(Image_Entry *im)
|
_evas_cache2_image_dirty_add(Image_Entry *im)
|
||||||
{
|
{
|
||||||
if (im->flags.dirty) return;
|
if (im->flags.dirty) return;
|
||||||
_evas_cache_image_activ_del(im);
|
_evas_cache2_image_activ_del(im);
|
||||||
_evas_cache_image_lru_del(im);
|
_evas_cache2_image_lru_del(im);
|
||||||
// _evas_cache_image_lru_nodata_del(im);
|
// _evas_cache2_image_lru_nodata_del(im);
|
||||||
im->flags.dirty = 1;
|
im->flags.dirty = 1;
|
||||||
im->flags.cached = 1;
|
im->flags.cached = 1;
|
||||||
im->cache2->dirty = eina_inlist_prepend(im->cache2->dirty, EINA_INLIST_GET(im));
|
im->cache2->dirty = eina_inlist_prepend(im->cache2->dirty, EINA_INLIST_GET(im));
|
||||||
|
@ -61,7 +61,7 @@ _evas_cache_image_dirty_add(Image_Entry *im)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_evas_cache_image_dirty_del(Image_Entry *im)
|
_evas_cache2_image_dirty_del(Image_Entry *im)
|
||||||
{
|
{
|
||||||
if (!im->flags.dirty) return;
|
if (!im->flags.dirty) return;
|
||||||
if (!im->cache2) return;
|
if (!im->cache2) return;
|
||||||
|
@ -71,12 +71,12 @@ _evas_cache_image_dirty_del(Image_Entry *im)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_evas_cache_image_activ_add(Image_Entry *im)
|
_evas_cache2_image_activ_add(Image_Entry *im)
|
||||||
{
|
{
|
||||||
if (im->flags.activ) return;
|
if (im->flags.activ) return;
|
||||||
_evas_cache_image_dirty_del(im);
|
_evas_cache2_image_dirty_del(im);
|
||||||
_evas_cache_image_lru_del(im);
|
_evas_cache2_image_lru_del(im);
|
||||||
// _evas_cache_image_lru_nodata_del(im);
|
// _evas_cache2_image_lru_nodata_del(im);
|
||||||
if (!im->cache_key) return;
|
if (!im->cache_key) return;
|
||||||
im->flags.activ = 1;
|
im->flags.activ = 1;
|
||||||
im->flags.cached = 1;
|
im->flags.cached = 1;
|
||||||
|
@ -84,7 +84,7 @@ _evas_cache_image_activ_add(Image_Entry *im)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_evas_cache_image_activ_del(Image_Entry *im)
|
_evas_cache2_image_activ_del(Image_Entry *im)
|
||||||
{
|
{
|
||||||
if (!im->flags.activ) return;
|
if (!im->flags.activ) return;
|
||||||
if (!im->cache_key) return;
|
if (!im->cache_key) return;
|
||||||
|
@ -94,12 +94,12 @@ _evas_cache_image_activ_del(Image_Entry *im)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_evas_cache_image_lru_add(Image_Entry *im)
|
_evas_cache2_image_lru_add(Image_Entry *im)
|
||||||
{
|
{
|
||||||
if (im->flags.lru) return;
|
if (im->flags.lru) return;
|
||||||
_evas_cache_image_dirty_del(im);
|
_evas_cache2_image_dirty_del(im);
|
||||||
_evas_cache_image_activ_del(im);
|
_evas_cache2_image_activ_del(im);
|
||||||
// _evas_cache_image_lru_nodata_del(im);
|
// _evas_cache2_image_lru_nodata_del(im);
|
||||||
if (!im->cache_key) return;
|
if (!im->cache_key) return;
|
||||||
im->flags.lru = 1;
|
im->flags.lru = 1;
|
||||||
im->flags.cached = 1;
|
im->flags.cached = 1;
|
||||||
|
@ -109,7 +109,7 @@ _evas_cache_image_lru_add(Image_Entry *im)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_evas_cache_image_lru_del(Image_Entry *im)
|
_evas_cache2_image_lru_del(Image_Entry *im)
|
||||||
{
|
{
|
||||||
if (!im->flags.lru) return;
|
if (!im->flags.lru) return;
|
||||||
if (!im->cache_key) return;
|
if (!im->cache_key) return;
|
||||||
|
@ -122,19 +122,19 @@ _evas_cache_image_lru_del(Image_Entry *im)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
static void
|
static void
|
||||||
_evas_cache_image_lru_nodata_add(Image_Entry *im)
|
_evas_cache2_image_lru_nodata_add(Image_Entry *im)
|
||||||
{
|
{
|
||||||
if (im->flags.lru_nodata) return;
|
if (im->flags.lru_nodata) return;
|
||||||
_evas_cache_image_dirty_del(im);
|
_evas_cache2_image_dirty_del(im);
|
||||||
_evas_cache_image_activ_del(im);
|
_evas_cache2_image_activ_del(im);
|
||||||
_evas_cache_image_lru_del(im);
|
_evas_cache2_image_lru_del(im);
|
||||||
im->flags.lru = 1;
|
im->flags.lru = 1;
|
||||||
im->flags.cached = 1;
|
im->flags.cached = 1;
|
||||||
im->cache2->lru_nodata = eina_inlist_prepend(im->cache2->lru_nodata, EINA_INLIST_GET(im));
|
im->cache2->lru_nodata = eina_inlist_prepend(im->cache2->lru_nodata, EINA_INLIST_GET(im));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_evas_cache_image_lru_nodata_del(Image_Entry *im)
|
_evas_cache2_image_lru_nodata_del(Image_Entry *im)
|
||||||
{
|
{
|
||||||
if (!im->flags.lru_nodata) return;
|
if (!im->flags.lru_nodata) return;
|
||||||
im->flags.lru = 0;
|
im->flags.lru = 0;
|
||||||
|
@ -177,7 +177,7 @@ _timestamp_build(Image_Timestamp *tstamp, struct stat *st)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_evas_cache_image_entry_delete(Evas_Cache2 *cache, Image_Entry *ie)
|
_evas_cache2_image_entry_delete(Evas_Cache2 *cache, Image_Entry *ie)
|
||||||
{
|
{
|
||||||
if (!ie) return;
|
if (!ie) return;
|
||||||
|
|
||||||
|
@ -191,10 +191,10 @@ _evas_cache_image_entry_delete(Evas_Cache2 *cache, Image_Entry *ie)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_evas_cache_image_dirty_del(ie);
|
_evas_cache2_image_dirty_del(ie);
|
||||||
_evas_cache_image_activ_del(ie);
|
_evas_cache2_image_activ_del(ie);
|
||||||
_evas_cache_image_lru_del(ie);
|
_evas_cache2_image_lru_del(ie);
|
||||||
// _evas_cache_image_lru_nodata_del(ie);
|
// _evas_cache2_image_lru_nodata_del(ie);
|
||||||
|
|
||||||
|
|
||||||
if (ie->data1)
|
if (ie->data1)
|
||||||
|
@ -220,7 +220,7 @@ _evas_cache_image_entry_delete(Evas_Cache2 *cache, Image_Entry *ie)
|
||||||
}
|
}
|
||||||
|
|
||||||
static Image_Entry *
|
static Image_Entry *
|
||||||
_evas_cache_image_entry_new(Evas_Cache2 *cache,
|
_evas_cache2_image_entry_new(Evas_Cache2 *cache,
|
||||||
const char *hkey,
|
const char *hkey,
|
||||||
Image_Timestamp *tstamp,
|
Image_Timestamp *tstamp,
|
||||||
const char *file,
|
const char *file,
|
||||||
|
@ -264,15 +264,15 @@ _evas_cache_image_entry_new(Evas_Cache2 *cache,
|
||||||
{
|
{
|
||||||
ERR("couldn't load '%s' '%s' with cserve2!",
|
ERR("couldn't load '%s' '%s' with cserve2!",
|
||||||
ie->file, ie->key ? ie->key : "");
|
ie->file, ie->key ? ie->key : "");
|
||||||
_evas_cache_image_entry_delete(cache, ie);
|
_evas_cache2_image_entry_delete(cache, ie);
|
||||||
if (error)
|
if (error)
|
||||||
*error = EVAS_LOAD_ERROR_GENERIC;
|
*error = EVAS_LOAD_ERROR_GENERIC;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ie->cache_key) _evas_cache_image_activ_add(ie);
|
if (ie->cache_key) _evas_cache2_image_activ_add(ie);
|
||||||
else _evas_cache_image_dirty_add(ie);
|
else _evas_cache2_image_dirty_add(ie);
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
*error = EVAS_LOAD_ERROR_NONE;
|
*error = EVAS_LOAD_ERROR_NONE;
|
||||||
|
@ -319,7 +319,7 @@ _evas_cache2_image_preloaded_cb(void *data, Eina_Bool success)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ie->flags.delete_me)
|
if (ie->flags.delete_me)
|
||||||
_evas_cache_image_entry_delete(ie->cache2, ie);
|
_evas_cache2_image_entry_delete(ie->cache2, ie);
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
|
@ -393,7 +393,7 @@ evas_cache2_image_copied_data(Evas_Cache2 *cache, unsigned int w, unsigned int h
|
||||||
(cspace == EVAS_COLORSPACE_YCBCR422601_PL))
|
(cspace == EVAS_COLORSPACE_YCBCR422601_PL))
|
||||||
w &= ~0x1;
|
w &= ~0x1;
|
||||||
|
|
||||||
im = _evas_cache_image_entry_new(cache, NULL, NULL, NULL, NULL, NULL, NULL);
|
im = _evas_cache2_image_entry_new(cache, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||||
if (!im)
|
if (!im)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -402,7 +402,7 @@ evas_cache2_image_copied_data(Evas_Cache2 *cache, unsigned int w, unsigned int h
|
||||||
evas_cache2_image_surface_alloc(im, w, h);
|
evas_cache2_image_surface_alloc(im, w, h);
|
||||||
if (cache->func.copied_data(im, w, h, image_data, alpha, cspace) != 0)
|
if (cache->func.copied_data(im, w, h, image_data, alpha, cspace) != 0)
|
||||||
{
|
{
|
||||||
_evas_cache_image_entry_delete(cache, im);
|
_evas_cache2_image_entry_delete(cache, im);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -423,14 +423,14 @@ evas_cache2_image_data(Evas_Cache2 *cache, unsigned int w, unsigned int h, DATA3
|
||||||
(cspace == EVAS_COLORSPACE_YCBCR422601_PL))
|
(cspace == EVAS_COLORSPACE_YCBCR422601_PL))
|
||||||
w &= ~0x1;
|
w &= ~0x1;
|
||||||
|
|
||||||
im = _evas_cache_image_entry_new(cache, NULL, NULL, NULL, NULL, NULL, NULL);
|
im = _evas_cache2_image_entry_new(cache, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||||
if (!im) return NULL;
|
if (!im) return NULL;
|
||||||
im->w = w;
|
im->w = w;
|
||||||
im->h = h;
|
im->h = h;
|
||||||
im->flags.alpha = alpha;
|
im->flags.alpha = alpha;
|
||||||
if (cache->func.data(im, w, h, image_data, alpha, cspace) != 0)
|
if (cache->func.data(im, w, h, image_data, alpha, cspace) != 0)
|
||||||
{
|
{
|
||||||
_evas_cache_image_entry_delete(cache, im);
|
_evas_cache2_image_entry_delete(cache, im);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
im->references = 1;
|
im->references = 1;
|
||||||
|
@ -444,7 +444,7 @@ evas_cache2_image_empty(Evas_Cache2 *cache)
|
||||||
{
|
{
|
||||||
Image_Entry *im;
|
Image_Entry *im;
|
||||||
|
|
||||||
im = _evas_cache_image_entry_new(cache, NULL, NULL, NULL, NULL, NULL, NULL);
|
im = _evas_cache2_image_entry_new(cache, NULL, NULL, NULL, NULL, NULL, NULL);
|
||||||
if (!im)
|
if (!im)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
@ -467,7 +467,7 @@ evas_cache2_image_size_set(Image_Entry *im, unsigned int w, unsigned h)
|
||||||
if ((im->w == w) && (im->h == h)) return im;
|
if ((im->w == w) && (im->h == h)) return im;
|
||||||
|
|
||||||
cache = im->cache2;
|
cache = im->cache2;
|
||||||
im2 = _evas_cache_image_entry_new(cache, NULL, NULL, NULL, NULL, NULL,
|
im2 = _evas_cache2_image_entry_new(cache, NULL, NULL, NULL, NULL, NULL,
|
||||||
NULL);
|
NULL);
|
||||||
if (!im2) goto on_error;
|
if (!im2) goto on_error;
|
||||||
|
|
||||||
|
@ -486,7 +486,7 @@ evas_cache2_image_size_set(Image_Entry *im, unsigned int w, unsigned h)
|
||||||
|
|
||||||
on_error:
|
on_error:
|
||||||
if (im2)
|
if (im2)
|
||||||
_evas_cache_image_entry_delete(cache, im2);
|
_evas_cache2_image_entry_delete(cache, im2);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -510,7 +510,7 @@ evas_cache2_init(const Evas_Cache2_Image_Func *cb)
|
||||||
}
|
}
|
||||||
|
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_evas_cache_image_free_cb(EINA_UNUSED const Eina_Hash *hash, EINA_UNUSED const void *key, void *data, void *fdata)
|
_evas_cache2_image_free_cb(EINA_UNUSED const Eina_Hash *hash, EINA_UNUSED const void *key, void *data, void *fdata)
|
||||||
{
|
{
|
||||||
Eina_List **delete_list = fdata;
|
Eina_List **delete_list = fdata;
|
||||||
*delete_list = eina_list_prepend(*delete_list, data);
|
*delete_list = eina_list_prepend(*delete_list, data);
|
||||||
|
@ -526,20 +526,20 @@ evas_cache2_shutdown(Evas_Cache2 *cache)
|
||||||
while (cache->lru)
|
while (cache->lru)
|
||||||
{
|
{
|
||||||
im = (Image_Entry *)cache->lru;
|
im = (Image_Entry *)cache->lru;
|
||||||
_evas_cache_image_entry_delete(cache, im);
|
_evas_cache2_image_entry_delete(cache, im);
|
||||||
}
|
}
|
||||||
/* This is mad, I am about to destroy image still alive, but we need to prevent leak. */
|
/* This is mad, I am about to destroy image still alive, but we need to prevent leak. */
|
||||||
while (cache->dirty)
|
while (cache->dirty)
|
||||||
{
|
{
|
||||||
im = (Image_Entry *)cache->dirty;
|
im = (Image_Entry *)cache->dirty;
|
||||||
_evas_cache_image_entry_delete(cache, im);
|
_evas_cache2_image_entry_delete(cache, im);
|
||||||
}
|
}
|
||||||
|
|
||||||
delete_list = NULL;
|
delete_list = NULL;
|
||||||
eina_hash_foreach(cache->activ, _evas_cache_image_free_cb, &delete_list);
|
eina_hash_foreach(cache->activ, _evas_cache2_image_free_cb, &delete_list);
|
||||||
while (delete_list)
|
while (delete_list)
|
||||||
{
|
{
|
||||||
_evas_cache_image_entry_delete(cache, eina_list_data_get(delete_list));
|
_evas_cache2_image_entry_delete(cache, eina_list_data_get(delete_list));
|
||||||
delete_list = eina_list_remove_list(delete_list, delete_list);
|
delete_list = eina_list_remove_list(delete_list, delete_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -701,7 +701,7 @@ evas_cache2_image_open(Evas_Cache2 *cache, const char *path, const char *key,
|
||||||
* of an image at a given key. we wither find it and keep re-reffing
|
* of an image at a given key. we wither find it and keep re-reffing
|
||||||
* it or we dirty it and get it out */
|
* it or we dirty it and get it out */
|
||||||
DBG("Entry on inactive hash was invalid (file changed or deleted).");
|
DBG("Entry on inactive hash was invalid (file changed or deleted).");
|
||||||
_evas_cache_image_dirty_add(im);
|
_evas_cache2_image_dirty_add(im);
|
||||||
im = NULL;
|
im = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -727,15 +727,15 @@ evas_cache2_image_open(Evas_Cache2 *cache, const char *path, const char *key,
|
||||||
if (ok)
|
if (ok)
|
||||||
{
|
{
|
||||||
/* remove from lru and make it active again */
|
/* remove from lru and make it active again */
|
||||||
_evas_cache_image_lru_del(im);
|
_evas_cache2_image_lru_del(im);
|
||||||
_evas_cache_image_activ_add(im);
|
_evas_cache2_image_activ_add(im);
|
||||||
goto on_ok;
|
goto on_ok;
|
||||||
}
|
}
|
||||||
DBG("Entry on inactive hash was invalid (file changed or deleted).");
|
DBG("Entry on inactive hash was invalid (file changed or deleted).");
|
||||||
/* as avtive cache find - if we match in lru and its invalid, dirty */
|
/* as avtive cache find - if we match in lru and its invalid, dirty */
|
||||||
_evas_cache_image_dirty_add(im);
|
_evas_cache2_image_dirty_add(im);
|
||||||
/* this image never used, so it have to be deleted */
|
/* this image never used, so it have to be deleted */
|
||||||
_evas_cache_image_entry_delete(cache, im);
|
_evas_cache2_image_entry_delete(cache, im);
|
||||||
im = NULL;
|
im = NULL;
|
||||||
}
|
}
|
||||||
if (stat_failed) goto on_stat_error;
|
if (stat_failed) goto on_stat_error;
|
||||||
|
@ -746,7 +746,7 @@ evas_cache2_image_open(Evas_Cache2 *cache, const char *path, const char *key,
|
||||||
}
|
}
|
||||||
_timestamp_build(&tstamp, &st);
|
_timestamp_build(&tstamp, &st);
|
||||||
DBG("Creating a new entry for key '%s'.", hkey);
|
DBG("Creating a new entry for key '%s'.", hkey);
|
||||||
im = _evas_cache_image_entry_new(cache, hkey, &tstamp, path, key,
|
im = _evas_cache2_image_entry_new(cache, hkey, &tstamp, path, key,
|
||||||
lo, error);
|
lo, error);
|
||||||
if (!im) goto on_stat_error;
|
if (!im) goto on_stat_error;
|
||||||
|
|
||||||
|
@ -777,7 +777,7 @@ on_stat_error:
|
||||||
else
|
else
|
||||||
*error = EVAS_LOAD_ERROR_GENERIC;
|
*error = EVAS_LOAD_ERROR_GENERIC;
|
||||||
|
|
||||||
if (im) _evas_cache_image_entry_delete(cache, im);
|
if (im) _evas_cache2_image_entry_delete(cache, im);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -844,8 +844,8 @@ _scaled_image_find(Image_Entry *im, int src_x, int src_y, int src_w, int src_h,
|
||||||
if (!ret) return NULL;
|
if (!ret) return NULL;
|
||||||
|
|
||||||
/* Remove from lru and make it active again */
|
/* Remove from lru and make it active again */
|
||||||
_evas_cache_image_lru_del(ret);
|
_evas_cache2_image_lru_del(ret);
|
||||||
_evas_cache_image_activ_add(ret);
|
_evas_cache2_image_activ_add(ret);
|
||||||
|
|
||||||
found:
|
found:
|
||||||
ret->references++;
|
ret->references++;
|
||||||
|
@ -905,13 +905,13 @@ evas_cache2_image_scale_load(Image_Entry *im,
|
||||||
evas_cache2_image_cache_key_create(hkey, im->file, pathlen,
|
evas_cache2_image_cache_key_create(hkey, im->file, pathlen,
|
||||||
im->key, keylen, &lo);
|
im->key, keylen, &lo);
|
||||||
|
|
||||||
ret = _evas_cache_image_entry_new(im->cache2, hkey, NULL, im->file, im->key,
|
ret = _evas_cache2_image_entry_new(im->cache2, hkey, NULL, im->file, im->key,
|
||||||
&lo, &error);
|
&lo, &error);
|
||||||
if (error != EVAS_LOAD_ERROR_NONE)
|
if (error != EVAS_LOAD_ERROR_NONE)
|
||||||
{
|
{
|
||||||
ERR("Failed to create scale image entry with error code %d.", error);
|
ERR("Failed to create scale image entry with error code %d.", error);
|
||||||
|
|
||||||
if (ret) _evas_cache_image_entry_delete(im->cache2, ret);
|
if (ret) _evas_cache2_image_entry_delete(im->cache2, ret);
|
||||||
goto parent_out;
|
goto parent_out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -957,11 +957,11 @@ evas_cache2_image_close(Image_Entry *im)
|
||||||
|
|
||||||
if (im->flags.dirty)
|
if (im->flags.dirty)
|
||||||
{
|
{
|
||||||
_evas_cache_image_entry_delete(cache, im);
|
_evas_cache2_image_entry_delete(cache, im);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_evas_cache_image_lru_add(im);
|
_evas_cache2_image_lru_add(im);
|
||||||
if (cache)
|
if (cache)
|
||||||
evas_cache2_flush(cache);
|
evas_cache2_flush(cache);
|
||||||
}
|
}
|
||||||
|
@ -1067,7 +1067,7 @@ evas_cache2_image_writable(Image_Entry *im)
|
||||||
if (!im->cache_key)
|
if (!im->cache_key)
|
||||||
{
|
{
|
||||||
if (!im->flags.dirty)
|
if (!im->flags.dirty)
|
||||||
_evas_cache_image_dirty_add(im);
|
_evas_cache2_image_dirty_add(im);
|
||||||
return im;
|
return im;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1082,7 +1082,7 @@ evas_cache2_image_writable(Image_Entry *im)
|
||||||
|
|
||||||
on_error:
|
on_error:
|
||||||
if (im2)
|
if (im2)
|
||||||
_evas_cache_image_entry_delete(cache, im2);
|
_evas_cache2_image_entry_delete(cache, im2);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1095,7 +1095,7 @@ evas_cache2_image_dirty(Image_Entry *im, unsigned int x, unsigned int y, unsigne
|
||||||
if (!im->cache_key)
|
if (!im->cache_key)
|
||||||
{
|
{
|
||||||
if (!im->flags.dirty)
|
if (!im->flags.dirty)
|
||||||
_evas_cache_image_dirty_add(im);
|
_evas_cache2_image_dirty_add(im);
|
||||||
im2 = im;
|
im2 = im;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1130,7 +1130,7 @@ evas_cache2_flush(Evas_Cache2 *cache)
|
||||||
|
|
||||||
im = (Image_Entry *)cache->lru->last;
|
im = (Image_Entry *)cache->lru->last;
|
||||||
DBG("Remove unused entry from cache.");
|
DBG("Remove unused entry from cache.");
|
||||||
_evas_cache_image_entry_delete(cache, im);
|
_evas_cache2_image_entry_delete(cache, im);
|
||||||
}
|
}
|
||||||
|
|
||||||
return cache->usage;
|
return cache->usage;
|
||||||
|
|
Loading…
Reference in New Issue