// 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,
(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,
// 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,
// 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);
}
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;
}
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;
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);
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 *
{
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++)
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
t = get_time() - t;
printf("T: update generation: "); out_time(t);
+ t = get_time();
updates = _evas_render2_regions_merge(updates);
rects = region_rects(updates);
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;
struct _Region
{
+ int w, h;
struct {
int x, y;
unsigned int w, h;
///////////////////////////////////////////////////////////////////////////
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;
}
free(region);
}
+void
+region_size_get(Region *region, int *w, int *h)
+{
+ *w = region->w;
+ *h = region->h;
+}
+
int
region_rects_num(Region *region)
{
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))
{
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)
// 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
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: ;
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)
/* 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);