summaryrefslogtreecommitdiff
path: root/src/modules/evas
diff options
context:
space:
mode:
authorCedric BAIL <c.bail@partner.samsung.com>2014-06-29 19:28:44 +0200
committerCedric BAIL <c.bail@partner.samsung.com>2014-07-04 15:11:22 +0200
commitab6dd99ed8d217e7c818460a447cf1acf1a789e1 (patch)
tree00c45451340c875847631b766f0ce21fc7fec15c /src/modules/evas
parent35648c09be74c97d6eae0f7c65e1a8ba2c96cc37 (diff)
evas: add support for merging redraw area across multiple frame with different logic.
Diffstat (limited to 'src/modules/evas')
-rw-r--r--src/modules/evas/engines/software_generic/Evas_Engine_Software_Generic.h18
-rw-r--r--src/modules/evas/engines/software_generic/evas_engine.c27
2 files changed, 31 insertions, 14 deletions
diff --git a/src/modules/evas/engines/software_generic/Evas_Engine_Software_Generic.h b/src/modules/evas/engines/software_generic/Evas_Engine_Software_Generic.h
index 29218880e5..8ab8101b22 100644
--- a/src/modules/evas/engines/software_generic/Evas_Engine_Software_Generic.h
+++ b/src/modules/evas/engines/software_generic/Evas_Engine_Software_Generic.h
@@ -31,6 +31,11 @@ typedef enum {
31 MODE_QUADRUPLE 31 MODE_QUADRUPLE
32} Render_Engine_Swap_Mode; 32} Render_Engine_Swap_Mode;
33 33
34typedef enum {
35 MERGE_BOUNDING,
36 MERGE_FULL
37} Render_Engine_Merge_Mode;
38
34typedef struct _Render_Engine_Software_Generic Render_Engine_Software_Generic; 39typedef struct _Render_Engine_Software_Generic Render_Engine_Software_Generic;
35typedef struct _Outbuf Outbuf; 40typedef struct _Outbuf Outbuf;
36 41
@@ -64,7 +69,8 @@ struct _Render_Engine_Software_Generic
64 69
65 unsigned int w, h; 70 unsigned int w, h;
66 71
67 Render_Engine_Swap_Mode mode; 72 Render_Engine_Swap_Mode swap_mode;
73 Render_Engine_Merge_Mode merge_mode;
68 74
69 unsigned char end : 1; 75 unsigned char end : 1;
70 unsigned char lost_back : 1; 76 unsigned char lost_back : 1;
@@ -104,7 +110,8 @@ evas_render_engine_software_generic_init(Render_Engine_Software_Generic *re,
104 110
105 re->w = w; 111 re->w = w;
106 re->h = h; 112 re->h = h;
107 re->mode = MODE_FULL; 113 re->swap_mode = MODE_FULL;
114 re->merge_mode = MERGE_FULL;
108 re->end = 0; 115 re->end = 0;
109 re->lost_back = 0; 116 re->lost_back = 0;
110 117
@@ -140,4 +147,11 @@ evas_render_engine_software_generic_update(Render_Engine_Software_Generic *re,
140 re->ob = ob; 147 re->ob = ob;
141} 148}
142 149
150static inline void
151evas_render_engine_software_generic_merge_mode_set(Render_Engine_Software_Generic *re,
152 Render_Engine_Merge_Mode merge_mode)
153{
154 re->merge_mode = merge_mode;
155}
156
143#endif 157#endif
diff --git a/src/modules/evas/engines/software_generic/evas_engine.c b/src/modules/evas/engines/software_generic/evas_engine.c
index 6342e20261..274d421e8d 100644
--- a/src/modules/evas/engines/software_generic/evas_engine.c
+++ b/src/modules/evas/engines/software_generic/evas_engine.c
@@ -2627,7 +2627,12 @@ eng_output_redraws_clear(void *data)
2627} 2627}
2628 2628
2629static Tilebuf_Rect * 2629static Tilebuf_Rect *
2630_merge_rects(Tilebuf *tb, Tilebuf_Rect *r1, Tilebuf_Rect *r2, Tilebuf_Rect *r3, Tilebuf_Rect *r4) 2630_merge_rects(Render_Engine_Merge_Mode merge_mode,
2631 Tilebuf *tb,
2632 Tilebuf_Rect *r1,
2633 Tilebuf_Rect *r2,
2634 Tilebuf_Rect *r3,
2635 Tilebuf_Rect *r4)
2631{ 2636{
2632 Tilebuf_Rect *r, *rects; 2637 Tilebuf_Rect *r, *rects;
2633 2638
@@ -2662,12 +2667,11 @@ _merge_rects(Tilebuf *tb, Tilebuf_Rect *r1, Tilebuf_Rect *r2, Tilebuf_Rect *r3,
2662 } 2667 }
2663 2668
2664 rects = evas_common_tilebuf_get_render_rects(tb); 2669 rects = evas_common_tilebuf_get_render_rects(tb);
2665 /*
2666 // bounding box -> make a bounding box single region update of all regions. 2670 // bounding box -> make a bounding box single region update of all regions.
2667 // yes we could try and be smart and figure out size of regions, how far 2671 // yes we could try and be smart and figure out size of regions, how far
2668 // apart etc. etc. to try and figure out an optimal "set". this is a tradeoff 2672 // apart etc. etc. to try and figure out an optimal "set". this is a tradeoff
2669 // between multiple update regions to render and total pixels to render. 2673 // between multiple update regions to render and total pixels to render.
2670 if (rects) 2674 if (merge_mode == MERGE_BOUNDING && rects)
2671 { 2675 {
2672 int px1, py1, px2, py2; 2676 int px1, py1, px2, py2;
2673 2677
@@ -2690,7 +2694,6 @@ _merge_rects(Tilebuf *tb, Tilebuf_Rect *r1, Tilebuf_Rect *r2, Tilebuf_Rect *r3,
2690 rects->h = py2 - py1; 2694 rects->h = py2 - py1;
2691 } 2695 }
2692 } 2696 }
2693 */
2694 evas_common_tilebuf_clear(tb); 2697 evas_common_tilebuf_clear(tb);
2695 return rects; 2698 return rects;
2696} 2699}
@@ -2726,8 +2729,8 @@ eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, i
2726 if (re->rects) 2729 if (re->rects)
2727 { 2730 {
2728 if (re->outbuf_swap_mode_get) mode = re->outbuf_swap_mode_get(re->ob); 2731 if (re->outbuf_swap_mode_get) mode = re->outbuf_swap_mode_get(re->ob);
2729 re->mode = mode; 2732 re->swap_mode = mode;
2730 if ((re->lost_back) || (re->mode == MODE_FULL)) 2733 if ((re->lost_back) || (re->swap_mode == MODE_FULL))
2731 { 2734 {
2732 /* if we lost our backbuffer since the last frame redraw all */ 2735 /* if we lost our backbuffer since the last frame redraw all */
2733 re->lost_back = 0; 2736 re->lost_back = 0;
@@ -2744,20 +2747,20 @@ eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, i
2744 re->rects_prev[1] = re->rects_prev[0]; 2747 re->rects_prev[1] = re->rects_prev[0];
2745 re->rects_prev[0] = re->rects; 2748 re->rects_prev[0] = re->rects;
2746 re->rects = NULL; 2749 re->rects = NULL;
2747 switch (re->mode) 2750 switch (re->swap_mode)
2748 { 2751 {
2749 case MODE_FULL: 2752 case MODE_FULL:
2750 case MODE_COPY: // no prev rects needed 2753 case MODE_COPY: // no prev rects needed
2751 re->rects = _merge_rects(re->tb, re->rects_prev[0], NULL, NULL, NULL); 2754 re->rects = _merge_rects(re->merge_mode, re->tb, re->rects_prev[0], NULL, NULL, NULL);
2752 break; 2755 break;
2753 case MODE_DOUBLE: // double mode - only 1 level of prev rect 2756 case MODE_DOUBLE: // double mode - only 1 level of prev rect
2754 re->rects = _merge_rects(re->tb, re->rects_prev[0], re->rects_prev[1], NULL, NULL); 2757 re->rects = _merge_rects(re->merge_mode, re->tb, re->rects_prev[0], re->rects_prev[1], NULL, NULL);
2755 break; 2758 break;
2756 case MODE_TRIPLE: // triple mode - 2 levels of prev rect 2759 case MODE_TRIPLE: // triple mode - 2 levels of prev rect
2757 re->rects = _merge_rects(re->tb, re->rects_prev[0], re->rects_prev[1], re->rects_prev[2], NULL); 2760 re->rects = _merge_rects(re->merge_mode, re->tb, re->rects_prev[0], re->rects_prev[1], re->rects_prev[2], NULL);
2758 break; 2761 break;
2759 case MODE_QUADRUPLE: // keep all 2762 case MODE_QUADRUPLE: // keep all
2760 re->rects = _merge_rects(re->tb, re->rects_prev[0], re->rects_prev[1], re->rects_prev[2], re->rects_prev[3]); 2763 re->rects = _merge_rects(re->merge_mode, re->tb, re->rects_prev[0], re->rects_prev[1], re->rects_prev[2], re->rects_prev[3]);
2761 break; 2764 break;
2762 default: 2765 default:
2763 break; 2766 break;
@@ -2771,7 +2774,7 @@ eng_output_redraws_next_update_get(void *data, int *x, int *y, int *w, int *h, i
2771 rect = (Tilebuf_Rect *)re->cur_rect; 2774 rect = (Tilebuf_Rect *)re->cur_rect;
2772 if (re->rects) 2775 if (re->rects)
2773 { 2776 {
2774 switch (re->mode) 2777 switch (re->swap_mode)
2775 { 2778 {
2776 case MODE_COPY: 2779 case MODE_COPY:
2777 case MODE_DOUBLE: 2780 case MODE_DOUBLE: