2013-06-20 03:53:29 -07:00
|
|
|
#include "evas_common_private.h"
|
2017-01-01 05:15:24 -08:00
|
|
|
#include "evas_image_private.h"
|
2002-12-09 22:45:18 -08:00
|
|
|
#include "evas_private.h"
|
|
|
|
|
|
|
|
/* local calls */
|
|
|
|
|
|
|
|
void
|
2017-10-19 16:04:12 -07:00
|
|
|
evas_object_inform_call_show(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
|
2002-12-09 22:45:18 -08:00
|
|
|
{
|
2017-02-16 02:34:08 -08:00
|
|
|
int event_id = _evas_object_event_new();
|
2010-03-04 06:48:21 -08:00
|
|
|
|
2018-04-05 01:47:26 -07:00
|
|
|
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_SHOW, NULL, event_id, EFL_GFX_ENTITY_EVENT_SHOW);
|
2017-02-16 02:34:08 -08:00
|
|
|
_evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id);
|
2002-12-09 22:45:18 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2017-10-19 16:05:30 -07:00
|
|
|
evas_object_inform_call_hide(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
|
2002-12-09 22:45:18 -08:00
|
|
|
{
|
2017-02-16 02:34:08 -08:00
|
|
|
int event_id = _evas_object_event_new();
|
2010-03-04 06:48:21 -08:00
|
|
|
|
2018-04-05 01:47:26 -07:00
|
|
|
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_HIDE, NULL, event_id, EFL_GFX_ENTITY_EVENT_HIDE);
|
2017-02-16 02:34:08 -08:00
|
|
|
_evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id);
|
2002-12-09 22:45:18 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_inform_call_move(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
|
2002-12-09 22:45:18 -08:00
|
|
|
{
|
2017-02-16 02:34:08 -08:00
|
|
|
int event_id = _evas_object_event_new();
|
|
|
|
|
2018-04-05 01:47:26 -07:00
|
|
|
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_MOVE, NULL, event_id, EFL_GFX_ENTITY_EVENT_MOVE);
|
2017-02-16 02:34:08 -08:00
|
|
|
_evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id);
|
2002-12-09 22:45:18 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2017-10-19 16:07:39 -07:00
|
|
|
evas_object_inform_call_resize(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
|
2002-12-09 22:45:18 -08:00
|
|
|
{
|
2017-02-16 02:34:08 -08:00
|
|
|
int event_id = _evas_object_event_new();
|
|
|
|
|
2018-04-05 01:47:26 -07:00
|
|
|
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_RESIZE, NULL, event_id, EFL_GFX_ENTITY_EVENT_RESIZE);
|
2017-02-16 02:34:08 -08:00
|
|
|
_evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id);
|
2002-12-09 22:45:18 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2017-10-19 16:11:30 -07:00
|
|
|
evas_object_inform_call_restack(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
|
2002-12-09 22:45:18 -08:00
|
|
|
{
|
2017-02-16 02:34:08 -08:00
|
|
|
int event_id = _evas_object_event_new();
|
|
|
|
|
2018-04-05 01:47:26 -07:00
|
|
|
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_RESTACK, NULL, event_id, EFL_GFX_ENTITY_EVENT_RESTACK);
|
2018-04-04 21:18:03 -07:00
|
|
|
if (obj->layer)
|
|
|
|
_evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id);
|
2002-12-09 22:45:18 -08:00
|
|
|
}
|
2008-04-11 16:12:20 -07:00
|
|
|
|
|
|
|
void
|
2017-10-19 16:14:48 -07:00
|
|
|
evas_object_inform_call_changed_size_hints(Evas_Object *eo_obj, Evas_Object_Protected_Data *obj)
|
2008-04-11 16:12:20 -07:00
|
|
|
{
|
2017-02-16 02:34:08 -08:00
|
|
|
int event_id = _evas_object_event_new();
|
|
|
|
|
2018-04-05 01:47:26 -07:00
|
|
|
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_CHANGED_SIZE_HINTS, NULL, event_id, EFL_GFX_ENTITY_EVENT_CHANGE_SIZE_HINTS);
|
2017-02-16 02:34:08 -08:00
|
|
|
_evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id);
|
2008-04-11 16:12:20 -07:00
|
|
|
}
|
2008-12-19 13:56:31 -08:00
|
|
|
|
|
|
|
void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_inform_call_image_preloaded(Evas_Object *eo_obj)
|
2008-12-19 13:56:31 -08:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
|
2017-02-16 02:34:08 -08:00
|
|
|
int event_id;
|
2013-09-02 23:53:08 -07:00
|
|
|
|
2017-02-16 02:34:08 -08:00
|
|
|
EINA_SAFETY_ON_NULL_RETURN(obj);
|
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-02 23:19:02 -07:00
|
|
|
|
|
|
|
unsigned char preload = _evas_object_image_preloading_get(eo_obj);
|
|
|
|
|
|
|
|
//Even cancelled, obj needs to draw image.
|
2017-01-01 05:15:24 -08:00
|
|
|
_evas_image_load_post_update(eo_obj, obj);
|
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-02 23:19:02 -07:00
|
|
|
|
evas image: fix non-rendered preload image.
Summary:
This is one more corner-case issue that I found,
When second image doesn't use preload (but still share the resource)
canvas engine triggers cancellation for first image preload function.
Unluckly, preload thread is cancelled on the intermediate rendering,
First image is not going to rendered, even image turn it changed states.
Because end of that frame, canvas reset/flushed all active objects.
Here changes to retain the changes status to redraw it in the next frame.
Test Plan:
img1 = image_add;
image_file_set(img1, "test.jpg");
image_preload(img1, true);
show(img);
img2 = image_add;
image_file_set(img2, "test.jpg"); //same resource
image_preload(img2, false);
show(img2);
img1 is invisible.
Reviewers: #committers
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Differential Revision: https://phab.enlightenment.org/D7157
2018-10-22 22:49:46 -07:00
|
|
|
if ((preload & EVAS_IMAGE_PRELOADING) ||
|
|
|
|
/* Boom! This cancellation call stack is in the intermediate render sequence. Need better idea.
|
|
|
|
So far, this cancellation is triggered by other non-preload image instances,
|
|
|
|
which doesn't require preloading. So by mechasnim we cancel preload other instances as well.
|
|
|
|
and mimic as it finished preloading done. */
|
|
|
|
(preload & EVAS_IMAGE_PRELOAD_CANCEL))
|
|
|
|
{
|
|
|
|
event_id = _evas_object_event_new();
|
|
|
|
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_IMAGE_PRELOADED, NULL, event_id, EFL_GFX_IMAGE_EVENT_PRELOAD);
|
|
|
|
_evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id);
|
|
|
|
}
|
2008-12-19 13:56:31 -08:00
|
|
|
}
|
2010-12-24 08:04:27 -08:00
|
|
|
|
|
|
|
void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_inform_call_image_unloaded(Evas_Object *eo_obj)
|
2010-12-24 08:04:27 -08:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
|
2017-02-16 02:34:08 -08:00
|
|
|
int event_id = _evas_object_event_new();
|
|
|
|
|
2018-04-19 04:26:59 -07:00
|
|
|
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_IMAGE_UNLOADED, NULL, event_id, EFL_GFX_IMAGE_EVENT_UNLOAD);
|
2017-02-16 02:34:08 -08:00
|
|
|
_evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id);
|
2010-12-24 08:04:27 -08:00
|
|
|
}
|
2012-09-04 21:20:42 -07:00
|
|
|
|
|
|
|
void
|
2012-10-08 18:58:41 -07:00
|
|
|
evas_object_inform_call_image_resize(Evas_Object *eo_obj)
|
2012-09-04 21:20:42 -07:00
|
|
|
{
|
2016-08-15 06:44:41 -07:00
|
|
|
Evas_Object_Protected_Data *obj = efl_data_scope_get(eo_obj, EFL_CANVAS_OBJECT_CLASS);
|
2017-02-16 02:34:08 -08:00
|
|
|
int event_id = _evas_object_event_new();
|
|
|
|
|
2018-04-19 04:26:59 -07:00
|
|
|
evas_object_event_callback_call(eo_obj, obj, EVAS_CALLBACK_IMAGE_RESIZE, NULL, event_id, EFL_GFX_IMAGE_EVENT_RESIZE);
|
2017-02-16 02:34:08 -08:00
|
|
|
_evas_post_event_callback_call(obj->layer->evas->evas, obj->layer->evas, event_id);
|
2012-09-04 21:20:42 -07:00
|
|
|
}
|