Page MenuHomePhabricator

evas_object_image: save EVAS_IMAGE_CONTENT_HINT_DYNAMIC image
ClosedPublic

Authored by kimcinoo on Apr 1 2019, 12:10 AM.

Details

Summary

evas_gl_common_image_content_hint_set makes RGBA_Image NULL if content hint
is EVAS_IMAGE_CONTENT_HINT_DYNAMIC with 'sec_tbm_surface' and 'egl_tbm_ext'.

efl_file_save(_efl_canvas_image_internal_efl_file_save_save) does not work
in this case because ENFN->image_data_direct_get returns FALSE.

This patch makes ENFN->image_data_direct_get work but you need to free its
returned data after using it.

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
kimcinoo created this revision.Apr 1 2019, 12:10 AM
kimcinoo requested review of this revision.Apr 1 2019, 12:10 AM
Hermet added a comment.Apr 2 2019, 3:58 AM

Will review this after 1.22 release.

Hermet requested changes to this revision.Apr 11 2019, 3:06 AM

Please check my comments

src/lib/evas/canvas/efl_canvas_image.c
727

Firstly, this is unnecessary,
you could pass NULL as tofree.

In this case image_data_direct_get() could avoid return DYNAMIC content data.

src/lib/evas/include/evas_private.h
1339

tofree... a little ambiguous, how about "free_data" ?

src/modules/evas/engines/gl_generic/evas_engine.c
308

this checking colorspace & bpp related code should be moved to main logic scope (326 ~ 345)

309–310

this exception checking should be positioned earlier.

326

It would be better if a description(comment) for this condition....

372

It would be better if a description(comment) for this condition....

This revision now requires changes to proceed.Apr 11 2019, 3:06 AM
kimcinoo marked 4 inline comments as done.Apr 28 2019, 11:42 PM
kimcinoo added inline comments.
src/lib/evas/canvas/efl_canvas_image.c
727

OK. my understand is that this Efl.Gfx.Buffer.buffer_managed_get should return for the issue "EVAS_IMAGE_CONTENT_HINT_DYNAMIC image"

https://www.enlightenment.org/develop/api/efl/gfx/buffer/method/buffer_managed_get
is also telling

This will return null unless Efl.Gfx.Buffer.buffer_managed_set was used to pass in an external data pointer.

Then good point. Thank yoiu.

src/lib/evas/include/evas_private.h
1339

The "image_data_get" has used tofree already.
So I would like to follow this name.

kimcinoo updated this revision to Diff 21761.Apr 28 2019, 11:44 PM

Amend based on comments

Hermet accepted this revision.May 2 2019, 4:49 AM
This revision is now accepted and ready to land.May 2 2019, 4:49 AM
This revision was automatically updated to reflect the committed changes.