r.h = ((rr->h + 2) * h) / o->cur.image.h;
r.x += obj->cur.geometry.x + x;
r.y += obj->cur.geometry.y + y;
+ RECTS_CLIP_TO_RECT(r.x, r.y, r.w, r.h,
+ obj->cur.cache.clip.x, obj->cur.cache.clip.y,
+ obj->cur.cache.clip.w, obj->cur.cache.clip.h);
evas_add_rect(&e->clip_changes, r.x, r.y, r.w, r.h);
idy += h;
}
evas_object_is_opaque(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);
+ obj->cur.cache.clip.x,
+ obj->cur.cache.clip.y,
+ obj->cur.cache.clip.w,
+ obj->cur.cache.clip.h);
}
done:
evas_object_render_pre_effect_updates(&e->clip_changes, obj, is_v, was_v);
/* this returns 1 if the internal object data implies that the object is */
/* currently fully opaque over the entire rectangle it occupies */
o = (Evas_Object_Image *)(obj->object_data);
+/* disable caching due tyo maps screwing with this
+ o->cur.opaque_valid = 0;
if (o->cur.opaque_valid)
{
if (!o->cur.opaque) return 0;
}
else
+*/
{
o->cur.opaque = 0;
- o->cur.opaque_valid = 1;
+/* disable caching */
+/* o->cur.opaque_valid = 1; */
if ((o->cur.fill.w < 1) || (o->cur.fill.h < 1))
- return 0;
+ return o->cur.opaque;
if (((o->cur.border.l != 0) ||
(o->cur.border.r != 0) ||
(o->cur.border.t != 0) ||
(o->cur.border.b != 0)) &&
- (!o->cur.border.fill)) return 0;
- if (!o->engine_data) return 0;
+ (!o->cur.border.fill)) return o->cur.opaque;
+ if (!o->engine_data) return o->cur.opaque;
o->cur.opaque = 1;
}
// FIXME: use proxy
- if (o->cur.source) return 0; /* FIXME: Should go poke at the object */
- if ((obj->cur.map) && (obj->cur.usemap)) return 0;
- if (obj->cur.render_op == EVAS_RENDER_COPY) return 1;
- if (o->cur.has_alpha) return 0;
- return 1;
+ if (o->cur.source)
+ {
+ o->cur.opaque = evas_object_is_opaque(o->cur.source);
+ return o->cur.opaque; /* FIXME: Should go poke at the object */
+ }
+ if (o->cur.has_alpha)
+ {
+ o->cur.opaque = 0;
+ return o->cur.opaque;
+ }
+ if ((obj->cur.map) && (obj->cur.usemap))
+ {
+ Evas_Map *m = obj->cur.map;
+
+ if ((m->points[0].a == 255) &&
+ (m->points[1].a == 255) &&
+ (m->points[2].a == 255) &&
+ (m->points[3].a == 255))
+ {
+ if (
+ ((m->points[0].x == m->points[3].x) &&
+ (m->points[1].x == m->points[2].x) &&
+ (m->points[0].y == m->points[1].y) &&
+ (m->points[2].y == m->points[3].y))
+ ||
+ ((m->points[0].x == m->points[1].x) &&
+ (m->points[2].x == m->points[3].x) &&
+ (m->points[0].y == m->points[3].y) &&
+ (m->points[1].y == m->points[2].y))
+ )
+ return o->cur.opaque;
+ }
+ o->cur.opaque = 0;
+ return o->cur.opaque;
+ }
+ if (obj->cur.render_op == EVAS_RENDER_COPY) return o->cur.opaque;
+ return o->cur.opaque;
}
static int
#ifdef RECTUPDATE
#elif defined(EVAS_RECT_SPLIT)
#else
+/*
static int tilebuf_x_intersect(Tilebuf *tb, int x, int w, int *x1, int *x2, int *x1_fill, int *x2_fill);
static int tilebuf_y_intersect(Tilebuf *tb, int y, int h, int *y1, int *y2, int *y1_fill, int *y2_fill);
static int tilebuf_intersect(int tsize, int tlen, int tnum, int x, int w, int *x1, int *x2, int *x1_fill, int *x2_fill);
+ */
#endif
+/*
static void tilebuf_setup(Tilebuf *tb);
+ */
EAPI void
evas_common_tilebuf_init(void)
evas_common_tilebuf_free(Tilebuf *tb)
{
#ifdef RECTUPDATE
+/*
evas_common_regionbuf_free(tb->rb);
+ */
#elif defined(EVAS_RECT_SPLIT)
rect_list_clear(&tb->rects);
rect_list_node_pool_flush();
#else
+/*
if (tb->tiles.tiles) free(tb->tiles.tiles);
+ */
#endif
free(tb);
}
{
tb->tile_size.w = tw;
tb->tile_size.h = th;
+/*
tilebuf_setup(tb);
+ */
}
EAPI void
#ifdef EVAS_RECT_SPLIT
static inline int
-_add_redraw(list_t *rects, int max_w, int max_h, int x, int y, int w, int h)
+_add_redraw(list_t *rects, int x, int y, int w, int h)
{
rect_node_t *rn;
-
- if ((w <= 0) || (h <= 0)) return 0;
- RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, max_w, max_h);
- if ((w <= 0) || (h <= 0)) return 0;
-
+/* we dont need to do this fuzz stuff - it actually creates overdraw bugs
+ * when evas shouldnt draw at all.
x >>= 1;
y >>= 1;
w += 2;
w >>= 1;
h += 2;
h >>= 1;
-
+ */
rn = (rect_node_t *)rect_list_node_pool_get();
rn->_lst = list_node_zeroed;
rect_init(&rn->rect, x, y, w, h);
evas_common_tilebuf_add_redraw(Tilebuf *tb, int x, int y, int w, int h)
{
#ifdef RECTUPDATE
+/*
int i;
if ((w <= 0) || (h <= 0)) return 0;
for (i = 0; i < h; i++)
evas_common_regionbuf_span_add(tb->rb, x, x + w - 1, y + i);
return 1;
+ */
#elif defined(EVAS_RECT_SPLIT)
- return _add_redraw(&tb->rects, tb->outbuf_w, tb->outbuf_h, x, y, w, h);
+ if ((w <= 0) || (h <= 0)) return 0;
+ RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, tb->outbuf_w, tb->outbuf_h);
+ if ((w <= 0) || (h <= 0)) return 0;
+ // optimize a common case -> adding the exact same rect 2x in a row
+ if ((tb->prev_add.x == x) && (tb->prev_add.y == y) &&
+ (tb->prev_add.w == w) && (tb->prev_add.h == h)) return 1;
+ tb->prev_add.x = x; tb->prev_add.y = y;
+ tb->prev_add.w = w; tb->prev_add.h = h;
+ tb->prev_del.w = 0; tb->prev_del.h = 0;
+ return _add_redraw(&tb->rects, x, y, w, h);
#else
+/*
int tx1, tx2, ty1, ty2, tfx1, tfx2, tfy1, tfy2, xx, yy;
int num;
RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, tb->outbuf_w, tb->outbuf_h);
if ((w <= 0) || (h <= 0)) return 0;
num = 0;
- /* wipes out any motion vectors in tiles it touches into redraws */
+ // wipes out any motion vectors in tiles it touches into redraws
if (tilebuf_x_intersect(tb, x, w, &tx1, &tx2, &tfx1, &tfx2) &&
tilebuf_y_intersect(tb, y, h, &ty1, &ty2, &tfy1, &tfy2))
{
num = (tx2 - tx1 + 1) * (ty2 - ty1 + 1);
}
return num;
+ */
#endif
}
evas_common_tilebuf_del_redraw(Tilebuf *tb, int x, int y, int w, int h)
{
#ifdef RECTUPDATE
+/*
int i;
for (i = 0; i < h; i++)
evas_common_regionbuf_span_del(tb->rb, x, x + w - 1, y + i);
+ */
#elif defined(EVAS_RECT_SPLIT)
rect_t r;
RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, tb->outbuf_w, tb->outbuf_h);
if ((w <= 0) || (h <= 0)) return 0;
+/* we dont need to do this fuzz stuff - it actually creates overdraw bugs
+ * when evas shouldnt draw at all.
x += 1;
y += 1;
x >>= 1;
h >>= 1;
if ((w <= 0) || (h <= 0)) return 0;
-
+ */
+
+ // optimize a common case -> deleting the exact same rect 2x in a row
+ if ((tb->prev_del.x == x) && (tb->prev_del.y == y) &&
+ (tb->prev_del.w == w) && (tb->prev_del.h == h)) return 1;
+ tb->prev_del.x = x; tb->prev_del.y = y;
+ tb->prev_del.w = w; tb->prev_del.h = h;
+ tb->prev_add.w = 0; tb->prev_add.h = 0;
rect_init(&r, x, y, w, h);
- //ERR("ACCOUNTING: del_redraw: %4d,%4d %3dx%3d", x, y, w, h);
rect_list_del_split_strict(&tb->rects, r);
tb->need_merge = 1;
return 0;
#else
+/*
int tx1, tx2, ty1, ty2, tfx1, tfx2, tfy1, tfy2, xx, yy;
int num;
num = 0;
- /* wipes out any motion vectors in tiles it touches into redraws */
+ // wipes out any motion vectors in tiles it touches into redraws
if (tilebuf_x_intersect(tb, x, w, &tx1, &tx2, &tfx1, &tfx2) &&
tilebuf_y_intersect(tb, y, h, &ty1, &ty2, &tfy1, &tfy2))
{
num = (tx2 - tx1 + 1) * (ty2 - ty1 + 1);
}
return num;
+ */
#endif
}
EAPI int
-evas_common_tilebuf_add_motion_vector(Tilebuf *tb, int x, int y, int w, int h, int dx, int dy, int alpha __UNUSED__)
+evas_common_tilebuf_add_motion_vector(Tilebuf *tb __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__, int dx __UNUSED__, int dy __UNUSED__, int alpha __UNUSED__)
{
#ifdef EVAS_RECT_SPLIT
+/* motion vector handling never has been used -> disable it
list_t lr = list_zeroed;
int num;
- num = _add_redraw(&lr, tb->outbuf_w, tb->outbuf_h, x, y, w, h);
- num += _add_redraw(&lr, tb->outbuf_w, tb->outbuf_h, x + dx, y + dy, w, h);
+ num = _add_redraw(&lr, x, y, w, h);
+ num += _add_redraw(&lr, x + dx, y + dy, w, h);
while (lr.head)
{
list_node_t *node = rect_list_unlink_next(&lr, NULL);
FUZZ * FUZZ, FUZZ * FUZZ);
}
return num;
+ */
+ return 0;
#else
- /* FIXME: need to actually implement motion vectors. for now it just */
- /* implements redraws */
+/*
int num;
num = evas_common_tilebuf_add_redraw(tb, x, y, w, h);
num += evas_common_tilebuf_add_redraw(tb, x + dx, y + dy, w, h);
return num;
+ */
#endif
}
evas_common_tilebuf_clear(Tilebuf *tb)
{
#ifdef RECTUPDATE
+/*
evas_common_regionbuf_clear(tb->rb);
+ */
#elif defined(EVAS_RECT_SPLIT)
+ tb->prev_add.x = tb->prev_add.y = tb->prev_add.w = tb->prev_add.h = 0;
+ tb->prev_del.x = tb->prev_del.y = tb->prev_del.w = tb->prev_del.h = 0;
rect_list_clear(&tb->rects);
tb->need_merge = 0;
#else
+/*
if (!tb->tiles.tiles) return;
memset(tb->tiles.tiles, 0, tb->tiles.w * tb->tiles.h * sizeof(Tilebuf_Tile));
+ */
#endif
}
evas_common_tilebuf_get_render_rects(Tilebuf *tb)
{
#ifdef RECTUPDATE
+/*
return evas_common_regionbuf_rects_get(tb->rb);
+ */
#elif defined(EVAS_RECT_SPLIT)
list_node_t *n;
Tilebuf_Rect *rects = NULL;
rect_t cur;
cur = ((rect_node_t *)n)->rect;
-
+/* disable fuzz - created bugs.
cur.left <<= 1;
cur.top <<= 1;
cur.width <<= 1;
cur.height <<= 1;
-
+ */
RECTS_CLIP_TO_RECT(cur.left, cur.top, cur.width, cur.height,
0, 0, tb->outbuf_w, tb->outbuf_h);
if ((cur.width > 0) && (cur.height > 0))
return rects;
#else
+/*
Tilebuf_Rect *rects = NULL;
Tilebuf_Tile *tbt;
int x, y;
r->_list_data.prev = NULL;
r->_list_data.last = NULL;
-/* amalgamate tiles */
+ // amalgamate tiles
#if 1
tbti = tbt;
while (can_expand_x)
}
}
return rects;
+ */
#endif
}
/* internal usage */
-
+/*
static void
tilebuf_setup(Tilebuf *tb)
{
memset(tb->tiles.tiles, 0, tb->tiles.w * tb->tiles.h * sizeof(Tilebuf_Tile));
#endif
}
+*/
#ifdef RECTUPDATE
#elif defined(EVAS_RECT_SPLIT)
#else
+/*
static int
tilebuf_x_intersect(Tilebuf *tb, int x, int w, int *x1, int *x2, int *x1_fill, int *x2_fill)
{
{
int p1, p2;
- /* initial clip out of region */
+ // initial clip out of region
if ((x + w) <= 0) return 0;
if (x >= tlen) return 0;
- /* adjust x & w so it all fits in region */
+ // adjust x & w so it all fits in region
if (x < 0)
{
w += x;
if (w < 0) return 0;
if ((x + w) > tlen) w = tlen - x;
- /* now figure if the first edge is fully filling its tile */
+ // now figure if the first edge is fully filling its tile
p1 = (x) / tsize;
if ((p1 * tsize) == (x)) *x1_fill = 1;
else *x1_fill = 0;
*x1 = p1;
- /* now figure if the last edge is fully filling its tile */
+ // now figure if the last edge is fully filling its tile
p2 = (x + w - 1) / tsize;
if (((p2 + 1) * tsize) == (x + w)) *x2_fill = 1;
else *x2_fill = 0;
return 1;
tnum = 0;
}
+*/
#endif
Evas_GL_X11_Window *win;
Evas_Engine_Info_GL_X11 *info;
Evas *evas;
+ Tilebuf *tb;
int end;
XrmDatabase xrdb; // xres - dpi
free(re);
return 0;
}
+ re->tb = evas_common_tilebuf_new(re->win->w, re->win->h);
+ if (!re->tb)
+ {
+ if (re->win)
+ {
+ eng_window_free(re->win);
+ gl_wins--;
+ }
+ free(re);
+ return 0;
+ }
+ evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE);
+
if (!e->engine.data.context)
e->engine.data.context =
e->engine.func->context_new(e->engine.data.output);
eng_window_use(re->win);
re->vsync = 0;
-/* we don't need this actually as evas_render does it
- if (re->win->alpha)
- {
- glClearColor(0.0, 0.0, 0.0, 0.0);
- glClear(GL_COLOR_BUFFER_BIT);
- }
- */
_sym_init();
return 1;
eng_window_free(re->win);
gl_wins--;
}
+ evas_common_tilebuf_free(re->tb);
free(re);
}
if ((initted == 1) && (gl_wins == 0))
re->win->h = h;
eng_window_use(re->win);
evas_gl_common_context_resize(re->win->gl_context, w, h, re->win->rot);
+ evas_common_tilebuf_free(re->tb);
+ re->tb = evas_common_tilebuf_new(w, h);
+ if (re->tb)
+ evas_common_tilebuf_set_tile_size(re->tb, TILESIZE, TILESIZE);
}
static void
-eng_output_tile_size_set(void *data __UNUSED__, int w __UNUSED__, int h __UNUSED__)
+eng_output_tile_size_set(void *data, int w, int h)
{
+ Render_Engine *re;
+
+ re = (Render_Engine *)data;
+ evas_common_tilebuf_set_tile_size(re->tb, w, h);
}
static void
re = (Render_Engine *)data;
eng_window_use(re->win);
evas_gl_common_context_resize(re->win->gl_context, re->win->w, re->win->h, re->win->rot);
- /* smple bounding box */
+ evas_common_tilebuf_add_redraw(re->tb, x, y, w, h);
+/*
RECTS_CLIP_TO_RECT(x, y, w, h, 0, 0, re->win->w, re->win->h);
if ((w <= 0) || (h <= 0)) return;
if (!re->win->draw.redraw)
if ((y + h - 1) > re->win->draw.y2) re->win->draw.y2 = y + h - 1;
}
re->win->draw.redraw = 1;
+*/
}
static void
eng_output_redraws_rect_del(void *data __UNUSED__, int x __UNUSED__, int y __UNUSED__, int w __UNUSED__, int h __UNUSED__)
{
+ Render_Engine *re;
+
+ re = (Render_Engine *)data;
+ evas_common_tilebuf_del_redraw(re->tb, x, y, w, h);
}
static void
Render_Engine *re;
re = (Render_Engine *)data;
- re->win->draw.redraw = 0;
+ evas_common_tilebuf_clear(re->tb);
+/* re->win->draw.redraw = 0;*/
// INF("GL: finish update cycle!");
}
eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, int *cx, int *cy, int *cw, int *ch)
{
Render_Engine *re;
+ Tilebuf_Rect *rects;
re = (Render_Engine *)data;
/* get the upate rect surface - return engine data as dummy */
+ rects = evas_common_tilebuf_get_render_rects(re->tb);
+ if (rects)
+ {
+ Tilebuf_Rect *r;
+ EINA_INLIST_FOREACH(EINA_INLIST_GET(rects), r)
+ {
+ //printf(" %i %i %ix%i\n", r->x, r->y, r->w, r->h);
+ }
+ evas_common_tilebuf_free_render_rects(rects);
+ evas_common_tilebuf_clear(re->tb);
+#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
+ // dont need to for egl - eng_window_use() can check for other ctxt's
+#else
+ eng_window_use(NULL);
+#endif
+ eng_window_use(re->win);
+ if (!_re_wincheck(re)) return NULL;
+ evas_gl_common_context_flush(re->win->gl_context);
+ evas_gl_common_context_newframe(re->win->gl_context);
+ if (x) *x = 0;
+ if (y) *y = 0;
+ if (w) *w = re->win->w;
+ if (h) *h = re->win->h;
+ if (cx) *cx = 0;
+ if (cy) *cy = 0;
+ if (cw) *cw = re->win->w;
+ if (ch) *ch = re->win->h;
+ return re->win->gl_context->def_surface;
+ }
+ return NULL;
+/*
if (!re->win->draw.redraw) return NULL;
#if defined (GLES_VARIETY_S3C6410) || defined (GLES_VARIETY_SGX)
// dont need to for egl - eng_window_use() can check for other ctxt's
if (cy) *cy = re->win->draw.y1;
if (cw) *cw = re->win->draw.x2 - re->win->draw.x1 + 1;
if (ch) *ch = re->win->draw.y2 - re->win->draw.y1 + 1;
-
-/* we don't need this actually as evas_render does it
- if (re->win->alpha)
- {
- glClearColor(0.0, 0.0, 0.0, 0.0);
- glClear(GL_COLOR_BUFFER_BIT);
- }
- */
return re->win->gl_context->def_surface;
+ */
}
//#define FRAMECOUNT 1