summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorCedric BAIL <cedric@osg.samsung.com>2017-08-25 10:49:06 -0700
committerCedric BAIL <cedric@osg.samsung.com>2017-08-25 10:49:06 -0700
commitf4afd5f1bd27323ac579dc41da8a12293f798a67 (patch)
tree5604b2729df0aa64e58bb4ca9c6b2868fa80cb98 /src/modules
parentd179a5c2a95785e64015c9d69f9e0f23dfc6699e (diff)
evas: reduce duplication of merge_mode getenv logic.
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/evas/engines/eglfs/evas_engine.c12
-rw-r--r--src/modules/evas/engines/gl_drm/evas_engine.c24
-rw-r--r--src/modules/evas/engines/gl_x11/evas_engine.c17
-rw-r--r--src/modules/evas/engines/software_generic/Evas_Engine_Software_Generic.h23
-rw-r--r--src/modules/evas/engines/software_x11/evas_engine.c17
-rw-r--r--src/modules/evas/engines/wayland_egl/evas_engine.c23
-rw-r--r--src/modules/evas/engines/wayland_shm/evas_engine.c15
7 files changed, 24 insertions, 107 deletions
diff --git a/src/modules/evas/engines/eglfs/evas_engine.c b/src/modules/evas/engines/eglfs/evas_engine.c
index b951bab..dfbaed8 100644
--- a/src/modules/evas/engines/eglfs/evas_engine.c
+++ b/src/modules/evas/engines/eglfs/evas_engine.c
@@ -684,7 +684,6 @@ eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned in
684 Evas_Engine_Info_Eglfs *info = in; 684 Evas_Engine_Info_Eglfs *info = in;
685 Render_Engine *re = NULL; 685 Render_Engine *re = NULL;
686 Outbuf *ob = NULL; 686 Outbuf *ob = NULL;
687 Render_Engine_Merge_Mode merge_mode = MERGE_BOUNDING;
688 Render_Engine_Swap_Mode swap_mode; 687 Render_Engine_Swap_Mode swap_mode;
689 688
690 swap_mode = evas_render_engine_gl_swap_mode_get(info->info.swap_mode); 689 swap_mode = evas_render_engine_gl_swap_mode_get(info->info.swap_mode);
@@ -725,16 +724,7 @@ eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned in
725 724
726 gl_wins++; 725 gl_wins++;
727 726
728 s = getenv("EVAS_GL_PARTIAL_MERGE"); 727 evas_render_engine_software_generic_merge_mode_set(&re->generic.software);
729 if (s)
730 {
731 if ((!strcmp(s, "bounding")) || (!strcmp(s, "b")))
732 merge_mode = MERGE_BOUNDING;
733 else if ((!strcmp(s, "full")) || (!strcmp(s, "f")))
734 merge_mode = MERGE_FULL;
735 }
736
737 evas_render_engine_software_generic_merge_mode_set(&re->generic.software, merge_mode);
738 728
739 evas_outbuf_use(eng_get_ob(re)); 729 evas_outbuf_use(eng_get_ob(re));
740 730
diff --git a/src/modules/evas/engines/gl_drm/evas_engine.c b/src/modules/evas/engines/gl_drm/evas_engine.c
index 2072284..28b21d2 100644
--- a/src/modules/evas/engines/gl_drm/evas_engine.c
+++ b/src/modules/evas/engines/gl_drm/evas_engine.c
@@ -899,26 +899,6 @@ eng_output_info_setup(void *info)
899 einfo->render_mode = EVAS_RENDER_MODE_BLOCKING; 899 einfo->render_mode = EVAS_RENDER_MODE_BLOCKING;
900} 900}
901 901
902static Render_Engine_Merge_Mode
903_eng_merge_mode_get(void)
904{
905 Render_Engine_Merge_Mode merge_mode = MERGE_SMART;
906 const char *s;
907
908 s = getenv("EVAS_GL_PARTIAL_MERGE");
909 if (s)
910 {
911 if ((!strcmp(s, "bounding")) || (!strcmp(s, "b")))
912 merge_mode = MERGE_BOUNDING;
913 else if ((!strcmp(s, "full")) || (!strcmp(s, "f")))
914 merge_mode = MERGE_FULL;
915 else if ((!strcmp(s, "smart")) || (!strcmp(s, "s")))
916 merge_mode = MERGE_SMART;
917 }
918
919 return merge_mode;
920}
921
922static void * 902static void *
923eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned int h) 903eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned int h)
924{ 904{
@@ -926,10 +906,8 @@ eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned in
926 Render_Engine *re = NULL; 906 Render_Engine *re = NULL;
927 Outbuf *ob; 907 Outbuf *ob;
928 Render_Engine_Swap_Mode swap_mode; 908 Render_Engine_Swap_Mode swap_mode;
929 Render_Engine_Merge_Mode merge_mode;
930 909
931 swap_mode = evas_render_engine_gl_swap_mode_get(info->info.swap_mode); 910 swap_mode = evas_render_engine_gl_swap_mode_get(info->info.swap_mode);
932 merge_mode = _eng_merge_mode_get();
933 911
934 if (!initted) 912 if (!initted)
935 { 913 {
@@ -984,7 +962,7 @@ eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned in
984 962
985 gl_wins++; 963 gl_wins++;
986 964
987 evas_render_engine_software_generic_merge_mode_set(&re->generic.software, merge_mode); 965 evas_render_engine_software_generic_merge_mode_set(&re->generic.software);
988 966
989 if (!initted) 967 if (!initted)
990 { 968 {
diff --git a/src/modules/evas/engines/gl_x11/evas_engine.c b/src/modules/evas/engines/gl_x11/evas_engine.c
index b64733b..924bb5a 100644
--- a/src/modules/evas/engines/gl_x11/evas_engine.c
+++ b/src/modules/evas/engines/gl_x11/evas_engine.c
@@ -1581,9 +1581,7 @@ eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned in
1581 Evas_Engine_Info_GL_X11 *info = in; 1581 Evas_Engine_Info_GL_X11 *info = in;
1582 Render_Engine *re = NULL; 1582 Render_Engine *re = NULL;
1583 Outbuf *ob = NULL; 1583 Outbuf *ob = NULL;
1584 Render_Engine_Merge_Mode merge_mode = MERGE_SMART;
1585 Render_Engine_Swap_Mode swap_mode; 1584 Render_Engine_Swap_Mode swap_mode;
1586 const char *s;
1587 1585
1588 swap_mode = evas_render_engine_gl_swap_mode_get(info->swap_mode); 1586 swap_mode = evas_render_engine_gl_swap_mode_get(info->swap_mode);
1589 1587
@@ -1669,20 +1667,7 @@ eng_output_setup(void *engine EINA_UNUSED, void *in, unsigned int w, unsigned in
1669 1667
1670 gl_wins++; 1668 gl_wins++;
1671 1669
1672 if ((s = getenv("EVAS_GL_PARTIAL_MERGE"))) 1670 evas_render_engine_software_generic_merge_mode_set(&re->generic.software);
1673 {
1674 if ((!strcmp(s, "bounding")) ||
1675 (!strcmp(s, "b")))
1676 merge_mode = MERGE_BOUNDING;
1677 else if ((!strcmp(s, "full")) ||
1678 (!strcmp(s, "f")))
1679 merge_mode = MERGE_FULL;
1680 else if ((!strcmp(s, "smart")) ||
1681 (!strcmp(s, "s")))
1682 merge_mode = MERGE_SMART;
1683 }
1684
1685 evas_render_engine_software_generic_merge_mode_set(&re->generic.software, merge_mode);
1686 1671
1687 if (!initted) 1672 if (!initted)
1688 { 1673 {
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 5db2a94..bf859dc 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
@@ -27,9 +27,9 @@ typedef enum _Outbuf_Depth
27 27
28typedef enum 28typedef enum
29{ 29{
30 MERGE_BOUNDING, 30 MERGE_BOUNDING = 1,
31 MERGE_FULL, 31 MERGE_FULL = 2,
32 MERGE_SMART 32 MERGE_SMART = 4
33} Render_Engine_Merge_Mode; 33} Render_Engine_Merge_Mode;
34 34
35typedef struct _Render_Output_Software_Generic Render_Output_Software_Generic; 35typedef struct _Render_Output_Software_Generic Render_Output_Software_Generic;
@@ -150,9 +150,22 @@ evas_render_engine_software_generic_clean(Render_Output_Software_Generic *re)
150} 150}
151 151
152static inline void 152static inline void
153evas_render_engine_software_generic_merge_mode_set(Render_Output_Software_Generic *re, 153evas_render_engine_software_generic_merge_mode_set(Render_Output_Software_Generic *re)
154 Render_Engine_Merge_Mode merge_mode)
155{ 154{
155 Render_Engine_Merge_Mode merge_mode = MERGE_SMART;
156 const char *s;
157
158 s = getenv("EVAS_GL_PARTIAL_MERGE");
159 if (s)
160 {
161 if ((!strcmp(s, "bounding")) || (!strcmp(s, "b")))
162 merge_mode = MERGE_BOUNDING;
163 else if ((!strcmp(s, "full")) || (!strcmp(s, "f")))
164 merge_mode = MERGE_FULL;
165 else if ((!strcmp(s, "smart")) || (!strcmp(s, "s")))
166 merge_mode = MERGE_SMART;
167 }
168
156 re->merge_mode = merge_mode; 169 re->merge_mode = merge_mode;
157} 170}
158 171
diff --git a/src/modules/evas/engines/software_x11/evas_engine.c b/src/modules/evas/engines/software_x11/evas_engine.c
index c2b2ec9..c1cab73 100644
--- a/src/modules/evas/engines/software_x11/evas_engine.c
+++ b/src/modules/evas/engines/software_x11/evas_engine.c
@@ -71,8 +71,6 @@ _output_xlib_setup(int w, int h, int rot, Display *disp, Drawable draw,
71{ 71{
72 Render_Engine *re; 72 Render_Engine *re;
73 Outbuf *ob; 73 Outbuf *ob;
74 Render_Engine_Merge_Mode merge_mode = MERGE_SMART;
75 const char *s;
76 74
77 if (!(re = calloc(1, sizeof(Render_Engine)))) return NULL; 75 if (!(re = calloc(1, sizeof(Render_Engine)))) return NULL;
78 76
@@ -113,20 +111,7 @@ _output_xlib_setup(int w, int h, int rot, Display *disp, Drawable draw,
113 w, h)) 111 w, h))
114 goto on_error; 112 goto on_error;
115 113
116 if ((s = getenv("EVAS_SOFTWARE_PARTIAL_MERGE"))) 114 evas_render_engine_software_generic_merge_mode_set(&re->generic);
117 {
118 if ((!strcmp(s, "bounding")) ||
119 (!strcmp(s, "b")))
120 merge_mode = MERGE_BOUNDING;
121 else if ((!strcmp(s, "full")) ||
122 (!strcmp(s, "f")))
123 merge_mode = MERGE_FULL;
124 else if ((!strcmp(s, "smart")) ||
125 (!strcmp(s, "s")))
126 merge_mode = MERGE_SMART;
127 }
128
129 evas_render_engine_software_generic_merge_mode_set(&re->generic, merge_mode);
130 115
131 return re; 116 return re;
132 117
diff --git a/src/modules/evas/engines/wayland_egl/evas_engine.c b/src/modules/evas/engines/wayland_egl/evas_engine.c
index 28c6203..f615acb 100644
--- a/src/modules/evas/engines/wayland_egl/evas_engine.c
+++ b/src/modules/evas/engines/wayland_egl/evas_engine.c
@@ -545,25 +545,6 @@ _eng_swap_mode_get(void)
545 return swap_mode; 545 return swap_mode;
546} 546}
547 547
548static Render_Engine_Merge_Mode
549_eng_merge_mode_get(void)
550{
551 Render_Engine_Merge_Mode merge = MERGE_SMART;
552 const char *s;
553
554 if ((s = getenv("EVAS_GL_PARTIAL_MERGE")))
555 {
556 if ((!strcmp(s, "bounding")) || (!strcmp(s, "b")))
557 merge = MERGE_BOUNDING;
558 else if ((!strcmp(s, "full")) || (!strcmp(s, "f")))
559 merge = MERGE_FULL;
560 else if ((!strcmp(s, "smart")) || (!strcmp(s, "s")))
561 merge = MERGE_SMART;
562 }
563
564 return merge;
565}
566
567static void * 548static void *
568eng_output_setup(void *engine EINA_UNUSED, void *info, unsigned int w, unsigned int h) 549eng_output_setup(void *engine EINA_UNUSED, void *info, unsigned int w, unsigned int h)
569{ 550{
@@ -571,10 +552,8 @@ eng_output_setup(void *engine EINA_UNUSED, void *info, unsigned int w, unsigned
571 Render_Engine *re; 552 Render_Engine *re;
572 Outbuf *ob; 553 Outbuf *ob;
573 Render_Engine_Swap_Mode swap_mode; 554 Render_Engine_Swap_Mode swap_mode;
574 Render_Engine_Merge_Mode merge;
575 555
576 swap_mode = _eng_swap_mode_get(); 556 swap_mode = _eng_swap_mode_get();
577 merge = _eng_merge_mode_get();
578 557
579 /* FIXME: Remove this line as soon as eglGetDisplay() autodetection 558 /* FIXME: Remove this line as soon as eglGetDisplay() autodetection
580 * gets fixed. Currently it is incorrectly detecting wl_display and 559 * gets fixed. Currently it is incorrectly detecting wl_display and
@@ -624,7 +603,7 @@ eng_output_setup(void *engine EINA_UNUSED, void *info, unsigned int w, unsigned
624 603
625 gl_wins++; 604 gl_wins++;
626 605
627 evas_render_engine_software_generic_merge_mode_set(&re->generic.software, merge); 606 evas_render_engine_software_generic_merge_mode_set(&re->generic.software);
628 607
629 if (!initted) 608 if (!initted)
630 { 609 {
diff --git a/src/modules/evas/engines/wayland_shm/evas_engine.c b/src/modules/evas/engines/wayland_shm/evas_engine.c
index e9ca14a..c82eb6a 100644
--- a/src/modules/evas/engines/wayland_shm/evas_engine.c
+++ b/src/modules/evas/engines/wayland_shm/evas_engine.c
@@ -33,8 +33,6 @@ _render_engine_swapbuf_setup(int w, int h, Evas_Engine_Info_Wayland *einfo)
33{ 33{
34 Render_Engine *re; 34 Render_Engine *re;
35 Outbuf *ob; 35 Outbuf *ob;
36 Render_Engine_Merge_Mode merge_mode = MERGE_SMART;
37 const char *s;
38 36
39 LOGFN(__FILE__, __LINE__, __FUNCTION__); 37 LOGFN(__FILE__, __LINE__, __FUNCTION__);
40 38
@@ -60,18 +58,7 @@ _render_engine_swapbuf_setup(int w, int h, Evas_Engine_Info_Wayland *einfo)
60 w, h)) 58 w, h))
61 goto err; 59 goto err;
62 60
63 s = getenv("EVAS_WAYLAND_PARTIAL_MERGE"); 61 evas_render_engine_software_generic_merge_mode_set(&re->generic);
64 if (s)
65 {
66 if ((!strcmp(s, "bounding")) || (!strcmp(s, "b")))
67 merge_mode = MERGE_BOUNDING;
68 else if ((!strcmp(s, "full")) || (!strcmp(s, "f")))
69 merge_mode = MERGE_FULL;
70 else if ((!strcmp(s, "smart")) || (!strcmp(s, "s")))
71 merge_mode = MERGE_SMART;
72 }
73
74 evas_render_engine_software_generic_merge_mode_set(&re->generic, merge_mode);
75 62
76 re->generic.ob->info = einfo; 63 re->generic.ob->info = einfo;
77 64