2002-11-08 00:02:15 -08:00
|
|
|
#include "evas_common.h"
|
|
|
|
#include "evas_private.h"
|
|
|
|
|
2008-10-21 09:31:05 -07:00
|
|
|
static Eina_List *
|
2009-11-06 00:44:49 -08:00
|
|
|
evas_render_updates_internal(Evas *e, unsigned char make_updates, unsigned char do_draw);
|
2005-12-03 01:27:53 -08:00
|
|
|
|
2003-03-04 18:30:20 -08:00
|
|
|
/**
|
2009-09-17 15:38:10 -07:00
|
|
|
* Add a damage rectangle.
|
2003-03-04 18:30:20 -08:00
|
|
|
*
|
2009-09-17 15:38:10 -07:00
|
|
|
* @param e The given canvas pointer.
|
|
|
|
* @param x The rectangle's left position.
|
|
|
|
* @param y The rectangle's top position.
|
|
|
|
* @param w The rectangle's width.
|
|
|
|
* @param h The rectangle's height.
|
|
|
|
*
|
|
|
|
* This is the function by which one tells evas that a part of the
|
|
|
|
* canvas has to be repainted.
|
2005-05-21 19:49:50 -07:00
|
|
|
*
|
2003-03-04 18:30:20 -08:00
|
|
|
*/
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2002-11-08 00:02:15 -08:00
|
|
|
evas_damage_rectangle_add(Evas *e, int x, int y, int w, int h)
|
|
|
|
{
|
2009-06-23 06:57:27 -07:00
|
|
|
Eina_Rectangle *r;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2009-04-14 02:27:27 -07:00
|
|
|
NEW_RECT(r, x, y, w, h);
|
2002-11-08 00:02:15 -08:00
|
|
|
if (!r) return;
|
2008-10-21 09:31:05 -07:00
|
|
|
e->damages = eina_list_append(e->damages, r);
|
2002-11-08 00:02:15 -08:00
|
|
|
e->changed = 1;
|
|
|
|
}
|
|
|
|
|
2003-03-04 18:30:20 -08:00
|
|
|
/**
|
2009-09-17 15:38:10 -07:00
|
|
|
* Add an obscured region.
|
|
|
|
*
|
|
|
|
* @param e The given canvas pointer.
|
|
|
|
* @param x The rectangle's left position.
|
|
|
|
* @param y The rectangle's top position
|
|
|
|
* @param w The rectangle's width.
|
|
|
|
* @param h The rectangle's height.
|
|
|
|
*
|
|
|
|
* This is the function by which one tells evas that a part of the
|
|
|
|
* canvas has not to be repainted. To make this region one that have
|
|
|
|
* to be repainted, call the function evas_obscured_clear().
|
2003-03-04 18:30:20 -08:00
|
|
|
*
|
2009-09-17 15:38:10 -07:00
|
|
|
* @see evas_obscured_clear().
|
2005-05-21 19:49:50 -07:00
|
|
|
*
|
2003-03-04 18:30:20 -08:00
|
|
|
*/
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2002-11-08 00:02:15 -08:00
|
|
|
evas_obscured_rectangle_add(Evas *e, int x, int y, int w, int h)
|
|
|
|
{
|
2009-06-23 06:57:27 -07:00
|
|
|
Eina_Rectangle *r;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2009-04-14 02:27:27 -07:00
|
|
|
NEW_RECT(r, x, y, w, h);
|
2002-11-08 00:02:15 -08:00
|
|
|
if (!r) return;
|
2008-10-21 09:31:05 -07:00
|
|
|
e->obscures = eina_list_append(e->obscures, r);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2003-03-04 18:30:20 -08:00
|
|
|
/**
|
2009-09-17 15:38:10 -07:00
|
|
|
* Remove all obscured region rectangles from the canvas.
|
2003-03-04 18:30:20 -08:00
|
|
|
*
|
2009-09-17 15:38:10 -07:00
|
|
|
* @param e The given canvas pointer.
|
|
|
|
*
|
|
|
|
* This function removes all the rectangles from the obscured list of
|
|
|
|
* the canvas. It takes obscured areas added with
|
|
|
|
* evas_obscured_rectangle_add() and makes it a region that have to be
|
|
|
|
* repainted.
|
2005-05-21 19:49:50 -07:00
|
|
|
*
|
2003-03-04 18:30:20 -08:00
|
|
|
*/
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2002-11-08 00:02:15 -08:00
|
|
|
evas_obscured_clear(Evas *e)
|
|
|
|
{
|
2009-06-23 06:57:27 -07:00
|
|
|
Eina_Rectangle *r;
|
2009-04-14 02:27:27 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
2005-05-21 19:49:50 -07:00
|
|
|
MAGIC_CHECK_END();
|
2009-04-14 02:27:27 -07:00
|
|
|
EINA_LIST_FREE(e->obscures, r)
|
2009-10-30 03:11:15 -07:00
|
|
|
{
|
|
|
|
eina_rectangle_free(r);
|
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2009-11-10 00:50:11 -08:00
|
|
|
static Eina_Bool
|
|
|
|
_evas_render_has_map(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
return ((!((obj->func->can_map) && (obj->func->can_map(obj)))) &&
|
|
|
|
((obj->cur.map) && (obj->cur.map->count == 4) &&
|
|
|
|
(obj->cur.usemap)));
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_evas_render_had_map(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
return ((!obj->cur.map) && (obj->prev.usemap));
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_evas_render_is_relevant(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
return ((evas_object_is_visible(obj) && (!obj->cur.have_clipees)) ||
|
|
|
|
(evas_object_was_visible(obj) && (!obj->prev.have_clipees)));
|
|
|
|
}
|
|
|
|
|
|
|
|
static Eina_Bool
|
|
|
|
_evas_render_can_render(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
return (evas_object_is_visible(obj) && (!obj->cur.have_clipees));
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_evas_render_prev_cur_clip_cache_add(Evas *e, Evas_Object *obj)
|
|
|
|
{
|
|
|
|
e->engine.func->output_redraws_rect_add(e->engine.data.output,
|
|
|
|
obj->prev.cache.clip.x,
|
|
|
|
obj->prev.cache.clip.y,
|
|
|
|
obj->prev.cache.clip.w,
|
|
|
|
obj->prev.cache.clip.h);
|
|
|
|
e->engine.func->output_redraws_rect_add(e->engine.data.output,
|
|
|
|
obj->cur.cache.clip.x,
|
|
|
|
obj->cur.cache.clip.y,
|
|
|
|
obj->cur.cache.clip.w,
|
|
|
|
obj->cur.cache.clip.h);
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_evas_render_cur_clip_cache_del(Evas *e, Evas_Object *obj)
|
|
|
|
{
|
|
|
|
e->engine.func->output_redraws_rect_del(e->engine.data.output,
|
|
|
|
obj->cur.cache.clip.x,
|
|
|
|
obj->cur.cache.clip.y,
|
|
|
|
obj->cur.cache.clip.w,
|
|
|
|
obj->cur.cache.clip.h);
|
|
|
|
}
|
|
|
|
|
2009-11-06 21:01:43 -08:00
|
|
|
static void
|
2009-11-10 00:50:11 -08:00
|
|
|
_evas_render_phase1_direct(Evas *e,
|
|
|
|
Eina_Array *active_objects,
|
|
|
|
Eina_Array *restack_objects,
|
|
|
|
Eina_Array *delete_objects,
|
|
|
|
Eina_Array *render_objects)
|
2009-11-06 21:01:43 -08:00
|
|
|
{
|
|
|
|
unsigned int i;
|
|
|
|
|
2009-11-09 07:18:37 -08:00
|
|
|
for (i = 0; i < render_objects->count; i++)
|
2009-11-06 21:01:43 -08:00
|
|
|
{
|
|
|
|
Evas_Object *obj;
|
|
|
|
|
|
|
|
obj = eina_array_data_get(render_objects, i);
|
|
|
|
if (obj->changed)
|
|
|
|
{
|
2009-11-09 07:18:37 -08:00
|
|
|
evas_object_clip_recalc(obj);
|
2009-11-06 21:01:43 -08:00
|
|
|
obj->func->render_pre(obj);
|
|
|
|
if (obj->pre_render_done)
|
|
|
|
{
|
2009-11-10 00:50:11 -08:00
|
|
|
if ((obj->smart.smart) && _evas_render_has_map(obj))
|
|
|
|
_evas_render_prev_cur_clip_cache_add(e, obj);
|
2009-11-09 07:18:37 -08:00
|
|
|
}
|
2009-11-10 00:50:11 -08:00
|
|
|
else if (_evas_render_had_map(obj))
|
|
|
|
_evas_render_prev_cur_clip_cache_add(e, obj);
|
2009-11-06 21:01:43 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (obj->smart.smart)
|
|
|
|
{
|
2009-11-09 07:18:37 -08:00
|
|
|
// obj->func->render_pre(obj);
|
2009-11-06 21:01:43 -08:00
|
|
|
}
|
|
|
|
else if (obj->rect_del)
|
2009-11-10 00:50:11 -08:00
|
|
|
_evas_render_cur_clip_cache_del(e, obj);
|
2009-11-06 21:01:43 -08:00
|
|
|
}
|
|
|
|
}
|
2009-10-30 03:11:15 -07:00
|
|
|
}
|
|
|
|
|
2009-06-17 03:01:52 -07:00
|
|
|
static Eina_Bool
|
2009-11-10 00:50:11 -08:00
|
|
|
_evas_render_phase1_object_process(Evas *e, Evas_Object *obj,
|
|
|
|
Eina_Array *active_objects,
|
|
|
|
Eina_Array *restack_objects,
|
|
|
|
Eina_Array *delete_objects,
|
|
|
|
Eina_Array *render_objects,
|
|
|
|
int restack, int map)
|
2008-05-26 06:24:24 -07:00
|
|
|
{
|
2009-06-17 03:01:52 -07:00
|
|
|
Eina_Bool clean_them = EINA_FALSE;
|
2009-11-10 00:50:11 -08:00
|
|
|
Evas_Object *obj2;
|
2005-10-26 21:36:58 -07:00
|
|
|
int is_active;
|
2008-04-14 02:31:31 -07:00
|
|
|
|
2008-05-26 06:24:24 -07:00
|
|
|
obj->rect_del = 0;
|
|
|
|
obj->render_pre = 0;
|
|
|
|
|
2007-01-16 02:17:10 -08:00
|
|
|
/* because of clip objects - delete 2 cycles later */
|
2009-11-10 00:50:11 -08:00
|
|
|
if (obj->delete_me == 2) eina_array_push(delete_objects, obj);
|
2007-01-16 02:17:10 -08:00
|
|
|
else if (obj->delete_me != 0) obj->delete_me++;
|
2008-05-26 06:24:24 -07:00
|
|
|
/* If the object will be removed, we should not cache anything during this run. */
|
2009-11-10 00:50:11 -08:00
|
|
|
if (obj->delete_me != 0) clean_them = EINA_TRUE;
|
2008-05-26 06:24:24 -07:00
|
|
|
|
2005-10-26 19:44:36 -07:00
|
|
|
/* build active object list */
|
2005-10-26 21:36:58 -07:00
|
|
|
is_active = evas_object_is_active(obj);
|
2008-05-26 06:24:24 -07:00
|
|
|
|
|
|
|
obj->is_active = is_active;
|
2008-04-14 02:31:31 -07:00
|
|
|
if ((is_active) || (obj->delete_me != 0))
|
2009-11-06 00:44:49 -08:00
|
|
|
{
|
2009-11-10 00:50:11 -08:00
|
|
|
printf("act1 [%p]\n", obj);
|
2009-11-06 00:44:49 -08:00
|
|
|
eina_array_push(active_objects, obj);
|
|
|
|
}
|
2009-11-10 00:50:11 -08:00
|
|
|
else
|
|
|
|
printf("nact [%p]\n", obj);
|
|
|
|
if (_evas_render_has_map(obj)) map = 1;
|
|
|
|
|
|
|
|
if ((restack) && (!map))
|
2005-10-26 23:40:28 -07:00
|
|
|
{
|
2008-06-12 06:22:26 -07:00
|
|
|
if (!obj->changed)
|
2009-11-09 07:18:37 -08:00
|
|
|
{
|
|
|
|
eina_array_push(&e->pending_objects, obj);
|
|
|
|
obj->changed = 1;
|
|
|
|
}
|
2005-10-26 23:40:28 -07:00
|
|
|
obj->restack = 1;
|
2009-06-17 03:01:52 -07:00
|
|
|
clean_them = EINA_TRUE;
|
2005-10-26 23:40:28 -07:00
|
|
|
}
|
2009-11-06 21:01:43 -08:00
|
|
|
|
2009-11-10 00:50:11 -08:00
|
|
|
if (map)
|
2009-10-28 01:59:01 -07:00
|
|
|
{
|
|
|
|
if (obj->changed)
|
|
|
|
{
|
2009-11-09 07:18:37 -08:00
|
|
|
evas_object_clip_recalc(obj);
|
2009-11-10 00:50:11 -08:00
|
|
|
if ((obj->restack) &&
|
|
|
|
(is_active) && (!obj->clip.clipees) &&
|
2009-10-28 01:59:01 -07:00
|
|
|
((evas_object_is_visible(obj) && (!obj->cur.have_clipees)) ||
|
|
|
|
(evas_object_was_visible(obj) && (!obj->prev.have_clipees))))
|
2009-11-06 21:01:43 -08:00
|
|
|
{
|
|
|
|
eina_array_push(render_objects, obj);
|
2009-11-10 00:50:11 -08:00
|
|
|
_evas_render_prev_cur_clip_cache_add(e, obj);
|
2009-11-06 21:01:43 -08:00
|
|
|
obj->render_pre = 1;
|
|
|
|
}
|
2009-10-28 01:59:01 -07:00
|
|
|
else if ((is_active) && (!obj->clip.clipees) &&
|
|
|
|
((evas_object_is_visible(obj) && (!obj->cur.have_clipees)) ||
|
|
|
|
(evas_object_was_visible(obj) && (!obj->prev.have_clipees))))
|
|
|
|
{
|
2009-11-06 21:01:43 -08:00
|
|
|
eina_array_push(render_objects, obj);
|
2009-11-10 00:50:11 -08:00
|
|
|
_evas_render_prev_cur_clip_cache_add(e, obj);
|
2009-10-28 01:59:01 -07:00
|
|
|
obj->render_pre = 1;
|
|
|
|
}
|
|
|
|
}
|
2009-11-06 02:26:54 -08:00
|
|
|
return clean_them;
|
2009-10-28 01:59:01 -07:00
|
|
|
}
|
2009-11-10 00:50:11 -08:00
|
|
|
else if (_evas_render_had_map(obj))
|
2009-11-09 07:18:37 -08:00
|
|
|
{
|
|
|
|
evas_object_clip_recalc(obj);
|
|
|
|
eina_array_push(restack_objects, obj);
|
2009-11-10 00:50:11 -08:00
|
|
|
_evas_render_prev_cur_clip_cache_add(e, obj);
|
2009-11-09 07:18:37 -08:00
|
|
|
}
|
2009-10-28 01:59:01 -07:00
|
|
|
|
|
|
|
/* handle normal rendering. this object knows how to handle maps */
|
|
|
|
|
2005-10-26 23:40:28 -07:00
|
|
|
if (obj->changed)
|
2005-10-26 19:44:36 -07:00
|
|
|
{
|
2009-11-09 07:18:37 -08:00
|
|
|
evas_object_clip_recalc(obj);
|
2005-10-26 19:44:36 -07:00
|
|
|
if (obj->smart.smart)
|
|
|
|
{
|
2008-10-16 05:27:07 -07:00
|
|
|
eina_array_push(render_objects, obj);
|
2008-05-26 06:24:24 -07:00
|
|
|
obj->render_pre = 1;
|
2008-10-21 05:19:57 -07:00
|
|
|
EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(obj), obj2)
|
2005-10-26 19:44:36 -07:00
|
|
|
{
|
2008-04-14 02:31:31 -07:00
|
|
|
_evas_render_phase1_object_process(e, obj2,
|
2005-10-26 19:44:36 -07:00
|
|
|
active_objects,
|
2005-10-26 21:36:58 -07:00
|
|
|
restack_objects,
|
2007-01-16 02:17:10 -08:00
|
|
|
delete_objects,
|
2008-05-26 06:24:24 -07:00
|
|
|
render_objects,
|
2009-11-10 00:50:11 -08:00
|
|
|
obj->restack,
|
|
|
|
map);
|
2005-10-26 19:44:36 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-11-10 00:50:11 -08:00
|
|
|
if ((is_active) && (!obj->clip.clipees) &&
|
|
|
|
_evas_render_is_relevant(obj))
|
|
|
|
{
|
|
|
|
if (obj->restack)
|
|
|
|
eina_array_push(restack_objects, obj);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
eina_array_push(render_objects, obj);
|
|
|
|
obj->render_pre = 1;
|
|
|
|
}
|
|
|
|
}
|
2005-10-26 19:44:36 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2005-11-01 23:13:49 -08:00
|
|
|
if ((!obj->clip.clipees) && (obj->delete_me == 0) &&
|
2008-04-14 02:31:31 -07:00
|
|
|
((evas_object_is_visible(obj) && (!obj->cur.have_clipees)) ||
|
2005-11-01 23:13:49 -08:00
|
|
|
(evas_object_was_visible(obj) && (!obj->prev.have_clipees))))
|
2005-10-26 19:44:36 -07:00
|
|
|
{
|
|
|
|
if (obj->smart.smart)
|
|
|
|
{
|
2008-10-16 05:27:07 -07:00
|
|
|
eina_array_push(render_objects, obj);
|
2008-05-26 06:24:24 -07:00
|
|
|
obj->render_pre = 1;
|
2009-11-10 00:50:11 -08:00
|
|
|
EINA_INLIST_FOREACH
|
|
|
|
(evas_object_smart_members_get_direct(obj), obj2)
|
2005-10-26 19:44:36 -07:00
|
|
|
{
|
2008-04-14 02:31:31 -07:00
|
|
|
_evas_render_phase1_object_process(e, obj2,
|
|
|
|
active_objects,
|
2005-10-26 19:44:36 -07:00
|
|
|
restack_objects,
|
2007-01-16 02:17:10 -08:00
|
|
|
delete_objects,
|
2008-05-26 06:24:24 -07:00
|
|
|
render_objects,
|
2009-11-10 00:50:11 -08:00
|
|
|
restack, map);
|
2005-10-26 19:44:36 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-04-14 02:31:31 -07:00
|
|
|
if (evas_object_is_opaque(obj) &&
|
2009-11-10 00:50:11 -08:00
|
|
|
evas_object_is_visible(obj))
|
2008-05-26 06:24:24 -07:00
|
|
|
{
|
2008-10-16 05:27:07 -07:00
|
|
|
eina_array_push(render_objects, obj);
|
2008-05-26 06:24:24 -07:00
|
|
|
obj->rect_del = 1;
|
|
|
|
}
|
2005-10-26 19:44:36 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2008-04-14 02:31:31 -07:00
|
|
|
if (!is_active) obj->restack = 0;
|
2008-05-26 06:24:24 -07:00
|
|
|
return clean_them;
|
2005-10-26 19:44:36 -07:00
|
|
|
}
|
|
|
|
|
2009-06-17 03:01:52 -07:00
|
|
|
static Eina_Bool
|
2009-11-10 00:50:11 -08:00
|
|
|
_evas_render_phase1_process(Evas *e,
|
|
|
|
Eina_Array *active_objects,
|
|
|
|
Eina_Array *restack_objects,
|
|
|
|
Eina_Array *delete_objects,
|
|
|
|
Eina_Array *render_objects)
|
2005-10-26 19:44:36 -07:00
|
|
|
{
|
2008-10-17 04:23:18 -07:00
|
|
|
Evas_Layer *lay;
|
2009-06-17 03:01:52 -07:00
|
|
|
Eina_Bool clean_them = EINA_FALSE;
|
2005-10-26 19:44:36 -07:00
|
|
|
|
2008-10-21 05:19:57 -07:00
|
|
|
EINA_INLIST_FOREACH(e->layers, lay)
|
2005-10-26 19:44:36 -07:00
|
|
|
{
|
2008-10-17 04:23:18 -07:00
|
|
|
Evas_Object *obj;
|
2009-11-06 21:01:43 -08:00
|
|
|
|
2008-10-21 05:19:57 -07:00
|
|
|
EINA_INLIST_FOREACH(lay->objects, obj)
|
2005-10-26 19:44:36 -07:00
|
|
|
{
|
2009-10-30 03:11:15 -07:00
|
|
|
clean_them |= _evas_render_phase1_object_process
|
|
|
|
(e, obj, active_objects, restack_objects, delete_objects,
|
2009-11-10 00:50:11 -08:00
|
|
|
render_objects, 0, 0);
|
2008-05-26 06:24:24 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return clean_them;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2008-10-16 05:27:07 -07:00
|
|
|
_evas_render_check_pending_objects(Eina_Array *pending_objects, Evas *e)
|
2008-05-26 06:24:24 -07:00
|
|
|
{
|
2009-10-30 03:11:15 -07:00
|
|
|
int i;
|
2008-05-26 06:24:24 -07:00
|
|
|
|
|
|
|
for (i = 0; i < pending_objects->count; ++i)
|
|
|
|
{
|
|
|
|
Evas_Object *obj;
|
2009-10-30 03:11:15 -07:00
|
|
|
int is_active, ok = 0;
|
2009-10-28 01:59:01 -07:00
|
|
|
|
2008-10-16 05:27:07 -07:00
|
|
|
obj = eina_array_data_get(pending_objects, i);
|
2009-10-28 01:59:01 -07:00
|
|
|
|
2008-06-17 02:04:12 -07:00
|
|
|
if (!obj->layer) goto clean_stuff;
|
2009-10-28 01:59:01 -07:00
|
|
|
|
2008-06-04 09:42:39 -07:00
|
|
|
evas_object_clip_recalc(obj);
|
|
|
|
is_active = evas_object_is_active(obj);
|
2009-10-28 01:59:01 -07:00
|
|
|
|
2009-10-30 03:11:15 -07:00
|
|
|
if ((!is_active) && (!obj->is_active) && (!obj->render_pre) &&
|
|
|
|
(!obj->rect_del))
|
2008-06-17 02:04:12 -07:00
|
|
|
{
|
|
|
|
ok = 1;
|
|
|
|
goto clean_stuff;
|
|
|
|
}
|
2009-10-28 01:59:01 -07:00
|
|
|
|
2008-06-17 02:04:12 -07:00
|
|
|
if (obj->is_active == is_active)
|
|
|
|
{
|
|
|
|
if (obj->changed)
|
|
|
|
{
|
|
|
|
if (obj->smart.smart)
|
|
|
|
{
|
2009-10-30 03:11:15 -07:00
|
|
|
if (obj->render_pre || obj->rect_del) ok = 1;
|
2008-06-17 02:04:12 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
if ((is_active) && (obj->restack) && (!obj->clip.clipees) &&
|
|
|
|
((evas_object_is_visible(obj) && (!obj->cur.have_clipees)) ||
|
|
|
|
(evas_object_was_visible(obj) && (!obj->prev.have_clipees))))
|
2008-06-04 09:42:39 -07:00
|
|
|
{
|
2009-10-30 03:11:15 -07:00
|
|
|
if (!(obj->render_pre || obj->rect_del)) ok = 1;
|
2008-06-04 09:42:39 -07:00
|
|
|
}
|
2009-10-28 01:59:01 -07:00
|
|
|
else
|
|
|
|
if (is_active && (!obj->clip.clipees) &&
|
|
|
|
((evas_object_is_visible(obj) && (!obj->cur.have_clipees)) ||
|
|
|
|
(evas_object_was_visible(obj) && (!obj->prev.have_clipees))))
|
|
|
|
{
|
2009-10-30 03:11:15 -07:00
|
|
|
if (obj->render_pre || obj->rect_del) ok = 1;
|
2009-10-28 01:59:01 -07:00
|
|
|
}
|
2008-06-17 02:04:12 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if ((!obj->clip.clipees) && (obj->delete_me == 0) &&
|
|
|
|
(!obj->cur.have_clipees || (evas_object_was_visible(obj) && (!obj->prev.have_clipees)))
|
|
|
|
&& evas_object_is_opaque(obj) && evas_object_is_visible(obj))
|
2009-10-30 03:11:15 -07:00
|
|
|
{
|
|
|
|
if (obj->rect_del || obj->smart.smart) ok = 1;
|
|
|
|
}
|
2008-06-17 02:04:12 -07:00
|
|
|
}
|
|
|
|
}
|
2009-10-28 01:59:01 -07:00
|
|
|
|
|
|
|
clean_stuff:
|
2008-05-26 06:24:24 -07:00
|
|
|
if (!ok)
|
|
|
|
{
|
2008-10-16 05:27:07 -07:00
|
|
|
eina_array_clean(&e->active_objects);
|
|
|
|
eina_array_clean(&e->render_objects);
|
|
|
|
eina_array_clean(&e->restack_objects);
|
|
|
|
eina_array_clean(&e->delete_objects);
|
2008-06-04 09:42:39 -07:00
|
|
|
e->invalidate = 1;
|
2008-05-26 06:24:24 -07:00
|
|
|
return ;
|
2005-10-26 19:44:36 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-09-03 22:13:19 -07:00
|
|
|
Eina_Bool
|
2009-08-09 12:07:03 -07:00
|
|
|
pending_change(void *data, void *gdata __UNUSED__)
|
2008-06-04 09:42:39 -07:00
|
|
|
{
|
|
|
|
Evas_Object *obj;
|
|
|
|
|
|
|
|
obj = data;
|
2008-10-16 05:27:07 -07:00
|
|
|
if (obj->delete_me) return EINA_FALSE;
|
2009-11-06 21:01:43 -08:00
|
|
|
obj->pre_render_done = 0;
|
2009-11-09 07:18:37 -08:00
|
|
|
// if (!obj->layer)
|
|
|
|
obj->changed = 0;
|
2008-10-16 05:27:07 -07:00
|
|
|
return obj->changed ? EINA_TRUE : EINA_FALSE;
|
2008-06-04 09:42:39 -07:00
|
|
|
}
|
|
|
|
|
2009-10-30 03:11:15 -07:00
|
|
|
static void
|
2009-11-06 21:01:43 -08:00
|
|
|
evas_render_mapped(Evas *e, Evas_Object *obj, void *context, void *surface,
|
|
|
|
int off_x, int off_y, int mapped)
|
2009-10-30 03:11:15 -07:00
|
|
|
{
|
2009-11-06 21:01:43 -08:00
|
|
|
void *ctx;
|
2009-11-10 00:50:11 -08:00
|
|
|
Evas_Object *obj2;
|
2009-11-06 21:01:43 -08:00
|
|
|
|
2009-11-09 07:18:37 -08:00
|
|
|
evas_object_clip_recalc(obj);
|
|
|
|
if (mapped)
|
|
|
|
{
|
|
|
|
if ((!evas_object_is_visible(obj)) || (obj->clip.clipees) ||
|
|
|
|
(obj->cur.have_clipees))
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
else if (!(((evas_object_is_active(obj) && (!obj->clip.clipees) &&
|
|
|
|
((evas_object_is_visible(obj) && (!obj->cur.have_clipees)))))
|
|
|
|
))
|
|
|
|
return;
|
2009-11-10 00:50:11 -08:00
|
|
|
printf("rndr [%p]\n", obj);
|
2009-11-09 07:18:37 -08:00
|
|
|
|
2009-11-10 00:50:11 -08:00
|
|
|
if (_evas_render_has_map(obj))
|
2009-10-30 03:11:15 -07:00
|
|
|
{
|
|
|
|
const Evas_Map_Point *p, *p_end;
|
|
|
|
RGBA_Map_Point pts[4], *pt;
|
2009-10-31 02:08:01 -07:00
|
|
|
int sw, sh;
|
|
|
|
int changed = 0;
|
2009-10-30 03:11:15 -07:00
|
|
|
|
2009-11-03 07:41:36 -08:00
|
|
|
sw = obj->cur.geometry.w;
|
|
|
|
sh = obj->cur.geometry.h;
|
2009-10-31 02:08:01 -07:00
|
|
|
if ((sw <= 0) || (sh <= 0)) return;
|
2009-10-30 03:11:15 -07:00
|
|
|
|
|
|
|
p = obj->cur.map->points;
|
|
|
|
p_end = p + 4;
|
|
|
|
pt = pts;
|
|
|
|
for (; p < p_end; p++, pt++)
|
|
|
|
{
|
|
|
|
pt->x = (p->x + off_x) << FP;
|
|
|
|
pt->y = (p->y + off_y) << FP;
|
|
|
|
pt->z = (p->z) << FP;
|
|
|
|
pt->u = p->u * FP1;
|
|
|
|
pt->v = p->v * FP1;
|
2009-11-01 01:03:01 -08:00
|
|
|
pt->col = ARGB_JOIN(p->a, p->r, p->g, p->b);
|
2009-10-30 03:11:15 -07:00
|
|
|
}
|
|
|
|
|
2009-10-31 02:08:01 -07:00
|
|
|
if (obj->cur.map->surface)
|
|
|
|
{
|
|
|
|
if ((obj->cur.map->surface_w != sw) ||
|
|
|
|
(obj->cur.map->surface_h != sh))
|
|
|
|
{
|
|
|
|
obj->layer->evas->engine.func->image_map_surface_free
|
|
|
|
(e->engine.data.output, obj->cur.map->surface);
|
|
|
|
obj->cur.map->surface = NULL;
|
|
|
|
}
|
|
|
|
}
|
2009-10-30 03:11:15 -07:00
|
|
|
if (!obj->cur.map->surface)
|
2009-10-31 02:08:01 -07:00
|
|
|
{
|
|
|
|
obj->cur.map->surface_w = sw;
|
|
|
|
obj->cur.map->surface_h = sh;
|
|
|
|
|
|
|
|
obj->cur.map->surface =
|
|
|
|
obj->layer->evas->engine.func->image_map_surface_new
|
|
|
|
(e->engine.data.output, obj->cur.map->surface_w,
|
|
|
|
obj->cur.map->surface_h,
|
|
|
|
obj->cur.map->alpha);
|
|
|
|
changed = 1;
|
|
|
|
}
|
2009-10-30 03:11:15 -07:00
|
|
|
if (obj->smart.smart)
|
|
|
|
{
|
|
|
|
Evas_Object *obj2;
|
|
|
|
|
2009-10-31 02:08:01 -07:00
|
|
|
EINA_INLIST_FOREACH(evas_object_smart_members_get_direct(obj), obj2)
|
2009-10-30 03:11:15 -07:00
|
|
|
{
|
2009-11-06 21:01:43 -08:00
|
|
|
if (obj2->changed)
|
2009-10-31 02:08:01 -07:00
|
|
|
{
|
2009-11-09 07:18:37 -08:00
|
|
|
obj2->changed = 0;
|
2009-11-06 21:01:43 -08:00
|
|
|
changed = 1;
|
|
|
|
break;
|
2009-10-31 02:08:01 -07:00
|
|
|
}
|
2009-10-30 03:11:15 -07:00
|
|
|
}
|
2009-10-31 02:08:01 -07:00
|
|
|
obj->changed = 0;
|
2009-10-30 03:11:15 -07:00
|
|
|
}
|
|
|
|
else
|
2009-11-09 07:18:37 -08:00
|
|
|
{
|
|
|
|
changed = obj->changed;
|
|
|
|
obj->changed = 0;
|
|
|
|
}
|
2009-10-31 02:08:01 -07:00
|
|
|
|
|
|
|
// clear surface before re-render
|
|
|
|
if ((changed) && (obj->cur.map->surface))
|
2009-10-30 03:11:15 -07:00
|
|
|
{
|
2009-11-09 07:18:37 -08:00
|
|
|
// FIXME: calculate "changes" within map surface and only clear
|
|
|
|
// and re-render those
|
2009-10-31 18:32:23 -07:00
|
|
|
if (obj->cur.map->alpha)
|
|
|
|
{
|
|
|
|
ctx = e->engine.func->context_new(e->engine.data.output);
|
|
|
|
e->engine.func->context_color_set
|
|
|
|
(e->engine.data.output, ctx, 0, 0, 0, 0);
|
|
|
|
e->engine.func->context_render_op_set
|
|
|
|
(e->engine.data.output, ctx, EVAS_RENDER_COPY);
|
|
|
|
e->engine.func->rectangle_draw(e->engine.data.output,
|
|
|
|
ctx,
|
|
|
|
obj->cur.map->surface,
|
|
|
|
0, 0,
|
|
|
|
obj->cur.map->surface_w,
|
|
|
|
obj->cur.map->surface_h);
|
|
|
|
e->engine.func->context_free(e->engine.data.output, ctx);
|
|
|
|
}
|
2009-10-31 02:08:01 -07:00
|
|
|
ctx = e->engine.func->context_new(e->engine.data.output);
|
2009-11-10 00:50:11 -08:00
|
|
|
off_x = -obj->cur.geometry.x;
|
|
|
|
off_y = -obj->cur.geometry.y;
|
2009-10-31 02:08:01 -07:00
|
|
|
if (obj->smart.smart)
|
|
|
|
{
|
|
|
|
EINA_INLIST_FOREACH
|
|
|
|
(evas_object_smart_members_get_direct(obj), obj2)
|
|
|
|
{
|
2009-11-09 07:18:37 -08:00
|
|
|
evas_render_mapped(e, obj2, ctx,
|
|
|
|
obj->cur.map->surface,
|
|
|
|
off_x, off_y, 1);
|
2009-10-31 02:08:01 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2009-11-10 00:50:11 -08:00
|
|
|
obj->func->render(obj, e->engine.data.output, ctx,
|
|
|
|
obj->cur.map->surface, off_x, off_y);
|
2009-10-31 02:08:01 -07:00
|
|
|
e->engine.func->context_free(e->engine.data.output, ctx);
|
|
|
|
}
|
|
|
|
|
2009-10-30 03:11:15 -07:00
|
|
|
obj->layer->evas->engine.func->image_map4_draw
|
|
|
|
(e->engine.data.output, e->engine.data.context, surface,
|
2009-10-31 02:08:01 -07:00
|
|
|
obj->cur.map->surface, pts, obj->cur.map->smooth, 0);
|
|
|
|
|
2009-10-30 03:11:15 -07:00
|
|
|
// FIXME: needs to cache these maps and
|
|
|
|
// keep them only rendering updates
|
2009-10-31 02:08:01 -07:00
|
|
|
// obj->layer->evas->engine.func->image_map_surface_free
|
|
|
|
// (e->engine.data.output, obj->cur.map->surface);
|
|
|
|
// obj->cur.map->surface = NULL;
|
2009-10-30 03:11:15 -07:00
|
|
|
}
|
|
|
|
else
|
2009-11-06 21:01:43 -08:00
|
|
|
{
|
|
|
|
if (mapped)
|
|
|
|
{
|
|
|
|
ctx = e->engine.func->context_new(e->engine.data.output);
|
|
|
|
if (obj->smart.smart)
|
|
|
|
{
|
|
|
|
EINA_INLIST_FOREACH
|
|
|
|
(evas_object_smart_members_get_direct(obj), obj2)
|
|
|
|
{
|
2009-11-09 07:18:37 -08:00
|
|
|
evas_render_mapped(e, obj2, ctx,
|
|
|
|
surface,
|
|
|
|
off_x, off_y, 1);
|
2009-11-06 21:01:43 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
2009-11-09 07:18:37 -08:00
|
|
|
obj->func->render(obj, e->engine.data.output, ctx,
|
|
|
|
surface, off_x, off_y);
|
2009-11-06 21:01:43 -08:00
|
|
|
e->engine.func->context_free(e->engine.data.output, ctx);
|
|
|
|
}
|
|
|
|
else
|
2009-11-09 07:18:37 -08:00
|
|
|
{
|
|
|
|
obj->func->render(obj, e->engine.data.output, context, surface,
|
|
|
|
off_x, off_y);
|
|
|
|
}
|
2009-11-06 21:01:43 -08:00
|
|
|
}
|
2009-10-30 03:11:15 -07:00
|
|
|
}
|
|
|
|
|
2008-10-21 09:31:05 -07:00
|
|
|
static Eina_List *
|
2009-10-28 01:59:01 -07:00
|
|
|
evas_render_updates_internal(Evas *e,
|
|
|
|
unsigned char make_updates,
|
|
|
|
unsigned char do_draw)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2008-10-21 09:31:05 -07:00
|
|
|
Eina_List *updates = NULL;
|
|
|
|
Eina_List *ll;
|
2002-11-08 00:02:15 -08:00
|
|
|
void *surface;
|
2009-06-17 03:01:52 -07:00
|
|
|
Eina_Bool clean_them = EINA_FALSE;
|
2009-06-26 06:26:52 -07:00
|
|
|
Eina_Bool alpha;
|
2009-06-23 06:57:27 -07:00
|
|
|
Eina_Rectangle *r;
|
2002-11-08 00:02:15 -08:00
|
|
|
int ux, uy, uw, uh;
|
|
|
|
int cx, cy, cw, ch;
|
2008-06-04 09:42:39 -07:00
|
|
|
unsigned int i, j;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return NULL;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
if (!e->changed) return NULL;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2008-09-06 18:25:49 -07:00
|
|
|
evas_call_smarts_calculate(e);
|
2009-11-10 00:50:11 -08:00
|
|
|
printf("--- --- --- --- --- --- --- --- --- --- --- --- --- --- ---\n");
|
2009-11-09 07:18:37 -08:00
|
|
|
|
2008-05-26 06:24:24 -07:00
|
|
|
/* Check if the modified object mean recalculating every thing */
|
2008-06-04 09:42:39 -07:00
|
|
|
if (!e->invalidate)
|
|
|
|
_evas_render_check_pending_objects(&e->pending_objects, e);
|
2008-05-26 06:24:24 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
/* phase 1. add extra updates for changed objects */
|
2008-06-04 09:42:39 -07:00
|
|
|
if (e->invalidate || e->render_objects.count <= 0)
|
2008-05-26 06:24:24 -07:00
|
|
|
clean_them = _evas_render_phase1_process(e, &e->active_objects, &e->restack_objects, &e->delete_objects, &e->render_objects);
|
2009-11-06 21:01:43 -08:00
|
|
|
|
|
|
|
_evas_render_phase1_direct(e, &e->active_objects, &e->restack_objects, &e->delete_objects, &e->render_objects);
|
2008-05-26 06:24:24 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
/* phase 2. force updates for restacks */
|
2008-05-26 06:24:24 -07:00
|
|
|
for (i = 0; i < e->restack_objects.count; ++i)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
|
|
|
Evas_Object *obj;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2008-10-16 05:27:07 -07:00
|
|
|
obj = eina_array_data_get(&e->restack_objects, i);
|
2002-11-08 00:02:15 -08:00
|
|
|
obj->func->render_pre(obj);
|
2009-11-10 00:50:11 -08:00
|
|
|
_evas_render_prev_cur_clip_cache_add(e, obj);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2008-10-16 05:27:07 -07:00
|
|
|
eina_array_clean(&e->restack_objects);
|
2002-11-08 00:02:15 -08:00
|
|
|
/* phase 3. add exposes */
|
2009-04-14 02:27:27 -07:00
|
|
|
EINA_LIST_FREE(e->damages, r)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2005-05-21 19:49:50 -07:00
|
|
|
e->engine.func->output_redraws_rect_add(e->engine.data.output,
|
2002-11-08 00:02:15 -08:00
|
|
|
r->x, r->y, r->w, r->h);
|
2009-06-23 06:57:27 -07:00
|
|
|
eina_rectangle_free(r);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2003-04-17 05:05:00 -07:00
|
|
|
/* phase 4. output & viewport changes */
|
|
|
|
if (e->viewport.changed)
|
|
|
|
{
|
2005-05-21 19:49:50 -07:00
|
|
|
e->engine.func->output_redraws_rect_add(e->engine.data.output,
|
|
|
|
0, 0,
|
2003-04-17 05:05:00 -07:00
|
|
|
e->output.w, e->output.h);
|
|
|
|
}
|
|
|
|
if (e->output.changed)
|
|
|
|
{
|
|
|
|
e->engine.func->output_resize(e->engine.data.output,
|
|
|
|
e->output.w, e->output.h);
|
2005-05-21 19:49:50 -07:00
|
|
|
e->engine.func->output_redraws_rect_add(e->engine.data.output,
|
|
|
|
0, 0,
|
2003-04-17 05:05:00 -07:00
|
|
|
e->output.w, e->output.h);
|
|
|
|
}
|
2006-11-15 19:20:24 -08:00
|
|
|
if ((e->output.w != e->viewport.w) || (e->output.h != e->viewport.h))
|
|
|
|
{
|
2009-10-22 08:22:22 -07:00
|
|
|
ERR("viewport size != output size!");
|
2006-11-15 19:20:24 -08:00
|
|
|
}
|
2003-04-17 05:05:00 -07:00
|
|
|
/* phase 5. add obscures */
|
2008-10-21 09:31:05 -07:00
|
|
|
EINA_LIST_FOREACH(e->obscures, ll, r)
|
2009-11-06 21:01:43 -08:00
|
|
|
{
|
2008-10-21 09:31:05 -07:00
|
|
|
e->engine.func->output_redraws_rect_del(e->engine.data.output,
|
2002-11-08 00:02:15 -08:00
|
|
|
r->x, r->y, r->w, r->h);
|
2009-11-06 21:01:43 -08:00
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
/* build obscure objects list of active objects that obscure */
|
2008-05-26 06:24:24 -07:00
|
|
|
for (i = 0; i < e->active_objects.count; ++i)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
|
|
|
Evas_Object *obj;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2008-10-16 05:27:07 -07:00
|
|
|
obj = eina_array_data_get(&e->active_objects, i);
|
2009-02-16 20:53:03 -08:00
|
|
|
if (UNLIKELY((evas_object_is_opaque(obj) ||
|
|
|
|
((obj->func->has_opaque_rect) &&
|
|
|
|
(obj->func->has_opaque_rect(obj)))) &&
|
2007-06-04 11:31:30 -07:00
|
|
|
evas_object_is_visible(obj) &&
|
|
|
|
(!obj->clip.clipees) &&
|
|
|
|
(obj->cur.visible) &&
|
|
|
|
(!obj->delete_me) &&
|
|
|
|
(obj->cur.cache.clip.visible) &&
|
|
|
|
(!obj->smart.smart)))
|
2009-09-03 22:13:19 -07:00
|
|
|
/* obscuring_objects = eina_list_append(obscuring_objects, obj); */
|
2008-10-16 05:27:07 -07:00
|
|
|
eina_array_push(&e->obscuring_objects, obj);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
/* save this list */
|
2008-06-04 09:42:39 -07:00
|
|
|
/* obscuring_objects_orig = obscuring_objects; */
|
|
|
|
/* obscuring_objects = NULL; */
|
2004-02-16 11:22:48 -08:00
|
|
|
/* phase 6. go thru each update rect and render objects in it*/
|
2007-01-22 04:44:57 -08:00
|
|
|
if (do_draw)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2008-06-04 09:42:39 -07:00
|
|
|
unsigned int offset = 0;
|
|
|
|
|
2009-06-26 06:26:52 -07:00
|
|
|
alpha = e->engine.func->canvas_alpha_get(e->engine.data.output, e->engine.data.context);
|
|
|
|
|
2007-01-22 04:44:57 -08:00
|
|
|
while ((surface =
|
|
|
|
e->engine.func->output_redraws_next_update_get(e->engine.data.output,
|
|
|
|
&ux, &uy, &uw, &uh,
|
|
|
|
&cx, &cy, &cw, &ch)))
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2007-01-22 04:44:57 -08:00
|
|
|
int off_x, off_y;
|
2008-04-14 02:31:31 -07:00
|
|
|
|
2009-11-10 00:50:11 -08:00
|
|
|
printf("============ [ %3i %3i | %3ix%3i ]\n", ux, uy, uw, uh);
|
2007-01-22 04:44:57 -08:00
|
|
|
if (make_updates)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2009-06-23 06:57:27 -07:00
|
|
|
Eina_Rectangle *rect;
|
2008-04-14 02:31:31 -07:00
|
|
|
|
2009-04-14 05:15:07 -07:00
|
|
|
NEW_RECT(rect, ux, uy, uw, uh);
|
2007-01-22 04:44:57 -08:00
|
|
|
if (rect)
|
2009-04-14 05:15:07 -07:00
|
|
|
updates = eina_list_append(updates, rect);
|
2007-01-22 04:44:57 -08:00
|
|
|
}
|
|
|
|
off_x = cx - ux;
|
|
|
|
off_y = cy - uy;
|
|
|
|
/* build obscuring objects list (in order from bottom to top) */
|
2008-06-04 09:42:39 -07:00
|
|
|
for (i = 0; i < e->obscuring_objects.count; ++i)
|
2007-01-22 04:44:57 -08:00
|
|
|
{
|
|
|
|
Evas_Object *obj;
|
2008-04-14 02:31:31 -07:00
|
|
|
|
2008-10-16 05:27:07 -07:00
|
|
|
obj = (Evas_Object *) eina_array_data_get(&e->obscuring_objects, i);
|
2007-01-22 04:44:57 -08:00
|
|
|
if (evas_object_is_in_output_rect(obj, ux, uy, uw, uh))
|
2009-06-26 06:26:52 -07:00
|
|
|
{
|
|
|
|
eina_array_push(&e->temporary_objects, obj);
|
|
|
|
|
|
|
|
/* reset the background of the area if needed (using cutout and engine alpha flag to help) */
|
2009-08-14 10:48:49 -07:00
|
|
|
if (alpha)
|
2009-06-26 06:26:52 -07:00
|
|
|
{
|
|
|
|
if (evas_object_is_opaque(obj))
|
|
|
|
e->engine.func->context_cutout_add(e->engine.data.output,
|
|
|
|
e->engine.data.context,
|
|
|
|
obj->cur.cache.clip.x + off_x,
|
|
|
|
obj->cur.cache.clip.y + off_y,
|
|
|
|
obj->cur.cache.clip.w,
|
|
|
|
obj->cur.cache.clip.h);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (obj->func->get_opaque_rect)
|
|
|
|
{
|
|
|
|
Evas_Coord obx, oby, obw, obh;
|
|
|
|
|
|
|
|
obj->func->get_opaque_rect(obj, &obx, &oby, &obw, &obh);
|
|
|
|
if ((obw > 0) && (obh > 0))
|
|
|
|
{
|
|
|
|
obx += off_x;
|
|
|
|
oby += off_y;
|
|
|
|
RECTS_CLIP_TO_RECT(obx, oby, obw, obh,
|
|
|
|
obj->cur.cache.clip.x + off_x,
|
|
|
|
obj->cur.cache.clip.y + off_y,
|
|
|
|
obj->cur.cache.clip.w,
|
|
|
|
obj->cur.cache.clip.h);
|
|
|
|
e->engine.func->context_cutout_add(e->engine.data.output,
|
|
|
|
e->engine.data.context,
|
|
|
|
obx, oby,
|
|
|
|
obw, obh);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2007-01-22 04:44:57 -08:00
|
|
|
}
|
2009-08-14 10:48:49 -07:00
|
|
|
if (alpha)
|
2009-06-26 06:26:52 -07:00
|
|
|
{
|
2009-08-14 10:17:01 -07:00
|
|
|
e->engine.func->context_clip_set(e->engine.data.output,
|
|
|
|
e->engine.data.context,
|
|
|
|
ux, uy, uw, uh);
|
2009-08-14 10:48:49 -07:00
|
|
|
e->engine.func->context_color_set(e->engine.data.output, e->engine.data.context, 0, 0, 0, 0);
|
2009-06-26 06:26:52 -07:00
|
|
|
e->engine.func->context_multiplier_unset(e->engine.data.output, e->engine.data.context);
|
|
|
|
e->engine.func->context_render_op_set(e->engine.data.output, e->engine.data.context, EVAS_RENDER_COPY);
|
|
|
|
e->engine.func->rectangle_draw(e->engine.data.output,
|
|
|
|
e->engine.data.context,
|
|
|
|
surface,
|
|
|
|
cx, cy, cw, ch);
|
|
|
|
e->engine.func->context_cutout_clear(e->engine.data.output,
|
|
|
|
e->engine.data.context);
|
|
|
|
}
|
2007-01-22 04:44:57 -08:00
|
|
|
/* render all object that intersect with rect */
|
2008-05-26 06:24:24 -07:00
|
|
|
for (i = 0; i < e->active_objects.count; ++i)
|
2007-01-22 04:44:57 -08:00
|
|
|
{
|
|
|
|
Evas_Object *obj;
|
2008-05-26 06:24:24 -07:00
|
|
|
|
2008-10-16 05:27:07 -07:00
|
|
|
obj = eina_array_data_get(&e->active_objects, i);
|
2008-04-14 02:31:31 -07:00
|
|
|
|
2007-01-22 04:44:57 -08:00
|
|
|
/* if it's in our outpout rect and it doesn't clip anything */
|
|
|
|
if (evas_object_is_in_output_rect(obj, ux, uy, uw, uh) &&
|
|
|
|
(!obj->clip.clipees) &&
|
|
|
|
(obj->cur.visible) &&
|
|
|
|
(!obj->delete_me) &&
|
|
|
|
(obj->cur.cache.clip.visible) &&
|
2009-10-30 03:11:15 -07:00
|
|
|
// (!obj->smart.smart) &&
|
2007-01-22 04:44:57 -08:00
|
|
|
(obj->cur.color.a > 0))
|
|
|
|
{
|
|
|
|
int x, y, w, h;
|
2008-04-14 02:31:31 -07:00
|
|
|
|
2008-06-04 09:42:39 -07:00
|
|
|
if ((e->temporary_objects.count > offset) &&
|
2008-10-16 05:27:07 -07:00
|
|
|
(eina_array_data_get(&e->temporary_objects, offset) == obj))
|
2008-06-04 09:42:39 -07:00
|
|
|
offset++;
|
2007-01-22 04:44:57 -08:00
|
|
|
x = cx; y = cy; w = cw; h = ch;
|
|
|
|
RECTS_CLIP_TO_RECT(x, y, w, h,
|
|
|
|
obj->cur.cache.clip.x + off_x,
|
|
|
|
obj->cur.cache.clip.y + off_y,
|
|
|
|
obj->cur.cache.clip.w,
|
|
|
|
obj->cur.cache.clip.h);
|
|
|
|
if ((w > 0) && (h > 0))
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2007-01-22 04:44:57 -08:00
|
|
|
e->engine.func->context_clip_set(e->engine.data.output,
|
|
|
|
e->engine.data.context,
|
|
|
|
x, y, w, h);
|
|
|
|
#if 1 /* FIXME: this can slow things down... figure out optimum... coverage */
|
2008-06-04 09:42:39 -07:00
|
|
|
for (j = offset; j < e->temporary_objects.count; ++j)
|
2007-01-22 04:44:57 -08:00
|
|
|
{
|
|
|
|
Evas_Object *obj2;
|
2008-04-14 02:31:31 -07:00
|
|
|
|
2008-10-16 05:27:07 -07:00
|
|
|
obj2 = (Evas_Object *) eina_array_data_get(&e->temporary_objects, j);
|
2009-02-16 20:53:03 -08:00
|
|
|
if (evas_object_is_opaque(obj2))
|
|
|
|
e->engine.func->context_cutout_add(e->engine.data.output,
|
|
|
|
e->engine.data.context,
|
|
|
|
obj2->cur.cache.clip.x + off_x,
|
|
|
|
obj2->cur.cache.clip.y + off_y,
|
|
|
|
obj2->cur.cache.clip.w,
|
|
|
|
obj2->cur.cache.clip.h);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (obj2->func->get_opaque_rect)
|
|
|
|
{
|
|
|
|
Evas_Coord obx, oby, obw, obh;
|
2009-09-03 22:13:19 -07:00
|
|
|
|
2009-02-16 20:53:03 -08:00
|
|
|
obj2->func->get_opaque_rect
|
|
|
|
(obj2, &obx, &oby, &obw, &obh);
|
|
|
|
if ((obw > 0) && (obh > 0))
|
|
|
|
{
|
|
|
|
obx += off_x;
|
|
|
|
oby += off_y;
|
|
|
|
RECTS_CLIP_TO_RECT(obx, oby, obw, obh,
|
|
|
|
obj2->cur.cache.clip.x + off_x,
|
|
|
|
obj2->cur.cache.clip.y + off_y,
|
|
|
|
obj2->cur.cache.clip.w,
|
|
|
|
obj2->cur.cache.clip.h);
|
|
|
|
e->engine.func->context_cutout_add(e->engine.data.output,
|
|
|
|
e->engine.data.context,
|
|
|
|
obx, oby,
|
|
|
|
obw, obh);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2007-01-22 04:44:57 -08:00
|
|
|
}
|
2005-05-21 19:49:50 -07:00
|
|
|
#endif
|
2009-10-30 03:11:15 -07:00
|
|
|
evas_render_mapped(e, obj, e->engine.data.context,
|
2009-11-06 21:01:43 -08:00
|
|
|
surface, off_x, off_y, 0);
|
2007-01-22 04:44:57 -08:00
|
|
|
e->engine.func->context_cutout_clear(e->engine.data.output,
|
|
|
|
e->engine.data.context);
|
|
|
|
}
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
}
|
2007-01-22 04:44:57 -08:00
|
|
|
/* punch rect out */
|
|
|
|
e->engine.func->output_redraws_next_update_push(e->engine.data.output,
|
|
|
|
surface,
|
|
|
|
ux, uy, uw, uh);
|
|
|
|
/* free obscuring objects list */
|
2008-10-16 05:27:07 -07:00
|
|
|
eina_array_clean(&e->temporary_objects);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2007-01-22 04:44:57 -08:00
|
|
|
/* flush redraws */
|
|
|
|
e->engine.func->output_flush(e->engine.data.output);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
/* clear redraws */
|
2005-05-21 19:49:50 -07:00
|
|
|
e->engine.func->output_redraws_clear(e->engine.data.output);
|
2002-11-08 00:02:15 -08:00
|
|
|
/* and do a post render pass */
|
2008-05-26 06:24:24 -07:00
|
|
|
for (i = 0; i < e->active_objects.count; ++i)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2005-10-26 19:44:36 -07:00
|
|
|
Evas_Object *obj;
|
2008-04-14 02:31:31 -07:00
|
|
|
|
2008-10-16 05:27:07 -07:00
|
|
|
obj = eina_array_data_get(&e->active_objects, i);
|
2005-10-26 19:44:36 -07:00
|
|
|
obj->pre_render_done = 0;
|
2007-01-16 02:17:10 -08:00
|
|
|
if ((obj->changed) && (do_draw))
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2005-10-26 19:44:36 -07:00
|
|
|
obj->func->render_post(obj);
|
|
|
|
obj->restack = 0;
|
|
|
|
obj->changed = 0;
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2009-11-09 07:18:37 -08:00
|
|
|
else if ((obj->cur.map != obj->prev.map) ||
|
|
|
|
(obj->cur.usemap != obj->prev.usemap))
|
2009-11-06 00:44:49 -08:00
|
|
|
{
|
|
|
|
obj->func->render_post(obj);
|
|
|
|
obj->restack = 0;
|
|
|
|
obj->changed = 0;
|
|
|
|
}
|
2007-01-16 02:17:10 -08:00
|
|
|
/* moved to other pre-process phase 1
|
2005-10-26 19:44:36 -07:00
|
|
|
if (obj->delete_me == 2)
|
2005-10-26 21:25:30 -07:00
|
|
|
{
|
2008-10-21 09:31:05 -07:00
|
|
|
delete_objects = eina_list_append(delete_objects, obj);
|
2005-10-26 21:25:30 -07:00
|
|
|
}
|
|
|
|
else if (obj->delete_me != 0) obj->delete_me++;
|
2007-01-16 02:17:10 -08:00
|
|
|
*/
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2005-10-26 21:25:30 -07:00
|
|
|
/* free our obscuring object list */
|
2008-10-16 05:27:07 -07:00
|
|
|
eina_array_clean(&e->obscuring_objects);
|
2008-06-04 09:42:39 -07:00
|
|
|
|
|
|
|
/* If some object are still marked as changed, do not remove
|
|
|
|
them from the pending list. */
|
2008-10-16 05:27:07 -07:00
|
|
|
eina_array_remove(&e->pending_objects, pending_change, NULL);
|
2008-06-04 09:42:39 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
/* delete all objects flagged for deletion now */
|
2008-05-26 06:24:24 -07:00
|
|
|
for (i = 0; i < e->delete_objects.count; ++i)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
|
|
|
Evas_Object *obj;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2008-10-16 05:27:07 -07:00
|
|
|
obj = eina_array_data_get(&e->delete_objects, i);
|
2002-11-08 00:02:15 -08:00
|
|
|
evas_object_free(obj, 1);
|
|
|
|
}
|
2008-10-16 05:27:07 -07:00
|
|
|
eina_array_clean(&e->delete_objects);
|
2008-05-26 06:24:24 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
e->changed = 0;
|
|
|
|
e->viewport.changed = 0;
|
|
|
|
e->output.changed = 0;
|
2008-06-04 09:42:39 -07:00
|
|
|
e->invalidate = 0;
|
|
|
|
|
2009-11-06 21:01:43 -08:00
|
|
|
for (i = 0; i < e->render_objects.count; ++i)
|
|
|
|
{
|
|
|
|
Evas_Object *obj;
|
|
|
|
|
|
|
|
obj = eina_array_data_get(&e->render_objects, i);
|
|
|
|
obj->pre_render_done = 0;
|
|
|
|
}
|
|
|
|
|
2009-11-09 07:18:37 -08:00
|
|
|
/* If their are some object to restack or some object to delete,
|
|
|
|
* it's useless to keep the render object list around. */
|
|
|
|
// if (clean_them)
|
|
|
|
if (1)
|
2008-06-04 09:42:39 -07:00
|
|
|
{
|
2008-10-16 05:27:07 -07:00
|
|
|
eina_array_clean(&e->active_objects);
|
|
|
|
eina_array_clean(&e->render_objects);
|
2009-11-09 07:18:37 -08:00
|
|
|
eina_array_clean(&e->restack_objects);
|
|
|
|
eina_array_clean(&e->delete_objects);
|
|
|
|
eina_array_clean(&e->obscuring_objects);
|
2008-06-04 09:42:39 -07:00
|
|
|
e->invalidate = 1;
|
|
|
|
}
|
2008-04-14 02:31:31 -07:00
|
|
|
|
2006-09-18 02:40:29 -07:00
|
|
|
evas_module_clean();
|
2008-04-14 02:31:31 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
return updates;
|
|
|
|
}
|
|
|
|
|
2003-03-04 18:30:20 -08:00
|
|
|
/**
|
2009-09-17 15:38:10 -07:00
|
|
|
* Free the rectangles returned by evas_render_updates().
|
|
|
|
*
|
|
|
|
* @param updates The list of updated rectangles of the canvas.
|
2003-03-04 18:30:20 -08:00
|
|
|
*
|
2009-09-17 15:38:10 -07:00
|
|
|
* This function removes the region from the render updates list. It
|
|
|
|
* makes the region doesn't be render updated anymore.
|
2005-05-21 19:49:50 -07:00
|
|
|
*
|
2003-03-04 18:30:20 -08:00
|
|
|
*/
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2008-10-21 09:31:05 -07:00
|
|
|
evas_render_updates_free(Eina_List *updates)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2009-06-23 06:57:27 -07:00
|
|
|
Eina_Rectangle *r;
|
2009-04-14 05:15:07 -07:00
|
|
|
|
|
|
|
EINA_LIST_FREE(updates, r)
|
2009-06-23 06:57:27 -07:00
|
|
|
eina_rectangle_free(r);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
|
|
|
|
2005-12-03 01:27:53 -08:00
|
|
|
/**
|
2009-09-17 15:38:10 -07:00
|
|
|
* Force immediate renderization of the given canvas.
|
2005-12-03 01:27:53 -08:00
|
|
|
*
|
2009-09-17 15:38:10 -07:00
|
|
|
* @param e The given canvas pointer.
|
|
|
|
* @return A list of updated rectangles of the canvas.
|
|
|
|
*
|
|
|
|
* This function forces an immediate renderization update of the given
|
|
|
|
* given canvas.
|
2005-12-03 01:27:53 -08:00
|
|
|
*
|
|
|
|
*/
|
2008-10-21 09:31:05 -07:00
|
|
|
EAPI Eina_List *
|
2005-12-03 01:27:53 -08:00
|
|
|
evas_render_updates(Evas *e)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return NULL;
|
|
|
|
MAGIC_CHECK_END();
|
2008-04-14 02:31:31 -07:00
|
|
|
|
2006-09-18 02:40:29 -07:00
|
|
|
if (!e->changed) return NULL;
|
2009-11-06 00:44:49 -08:00
|
|
|
return evas_render_updates_internal(e, 1, 1);
|
2005-12-03 01:27:53 -08:00
|
|
|
}
|
|
|
|
|
2003-03-04 18:30:20 -08:00
|
|
|
/**
|
2009-09-17 15:38:10 -07:00
|
|
|
* Force renderization of a region
|
|
|
|
*
|
|
|
|
* @param e The given canvas pointer.
|
2003-03-04 18:30:20 -08:00
|
|
|
*
|
2009-09-17 15:38:10 -07:00
|
|
|
* This function forces renderization of the region given.
|
2005-05-21 19:49:50 -07:00
|
|
|
*
|
2003-03-04 18:30:20 -08:00
|
|
|
*/
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI void
|
2002-11-08 00:02:15 -08:00
|
|
|
evas_render(Evas *e)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
|
2006-09-18 02:40:29 -07:00
|
|
|
if (!e->changed) return;
|
2009-11-06 00:44:49 -08:00
|
|
|
evas_render_updates_internal(e, 0, 1);
|
2007-01-16 02:17:10 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2009-09-17 15:38:10 -07:00
|
|
|
* Update the canvas internal objects but not triggering immediate
|
|
|
|
* renderization.
|
|
|
|
*
|
|
|
|
* @param e The given canvas pointer.
|
2007-01-16 02:17:10 -08:00
|
|
|
*
|
2009-09-17 15:38:10 -07:00
|
|
|
* This function updates the canvas internal objects not triggering
|
|
|
|
* renderization. To force renderization function evas_render() should
|
|
|
|
* be used.
|
|
|
|
*
|
|
|
|
* @see evas_render.
|
2007-01-16 02:17:10 -08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
EAPI void
|
|
|
|
evas_norender(Evas *e)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
2008-04-14 02:31:31 -07:00
|
|
|
|
2007-01-16 02:17:10 -08:00
|
|
|
// if (!e->changed) return;
|
2009-11-06 00:44:49 -08:00
|
|
|
evas_render_updates_internal(e, 0, 0);
|
2002-11-08 00:02:15 -08:00
|
|
|
}
|
2007-01-16 02:17:10 -08:00
|
|
|
|
2007-06-16 19:56:59 -07:00
|
|
|
/**
|
2009-09-17 15:38:10 -07:00
|
|
|
* Make the canvas discard internally cached data used for renderization
|
|
|
|
*
|
|
|
|
* @param e The given canvas pointer.
|
2007-06-16 19:56:59 -07:00
|
|
|
*
|
2009-09-17 15:38:10 -07:00
|
|
|
* This function flushes the arrays of delete, active and render objects.
|
2007-06-16 19:56:59 -07:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
EAPI void
|
|
|
|
evas_render_idle_flush(Evas *e)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
|
2009-06-15 07:37:14 -07:00
|
|
|
evas_fonts_zero_presure(e);
|
|
|
|
|
2007-06-16 19:56:59 -07:00
|
|
|
if ((e->engine.func) && (e->engine.func->output_idle_flush) &&
|
|
|
|
(e->engine.data.output))
|
|
|
|
e->engine.func->output_idle_flush(e->engine.data.output);
|
2008-05-26 06:24:24 -07:00
|
|
|
|
2008-10-16 05:27:07 -07:00
|
|
|
eina_array_flush(&e->delete_objects);
|
|
|
|
eina_array_flush(&e->active_objects);
|
|
|
|
eina_array_flush(&e->restack_objects);
|
|
|
|
eina_array_flush(&e->render_objects);
|
2009-04-15 06:40:37 -07:00
|
|
|
eina_array_flush(&e->clip_changes);
|
2008-06-04 09:42:39 -07:00
|
|
|
|
|
|
|
e->invalidate = 1;
|
2007-06-16 19:56:59 -07:00
|
|
|
}
|
2008-05-26 06:24:24 -07:00
|
|
|
|
|
|
|
void
|
|
|
|
evas_render_invalidate(Evas *e)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
|
2008-10-16 05:27:07 -07:00
|
|
|
eina_array_clean(&e->active_objects);
|
|
|
|
eina_array_clean(&e->render_objects);
|
2008-06-04 09:42:39 -07:00
|
|
|
|
2008-10-16 05:27:07 -07:00
|
|
|
eina_array_flush(&e->restack_objects);
|
|
|
|
eina_array_flush(&e->delete_objects);
|
2008-06-04 09:42:39 -07:00
|
|
|
|
|
|
|
e->invalidate = 1;
|
2008-05-26 06:24:24 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
evas_render_object_recalc(Evas_Object *obj)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
|
2008-06-12 06:22:26 -07:00
|
|
|
if ((!obj->changed) && (obj->delete_me < 2))
|
2008-05-26 06:24:24 -07:00
|
|
|
{
|
2009-08-07 14:38:36 -07:00
|
|
|
Evas *e;
|
2008-05-26 06:24:24 -07:00
|
|
|
|
|
|
|
e = obj->layer->evas;
|
2009-08-07 14:38:36 -07:00
|
|
|
if ((!e) || (e->cleanup)) return;
|
2009-11-09 07:18:37 -08:00
|
|
|
eina_array_push(&e->pending_objects, obj);
|
2008-06-04 09:42:39 -07:00
|
|
|
obj->changed = 1;
|
2008-05-26 06:24:24 -07:00
|
|
|
}
|
|
|
|
}
|