jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=68e6e46015ebd3b52fd360e532a635e133a364bf

commit 68e6e46015ebd3b52fd360e532a635e133a364bf
Author: Jean-Philippe Andre <jp.an...@samsung.com>
Date:   Fri Dec 9 10:48:35 2016 +0900

    evas: Fix compilation after @cedric's "fix"
    
    Don't forget git add!
---
 src/Makefile_Evas.am                               |  3 +
 .../engines/gl_generic/Evas_Engine_GL_Shared.h     | 80 ++++++++++++++++++++++
 .../software_generic/Evas_Engine_Software_Shared.h | 15 ++++
 3 files changed, 98 insertions(+)

diff --git a/src/Makefile_Evas.am b/src/Makefile_Evas.am
index 0bbe6a6..8b8186b 100644
--- a/src/Makefile_Evas.am
+++ b/src/Makefile_Evas.am
@@ -636,6 +636,7 @@ if EVAS_STATIC_BUILD_SOFTWARE_GENERIC
 lib_evas_libevas_la_SOURCES += \
 modules/evas/engines/software_generic/evas_engine.c \
 modules/evas/engines/software_generic/Evas_Engine_Software_Generic.h \
+modules/evas/engines/software_generic/Evas_Engine_Software_Shared.h \
 modules/evas/engines/software_generic/evas_native_tbm.c \
 modules/evas/engines/software_generic/evas_native_dmabuf.c \
 modules/evas/engines/software_generic/evas_ector_software_buffer.c \
@@ -654,6 +655,7 @@ $(install_enginesoftwaregenericpkgLTLIBRARIES): 
install-libLTLIBRARIES
 modules_evas_engines_software_generic_module_la_SOURCES = \
 modules/evas/engines/software_generic/evas_engine.c \
 modules/evas/engines/software_generic/Evas_Engine_Software_Generic.h \
+modules/evas/engines/software_generic/Evas_Engine_Software_Shared.h \
 modules/evas/engines/software_generic/evas_native_tbm.c \
 modules/evas/engines/software_generic/evas_native_dmabuf.c \
 modules/evas/engines/software_generic/evas_ector_software_buffer.c \
@@ -827,6 +829,7 @@ modules/evas/engines/gl_common/evas_gl_3d_shader.c: 
modules/evas/engines/gl_comm
 GL_GENERIC_SOURCES = \
 modules/evas/engines/gl_generic/evas_engine.c \
 modules/evas/engines/gl_generic/Evas_Engine_GL_Generic.h \
+modules/evas/engines/gl_generic/Evas_Engine_GL_Shared.h \
 modules/evas/engines/gl_generic/evas_ector_gl_buffer.c \
 modules/evas/engines/gl_generic/evas_ector_gl_image_buffer.c \
 modules/evas/engines/gl_generic/evas_ector_gl_rgbaimage_buffer.c \
diff --git a/src/modules/evas/engines/gl_generic/Evas_Engine_GL_Shared.h 
b/src/modules/evas/engines/gl_generic/Evas_Engine_GL_Shared.h
new file mode 100644
index 0000000..90b7a1d
--- /dev/null
+++ b/src/modules/evas/engines/gl_generic/Evas_Engine_GL_Shared.h
@@ -0,0 +1,80 @@
+#ifndef EVAS_ENGINE_GL_SHARED_H
+#define EVAS_ENGINE_GL_SHARED_H
+
+#include "../software_generic/Evas_Engine_Software_Shared.h"
+
+typedef enum _Evas_Engine_Info_Gl_Swap_Mode
+{
+   EVAS_ENGINE_GL_SWAP_MODE_AUTO = 0,
+   EVAS_ENGINE_GL_SWAP_MODE_FULL = 1,
+   EVAS_ENGINE_GL_SWAP_MODE_COPY = 2,
+   EVAS_ENGINE_GL_SWAP_MODE_DOUBLE = 3,
+   EVAS_ENGINE_GL_SWAP_MODE_TRIPLE = 4,
+   EVAS_ENGINE_GL_SWAP_MODE_QUADRUPLE = 5
+} Evas_Engine_Info_Gl_Swap_Mode;
+
+static inline Render_Engine_Swap_Mode
+evas_render_engine_gl_swap_mode_get(Evas_Engine_Info_Gl_Swap_Mode 
info_swap_mode)
+{
+   Render_Engine_Swap_Mode swap_mode = MODE_FULL;
+   const char *s;
+
+   s = getenv("EVAS_GL_SWAP_MODE");
+   if (s)
+     {
+        if ((!strcasecmp(s, "full")) || (!strcasecmp(s, "f")))
+          swap_mode = MODE_FULL;
+        else if ((!strcasecmp(s, "copy")) || (!strcasecmp(s, "c")))
+          swap_mode = MODE_COPY;
+        else if ((!strcasecmp(s, "double")) ||
+                 (!strcasecmp(s, "d")) || (!strcasecmp(s, "2")))
+          swap_mode = MODE_DOUBLE;
+        else if ((!strcasecmp(s, "triple")) ||
+                 (!strcasecmp(s, "t")) || (!strcasecmp(s, "3")))
+          swap_mode = MODE_TRIPLE;
+        else if ((!strcasecmp(s, "quadruple")) ||
+                 (!strcasecmp(s, "q")) || (!strcasecmp(s, "4")))
+          swap_mode = MODE_QUADRUPLE;
+     }
+   else
+     {
+// in most gl implementations - egl and glx here that we care about the TEND
+// to either swap or copy backbuffer and front buffer, but strictly that is
+// not true. technically backbuffer content is totally undefined after a swap
+// and thus you MUST re-render all of it, thus MODE_FULL
+        swap_mode = MODE_FULL;
+// BUT... reality is that lmost every implementation copies or swaps so
+// triple buffer mode can be used as it is a superset of double buffer and
+// copy (though using those explicitly is more efficient). so let's play with
+// triple buffer mdoe as a default and see.
+//        re->mode = MODE_TRIPLE;
+// XXX: note - the above seems to break on some older intel chipsets and
+// drivers. it seems we CANT depend on backbuffer staying around. bugger!
+        switch (info_swap_mode)
+          {
+           case EVAS_ENGINE_GL_SWAP_MODE_FULL:
+             swap_mode = MODE_FULL;
+             break;
+           case EVAS_ENGINE_GL_SWAP_MODE_COPY:
+             swap_mode = MODE_COPY;
+             break;
+           case EVAS_ENGINE_GL_SWAP_MODE_DOUBLE:
+             swap_mode = MODE_DOUBLE;
+             break;
+           case EVAS_ENGINE_GL_SWAP_MODE_TRIPLE:
+             swap_mode = MODE_TRIPLE;
+             break;
+           case EVAS_ENGINE_GL_SWAP_MODE_QUADRUPLE:
+             swap_mode = MODE_QUADRUPLE;
+             break;
+           default:
+             swap_mode = MODE_AUTO;
+             break;
+          }
+     }
+
+   return swap_mode;
+}
+
+#endif
+
diff --git 
a/src/modules/evas/engines/software_generic/Evas_Engine_Software_Shared.h 
b/src/modules/evas/engines/software_generic/Evas_Engine_Software_Shared.h
new file mode 100644
index 0000000..4bb64cf
--- /dev/null
+++ b/src/modules/evas/engines/software_generic/Evas_Engine_Software_Shared.h
@@ -0,0 +1,15 @@
+#ifndef EVAS_ENGINE_SOFTWARE_SHARED_H
+#define EVAS_ENGINE_SOFTWARE_SHARED_H
+
+typedef enum
+{
+   MODE_FULL,
+   MODE_COPY,
+   MODE_DOUBLE,
+   MODE_TRIPLE,
+   MODE_QUADRUPLE,
+   MODE_AUTO
+} Render_Engine_Swap_Mode;
+
+#endif
+

-- 


Reply via email to