partial merging to update the partial tiles when it need to be updated.
authorChunEon Park <chuneon.park@samsung.com>
Tue, 25 Oct 2011 01:33:29 +0000 (10:33 +0900)
committerChunEon Park <chuneon.park@samsung.com>
Tue, 25 Oct 2011 01:42:52 +0000 (10:42 +0900)
revision
64246
64248
64249
64252
64264
64287
64288
64289

Change-Id: I56bfcb4e65042efd04cb40c64d3eecc5e9d01f58

src/lib/canvas/evas_object_image.c
src/lib/canvas/evas_render.c
src/lib/engines/common/evas_tiler.c
src/lib/include/evas_common.h
src/modules/engines/gl_x11/evas_engine.c

index 45189a4..f37d436 100755 (executable)
@@ -3334,6 +3334,9 @@ evas_object_image_render_pre(Evas_Object *obj)
                                  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;
                               }
@@ -3369,10 +3372,10 @@ evas_object_image_render_pre(Evas_Object *obj)
        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);
@@ -3434,30 +3437,66 @@ evas_object_image_is_opaque(Evas_Object *obj)
    /* 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
index 12f5f2c..bff79d5 100644 (file)
@@ -220,7 +220,8 @@ _evas_render_phase1_direct(Evas *e,
                {
                   //                  obj->func->render_pre(obj);
                }
-             else if (obj->rect_del)
+             else if ((obj->rect_del) ||
+                      (evas_object_is_opaque(obj) && evas_object_is_visible(obj)))
                {
                   RD("    rect del\n");
                   _evas_render_cur_clip_cache_del(e, obj);
@@ -1302,9 +1303,6 @@ evas_render_updates_internal(Evas *e,
                                               &e->render_objects,
                                               &redraw_all);
 
-   _evas_render_phase1_direct(e, &e->active_objects, &e->restack_objects,
-                              &e->delete_objects, &e->render_objects);
-
    /* phase 1.5. check if the video should be inlined or stay in their overlay */
    alpha = e->engine.func->canvas_alpha_get(e->engine.data.output,
                                            e->engine.data.context);
@@ -1318,6 +1316,11 @@ evas_render_updates_internal(Evas *e,
          _evas_object_image_video_overlay_hide(obj);
      }
 
+
+   /* phase 1.8. pre render for proxy */
+   _evas_render_phase1_direct(e, &e->active_objects, &e->restack_objects,
+                              &e->delete_objects, &e->render_objects);
+
    /* phase 2. force updates for restacks */
    for (i = 0; i < e->restack_objects.count; ++i)
      {
index 2bce778..785bd57 100644 (file)
@@ -843,11 +843,15 @@ rect_list_add_split_fuzzy_and_merge(list_t *rects,
 #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)
@@ -874,12 +878,16 @@ EAPI 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);
 }
@@ -889,7 +897,9 @@ evas_common_tilebuf_set_tile_size(Tilebuf *tb, int tw, int th)
 {
    tb->tile_size.w = tw;
    tb->tile_size.h = th;
+/*
    tilebuf_setup(tb);
+ */
 }
 
 EAPI void
@@ -901,21 +911,18 @@ evas_common_tilebuf_get_tile_size(Tilebuf *tb, int *tw, int *th)
 
 #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);
@@ -932,6 +939,7 @@ EAPI int
 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;
@@ -940,9 +948,20 @@ evas_common_tilebuf_add_redraw(Tilebuf *tb, int x, int y, int w, int h)
    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;
 
@@ -950,7 +969,7 @@ evas_common_tilebuf_add_redraw(Tilebuf *tb, int x, int y, int w, int h)
    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))
      {
@@ -976,6 +995,7 @@ evas_common_tilebuf_add_redraw(Tilebuf *tb, int x, int y, int w, int h)
        num = (tx2 - tx1 + 1) * (ty2 - ty1 + 1);
      }
    return num;
+ */
 #endif
 }
 
@@ -983,10 +1003,12 @@ EAPI int
 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;
 
@@ -995,6 +1017,8 @@ evas_common_tilebuf_del_redraw(Tilebuf *tb, int x, int y, int w, int h)
    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;
@@ -1005,19 +1029,26 @@ evas_common_tilebuf_del_redraw(Tilebuf *tb, int x, int y, int w, int h)
    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))
      {
@@ -1048,18 +1079,20 @@ evas_common_tilebuf_del_redraw(Tilebuf *tb, int x, int y, int w, int h)
        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);
@@ -1067,14 +1100,16 @@ evas_common_tilebuf_add_motion_vector(Tilebuf *tb, int x, int y, int w, int h, i
                                             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
 }
 
@@ -1082,13 +1117,19 @@ EAPI void
 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
 }
 
@@ -1096,7 +1137,9 @@ EAPI Tilebuf_Rect *
 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;
@@ -1113,12 +1156,12 @@ evas_common_tilebuf_get_render_rects(Tilebuf *tb)
        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))
@@ -1137,6 +1180,7 @@ evas_common_tilebuf_get_render_rects(Tilebuf *tb)
    return rects;
 
 #else
+/*
    Tilebuf_Rect *rects = NULL;
    Tilebuf_Tile *tbt;
    int x, y;
@@ -1157,7 +1201,7 @@ evas_common_tilebuf_get_render_rects(Tilebuf *tb)
                   r->_list_data.prev = NULL;
                   r->_list_data.last = NULL;
 
-/* amalgamate tiles */
+                  // amalgamate tiles
 #if 1
                   tbti = tbt;
                  while (can_expand_x)
@@ -1219,6 +1263,7 @@ evas_common_tilebuf_get_render_rects(Tilebuf *tb)
          }
      }
    return rects;
+ */
 #endif
 }
 
@@ -1242,7 +1287,7 @@ evas_common_tilebuf_free_render_rects(Tilebuf_Rect *rects)
 
 
 /* internal usage */
-
+/*
 static void
 tilebuf_setup(Tilebuf *tb)
 {
@@ -1269,10 +1314,12 @@ 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)
 {
@@ -1292,11 +1339,11 @@ tilebuf_intersect(int tsize, int tlen, int tnum, int x, int w, int *x1, int *x2,
 {
    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;
@@ -1305,13 +1352,13 @@ tilebuf_intersect(int tsize, int tlen, int tnum, int x, int w, int *x1, int *x2,
    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;
@@ -1320,4 +1367,5 @@ tilebuf_intersect(int tsize, int tlen, int tnum, int x, int w, int *x1, int *x2,
    return 1;
    tnum = 0;
 }
+*/
 #endif
index 95c7cc8..5a86c16 100644 (file)
@@ -1037,16 +1037,23 @@ struct _Tilebuf
       int           w, h;
    } tile_size;
 
+   struct {
+      int x, y, w, h;
+   } prev_add, prev_del;
 #ifdef RECTUPDATE
+/*
    Regionbuf *rb;
+ */
 #elif defined(EVAS_RECT_SPLIT)
    int need_merge;
    list_t rects;
 #else
+/*
    struct {
       int           w, h;
       Tilebuf_Tile *tiles;
    } tiles;
+ */
 #endif
 };
 
index 08066d3..de297d4 100644 (file)
@@ -23,6 +23,7 @@ struct _Render_Engine
    Evas_GL_X11_Window      *win;
    Evas_Engine_Info_GL_X11 *info;
    Evas                    *evas;
+   Tilebuf                 *tb;
    int                      end;
 
    XrmDatabase   xrdb; // xres - dpi
@@ -473,19 +474,25 @@ eng_setup(Evas *e, void *in)
         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;
@@ -508,6 +515,7 @@ eng_output_free(void *data)
              eng_window_free(re->win);
              gl_wins--;
           }
+        evas_common_tilebuf_free(re->tb);
         free(re);
      }
    if ((initted == 1) && (gl_wins == 0))
@@ -528,11 +536,19 @@ eng_output_resize(void *data, int w, int h)
    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
@@ -543,7 +559,8 @@ eng_output_redraws_rect_add(void *data, int x, int y, int w, int h)
    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)
@@ -568,11 +585,16 @@ eng_output_redraws_rect_add(void *data, int x, int y, int w, int h)
        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
@@ -581,7 +603,8 @@ eng_output_redraws_clear(void *data)
    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!");
 }
 
@@ -592,9 +615,41 @@ static void *
 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
@@ -613,15 +668,8 @@ eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, i
    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