2002-11-08 00:02:15 -08:00
|
|
|
#include "evas_common.h"
|
|
|
|
#include "evas_private.h"
|
|
|
|
|
2005-12-03 01:27:53 -08:00
|
|
|
static Evas_List *
|
2007-01-16 02:17:10 -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
|
|
|
/**
|
|
|
|
* To be documented.
|
|
|
|
*
|
|
|
|
* FIXME: To be fixed.
|
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)
|
|
|
|
{
|
|
|
|
Evas_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();
|
|
|
|
r = malloc(sizeof(Evas_Rectangle));
|
|
|
|
if (!r) return;
|
|
|
|
r->x = x; r->y = y; r->w = w; r->h = h;
|
|
|
|
e->damages = evas_list_append(e->damages, r);
|
|
|
|
e->changed = 1;
|
|
|
|
}
|
|
|
|
|
2003-03-04 18:30:20 -08:00
|
|
|
/**
|
|
|
|
* To be documented.
|
|
|
|
*
|
|
|
|
* FIXME: To be fixed.
|
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)
|
|
|
|
{
|
|
|
|
Evas_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();
|
|
|
|
r = malloc(sizeof(Evas_Rectangle));
|
|
|
|
if (!r) return;
|
|
|
|
r->x = x; r->y = y; r->w = w; r->h = h;
|
|
|
|
e->obscures = evas_list_append(e->obscures, r);
|
|
|
|
}
|
|
|
|
|
2003-03-04 18:30:20 -08:00
|
|
|
/**
|
|
|
|
* To be documented.
|
|
|
|
*
|
|
|
|
* FIXME: To be fixed.
|
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)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
2005-05-21 19:49:50 -07:00
|
|
|
MAGIC_CHECK_END();
|
2002-11-08 00:02:15 -08:00
|
|
|
while (e->obscures)
|
|
|
|
{
|
|
|
|
Evas_Rectangle *r;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
r = (Evas_Rectangle *)e->obscures->data;
|
|
|
|
e->obscures = evas_list_remove(e->obscures, r);
|
|
|
|
free(r);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-10-26 19:44:36 -07:00
|
|
|
static void
|
2008-05-26 06:24:24 -07:00
|
|
|
_evas_render_phase1_direct(Evas *e, Evas_Array *render_objects)
|
2005-10-26 19:44:36 -07:00
|
|
|
{
|
2008-05-26 06:24:24 -07:00
|
|
|
unsigned int i;
|
|
|
|
|
|
|
|
for (i = 0; i < render_objects->count; ++i)
|
|
|
|
{
|
|
|
|
Evas_Object *obj;
|
|
|
|
|
|
|
|
obj = _evas_array_get(render_objects, i);
|
|
|
|
if (obj->changed) obj->func->render_pre(obj);
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (obj->smart.smart)
|
|
|
|
obj->func->render_pre(obj);
|
|
|
|
else
|
|
|
|
if (obj->rect_del)
|
|
|
|
{
|
|
|
|
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);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static Evas_Bool
|
|
|
|
_evas_render_phase1_object_process(Evas *e, Evas_Object *obj, Evas_Array *active_objects, Evas_Array *restack_objects, Evas_Array *delete_objects, Evas_Array *render_objects, int restack)
|
|
|
|
{
|
|
|
|
int clean_them = 0;
|
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;
|
|
|
|
|
2005-10-26 19:44:36 -07:00
|
|
|
/* if (obj->cur.cache.clip.dirty) */
|
|
|
|
evas_object_clip_recalc(obj);
|
2007-01-16 02:17:10 -08:00
|
|
|
/* because of clip objects - delete 2 cycles later */
|
|
|
|
if (obj->delete_me == 2)
|
2008-05-26 06:24:24 -07:00
|
|
|
_evas_array_append(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. */
|
|
|
|
if (obj->delete_me != 0)
|
|
|
|
clean_them = 1;
|
|
|
|
|
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))
|
2008-05-26 06:24:24 -07:00
|
|
|
_evas_array_append(active_objects, obj);
|
2005-10-26 23:40:28 -07:00
|
|
|
if (restack)
|
|
|
|
{
|
|
|
|
obj->restack = 1;
|
|
|
|
obj->changed = 1;
|
2008-05-26 06:24:24 -07:00
|
|
|
clean_them = 1;
|
2005-10-26 23:40:28 -07:00
|
|
|
}
|
|
|
|
if (obj->changed)
|
2005-10-26 19:44:36 -07:00
|
|
|
{
|
|
|
|
if (obj->smart.smart)
|
|
|
|
{
|
2008-04-30 22:48:03 -07:00
|
|
|
const Evas_Object_List *l;
|
2008-04-14 02:31:31 -07:00
|
|
|
|
2008-05-26 06:24:24 -07:00
|
|
|
_evas_array_append(render_objects, obj);
|
|
|
|
obj->render_pre = 1;
|
2008-04-30 22:48:03 -07:00
|
|
|
for (l = evas_object_smart_members_get_direct(obj); l; l = l->next)
|
2005-10-26 19:44:36 -07:00
|
|
|
{
|
|
|
|
Evas_Object *obj2;
|
2008-04-14 02:31:31 -07:00
|
|
|
|
2005-10-26 19:44:36 -07:00
|
|
|
obj2 = (Evas_Object *)l;
|
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,
|
2005-10-26 23:40:28 -07:00
|
|
|
obj->restack);
|
2005-10-26 19:44:36 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2005-11-01 20:03:55 -08:00
|
|
|
if ((is_active) && (obj->restack) && (!obj->clip.clipees) &&
|
2008-04-14 02:31:31 -07:00
|
|
|
((evas_object_is_visible(obj) && (!obj->cur.have_clipees)) ||
|
2005-11-01 20:03:55 -08:00
|
|
|
(evas_object_was_visible(obj) && (!obj->prev.have_clipees))))
|
2008-05-26 06:24:24 -07:00
|
|
|
_evas_array_append(restack_objects, obj);
|
2005-11-01 23:13:49 -08:00
|
|
|
else if ((is_active) && (!obj->clip.clipees) &&
|
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))))
|
2008-05-26 06:24:24 -07:00
|
|
|
{
|
|
|
|
_evas_array_append(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-04-30 22:48:03 -07:00
|
|
|
const Evas_Object_List *l;
|
2008-04-14 02:31:31 -07:00
|
|
|
|
2008-05-26 06:24:24 -07:00
|
|
|
_evas_array_append(render_objects, obj);
|
|
|
|
obj->render_pre = 1;
|
2008-04-30 22:48:03 -07:00
|
|
|
for (l = evas_object_smart_members_get_direct(obj); l; l = l->next)
|
2005-10-26 19:44:36 -07:00
|
|
|
{
|
|
|
|
Evas_Object *obj2;
|
2008-04-14 02:31:31 -07:00
|
|
|
|
2005-10-26 19:44:36 -07:00
|
|
|
obj2 = (Evas_Object *)l;
|
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,
|
2005-10-26 19:44:36 -07:00
|
|
|
restack);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2008-04-14 02:31:31 -07:00
|
|
|
if (evas_object_is_opaque(obj) &&
|
2005-10-26 19:44:36 -07:00
|
|
|
evas_object_is_visible(obj))
|
2008-05-26 06:24:24 -07:00
|
|
|
{
|
|
|
|
_evas_array_append(render_objects, obj);
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2008-05-26 06:24:24 -07:00
|
|
|
static Evas_Bool
|
|
|
|
_evas_render_phase1_process(Evas *e, Evas_Array *active_objects, Evas_Array *restack_objects, Evas_Array *delete_objects, Evas_Array *render_objects)
|
2005-10-26 19:44:36 -07:00
|
|
|
{
|
|
|
|
Evas_Object_List *l;
|
2008-05-26 06:24:24 -07:00
|
|
|
int clean_them = 0;
|
2005-10-26 19:44:36 -07:00
|
|
|
|
|
|
|
for (l = (Evas_Object_List *)e->layers; l; l = l->next)
|
|
|
|
{
|
|
|
|
Evas_Object_List *l2;
|
|
|
|
Evas_Layer *lay;
|
|
|
|
|
|
|
|
lay = (Evas_Layer *)l;
|
|
|
|
for (l2 = (Evas_Object_List *)lay->objects; l2; l2 = l2->next)
|
|
|
|
{
|
|
|
|
Evas_Object *obj;
|
|
|
|
|
|
|
|
obj = (Evas_Object *)l2;
|
2008-05-26 06:24:24 -07:00
|
|
|
clean_them |= _evas_render_phase1_object_process(e, obj,
|
|
|
|
active_objects, restack_objects,
|
|
|
|
delete_objects, render_objects,
|
|
|
|
0);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return clean_them;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_evas_render_check_pending_objects(Evas_Array *pending_objects, Evas *e)
|
|
|
|
{
|
|
|
|
unsigned int i;
|
|
|
|
|
|
|
|
for (i = 0; i < pending_objects->count; ++i)
|
|
|
|
{
|
|
|
|
Evas_Object *obj;
|
|
|
|
int ok = 0;
|
|
|
|
int is_active;
|
|
|
|
|
|
|
|
obj = _evas_array_get(pending_objects, i);
|
|
|
|
|
2008-06-04 09:42:39 -07:00
|
|
|
evas_object_clip_recalc(obj);
|
|
|
|
is_active = evas_object_is_active(obj);
|
2008-05-26 06:24:24 -07:00
|
|
|
|
2008-06-04 09:42:39 -07:00
|
|
|
if (!is_active && !obj->is_active && !obj->render_pre && !obj->rect_del)
|
|
|
|
ok = 1;
|
|
|
|
else
|
|
|
|
if (obj->is_active == is_active)
|
|
|
|
{
|
|
|
|
if (obj->changed)
|
|
|
|
{
|
|
|
|
if (obj->smart.smart)
|
|
|
|
{
|
|
|
|
if (obj->render_pre
|
|
|
|
|| obj->rect_del)
|
|
|
|
ok = 1;
|
|
|
|
}
|
|
|
|
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))))
|
|
|
|
{
|
|
|
|
if (!(obj->render_pre
|
|
|
|
|| obj->rect_del))
|
2008-05-26 06:24:24 -07:00
|
|
|
ok = 1;
|
2008-06-04 09:42:39 -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))))
|
|
|
|
{
|
|
|
|
if (obj->render_pre
|
|
|
|
|| obj->rect_del)
|
|
|
|
ok = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
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))
|
|
|
|
if (obj->rect_del || obj->smart.smart)
|
|
|
|
{
|
2008-05-26 06:24:24 -07:00
|
|
|
ok = 1;
|
2008-06-04 09:42:39 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2008-05-26 06:24:24 -07:00
|
|
|
|
|
|
|
if (!ok)
|
|
|
|
{
|
2008-06-04 09:42:39 -07:00
|
|
|
evas_array_clean(&e->active_objects);
|
|
|
|
evas_array_clean(&e->render_objects);
|
|
|
|
|
|
|
|
evas_array_clean(&e->restack_objects);
|
|
|
|
evas_array_clean(&e->delete_objects);
|
|
|
|
|
|
|
|
e->invalidate = 1;
|
|
|
|
|
2008-05-26 06:24:24 -07:00
|
|
|
return ;
|
2005-10-26 19:44:36 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-06-04 09:42:39 -07:00
|
|
|
Evas_Bool pending_change(void *data, void *gdata)
|
|
|
|
{
|
|
|
|
Evas_Object *obj;
|
|
|
|
|
|
|
|
obj = data;
|
|
|
|
|
|
|
|
if (obj->delete_me) return 0;
|
|
|
|
|
|
|
|
return obj->changed ? 1 : 0;
|
|
|
|
}
|
|
|
|
|
2005-12-03 01:27:53 -08:00
|
|
|
static Evas_List *
|
2007-01-16 02:17:10 -08:00
|
|
|
evas_render_updates_internal(Evas *e, unsigned char make_updates, unsigned char do_draw)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
|
|
|
Evas_List *updates = NULL;
|
|
|
|
Evas_List *ll;
|
|
|
|
void *surface;
|
2008-05-26 06:24:24 -07:00
|
|
|
Evas_Bool clean_them = 0;
|
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-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);
|
|
|
|
|
|
|
|
_evas_render_phase1_direct(e, &e->render_objects);
|
|
|
|
|
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-05-26 06:24:24 -07:00
|
|
|
obj = _evas_array_get(&e->restack_objects, i);
|
2002-11-08 00:02:15 -08:00
|
|
|
obj->func->render_pre(obj);
|
|
|
|
e->engine.func->output_redraws_rect_add(e->engine.data.output,
|
2005-05-21 19:49:50 -07:00
|
|
|
obj->prev.cache.clip.x,
|
|
|
|
obj->prev.cache.clip.y,
|
|
|
|
obj->prev.cache.clip.w,
|
2002-11-08 00:02:15 -08:00
|
|
|
obj->prev.cache.clip.h);
|
|
|
|
e->engine.func->output_redraws_rect_add(e->engine.data.output,
|
2005-05-21 19:49:50 -07:00
|
|
|
obj->cur.cache.clip.x,
|
|
|
|
obj->cur.cache.clip.y,
|
|
|
|
obj->cur.cache.clip.w,
|
2002-11-08 00:02:15 -08:00
|
|
|
obj->cur.cache.clip.h);
|
|
|
|
}
|
2008-05-26 06:24:24 -07:00
|
|
|
evas_array_clean(&e->restack_objects);
|
2002-11-08 00:02:15 -08:00
|
|
|
/* phase 3. add exposes */
|
|
|
|
while (e->damages)
|
|
|
|
{
|
|
|
|
Evas_Rectangle *r;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
r = e->damages->data;
|
|
|
|
e->damages = evas_list_remove(e->damages, r);
|
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);
|
|
|
|
free(r);
|
|
|
|
}
|
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))
|
|
|
|
{
|
|
|
|
printf("EVAS: error: viewport size != output size!\n");
|
|
|
|
}
|
2003-04-17 05:05:00 -07:00
|
|
|
/* phase 5. add obscures */
|
2002-11-08 00:02:15 -08:00
|
|
|
for (ll = e->obscures; ll; ll = ll->next)
|
|
|
|
{
|
|
|
|
Evas_Rectangle *r;
|
2005-05-21 19:49:50 -07:00
|
|
|
|
2002-11-08 00:02:15 -08:00
|
|
|
r = ll->data;
|
|
|
|
e->engine.func->output_redraws_rect_del(e->engine.data.output,
|
|
|
|
r->x, r->y, r->w, r->h);
|
|
|
|
}
|
|
|
|
/* 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-05-26 06:24:24 -07:00
|
|
|
obj = _evas_array_get(&e->active_objects, i);
|
2007-06-04 11:31:30 -07:00
|
|
|
if (UNLIKELY(evas_object_is_opaque(obj) &&
|
|
|
|
evas_object_is_visible(obj) &&
|
|
|
|
(!obj->clip.clipees) &&
|
|
|
|
(obj->cur.visible) &&
|
|
|
|
(!obj->delete_me) &&
|
|
|
|
(obj->cur.cache.clip.visible) &&
|
|
|
|
(!obj->smart.smart)))
|
2008-06-04 09:42:39 -07:00
|
|
|
/* obscuring_objects = evas_list_append(obscuring_objects, obj); */
|
|
|
|
_evas_array_append(&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;
|
|
|
|
|
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
|
|
|
|
2007-01-22 04:44:57 -08:00
|
|
|
if (make_updates)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2007-01-22 04:44:57 -08:00
|
|
|
Evas_Rectangle *rect;
|
2008-04-14 02:31:31 -07:00
|
|
|
|
2007-01-22 04:44:57 -08:00
|
|
|
rect = malloc(sizeof(Evas_Rectangle));
|
|
|
|
if (rect)
|
2002-11-08 00:02:15 -08:00
|
|
|
{
|
2007-01-22 04:44:57 -08:00
|
|
|
rect->x = ux; rect->y = uy; rect->w = uw; rect->h = uh;
|
|
|
|
updates = evas_list_append(updates, rect);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
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-06-04 09:42:39 -07:00
|
|
|
obj = (Evas_Object *) _evas_array_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))
|
2008-06-04 09:42:39 -07:00
|
|
|
_evas_array_append(&e->temporary_objects, obj);
|
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
|
|
|
|
|
|
|
obj = _evas_array_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) &&
|
|
|
|
(!obj->smart.smart) &&
|
|
|
|
(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) &&
|
|
|
|
(_evas_array_get(&e->temporary_objects, offset) == obj))
|
|
|
|
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
|
|
|
/// printf("CLIP: %p | %i %i, %ix%i | %p %i %i %ix%i\n",
|
|
|
|
/// obj,
|
|
|
|
/// x, y, w, h,
|
|
|
|
/// obj->cur.clipper,
|
|
|
|
/// 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 (((obj->cur.cache.clip.x + off_x) == 0) &&
|
|
|
|
/// ((obj->cur.cache.clip.w) == 960))
|
|
|
|
/// {
|
|
|
|
/// abort();
|
|
|
|
/// }
|
2008-04-14 02:31:31 -07: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-06-04 09:42:39 -07:00
|
|
|
obj2 = (Evas_Object *) _evas_array_get(&e->temporary_objects, j);
|
2007-01-22 04:44:57 -08:00
|
|
|
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);
|
|
|
|
}
|
2005-05-21 19:49:50 -07:00
|
|
|
#endif
|
2007-01-22 04:44:57 -08:00
|
|
|
obj->func->render(obj,
|
|
|
|
e->engine.data.output,
|
|
|
|
e->engine.data.context,
|
|
|
|
surface,
|
|
|
|
off_x, off_y);
|
|
|
|
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-06-04 09:42:39 -07:00
|
|
|
evas_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-05-26 06:24:24 -07:00
|
|
|
obj = _evas_array_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
|
|
|
}
|
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
|
|
|
{
|
|
|
|
delete_objects = evas_list_append(delete_objects, obj);
|
|
|
|
}
|
|
|
|
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-06-04 09:42:39 -07:00
|
|
|
evas_array_clean(&e->obscuring_objects);
|
|
|
|
|
|
|
|
/* If some object are still marked as changed, do not remove
|
|
|
|
them from the pending list. */
|
|
|
|
evas_array_remove(&e->pending_objects, pending_change, NULL);
|
|
|
|
|
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-05-26 06:24:24 -07:00
|
|
|
obj = _evas_array_get(&e->delete_objects, i);
|
2002-11-08 00:02:15 -08:00
|
|
|
evas_object_free(obj, 1);
|
|
|
|
}
|
2008-06-04 09:42:39 -07:00
|
|
|
evas_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;
|
|
|
|
|
|
|
|
/* 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)
|
|
|
|
{
|
|
|
|
evas_array_clean(&e->active_objects);
|
|
|
|
evas_array_clean(&e->render_objects);
|
|
|
|
|
|
|
|
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
|
|
|
/**
|
|
|
|
* To be documented.
|
|
|
|
*
|
|
|
|
* FIXME: To be fixed.
|
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_updates_free(Evas_List *updates)
|
|
|
|
{
|
|
|
|
while (updates)
|
|
|
|
{
|
|
|
|
free(updates->data);
|
|
|
|
updates = evas_list_remove(updates, updates->data);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-12-03 01:27:53 -08:00
|
|
|
/**
|
|
|
|
* To be documented.
|
|
|
|
*
|
|
|
|
* FIXME: To be fixed.
|
|
|
|
*
|
|
|
|
*/
|
2006-01-06 15:05:17 -08:00
|
|
|
EAPI Evas_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;
|
2007-01-16 02:17:10 -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
|
|
|
/**
|
|
|
|
* To be documented.
|
|
|
|
*
|
|
|
|
* FIXME: To be fixed.
|
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;
|
2007-01-16 02:17:10 -08:00
|
|
|
evas_render_updates_internal(e, 0, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* To be documented.
|
|
|
|
*
|
|
|
|
* FIXME: To be fixed.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
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;
|
|
|
|
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
|
|
|
/**
|
|
|
|
* To be documented.
|
|
|
|
*
|
|
|
|
* FIXME: To be fixed.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
EAPI void
|
|
|
|
evas_render_idle_flush(Evas *e)
|
|
|
|
{
|
|
|
|
MAGIC_CHECK(e, Evas, MAGIC_EVAS);
|
|
|
|
return;
|
|
|
|
MAGIC_CHECK_END();
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
evas_array_flush(&e->delete_objects);
|
|
|
|
evas_array_flush(&e->active_objects);
|
|
|
|
evas_array_flush(&e->restack_objects);
|
|
|
|
evas_array_flush(&e->render_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. */
|
|
|
|
evas_array_remove(&e->pending_objects, pending_change, NULL);
|
|
|
|
|
|
|
|
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();
|
|
|
|
|
|
|
|
evas_array_clean(&e->active_objects);
|
|
|
|
evas_array_clean(&e->render_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. */
|
|
|
|
evas_array_remove(&e->pending_objects, pending_change, NULL);
|
2008-05-26 06:24:24 -07:00
|
|
|
|
|
|
|
evas_array_flush(&e->restack_objects);
|
|
|
|
evas_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-04 09:42:39 -07:00
|
|
|
if (!obj->changed && obj->delete_me < 2)
|
2008-05-26 06:24:24 -07:00
|
|
|
{
|
|
|
|
Evas *e;
|
|
|
|
|
|
|
|
e = obj->layer->evas;
|
2008-06-04 09:42:39 -07:00
|
|
|
if (!e || e->cleanup) return ;
|
|
|
|
|
|
|
|
obj->changed = 1;
|
2008-05-26 06:24:24 -07:00
|
|
|
|
2008-06-04 09:42:39 -07:00
|
|
|
_evas_array_append(&e->pending_objects, obj);
|
2008-05-26 06:24:24 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|