evas: set mmap data to image data after preload with skip_head enabled

this is a bit ugly, but in the case where skip_head is used it's important
to propagate the resulting Eina_File back up to the image object's data
for use in other api functions

Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D11422
This commit is contained in:
Mike Blumenkrantz 2020-02-26 09:38:13 -05:00 committed by Marcel Hollerbach
parent 92a03628c8
commit 576229bf6a
3 changed files with 16 additions and 1 deletions

View File

@ -386,6 +386,8 @@ _evas_cache_image_preloaded_notify(Image_Entry *ie)
ie->targets = (Evas_Cache_Target *)
eina_inlist_remove(EINA_INLIST_GET(ie->targets),
EINA_INLIST_GET(ie->targets));
if (ie->load_opts.skip_head && !tmp->delete_me && !tmp->preload_cancel)
_evas_image_preload_update((void*)tmp->target, ie->f);
if (!tmp->delete_me && tmp->preloaded_cb)
tmp->preloaded_cb(tmp->preloaded_data);
if (!tmp->preload_cancel)

View File

@ -19,6 +19,19 @@ _evas_image_file_unload(Eo *eo_obj)
_evas_image_done_set(eo_obj, obj, o);
o->load_error = EFL_GFX_IMAGE_LOAD_ERROR_NONE;
}
void
_evas_image_preload_update(Eo *eo_obj, Eina_File *f)
{
Evas_Image_Data *o = efl_data_scope_get(eo_obj, EFL_CANVAS_IMAGE_INTERNAL_CLASS);
if (o->cur->f) return;
EINA_COW_IMAGE_STATE_WRITE_BEGIN(o, cur)
{
cur->f = eina_file_dup(f);
}
EINA_COW_IMAGE_STATE_WRITE_END(o, cur)
}
Eina_Bool
_evas_image_file_load(Eo *eo_obj, Evas_Image_Data *o)
{

View File

@ -1891,7 +1891,7 @@ EAPI const char *_evas_module_libdir_get(void);
const char *_evas_module_datadir_get(void);
EAPI Eina_List *_evas_canvas_image_data_unset(Evas *eo_e);
EAPI void _evas_canvas_image_data_regenerate(Eina_List *list);
void _evas_image_preload_update(Eo *eo_obj, Eina_File *f);
Eina_Bool evas_render_mapped(Evas_Public_Data *e, Evas_Object *obj,
Evas_Object_Protected_Data *source_pd,
void *context, void *output, void *surface,