evas: Modify logic to properly invalidate buffer 33/92433/3
authorWonki Kim <wonki_.kim@samsung.com>
Tue, 11 Oct 2016 12:17:41 +0000 (21:17 +0900)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Tue, 18 Oct 2016 10:50:39 +0000 (03:50 -0700)
when buffer size is growing, there is a chance not to invalidate
back buffer properly, this commit remove the case.

Change-Id: I06778e8abf654c0aef60885f9326aa6f2334b447
Signed-off-by: Wonki Kim <wonki_.kim@samsung.com>
src/modules/evas/engines/wayland_shm/evas_engine.h
src/modules/evas/engines/wayland_shm/evas_outbuf.c

index 9eba16a..00b5ad6 100755 (executable)
@@ -86,7 +86,7 @@ struct _Outbuf
 
    Surface *surface;
 
-   struct 
+   struct
      {
         /* one big buffer for updates. flushed on idle_flush */
         RGBA_Image *onebuf;
@@ -101,6 +101,9 @@ struct _Outbuf
         /* Eina_Bool redraw : 1; */
         Eina_Bool destination_alpha : 1;
      } priv;
+   // TIZEN_ONLY(20161017): Properly invalidate buffer //
+   int prev_age;
+   //
 };
 
 Eina_Bool _evas_tbmbuf_surface_create(Surface *s, int w, int h, int num_buff);
index 6d91c0a..a229b7b 100755 (executable)
@@ -318,17 +318,24 @@ _evas_outbuf_flush(Outbuf *ob, Tilebuf_Rect *rects EINA_UNUSED, Evas_Render_Mode
 Render_Engine_Swap_Mode
 _evas_outbuf_swap_mode_get(Outbuf *ob)
 {
+   //TIZEN_ONLY(20161017): Properly invalidate buffer
    int age;
+   Render_Engine_Swap_Mode mode;
 
    LOGFN(__FILE__, __LINE__, __FUNCTION__);
 
    age = ob->surface->funcs.assign(ob->surface);
-   if (age == 1) return MODE_COPY;
-   else if (age == 2) return MODE_DOUBLE;
-   else if (age == 3) return MODE_TRIPLE;
-   else if (age == 4) return MODE_QUADRUPLE;
+   if (age == 1) mode = MODE_COPY;
+   else if (age == 2) mode = MODE_DOUBLE;
+   else if (age == 3) mode = MODE_TRIPLE;
+   else if (age == 4) mode = MODE_QUADRUPLE;
+   else mode = MODE_FULL;
 
-   return MODE_FULL;
+   if (ob->prev_age != age) mode = MODE_FULL;
+   ob->prev_age = age;
+
+   return mode;
+   //
 }
 
 int