summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWonsik Jung <sidein@samsung.com>2014-02-08 23:04:04 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-02-08 23:04:04 +0900
commit0e0421975872c990a69cef82d42487a158dcc08f (patch)
tree8d7df81e576adf4d838034fbd3c403be73a121a2
parent229ee74f6c6637a369d46b771642cb91a3c34409 (diff)
Add quadruple swap mode for partial rendering
Summary: This patch is for QUADRUPLE window buffers. Test Plan: When enlightenment uses quadruple buffers or window system can support quadruple buffers, application can use quadruple buffers with partial rendering Reviewers: tasn, seoz, raster Reviewed By: raster CC: cedric Differential Revision: https://phab.enlightenment.org/D527
-rw-r--r--src/modules/evas/engines/gl_x11/Evas_Engine_GL_X11.h11
-rw-r--r--src/modules/evas/engines/gl_x11/evas_engine.c38
-rw-r--r--src/modules/evas/engines/software_x11/evas_engine.c29
-rw-r--r--src/modules/evas/engines/software_x11/evas_engine.h3
-rw-r--r--src/modules/evas/engines/software_x11/evas_xlib_swapper.c3
5 files changed, 62 insertions, 22 deletions
diff --git a/src/modules/evas/engines/gl_x11/Evas_Engine_GL_X11.h b/src/modules/evas/engines/gl_x11/Evas_Engine_GL_X11.h
index 04e1c4c82d..e66539e021 100644
--- a/src/modules/evas/engines/gl_x11/Evas_Engine_GL_X11.h
+++ b/src/modules/evas/engines/gl_x11/Evas_Engine_GL_X11.h
@@ -8,11 +8,12 @@ typedef struct _Evas_Engine_Info_GL_X11 Evas_Engine_Info_GL_X11;
8 8
9typedef enum _Evas_Engine_Info_GL_X11_Swap_Mode 9typedef enum _Evas_Engine_Info_GL_X11_Swap_Mode
10{ 10{
11 EVAS_ENGINE_GL_X11_SWAP_MODE_AUTO = 0, 11 EVAS_ENGINE_GL_X11_SWAP_MODE_AUTO = 0,
12 EVAS_ENGINE_GL_X11_SWAP_MODE_FULL = 1, 12 EVAS_ENGINE_GL_X11_SWAP_MODE_FULL = 1,
13 EVAS_ENGINE_GL_X11_SWAP_MODE_COPY = 2, 13 EVAS_ENGINE_GL_X11_SWAP_MODE_COPY = 2,
14 EVAS_ENGINE_GL_X11_SWAP_MODE_DOUBLE = 3, 14 EVAS_ENGINE_GL_X11_SWAP_MODE_DOUBLE = 3,
15 EVAS_ENGINE_GL_X11_SWAP_MODE_TRIPLE = 4 15 EVAS_ENGINE_GL_X11_SWAP_MODE_TRIPLE = 4,
16 EVAS_ENGINE_GL_X11_SWAP_MODE_QUADRUPLE = 5
16} Evas_Engine_Info_GL_X11_Swap_Mode; 17} Evas_Engine_Info_GL_X11_Swap_Mode;
17 18
18struct _Evas_Engine_Info_GL_X11 19struct _Evas_Engine_Info_GL_X11
diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c b/src/modules/evas/engines/gl_x11/evas_engine.c
index fffa16fd11..1419d163cd 100644
--- a/src/modules/evas/engines/gl_x11/evas_engine.c
+++ b/src/modules/evas/engines/gl_x11/evas_engine.c
@@ -37,7 +37,8 @@ enum {
37 MODE_FULL, 37 MODE_FULL,
38 MODE_COPY, 38 MODE_COPY,
39 MODE_DOUBLE, 39 MODE_DOUBLE,
40 MODE_TRIPLE 40 MODE_TRIPLE,
41 MODE_QUADRUPLE
41}; 42};
42 43
43typedef struct _Render_Engine Render_Engine; 44typedef struct _Render_Engine Render_Engine;
@@ -45,7 +46,7 @@ typedef struct _Render_Engine Render_Engine;
45struct _Render_Engine 46struct _Render_Engine
46{ 47{
47 Tilebuf_Rect *rects; 48 Tilebuf_Rect *rects;
48 Tilebuf_Rect *rects_prev[3]; 49 Tilebuf_Rect *rects_prev[4];
49 Eina_Inlist *cur_rect; 50 Eina_Inlist *cur_rect;
50 51
51 Evas_GL_X11_Window *win; 52 Evas_GL_X11_Window *win;
@@ -988,6 +989,10 @@ eng_setup(Evas *eo_e, void *in)
988 (!strcasecmp(s, "t")) || 989 (!strcasecmp(s, "t")) ||
989 (!strcasecmp(s, "3"))) 990 (!strcasecmp(s, "3")))
990 re->mode = MODE_TRIPLE; 991 re->mode = MODE_TRIPLE;
992 else if ((!strcasecmp(s, "quadruple")) ||
993 (!strcasecmp(s, "q")) ||
994 (!strcasecmp(s, "4")))
995 re->mode = MODE_QUADRUPLE;
991 } 996 }
992 else 997 else
993 { 998 {
@@ -1017,6 +1022,9 @@ eng_setup(Evas *eo_e, void *in)
1017 case EVAS_ENGINE_GL_X11_SWAP_MODE_TRIPLE: 1022 case EVAS_ENGINE_GL_X11_SWAP_MODE_TRIPLE:
1018 re->mode = MODE_TRIPLE; 1023 re->mode = MODE_TRIPLE;
1019 break; 1024 break;
1025 case EVAS_ENGINE_GL_X11_SWAP_MODE_QUADRUPLE:
1026 re->mode = MODE_QUADRUPLE;
1027 break;
1020 default: 1028 default:
1021 break; 1029 break;
1022 } 1030 }
@@ -1105,6 +1113,7 @@ eng_output_free(void *data)
1105 if (re->rects_prev[0]) evas_common_tilebuf_free_render_rects(re->rects_prev[0]); 1113 if (re->rects_prev[0]) evas_common_tilebuf_free_render_rects(re->rects_prev[0]);
1106 if (re->rects_prev[1]) evas_common_tilebuf_free_render_rects(re->rects_prev[1]); 1114 if (re->rects_prev[1]) evas_common_tilebuf_free_render_rects(re->rects_prev[1]);
1107 if (re->rects_prev[2]) evas_common_tilebuf_free_render_rects(re->rects_prev[2]); 1115 if (re->rects_prev[2]) evas_common_tilebuf_free_render_rects(re->rects_prev[2]);
1116 if (re->rects_prev[3]) evas_common_tilebuf_free_render_rects(re->rects_prev[3]);
1108 1117
1109 1118
1110 free(re); 1119 free(re);
@@ -1177,7 +1186,7 @@ eng_output_redraws_clear(void *data)
1177} 1186}
1178 1187
1179static Tilebuf_Rect * 1188static Tilebuf_Rect *
1180_merge_rects(Tilebuf *tb, Tilebuf_Rect *r1, Tilebuf_Rect *r2, Tilebuf_Rect *r3) 1189_merge_rects(Tilebuf *tb, Tilebuf_Rect *r1, Tilebuf_Rect *r2, Tilebuf_Rect *r3, Tilebuf_Rect *r4)
1181{ 1190{
1182 Tilebuf_Rect *r, *rects; 1191 Tilebuf_Rect *r, *rects;
1183 Evas_Point p1, p2; 1192 Evas_Point p1, p2;
@@ -1203,6 +1212,13 @@ _merge_rects(Tilebuf *tb, Tilebuf_Rect *r1, Tilebuf_Rect *r2, Tilebuf_Rect *r3)
1203 evas_common_tilebuf_add_redraw(tb, r->x, r->y, r->w, r->h); 1212 evas_common_tilebuf_add_redraw(tb, r->x, r->y, r->w, r->h);
1204 } 1213 }
1205 } 1214 }
1215 if (r4)
1216 {
1217 EINA_INLIST_FOREACH(EINA_INLIST_GET(r4), r)
1218 {
1219 evas_common_tilebuf_add_redraw(tb, r->x, r->y, r->w, r->h);
1220 }
1221 }
1206 rects = evas_common_tilebuf_get_render_rects(tb); 1222 rects = evas_common_tilebuf_get_render_rects(tb);
1207 1223
1208 if (partial_rect_union_mode == -1) 1224 if (partial_rect_union_mode == -1)
@@ -1348,6 +1364,7 @@ eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, i
1348 if (age == 1) re->mode = MODE_COPY; 1364 if (age == 1) re->mode = MODE_COPY;
1349 else if (age == 2) re->mode = MODE_DOUBLE; 1365 else if (age == 2) re->mode = MODE_DOUBLE;
1350 else if (age == 3) re->mode = MODE_TRIPLE; 1366 else if (age == 3) re->mode = MODE_TRIPLE;
1367 else if (age == 4) re->mode = MODE_QUADRUPLE;
1351 else re->mode = MODE_FULL; 1368 else re->mode = MODE_FULL;
1352 if ((int)age != re->prev_age) re->mode = MODE_FULL; 1369 if ((int)age != re->prev_age) re->mode = MODE_FULL;
1353 re->prev_age = age; 1370 re->prev_age = age;
@@ -1364,7 +1381,8 @@ eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, i
1364 /* ensure we get rid of previous rect lists we dont need if mode 1381 /* ensure we get rid of previous rect lists we dont need if mode
1365 * changed/is appropriate */ 1382 * changed/is appropriate */
1366 evas_common_tilebuf_clear(re->tb); 1383 evas_common_tilebuf_clear(re->tb);
1367 CLEAR_PREV_RECTS(2); 1384 CLEAR_PREV_RECTS(3);
1385 re->rects_prev[3] = re->rects_prev[2];
1368 re->rects_prev[2] = re->rects_prev[1]; 1386 re->rects_prev[2] = re->rects_prev[1];
1369 re->rects_prev[1] = re->rects_prev[0]; 1387 re->rects_prev[1] = re->rects_prev[0];
1370 re->rects_prev[0] = re->rects; 1388 re->rects_prev[0] = re->rects;
@@ -1373,13 +1391,16 @@ eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, i
1373 { 1391 {
1374 case MODE_FULL: 1392 case MODE_FULL:
1375 case MODE_COPY: // no prev rects needed 1393 case MODE_COPY: // no prev rects needed
1376 re->rects = _merge_rects(re->tb, re->rects_prev[0], NULL, NULL); 1394 re->rects = _merge_rects(re->tb, re->rects_prev[0], NULL, NULL, NULL);
1377 break; 1395 break;
1378 case MODE_DOUBLE: // double mode - only 1 level of prev rect 1396 case MODE_DOUBLE: // double mode - only 1 level of prev rect
1379 re->rects = _merge_rects(re->tb, re->rects_prev[0], re->rects_prev[1], NULL); 1397 re->rects = _merge_rects(re->tb, re->rects_prev[0], re->rects_prev[1], NULL, NULL);
1398 break;
1399 case MODE_TRIPLE: // triple mode - 2 levels of prev rect
1400 re->rects = _merge_rects(re->tb, re->rects_prev[0], re->rects_prev[1], re->rects_prev[2], NULL);
1380 break; 1401 break;
1381 case MODE_TRIPLE: // keep all 1402 case MODE_QUADRUPLE: // keep all
1382 re->rects = _merge_rects(re->tb, re->rects_prev[0], re->rects_prev[1], re->rects_prev[2]); 1403 re->rects = _merge_rects(re->tb, re->rects_prev[0], re->rects_prev[1], re->rects_prev[2], re->rects_prev[3]);
1383 break; 1404 break;
1384 default: 1405 default:
1385 break; 1406 break;
@@ -1398,6 +1419,7 @@ eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, i
1398 case MODE_COPY: 1419 case MODE_COPY:
1399 case MODE_DOUBLE: 1420 case MODE_DOUBLE:
1400 case MODE_TRIPLE: 1421 case MODE_TRIPLE:
1422 case MODE_QUADRUPLE:
1401 rect = (Tilebuf_Rect *)re->cur_rect; 1423 rect = (Tilebuf_Rect *)re->cur_rect;
1402 *x = rect->x; 1424 *x = rect->x;
1403 *y = rect->y; 1425 *y = rect->y;
diff --git a/src/modules/evas/engines/software_x11/evas_engine.c b/src/modules/evas/engines/software_x11/evas_engine.c
index 4a1bf4b45b..8ae0d4d1c0 100644
--- a/src/modules/evas/engines/software_x11/evas_engine.c
+++ b/src/modules/evas/engines/software_x11/evas_engine.c
@@ -33,7 +33,7 @@ struct _Render_Engine
33 Tilebuf *tb; 33 Tilebuf *tb;
34 Outbuf *ob; 34 Outbuf *ob;
35 Tilebuf_Rect *rects; 35 Tilebuf_Rect *rects;
36 Tilebuf_Rect *rects_prev[3]; 36 Tilebuf_Rect *rects_prev[4];
37 Eina_Inlist *cur_rect; 37 Eina_Inlist *cur_rect;
38 short mode; 38 short mode;
39 unsigned char end : 1; 39 unsigned char end : 1;
@@ -643,6 +643,7 @@ eng_output_free(void *data)
643 if (re->rects_prev[0]) evas_common_tilebuf_free_render_rects(re->rects_prev[0]); 643 if (re->rects_prev[0]) evas_common_tilebuf_free_render_rects(re->rects_prev[0]);
644 if (re->rects_prev[1]) evas_common_tilebuf_free_render_rects(re->rects_prev[1]); 644 if (re->rects_prev[1]) evas_common_tilebuf_free_render_rects(re->rects_prev[1]);
645 if (re->rects_prev[2]) evas_common_tilebuf_free_render_rects(re->rects_prev[2]); 645 if (re->rects_prev[2]) evas_common_tilebuf_free_render_rects(re->rects_prev[2]);
646 if (re->rects_prev[3]) evas_common_tilebuf_free_render_rects(re->rects_prev[3]);
646#ifdef BUILD_ENGINE_SOFTWARE_XLIB 647#ifdef BUILD_ENGINE_SOFTWARE_XLIB
647 _output_egl_shutdown(re); 648 _output_egl_shutdown(re);
648#endif 649#endif
@@ -704,7 +705,7 @@ eng_output_redraws_clear(void *data)
704} 705}
705 706
706static Tilebuf_Rect * 707static Tilebuf_Rect *
707_merge_rects(Tilebuf *tb, Tilebuf_Rect *r1, Tilebuf_Rect *r2, Tilebuf_Rect *r3) 708_merge_rects(Tilebuf *tb, Tilebuf_Rect *r1, Tilebuf_Rect *r2, Tilebuf_Rect *r3, Tilebuf_Rect *r4)
708{ 709{
709 Tilebuf_Rect *r, *rects; 710 Tilebuf_Rect *r, *rects;
710// int px1, py1, px2, py2; 711// int px1, py1, px2, py2;
@@ -730,6 +731,15 @@ _merge_rects(Tilebuf *tb, Tilebuf_Rect *r1, Tilebuf_Rect *r2, Tilebuf_Rect *r3)
730 evas_common_tilebuf_add_redraw(tb, r->x, r->y, r->w, r->h); 731 evas_common_tilebuf_add_redraw(tb, r->x, r->y, r->w, r->h);
731 } 732 }
732 } 733 }
734
735 if (r4)
736 {
737 EINA_INLIST_FOREACH(EINA_INLIST_GET(r4), r)
738 {
739 evas_common_tilebuf_add_redraw(tb, r->x, r->y, r->w, r->h);
740 }
741 }
742
733 rects = evas_common_tilebuf_get_render_rects(tb); 743 rects = evas_common_tilebuf_get_render_rects(tb);
734 /* 744 /*
735 // bounding box -> make a bounding box single region update of all regions. 745 // bounding box -> make a bounding box single region update of all regions.
@@ -807,7 +817,8 @@ eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, i
807 /* ensure we get rid of previous rect lists we dont need if mode 817 /* ensure we get rid of previous rect lists we dont need if mode
808 * changed/is appropriate */ 818 * changed/is appropriate */
809 evas_common_tilebuf_clear(re->tb); 819 evas_common_tilebuf_clear(re->tb);
810 CLEAR_PREV_RECTS(2); 820 CLEAR_PREV_RECTS(3);
821 re->rects_prev[3] = re->rects_prev[2];
811 re->rects_prev[2] = re->rects_prev[1]; 822 re->rects_prev[2] = re->rects_prev[1];
812 re->rects_prev[1] = re->rects_prev[0]; 823 re->rects_prev[1] = re->rects_prev[0];
813 re->rects_prev[0] = re->rects; 824 re->rects_prev[0] = re->rects;
@@ -816,13 +827,16 @@ eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, i
816 { 827 {
817 case MODE_FULL: 828 case MODE_FULL:
818 case MODE_COPY: // no prev rects needed 829 case MODE_COPY: // no prev rects needed
819 re->rects = _merge_rects(re->tb, re->rects_prev[0], NULL, NULL); 830 re->rects = _merge_rects(re->tb, re->rects_prev[0], NULL, NULL, NULL);
820 break; 831 break;
821 case MODE_DOUBLE: // double mode - only 1 level of prev rect 832 case MODE_DOUBLE: // double mode - only 1 level of prev rect
822 re->rects = _merge_rects(re->tb, re->rects_prev[0], re->rects_prev[1], NULL); 833 re->rects = _merge_rects(re->tb, re->rects_prev[0], re->rects_prev[1], NULL, NULL);
834 break;
835 case MODE_TRIPLE: // triple mode - 2 levels of prev rect
836 re->rects = _merge_rects(re->tb, re->rects_prev[0], re->rects_prev[1], re->rects_prev[2], NULL);
823 break; 837 break;
824 case MODE_TRIPLE: // keep all 838 case MODE_QUADRUPLE: // keep all
825 re->rects = _merge_rects(re->tb, re->rects_prev[0], re->rects_prev[1], re->rects_prev[2]); 839 re->rects = _merge_rects(re->tb, re->rects_prev[0], re->rects_prev[1], re->rects_prev[2], re->rects_prev[3]);
826 break; 840 break;
827 default: 841 default:
828 break; 842 break;
@@ -841,6 +855,7 @@ eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, i
841 case MODE_COPY: 855 case MODE_COPY:
842 case MODE_DOUBLE: 856 case MODE_DOUBLE:
843 case MODE_TRIPLE: 857 case MODE_TRIPLE:
858 case MODE_QUADRUPLE:
844 rect = (Tilebuf_Rect *)re->cur_rect; 859 rect = (Tilebuf_Rect *)re->cur_rect;
845 *x = rect->x; 860 *x = rect->x;
846 *y = rect->y; 861 *y = rect->y;
diff --git a/src/modules/evas/engines/software_x11/evas_engine.h b/src/modules/evas/engines/software_x11/evas_engine.h
index 4e91a1c278..e15a76e33a 100644
--- a/src/modules/evas/engines/software_x11/evas_engine.h
+++ b/src/modules/evas/engines/software_x11/evas_engine.h
@@ -64,7 +64,8 @@ enum {
64 MODE_FULL, 64 MODE_FULL,
65 MODE_COPY, 65 MODE_COPY,
66 MODE_DOUBLE, 66 MODE_DOUBLE,
67 MODE_TRIPLE 67 MODE_TRIPLE,
68 MODE_QUADRUPLE
68}; 69};
69 70
70typedef struct _Outbuf Outbuf; 71typedef struct _Outbuf Outbuf;
diff --git a/src/modules/evas/engines/software_x11/evas_xlib_swapper.c b/src/modules/evas/engines/software_x11/evas_xlib_swapper.c
index fa7a9daf80..b1d26afaa3 100644
--- a/src/modules/evas/engines/software_x11/evas_xlib_swapper.c
+++ b/src/modules/evas/engines/software_x11/evas_xlib_swapper.c
@@ -832,11 +832,12 @@ evas_xlib_swapper_buffer_state_get(X_Swapper *swp)
832 if (swap_debug) printf("Reuse changed - force FULL\n"); 832 if (swap_debug) printf("Reuse changed - force FULL\n");
833 return MODE_FULL; 833 return MODE_FULL;
834 } 834 }
835 if (swap_debug) printf("Swap state idx_reuse = %i (0=FULL, 1=COPY, 2=DOUBLE, 3=TRIPLE)\n", flags->data.idx_reuse); 835 if (swap_debug) printf("Swap state idx_reuse = %i (0=FULL, 1=COPY, 2=DOUBLE, 3=TRIPLE, 4=QUAD)\n", flags->data.idx_reuse);
836 if (flags->data.idx_reuse == 0) return MODE_FULL; 836 if (flags->data.idx_reuse == 0) return MODE_FULL;
837 else if (flags->data.idx_reuse == 1) return MODE_COPY; 837 else if (flags->data.idx_reuse == 1) return MODE_COPY;
838 else if (flags->data.idx_reuse == 2) return MODE_DOUBLE; 838 else if (flags->data.idx_reuse == 2) return MODE_DOUBLE;
839 else if (flags->data.idx_reuse == 3) return MODE_TRIPLE; 839 else if (flags->data.idx_reuse == 3) return MODE_TRIPLE;
840 else if (flags->data.idx_reuse == 4) return MODE_QUADRUPLE;
840 return MODE_FULL; 841 return MODE_FULL;
841} 842}
842 843