evas: restore codepath for loading images from files with skip_head set
Summary: this was never handled during refactoring because it had already been removed from the tree by that point fix T8378 Depends on D11339 Reviewers: raster Reviewed By: raster Subscribers: cedric, #reviewers, #committers Tags: #efl Maniphest Tasks: T8378 Differential Revision: https://phab.enlightenment.org/D11340
This commit is contained in:
parent
c37e545a03
commit
acee4e1db5
|
@ -20,18 +20,18 @@ _evas_image_file_unload(Eo *eo_obj)
|
|||
o->load_error = EFL_GFX_IMAGE_LOAD_ERROR_NONE;
|
||||
}
|
||||
Eina_Bool
|
||||
_evas_image_file_load(Eo *eo_obj)
|
||||
_evas_image_file_load(Eo *eo_obj, Evas_Image_Data *o)
|
||||
{
|
||||
Evas_Object_Protected_Data *obj;
|
||||
Evas_Image_Data *o = efl_data_scope_get(eo_obj, EFL_CANVAS_IMAGE_INTERNAL_CLASS);
|
||||
Evas_Image_Load_Opts lo;
|
||||
const Eina_File *f = efl_file_mmap_get(eo_obj);
|
||||
const char *key = efl_file_key_get(eo_obj);
|
||||
int load_error;
|
||||
|
||||
if (!o->skip_head)
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(f, EINA_FALSE);
|
||||
|
||||
if (o->cur->f == f)
|
||||
if (f && (o->cur->f == f))
|
||||
{
|
||||
if ((!o->cur->key) && (!key))
|
||||
return EINA_TRUE;
|
||||
|
@ -42,7 +42,10 @@ _evas_image_file_load(Eo *eo_obj)
|
|||
obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
|
||||
evas_object_async_block(obj);
|
||||
_evas_image_init_set(f, key, eo_obj, obj, o, &lo);
|
||||
if (f)
|
||||
o->engine_data = ENFN->image_mmap(ENC, o->cur->f, o->cur->key, &load_error, &lo);
|
||||
else
|
||||
o->engine_data = ENFN->image_load(ENC, efl_file_get(eo_obj), o->cur->key, &load_error, &lo);
|
||||
o->load_error = _evas_load_error_to_efl_gfx_image_load_error(load_error);
|
||||
o->buffer_data_set = EINA_FALSE;
|
||||
_evas_image_done_set(eo_obj, obj, o);
|
||||
|
@ -56,9 +59,13 @@ EOLIAN static Eina_Error
|
|||
_efl_canvas_image_efl_file_load(Eo *eo_obj, void *_pd EINA_UNUSED)
|
||||
{
|
||||
if (efl_file_loaded_get(eo_obj)) return 0;
|
||||
Eina_Error err = efl_file_load(efl_super(eo_obj, MY_CLASS));
|
||||
Evas_Image_Data *o = efl_data_scope_get(eo_obj, EFL_CANVAS_IMAGE_INTERNAL_CLASS);
|
||||
Eina_Error err = 0;
|
||||
|
||||
if (!o->skip_head)
|
||||
err = efl_file_load(efl_super(eo_obj, MY_CLASS));
|
||||
if (err) return err;
|
||||
if (_evas_image_file_load(eo_obj))
|
||||
if (_evas_image_file_load(eo_obj, o))
|
||||
return 0;
|
||||
return EFL_GFX_IMAGE_LOAD_ERROR_DOES_NOT_EXIST;
|
||||
}
|
||||
|
|
|
@ -1286,7 +1286,11 @@ _evas_image_efl_file_load(Eo *obj, void *pd EINA_UNUSED)
|
|||
{
|
||||
EVAS_IMAGE_API(obj, EINA_FALSE);
|
||||
if (efl_file_loaded_get(obj)) return 0;
|
||||
Eina_Error err = efl_file_load(efl_super(obj, EVAS_IMAGE_CLASS));
|
||||
Evas_Image_Data *o = efl_data_scope_get(obj, EFL_CANVAS_IMAGE_INTERNAL_CLASS);
|
||||
Eina_Error err = 0;
|
||||
|
||||
if (!o->skip_head)
|
||||
err = efl_file_load(efl_super(obj, EVAS_IMAGE_CLASS));
|
||||
if (err)
|
||||
{
|
||||
if (err == ENOENT)
|
||||
|
@ -1299,7 +1303,7 @@ _evas_image_efl_file_load(Eo *obj, void *pd EINA_UNUSED)
|
|||
_efl_canvas_image_load_error_set(obj, EFL_GFX_IMAGE_LOAD_ERROR_GENERIC);
|
||||
return err;
|
||||
}
|
||||
if (_evas_image_file_load(obj))
|
||||
if (_evas_image_file_load(obj, o))
|
||||
return 0;
|
||||
return EFL_GFX_IMAGE_LOAD_ERROR_DOES_NOT_EXIST;
|
||||
}
|
||||
|
|
|
@ -168,7 +168,7 @@ void *_evas_image_pixels_get(Eo *eo_obj, Evas_Object_Protected_Data *obj, void *
|
|||
void _evas_image_fill_set(Eo *eo_obj, Evas_Image_Data *o, int x, int y, int w, int h);
|
||||
|
||||
/* Efl.File */
|
||||
Eina_Bool _evas_image_file_load(Eo *eo_obj);
|
||||
Eina_Bool _evas_image_file_load(Eo *eo_obj, Evas_Image_Data *o);
|
||||
void _evas_image_file_unload(Eo *eo_obj);
|
||||
const Eina_File *_evas_image_mmap_get(const Eo *eo_obj);
|
||||
const char *_evas_image_key_get(const Eo *eo_obj);
|
||||
|
|
Loading…
Reference in New Issue