summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-04-30 11:13:36 -0400
committerChris Michael <cp.michael@samsung.com>2015-04-30 11:15:00 -0400
commitfaa99297e0a262f989a7304fdca0a5a7e92583ad (patch)
tree76c271450790c431d80312f2f26d7337ec58215a /src/modules
parentae095bb5c5e1190d01887e799ea806b4778ef88a (diff)
evas-wayland-shm: Fix T2352 (focused window borders blink)
Summary: This fixes an issue where the wrong swapmode was being returned to the evas render function. This was causing focused windows to blink. NB: Big thanks to Derek for assisting !! :) @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/evas/engines/wayland_shm/evas_engine.h1
-rw-r--r--src/modules/evas/engines/wayland_shm/evas_outbuf.c32
-rw-r--r--src/modules/evas/engines/wayland_shm/evas_shm.c9
3 files changed, 23 insertions, 19 deletions
diff --git a/src/modules/evas/engines/wayland_shm/evas_engine.h b/src/modules/evas/engines/wayland_shm/evas_engine.h
index 3c4fcc2..e9ea18d 100644
--- a/src/modules/evas/engines/wayland_shm/evas_engine.h
+++ b/src/modules/evas/engines/wayland_shm/evas_engine.h
@@ -88,6 +88,7 @@ struct _Shm_Surface
88 88
89 Eina_Bool redraw : 1; 89 Eina_Bool redraw : 1;
90 Eina_Bool alpha : 1; 90 Eina_Bool alpha : 1;
91 Eina_Bool mapped : 1;
91}; 92};
92 93
93struct _Outbuf 94struct _Outbuf
diff --git a/src/modules/evas/engines/wayland_shm/evas_outbuf.c b/src/modules/evas/engines/wayland_shm/evas_outbuf.c
index 7b4fb91..7571566 100644
--- a/src/modules/evas/engines/wayland_shm/evas_outbuf.c
+++ b/src/modules/evas/engines/wayland_shm/evas_outbuf.c
@@ -257,27 +257,29 @@ _evas_outbuf_flush(Outbuf *ob, Tilebuf_Rect *rects EINA_UNUSED, Evas_Render_Mode
257Render_Engine_Swap_Mode 257Render_Engine_Swap_Mode
258_evas_outbuf_swapmode_get(Outbuf *ob) 258_evas_outbuf_swapmode_get(Outbuf *ob)
259{ 259{
260 int i = 0; 260 int i = 0, n = 0, count = 0, ret = 0;
261 261
262 LOGFN(__FILE__, __LINE__, __FUNCTION__); 262 LOGFN(__FILE__, __LINE__, __FUNCTION__);
263 263
264 i = (ob->surface->last_buff - ob->surface->curr_buff + 264 if (!ob->surface->mapped) return MODE_FULL;
265 (ob->surface->last_buff > ob->surface->last_buff ?
266 0 : ob->surface->num_buff)) % ob->surface->num_buff;
267 265
268 switch (i) 266 for (; i < ob->surface->num_buff; i++)
269 { 267 {
270 case 0: 268 n = (ob->surface->num_buff + ob->surface->curr_buff - (i)) % ob->surface->num_buff;
271 return MODE_COPY; 269 if (ob->surface->leaf[n].busy) count++;
272 case 1:
273 return MODE_DOUBLE;
274 case 2:
275 return MODE_TRIPLE;
276 case 3:
277 return MODE_QUADRUPLE;
278 default:
279 return MODE_FULL;
280 } 270 }
271
272 if (count == ob->surface->num_buff) ret = MODE_FULL;
273 else if (count == 0) ret = MODE_COPY;
274 else if (count == 1) ret = MODE_DOUBLE;
275 else if (count == 2) ret = MODE_TRIPLE;
276 else if (count == 3) ret = MODE_QUADRUPLE;
277 else ret = MODE_FULL;
278
279 /* DBG("SWAPMODE: %d (0=FULL, 1=COPY, 2=DOUBLE, 3=TRIPLE, 4=QUAD", ret); */
280 /* DBG("\tBusy: %d", count); */
281
282 return ret;
281} 283}
282 284
283int 285int
diff --git a/src/modules/evas/engines/wayland_shm/evas_shm.c b/src/modules/evas/engines/wayland_shm/evas_shm.c
index 3cea7d2..724f42c3 100644
--- a/src/modules/evas/engines/wayland_shm/evas_shm.c
+++ b/src/modules/evas/engines/wayland_shm/evas_shm.c
@@ -408,7 +408,6 @@ void
408_evas_shm_surface_swap(Shm_Surface *surface, Eina_Rectangle *rects, unsigned int count) 408_evas_shm_surface_swap(Shm_Surface *surface, Eina_Rectangle *rects, unsigned int count)
409{ 409{
410 Shm_Leaf *leaf = NULL; 410 Shm_Leaf *leaf = NULL;
411 int i = 0;
412 411
413 LOGFN(__FILE__, __LINE__, __FUNCTION__); 412 LOGFN(__FILE__, __LINE__, __FUNCTION__);
414 413
@@ -421,7 +420,9 @@ _evas_shm_surface_swap(Shm_Surface *surface, Eina_Rectangle *rects, unsigned int
421 return; 420 return;
422 } 421 }
423 422
424 DBG("Current Leaf %d", (int)(leaf - &surface->leaf[0])); 423 /* DBG("Current Leaf %d", (int)(leaf - &surface->leaf[0])); */
424
425 surface->last_buff = surface->curr_buff;
425 426
426 wl_surface_attach(surface->surface, leaf->data->buffer, 0, 0); 427 wl_surface_attach(surface->surface, leaf->data->buffer, 0, 0);
427 428
@@ -443,6 +444,7 @@ _evas_shm_surface_swap(Shm_Surface *surface, Eina_Rectangle *rects, unsigned int
443 surface->dx = 0; 444 surface->dx = 0;
444 surface->dy = 0; 445 surface->dy = 0;
445 surface->redraw = EINA_TRUE; 446 surface->redraw = EINA_TRUE;
447 surface->mapped = EINA_TRUE;
446} 448}
447 449
448void * 450void *
@@ -468,7 +470,7 @@ _evas_shm_surface_data_get(Shm_Surface *surface, int *w, int *h)
468 470
469 if (!leaf) 471 if (!leaf)
470 { 472 {
471 WRN("All buffers held by server"); 473 /* WRN("All buffers held by server"); */
472 return NULL; 474 return NULL;
473 } 475 }
474 476
@@ -477,7 +479,6 @@ _evas_shm_surface_data_get(Shm_Surface *surface, int *w, int *h)
477 if (w) *w = leaf->w; 479 if (w) *w = leaf->w;
478 if (h) *h = leaf->h; 480 if (h) *h = leaf->h;
479 481
480 surface->last_buff = surface->curr_buff;
481 surface->curr_buff = (int)(leaf - &surface->leaf[0]); 482 surface->curr_buff = (int)(leaf - &surface->leaf[0]);
482 483
483 return leaf->data->map; 484 return leaf->data->map;