forked from enlightenment/efl
fixed async preload stall bug! still 1 issue left when caches
(scalecaches) are flushed which can cause a hang until all data is "loaded back in" again. it's a bit of a doosey actually and so isn't fixed here. SVN revision: 55551
This commit is contained in:
parent
b600427f5d
commit
62c8659619
|
@ -272,6 +272,7 @@ _evas_cache_image_entry_delete(Evas_Cache_Image *cache, Image_Entry *ie)
|
||||||
|
|
||||||
#ifdef BUILD_ASYNC_PRELOAD
|
#ifdef BUILD_ASYNC_PRELOAD
|
||||||
LKD(ie->lock);
|
LKD(ie->lock);
|
||||||
|
LKD(ie->lock_cancel);
|
||||||
#endif
|
#endif
|
||||||
#ifdef EVAS_FRAME_QUEUING
|
#ifdef EVAS_FRAME_QUEUING
|
||||||
LKD(ie->lock_references);
|
LKD(ie->lock_references);
|
||||||
|
@ -336,6 +337,7 @@ _evas_cache_image_entry_new(Evas_Cache_Image *cache,
|
||||||
|
|
||||||
#ifdef BUILD_ASYNC_PRELOAD
|
#ifdef BUILD_ASYNC_PRELOAD
|
||||||
LKI(ie->lock);
|
LKI(ie->lock);
|
||||||
|
LKI(ie->lock_cancel);
|
||||||
ie->targets = NULL;
|
ie->targets = NULL;
|
||||||
ie->preload = NULL;
|
ie->preload = NULL;
|
||||||
ie->flags.delete_me = 0;
|
ie->flags.delete_me = 0;
|
||||||
|
@ -431,6 +433,18 @@ _evas_cache_image_async_heavy(void *data)
|
||||||
}
|
}
|
||||||
|
|
||||||
current->channel = pchannel;
|
current->channel = pchannel;
|
||||||
|
|
||||||
|
// check the unload cancel flag
|
||||||
|
LKL(current->lock_cancel);
|
||||||
|
if (current->unload_cancel)
|
||||||
|
{
|
||||||
|
current->unload_cancel = EINA_FALSE;
|
||||||
|
cache->func.surface_delete(current);
|
||||||
|
current->flags.loaded = 0;
|
||||||
|
current->flags.preload_done = 0;
|
||||||
|
}
|
||||||
|
LKU(current->lock_cancel);
|
||||||
|
|
||||||
LKU(current->lock);
|
LKU(current->lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1406,7 +1420,15 @@ evas_cache_image_unload_data(Image_Entry *im)
|
||||||
evas_cache_image_preload_cancel(im, NULL);
|
evas_cache_image_preload_cancel(im, NULL);
|
||||||
|
|
||||||
#ifdef BUILD_ASYNC_PRELOAD
|
#ifdef BUILD_ASYNC_PRELOAD
|
||||||
LKL(im->lock);
|
LKL(im->lock_cancel);
|
||||||
|
if (LKT(im->lock) != 0) /* can't get image lock - busy async load */
|
||||||
|
{
|
||||||
|
im->unload_cancel = EINA_TRUE;
|
||||||
|
LKU(im->lock_cancel);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
LKU(im->lock_cancel);
|
||||||
|
// LKL(im->lock);
|
||||||
#endif
|
#endif
|
||||||
if ((!im->flags.loaded) || (!im->file) ||
|
if ((!im->flags.loaded) || (!im->file) ||
|
||||||
(!im->info.module) || (im->flags.dirty))
|
(!im->info.module) || (im->flags.dirty))
|
||||||
|
@ -1453,17 +1475,22 @@ EAPI void
|
||||||
evas_cache_image_preload_data(Image_Entry *im, const void *target)
|
evas_cache_image_preload_data(Image_Entry *im, const void *target)
|
||||||
{
|
{
|
||||||
#ifdef BUILD_ASYNC_PRELOAD
|
#ifdef BUILD_ASYNC_PRELOAD
|
||||||
|
RGBA_Image *img = (RGBA_Image *)im;
|
||||||
|
|
||||||
assert(im);
|
assert(im);
|
||||||
assert(im->cache);
|
assert(im->cache);
|
||||||
|
|
||||||
if (im->flags.loaded)
|
if ((im->flags.loaded) && (img->image.data))
|
||||||
{
|
{
|
||||||
evas_object_inform_call_image_preloaded((Evas_Object *)target);
|
evas_object_inform_call_image_preloaded((Evas_Object *)target);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
im->flags.loaded = 0;
|
||||||
|
|
||||||
if (!_evas_cache_image_entry_preload_add(im, target))
|
if (!_evas_cache_image_entry_preload_add(im, target))
|
||||||
evas_object_inform_call_image_preloaded((Evas_Object *)target);
|
{
|
||||||
|
evas_object_inform_call_image_preloaded((Evas_Object *)target);
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
evas_cache_image_load_data(im);
|
evas_cache_image_load_data(im);
|
||||||
evas_object_inform_call_image_preloaded((Evas_Object *)target);
|
evas_object_inform_call_image_preloaded((Evas_Object *)target);
|
||||||
|
|
|
@ -102,7 +102,11 @@ evas_common_rgba_image_colorspace_set(Image_Entry* ie_dst, int cspace)
|
||||||
case EVAS_COLORSPACE_YCBCR422P709_PL:
|
case EVAS_COLORSPACE_YCBCR422P709_PL:
|
||||||
if (dst->image.no_free)
|
if (dst->image.no_free)
|
||||||
{
|
{
|
||||||
dst->image.data = NULL;
|
ie_dst->allocated.w = 0;
|
||||||
|
ie_dst->allocated.h = 0;
|
||||||
|
ie_dst->flags.preload_done = 0;
|
||||||
|
ie_dst->flags.loaded = 0;
|
||||||
|
dst->image.data = NULL;
|
||||||
dst->image.no_free = 0;
|
dst->image.no_free = 0;
|
||||||
/* FIXME: Must allocate image.data surface cleanly. */
|
/* FIXME: Must allocate image.data surface cleanly. */
|
||||||
}
|
}
|
||||||
|
|
|
@ -213,6 +213,8 @@ evas_common_rgba_image_unload(Image_Entry *ie)
|
||||||
im->image.data = NULL;
|
im->image.data = NULL;
|
||||||
ie->allocated.w = 0;
|
ie->allocated.w = 0;
|
||||||
ie->allocated.h = 0;
|
ie->allocated.h = 0;
|
||||||
|
ie->flags.preload_done = 0;
|
||||||
|
ie->flags.loaded = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -222,6 +224,8 @@ evas_common_rgba_image_unload(Image_Entry *ie)
|
||||||
im->image.data = NULL;
|
im->image.data = NULL;
|
||||||
ie->allocated.w = 0;
|
ie->allocated.w = 0;
|
||||||
ie->allocated.h = 0;
|
ie->allocated.h = 0;
|
||||||
|
ie->flags.preload_done = 0;
|
||||||
|
ie->flags.loaded = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@ -284,6 +288,10 @@ _evas_common_rgba_image_surface_delete(Image_Entry *ie)
|
||||||
evas_cserve_image_free(ie);
|
evas_cserve_image_free(ie);
|
||||||
#endif
|
#endif
|
||||||
im->image.data = NULL;
|
im->image.data = NULL;
|
||||||
|
ie->allocated.w = 0;
|
||||||
|
ie->allocated.h = 0;
|
||||||
|
ie->flags.preload_done = 0;
|
||||||
|
ie->flags.loaded = 0;
|
||||||
evas_common_rgba_image_scalecache_dirty(&im->cache_entry);
|
evas_common_rgba_image_scalecache_dirty(&im->cache_entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -729,19 +729,22 @@ evas_common_rgba_image_scalecache_do(Image_Entry *ie, RGBA_Image *dst,
|
||||||
* causes only speed-down side-effect and no memory usage gain;
|
* causes only speed-down side-effect and no memory usage gain;
|
||||||
* it will be loaded again for the very next rendering for this image.
|
* it will be loaded again for the very next rendering for this image.
|
||||||
*/
|
*/
|
||||||
if ((dounload) ||
|
if (ie->scale_hint != EVAS_IMAGE_SCALE_HINT_DYNAMIC)
|
||||||
((im->cache_entry.flags.loaded) &&
|
|
||||||
((!im->cs.no_free)
|
|
||||||
#ifdef EVAS_CSERVE
|
|
||||||
|| (ie->data1)
|
|
||||||
#endif
|
|
||||||
) &&
|
|
||||||
(im->cache_entry.space == EVAS_COLORSPACE_ARGB8888)))
|
|
||||||
{
|
{
|
||||||
if ((dounload) || (im->cache.orig_usage <
|
if ((dounload) ||
|
||||||
(im->cache.newest_usage / 20)))
|
((im->cache_entry.flags.loaded) &&
|
||||||
|
((!im->cs.no_free)
|
||||||
|
#ifdef EVAS_CSERVE
|
||||||
|
|| (ie->data1)
|
||||||
|
#endif
|
||||||
|
) &&
|
||||||
|
(im->cache_entry.space == EVAS_COLORSPACE_ARGB8888)))
|
||||||
{
|
{
|
||||||
evas_common_rgba_image_unload(&im->cache_entry);
|
if ((dounload) || (im->cache.orig_usage <
|
||||||
|
(im->cache.newest_usage / 20)))
|
||||||
|
{
|
||||||
|
evas_common_rgba_image_unload(&im->cache_entry);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -598,6 +598,8 @@ struct _Image_Entry
|
||||||
|
|
||||||
#ifdef BUILD_ASYNC_PRELOAD
|
#ifdef BUILD_ASYNC_PRELOAD
|
||||||
LK(lock);
|
LK(lock);
|
||||||
|
LK(lock_cancel);
|
||||||
|
Eina_Bool unload_cancel : 1;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Image_Entry_Flags flags;
|
Image_Entry_Flags flags;
|
||||||
|
|
Loading…
Reference in New Issue