Commit Graph

47 Commits

Author SHA1 Message Date
Jiyoun Park e8fe0c9c92 evas_image: fix pixels_dirty_set(False) makes wrong object-change-list.
Summary:
evas_object_image_pixels_dirty_set(img B, False) means
1. app want to mark image object's data is not dirty anymore
2. app don't want to be called get_pixels callback.

that does not mean image need to be redraw.

evas_object_image_pixels_dirty_set(img B, True) means
1. image object's data is dirty, so image object need to be redraw.
2. app want to be called get_pixels callback.

but pixels_dirty_set(img B, FALSE) function also set o->changed to true,
it cause problem related with rendering

Below case is the example of problem.

1. Smart object A
2. Child image object B
3. app call pixels_dirty_set(FALSE) inside pixels_get_callback
   pixels_get_callback is called inside the image object B's rendering.

enlightenment's e_comp_object_render do upper job.

After adding preload fetch,
evas_object_image_render_post can call evas_object_change.

https://phab.enlightenment.org/D7157

evas_render_updates_internal

0. enlightenment call evas_object_image_pixels_dirty_set(img B, TRUE)
   o->changed = 1;
   evas_object_change(img B)
1. smart obj A is in render_objects
2. evas_object_image_render_pre B, o->change=0
3. evas_render_mapped (Smart A)
     3-1. evas_render_mapped (img B)
         : enlightenment call evas_object_image_pixels_dirty_set(img B, False)
         : o->changed=1

     3-2. evas_object_change_reset(img B)
4. pending_change(img B)
     4-1. evas_object_image_render_post(img B)
          o->changed=1 (3-1 step) evas_object_change(img B)->evas_object_change(Smart A)

5. render_post_reset
   smart A is chaged(4-1 step), so, called   evas_object_change_reset(Smart A)
   ###smart A is reset(5 step), img B is changed(4-1 step). after this case,
    img B never get change to be redraw.

Reviewers: Hermet, cedric, zmike, ManMower

Reviewed By: Hermet

Subscribers: zmike, ManMower, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7821
2019-02-13 11:16:16 +09:00
Derek Foreman bec631aa2c evas_image: Force stacking check on non-video surface
Summary:
We use this code path for native image hardware planes.  Force the
stacking check on those for now so planes don't accidentally occlude
surfaces above them.

Reviewers: Hermet

Reviewed By: Hermet

Subscribers: cedric, #reviewers, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D7188
2018-10-26 20:09:37 +09:00
Hermet Park 423d8a2296 evas image: fix a bug in image preloading.
Summary:
Current preloading is too buggy since it's on thread-based.
This is a fundamental improvement to fix a bug.

The critical issue here is,
When preloading img object suddenly cancel its preloading,
the object possibly cannot render image next then because
renderer doesn't have any idea when async cancelling is
finished. Renderer just tries to render regardless of
image loading status, and this could occur no-texture(in gl case)
image object.

So, here improvement is, adding a notification for async cancelled
so that putting img objects to redraw images properly after their preloading is
cancelled.

The best scenario to reproduce this bug is this one.

Evas_Object *img2 = evas_object_image_filled_add(evas);
evas_object_image_file_set(img2, "test.jpg", NULL);
evas_object_image_preload(img2, EINA_FALSE);
evas_object_resize(img2, 200, 200);
evas_object_show(img2);

Evas_Object *img = evas_object_image_filled_add(evas);
evas_object_image_file_set(img, "test.jpg", NULL);
evas_object_image_preload(img, EINA_FALSE);
evas_object_move(img, 200, 200);
evas_object_resize(img, 200, 200);
evas_object_show(img);

evas_object_image_preload(img2, EINA_TRUE);
If you run this on gl backend, occasionally happens rendering fail.

Yet there other bugs on preloading feature....

@fix

Reviewers: #committers, raster

Subscribers: cedric, #reviewers, #committers, zmike

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6919
2018-09-03 17:12:55 +09:00
Yeongjong Lee e19292aa2b evas: call evas_find before safety check
Summary:
edje_edit_object_add
edje_object_add
emotion_object_add
evas_object_xxx_add

These APIs had allowed to set parent to EFL_CANVAS_OBJECT(Evas_Object) before
8bb11a17. we should call evas_find before safety check for backward compatibility.

Test Plan:
  win = elm_win_add(NULL, "main", ELM_WIN_BASIC);

 1.  `rect = evas_object_rectangle_add(evas_object_evas_get(win));`

 2.  `rect = evas_object_rectangle_add(win);`

Check that 1. and 2. works.

Reviewers: Hermet, zmike

Reviewed By: Hermet

Subscribers: cedric, #reviewers, CHAN, #committers

Tags: #efl

Differential Revision: https://phab.enlightenment.org/D6909
2018-08-29 21:11:00 +09:00
Cedric Bail c2e8b492b1 evas: enforce legacy parent to be the canvas. 2018-05-24 16:02:19 -07:00
Jaeun Choi 9fa1c8a2e3 evas: fix default return value of image-related legacy functions
In commit 8367f497b8,
type checking code was added for legacy image functions
in order to reduce failing calls of efl_xxx function.
The default return values of some functions for none-legacy
objects (including NULL), however, were not equal to eo-based
default return value, which broke compatibility.
This commit fixes it.

@fix
2018-04-30 17:55:24 +09:00
Xavi Artigas 5697f6e94b Efl.Gfx.Image* (From Efl.Image*)
Ref https://phab.enlightenment.org/T6847

Reviewed-by: Cedric Bail <cedric@osg.samsung.com>
2018-04-24 09:03:40 -07:00
Xavi Artigas 65ee277a66 Efl.Canvas.Scene (from Efl.Canvas)
Ref https://phab.enlightenment.org/T6847

Reviewed-by: Cedric Bail <cedric@osg.samsung.com>
2018-04-24 09:03:23 -07:00
Daniel Kolesa fcae7cab27 eolian gen: enable constness generation on property getter impls
This changes a lot of things all across the EFL. Previously,
methods tagged @const had both their external prototype and
internal impl generated with const on object, while property
getters only had const on the external API. This is now changed
and it all has const everywhere.

Ref T6859.
2018-04-17 20:31:55 +02:00
Mike Blumenkrantz 59583a6f89 evas: properly implement evas_image_max_size_get() as a wrapper
ref 457dc16cffdd5f9c6ce42e72beddad06fa36f0c0
2018-02-15 13:10:59 -05:00
Jean-Philippe Andre f47f8dcf82 evas: Remove stupid warning 2018-01-16 18:37:04 +09:00
Cedric Bail c8c4572d70 evas: remove duplicated code and rely on Efl.File { get; set; }
We can almost remove image_load from the engine backend after this patch.
One little bit left in Evas_3D.
2017-10-04 21:01:35 -07:00
Jean-Philippe Andre b19ee757e5 efl: Use Eina.Size2D in Gfx.View 2017-09-19 10:51:48 +09:00
Jean-Philippe Andre 1f242afdef evas: Use Eina.Size2D for gfx.buffer
For consistency.
2017-09-19 10:51:48 +09:00
Jean-Philippe Andre f3eff6eb3e efl: Introduce Eina.Rect and switch EO APIs to it
It's a complex struct but defined in EO as a simple struct. ABI-wise
it's equivalent to Eina_Rectangle. Some macros that use Eina_Rectangle
also work on Eina_Rect out of the box, most of the code dealing with
x,y,w,h will require no modifications either.

But Eina_Rect provides direct access to a size or position 2d component,
as well as the usual x,y,w,h. The field "rect" is provided as a
convenience for code dealing with both Eina_Rectangle and Eina_Rect. We
may or may not require it.

Note: Size2D could use unsigned values but I have spotted a few places
in the code that actually use -1 to indicate invalid size (as opposed to
0x0).

@feature
2017-09-18 13:22:52 +09:00
Jean-Philippe Andre 89733b22f6 efl_gfx_fill: Use Eina.Rectangle for fill (EO) 2017-09-13 18:09:19 +09:00
Cedric BAIL 1d57cb2627 evas: move all image object related function to use the engine instead of the output. 2017-08-25 10:51:10 -07:00
Jean-Philippe Andre 69a3d68693 evas: Fix crash in E
Somehow starting VirtualBox would crash E when trying to upload invalid
data. I believe checking for NULL data here is all we need to do in
order to keep the image data consistent and valid.

I have to admit I'm not 100% sure what is happening here.

Fixes T5868

@fix
2017-08-10 11:51:56 +09:00
Jean-Philippe Andre 45c8e5e983 evas: Fix support for image_data_get on snapshot
evas_object_image_data_get() is a legacy API that I made work
with snapshot objects (evas_object_image_snapshot_set()). Some
changes in the engine broke the behaviour and this patch fixes
it.

When getting the pixels from an FBO, in read-only mode, we need
to create a temporary image (pixels surface) that contains the
copy of the pixels we get from glReadPixels. This image needs
to be deleted afterwards. It is thus stored by the image object
and freed upon _image_data_set() (good) or object deletion (bad).

FBO + read-write is not supported by this API (it is supported
through buffer_map as the filters had to use that).

Fixes T5754
2017-07-19 13:59:42 +09:00
Derek Foreman f45c0fcd67 evas image: Set load error on native image set failure
evas_object_image_native_surface_set() has no return, so without
setting load error we can't tell if it failed.

fix T5418
2017-06-30 14:10:50 -05:00
Jaeyong Hwang 3f84aac424 evas: Add code to change the object's chage flag in evas_object_image_data_set
Summary:
When using evas_object_image_data_set(obj, data), if you give the value of data to NULL, the image data is free.
However, Since you have not set a flag in the image object to be modified, it will not be processed in the next render loop.
Eventually, the image data is erased, but you see the image before it was erased.
If evas_object_image_data_update_add() is used to solve this problem, the operation of the function is skipped because the values of w and h in image are 0.
So, If data is NULL, I modified it to call evas_object_change() in evas_object_image_data_set().

Test Plan:
Sample code

{F61599}
{F61601}

Reviewers: Hermet, jiin.moon, eunue, jpeg

Reviewed By: jpeg

Subscribers: jpeg, cedric

Differential Revision: https://phab.enlightenment.org/D4520
2017-01-03 17:42:12 +09:00
Carsten Haitzler 9e01cf2698 evas image async preload - add option to also make header load async
to date if you use async preload we still load the header
synchronously and this can be horrible especially with generic
loaders. there is no way to farm this off to the preload thread. now
there is. youhave to set it as a skip head load option before doing a
file_set AND you need to issue a preload ... but now it's possible.

@feature
2017-01-02 18:53:56 +09:00
Tom Hacohen 9c779dca90 Rename efl_self to efl_added
It has been discussed on the ML (thread: "[RFC] rename efl_self") and
IRC, and has been decided we should rename it to this in order to avoid
confusion with the already established meaning of self which is very
similar to what we were using it for, but didn't have complete overlap.

Kudos to Marcel Hollerbach for initiating the discussion and
fighting for it until he convinced a significant mass. :)

This commit breaks API, and depending on compiler potentially ABI.

@feature
2016-09-05 16:59:56 +01:00
Tom Hacohen e65aae994e Eo: Finish the renaming of Eo to the EFL.
This renames all the rest of the API to the EFL namespace except for
Eo_Event that will follow soon.

Obviously breaks both API and ABI.
2016-08-15 15:07:42 +01:00
Tom Hacohen c662934be8 Change the EFL to follow the new Eo rename. 2016-08-11 17:04:43 +01:00
Jean-Philippe Andre 917f34587b evas: Make safety check more lenient
This is to avoid ERR messages such as "object is not an image!"
that can happen when a legacy image function is called on an
eo image (proxy, 3d, ...) object.

Note: This does not fix any known issue, but it's probably a safer
solution.
2016-08-05 11:01:55 +09:00
Jean-Philippe Andre 26ee77ff67 evas image: Lower ERR message to WRN and fix it
In elm_image, efl_file_get() was called on a legacy Evas Image
object, which generated an ERR message. This was way too much
noise for something that actually works.

It's best not to call efl_file_get/set API on a legacy
object, but it can be convenient for smooth code transitions
from legacy to pure eo.

Also, add safety to those APIs.

Test case: elm_test genlist dnd, start dragging anything.
2016-08-05 10:32:30 +09:00
Jean-Philippe Andre 4d67ee2478 evas: Add safety checks to evas image legacy APIs
This checks for NULL and ensures the type is evas image.
2016-08-05 10:32:30 +09:00
Jean-Philippe Andre 7bf8da2baa evas: Rename Evas.Object to Efl.Canvas.Object
One step closer to make the EO inheritance tree look like
it's all Efl.
2016-06-21 14:35:19 +09:00
Jean-Philippe Andre ccaf12e1b6 evas: Use efl_gfx APIs where appropriate
This is a better fix than the previous patch, as it keeps
the legacy API check. The point of that check is: if the object
has been created with legacy API (evas_object_image_[filled_]add,
then legacy APIs are allowed, otherwise they are disallowed. This
means only EO APIs should be used on an eo_add() image object.
2016-06-20 14:11:32 +09:00
Jean-Philippe Andre 17a51cffd3 evas: Fix type checking for legacy APIs
This should fix canvas 3d examples (that were calling fill_set
and evas would reject with "object is not an image").
2016-06-20 14:04:09 +09:00
Jean-Philippe Andre fc6ba5561e Evas: Move Evas.Load_Error to legacy, use Efl.Image.Load.Error
This also disables the unused interface "load_state".
2016-06-17 11:37:39 +09:00
Jean-Philippe Andre bb7edc2ed4 Evas: Fix clipees_get and return an iterator
The legacy function was broken: it was returning the
private data.
2016-06-17 11:37:39 +09:00
Jean-Philippe Andre 79abba52c5 Evas: Rename Evas.Image into Efl.Canvas.Image.Internal
Make it abstract.
And add Evas.Image as a legacy-only class.
2016-06-10 13:21:20 +09:00
Tom Hacohen a6a2338962 Revert "Eo: Remove eo_del() and make eo_unref() the replacement."
This reverts commit 546ff7bbba.

It seems that eo_del() is useful and removing it was creating bugs.
The issue is that the way we defined parents in eo, both the parent and
the programmer share a reference to the object. When we eo_unref() that
reference as the programmer, eo has no way to know it's this specific
reference we are freeing, and not a general one, so in some
circumstances, for example:
eo_ref(child);
eo_unref(child); // trying to delete here
eo_unref(container); // container is deleted here
eo_unref(child); // child already has 0 refs before this point.

We would have an issue with references and objects being freed too soon
and in general, issue with the references.

Having eo_del() solves that, because this one explicitly unparents if
there is a parent, meaning the reference ownership is explicitly taken
by the programmer.

eo_del() is essentially a convenience function around "check if has
parent, and if so unparent, otherwise, unref". Which should be used when
you want to delete an object although it has a parent, and is equivalent
to eo_unref() when it doesn't have one.
2016-06-01 13:33:21 +01:00
Tom Hacohen 546ff7bbba Eo: Remove eo_del() and make eo_unref() the replacement.
We used to have eo_del() as the mirrored action to eo_add(). No longer,
now you just always eo_unref() to delete an object. This change makes it
so the reference of the parent is shared with the reference the
programmer has. So eo_parent_set(obj, NULL) can free an object, and so
does eo_unref() (even if there is a parent).

This means Eo no longer complains if you have a parent during deletion.
2016-05-17 16:23:23 +01:00
Yeshwanth Reddivari 98edbd23a4 Interface: Flip and orientation interface
Summary:
Added flip and orientation interface and used them in evas_image.
Removed efl_image_orientation_set API and used efl_orientation_set and efl_flip_set API.
In implementation part, converted enums back and forth in order to keep current implementation as it is.

Test Plan: src/examples/evas/evas-images5.c

Reviewers: singh.amitesh, raster, tasn, herdsman, woohyun, cedric, felipealmeida, jpeg

Subscribers: cedric, jpeg

Differential Revision: https://phab.enlightenment.org/D3844
2016-04-06 10:46:39 +09:00
Carsten Haitzler 776f4cb112 evas: image obj - use vath to find images (sync not async) 2016-04-05 16:22:59 +09:00
Jean-Philippe Andre a5b89d8ab3 Evas.Image: Remove pixels_dirty and pixels_callback
Those APIs belong to legacy, not Eo. Also, the image object
shouldn't be used directly for GL rendering, instead the GLview
widget should be used.
2016-03-29 14:54:03 +09:00
Jean-Philippe Andre 8b9f525c01 Evas.Image: Add ERR in long-deprecated functions
- evas_object_image_data_convert()
- evas_object_image_pixels_import()
2016-03-28 16:40:01 +09:00
Jean-Philippe Andre 08c1160888 Efl.Canvas.Image: Implement raw data_set/copy/get
No more refcount. This is only to initialize the data from
an external buffer. data_get will only work if data_set was
used (not even copy_set).
2016-03-28 16:40:01 +09:00
Jean-Philippe Andre d4e713a18c Evas.Image: Move stride.get away from Evas.Image
stride does not apply to all image objects, eg. proxies or 3d scenes.
it will be implemented by the classes that support stride and pixel
data access
2016-03-28 16:40:01 +09:00
Jean-Philippe Andre 83b8b8c958 Evas.Image: Move data_set/get to legacy file
Those functions will be replaced by map/unmap
2016-03-28 15:53:15 +09:00
Jean-Philippe Andre b8f682b842 Efl.Gfx.Fill: Rename filled to fill_auto
fill_filled is a strange name for the property.
fill_auto seems to make more sense. If you disagree, scream at
me or revert this commit.
2016-03-18 13:28:45 +09:00
Jean-Philippe Andre 9d4ca6f352 Evas.Image: (eo) fill_set now unsets the filled flag
There's no point in calling fill_set AND fillet_set(false).
If a users wants to specify the fill, that should be enough
to switch to non-filled mode.

Maybe the "filled" mode should even be called auto or something?
2016-03-18 13:28:45 +09:00
Jean-Philippe Andre 8367f497b8 Evas.Image: Create Efl.Canvas.Image for file & data images
This replaces standard Evas_Object_Image when it is used "normally",
ie. it's an image from a file or from a pixel buffer. All other APIs
(proxy, snapshot, 3d, gl, ...) are disabled on this object.

Also, reduce number of failing calls when the object is not a legacy
object, but a legacy function is called. This is because a lot of
image APIs are called internally using the legacy APIs, often in
order to reset the state of the image object (eg. set file to NULL,
etc...)
2016-03-17 13:10:35 +09:00
Jean-Philippe Andre 6ac68c9252 Evas.Image: Move all legacy EAPI out of evas_object_image.c
Some of these functions are still be in use by the new EO objects,
like data_set/get/copy_set.
2016-03-17 13:10:35 +09:00