forked from enlightenment/efl
evas render2 - more work on fleshing it out a bit
This commit is contained in:
parent
8f62e4f7ce
commit
6da5d54f8e
|
@ -139,9 +139,6 @@ evas_object_rectangle_render2_walk(Evas_Object *eo_obj,
|
|||
// just became visible or invisible
|
||||
if (visible_is != visible_was)
|
||||
{
|
||||
printf(" UP1 %p - %4i %4i %4ix%4i\n", eo_obj,
|
||||
obj->cur->cache.clip.x, obj->cur->cache.clip.y,
|
||||
obj->cur->cache.clip.w, obj->cur->cache.clip.h);
|
||||
region_rect_add
|
||||
(updates,
|
||||
obj->cur->cache.clip.x - offx, obj->cur->cache.clip.y - offy,
|
||||
|
@ -162,9 +159,6 @@ evas_object_rectangle_render2_walk(Evas_Object *eo_obj,
|
|||
(obj->restack)
|
||||
)
|
||||
{
|
||||
printf(" UP2 %p - %4i %4i %4ix%4i\n", eo_obj,
|
||||
obj->prev->cache.clip.x, obj->prev->cache.clip.y,
|
||||
obj->prev->cache.clip.w, obj->prev->cache.clip.h);
|
||||
region_rect_add
|
||||
(updates,
|
||||
obj->prev->cache.clip.x - offx, obj->prev->cache.clip.y - offy,
|
||||
|
@ -179,9 +173,6 @@ nochange:
|
|||
// object hasn't really changed
|
||||
if ((visible_is) && (evas_object_is_opaque(eo_obj, obj)))
|
||||
{
|
||||
printf(" NO- %p - %4i %4i %4ix%4i\n", eo_obj,
|
||||
obj->cur->cache.clip.x, obj->cur->cache.clip.y,
|
||||
obj->cur->cache.clip.w, obj->cur->cache.clip.h);
|
||||
region_rect_del
|
||||
(updates,
|
||||
obj->cur->cache.clip.x - offx, obj->cur->cache.clip.y - offy,
|
||||
|
|
|
@ -76,7 +76,7 @@ _evas_render2(Eo *eo_e, Evas_Public_Data *e)
|
|||
// if render threads not initted - init them - maybe move this later?
|
||||
_evas_render2_th_init();
|
||||
|
||||
printf("------------------------------------------------ %p %p\n", eo_e, e);
|
||||
printf("-------------------------------------------- %p %p\n", eo_e, e);
|
||||
// wait for any previous render pass to do its thing
|
||||
t = get_time();
|
||||
evas_canvas_async_block(e);
|
||||
|
|
|
@ -104,12 +104,12 @@ _evas_render2_th_main_obj_del_handle(Evas_Public_Data *e,
|
|||
}
|
||||
|
||||
static void
|
||||
_evas_render2_th_main_obj_basic_process(Evas_Public_Data *e,
|
||||
Evas_Object_Protected_Data *obj,
|
||||
void *updates,
|
||||
int offx,
|
||||
int offy,
|
||||
int l EINA_UNUSED)
|
||||
_evas_render2_th_main_obj_basic_walk_process(Evas_Public_Data *e,
|
||||
Evas_Object_Protected_Data *obj,
|
||||
void *updates,
|
||||
int offx,
|
||||
int offy,
|
||||
int l EINA_UNUSED)
|
||||
{
|
||||
Evas_Object *eo_obj = obj->object;
|
||||
|
||||
|
@ -130,12 +130,12 @@ _evas_render2_th_main_obj_basic_process(Evas_Public_Data *e,
|
|||
}
|
||||
|
||||
static void
|
||||
_evas_render2_th_main_obj_process(Evas_Public_Data *e,
|
||||
Evas_Object_Protected_Data *obj,
|
||||
void *updates,
|
||||
int offx,
|
||||
int offy,
|
||||
int l EINA_UNUSED)
|
||||
_evas_render2_th_main_obj_walk_process(Evas_Public_Data *e,
|
||||
Evas_Object_Protected_Data *obj,
|
||||
void *updates,
|
||||
int offx,
|
||||
int offy,
|
||||
int l EINA_UNUSED)
|
||||
{
|
||||
// process object OR walk through child objects if smart and process those
|
||||
Evas_Object_Protected_Data *obj2;
|
||||
|
@ -154,8 +154,8 @@ _evas_render2_th_main_obj_process(Evas_Public_Data *e,
|
|||
obj->func->render2_walk(eo_obj, obj, obj->private_data,
|
||||
updates, offx, offy);
|
||||
EINA_INLIST_FOREACH(il, obj2)
|
||||
_evas_render2_th_main_obj_process(e, obj2, updates,
|
||||
offx, offy, l + 1);
|
||||
_evas_render2_th_main_obj_walk_process(e, obj2, updates,
|
||||
offx, offy, l + 1);
|
||||
if (obj->changed)
|
||||
{
|
||||
evas_object_clip_changes_clean(eo_obj);
|
||||
|
@ -163,8 +163,8 @@ _evas_render2_th_main_obj_process(Evas_Public_Data *e,
|
|||
evas_object_change_reset(eo_obj);
|
||||
}
|
||||
}
|
||||
else _evas_render2_th_main_obj_basic_process(e, obj, updates,
|
||||
offx, offy, l);
|
||||
else _evas_render2_th_main_obj_basic_walk_process(e, obj, updates,
|
||||
offx, offy, l);
|
||||
}
|
||||
|
||||
static Region *
|
||||
|
@ -172,10 +172,11 @@ _evas_render2_regions_merge(Region *region)
|
|||
{
|
||||
Region *region2;
|
||||
Box *rects;
|
||||
int num, i;
|
||||
int num, i, w, h;
|
||||
int tsize = 16;
|
||||
|
||||
region2 = region_new();
|
||||
region_size_get(region, &w, &h);
|
||||
region2 = region_new(w, h);
|
||||
rects = region_rects(region);
|
||||
num = region_rects_num(region);
|
||||
for (i = 0; i < num; i++)
|
||||
|
@ -205,16 +206,16 @@ _evas_render2_th_main_do(Eo *eo_e, Evas_Public_Data *e)
|
|||
int rects_num, i;
|
||||
static int num = 0;
|
||||
|
||||
updates = region_new();
|
||||
updates = region_new(e->output.w, e->output.h);
|
||||
printf("........... updates # %i\n", num++);
|
||||
t = get_time();
|
||||
EINA_INLIST_FOREACH(e->layers, lay)
|
||||
{
|
||||
EINA_INLIST_FOREACH(lay->objects, obj)
|
||||
{
|
||||
_evas_render2_th_main_obj_process(e, obj,
|
||||
updates, 0, 0,
|
||||
0);
|
||||
_evas_render2_th_main_obj_walk_process(e, obj,
|
||||
updates, 0, 0,
|
||||
0);
|
||||
}
|
||||
}
|
||||
// add explicitly exposed/damaged regions of the canvas
|
||||
|
@ -231,6 +232,7 @@ _evas_render2_th_main_do(Eo *eo_e, Evas_Public_Data *e)
|
|||
t = get_time() - t;
|
||||
printf("T: update generation: "); out_time(t);
|
||||
|
||||
t = get_time();
|
||||
updates = _evas_render2_regions_merge(updates);
|
||||
|
||||
rects = region_rects(updates);
|
||||
|
@ -255,6 +257,22 @@ _evas_render2_th_main_do(Eo *eo_e, Evas_Public_Data *e)
|
|||
printf("T: merge updates: "); out_time(t);
|
||||
|
||||
// ... now render every update region
|
||||
EINA_LIST_FOREACH(updates_list, l, rect)
|
||||
{
|
||||
// XXX: create update buffer
|
||||
EINA_INLIST_FOREACH(e->layers, lay)
|
||||
{
|
||||
EINA_INLIST_FOREACH(lay->objects, obj)
|
||||
{
|
||||
// render to update buffer
|
||||
// _evas_render2_th_main_obj_render_process(e, obj,
|
||||
// updates, 0, 0,
|
||||
// 0);
|
||||
}
|
||||
}
|
||||
// delete update buffer
|
||||
}
|
||||
// free up updates we don't need anymore
|
||||
region_free(updates);
|
||||
|
||||
e->changed = EINA_FALSE;
|
||||
|
|
|
@ -64,6 +64,7 @@ struct _Region_Data
|
|||
|
||||
struct _Region
|
||||
{
|
||||
int w, h;
|
||||
struct {
|
||||
int x, y;
|
||||
unsigned int w, h;
|
||||
|
@ -712,12 +713,14 @@ _region_del(Region *region, Box *r1, Box *r1end, Box *r2, Box *r2end,
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Region *
|
||||
region_new(void)
|
||||
region_new(int w, int h)
|
||||
{
|
||||
Region *region = calloc(1, sizeof(Region));
|
||||
if (!region) return NULL;
|
||||
region->bound = _region_emptybox;
|
||||
region->data = &_region_emptydata;
|
||||
region->w = w;
|
||||
region->h = h;
|
||||
return region;
|
||||
}
|
||||
|
||||
|
@ -729,6 +732,13 @@ region_free(Region *region)
|
|||
free(region);
|
||||
}
|
||||
|
||||
void
|
||||
region_size_get(Region *region, int *w, int *h)
|
||||
{
|
||||
*w = region->w;
|
||||
*h = region->h;
|
||||
}
|
||||
|
||||
int
|
||||
region_rects_num(Region *region)
|
||||
{
|
||||
|
@ -747,6 +757,9 @@ region_copy(Region *dest, Region *src)
|
|||
dest->last_del.w = 0;
|
||||
dest->last_add.w = 0;
|
||||
|
||||
dest->w = src->w;
|
||||
dest->h = src->h;
|
||||
|
||||
dest->bound = src->bound;
|
||||
if ((!src->data) || (!src->data->size))
|
||||
{
|
||||
|
@ -875,6 +888,8 @@ region_rect_add(Region *dest, int x, int y, unsigned int w, unsigned int h)
|
|||
Region region;
|
||||
Eina_Bool ret;
|
||||
|
||||
RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, dest->w, dest->h);
|
||||
|
||||
if (!w || !h) return EINA_FALSE;
|
||||
|
||||
if (dest->last_add.w > 0)
|
||||
|
@ -1026,16 +1041,16 @@ region_validate(Region *region, Eina_Bool *overlap_ret)
|
|||
|
||||
// Set up the first region to be the first rectangle in region
|
||||
// Note that step 2 code will never overflow the ri[0].reg rects array
|
||||
ri = malloc(4 * sizeof(Region_Info));
|
||||
ri = calloc(1, 4 * sizeof(Region_Info));
|
||||
if (!ri) return _region_break(region);
|
||||
size_ri = 4;
|
||||
num_ri = 1;
|
||||
ri[0].prev_band = 0;
|
||||
ri[0].cur_band = 0;
|
||||
ri[0].reg = *region;
|
||||
box = PIXREGION_BOXPTR(&ri[0].reg);
|
||||
ri[0].reg.bound = *box;
|
||||
ri[0].reg.data->num = 1;
|
||||
ri[0].reg.w = region->w;
|
||||
ri[0].reg.h = region->h;
|
||||
|
||||
// Now scatter rectangles into the minimum set of valid regions. If the
|
||||
// next rectangle to be added to a region would force an existing rectangle
|
||||
|
@ -1099,6 +1114,8 @@ region_validate(Region *region, Eina_Bool *overlap_ret)
|
|||
rit->cur_band = 0;
|
||||
rit->reg.bound = *box;
|
||||
rit->reg.data = NULL;
|
||||
rit->reg.w = region->w;
|
||||
rit->reg.h = region->h;
|
||||
// MUST force allocation
|
||||
if (!_region_rect_alloc(&rit->reg, (i + num_ri) / num_ri)) goto bail;
|
||||
next_rect: ;
|
||||
|
@ -1199,6 +1216,8 @@ region_rect_del(Region *dest, int x, int y, unsigned int w, unsigned int h)
|
|||
Region region;
|
||||
Eina_Bool ret;
|
||||
|
||||
RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, dest->w, dest->h);
|
||||
|
||||
if (!w || !h) return EINA_FALSE;
|
||||
|
||||
if (dest->last_del.w > 0)
|
||||
|
|
|
@ -70,8 +70,9 @@ struct _Box
|
|||
|
||||
/* creation/destruction */
|
||||
|
||||
Region *region_new (void);
|
||||
Region *region_new (int w, int h);
|
||||
void region_free (Region *region);
|
||||
void region_size_get (Region *region, int *w, int *h);
|
||||
|
||||
void region_move (Region *region, int x, int y);
|
||||
Eina_Bool region_copy (Region *dest, Region *source);
|
||||
|
|
Loading…
Reference in New Issue