Change evas gl option to option bits.
authorAron Kim <aron.kim@samsung.com>
Mon, 2 Nov 2015 11:04:24 +0000 (20:04 +0900)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 07:55:23 +0000 (07:55 +0000)
[Problem] efl version >= 1.13.2 deprecates mem optimize
environment flags.

[Solution] Add efl mem optimize flags to option bit.
Environment variables for evas surface are not supported
from efl 1.13.2. Environment variables are supported only
for evas engine. With mem optimize option for evas surface,
intermediate buffers created by evas are generated on demand.
16MB 3D memory is reduced.
Original commit: http://165.213.202.130/gerrit/#/c/77299/

Bug: http://107.108.218.239/bugzilla/show_bug.cgi?id=14879

Reviewed by: a1.gomes, d.waslicki, dhyuna.ko, hyuki.kim, prashant.n, sns.park

Change-Id: I1c5ca9dfdd1ee8c4cc7cf27f14831112b8d26c1d
Signed-off-by: Aron Kim <aron.kim@samsung.com>
tizen_src/chromium_impl/content/browser/renderer_host/render_widget_host_view_efl.cc

index 79944d9..308565a 100755 (executable)
 #define MAX_SURFACE_WIDTH_EGL 4096 //max supported Framebuffer width
 #define MAX_SURFACE_HEIGHT_EGL 4096 //max supported Framebuffer height
 
+// These two constants are redefinitions of the original constants defined
+// in evas_common.c. These are not supposed to be used directly by apps,
+// but we do this because of chromium uses fbo for direct rendering.
+#define EVAS_GL_OPTIONS_DIRECT_MEMORY_OPTIMIZE (1 << 12)
+#define EVAS_GL_OPTIONS_DIRECT_OVERRIDE (1 << 13)
+
 namespace content {
 
 namespace {
@@ -537,11 +543,10 @@ void RenderWidgetHostViewEfl::EvasObjectImagePixelsGetCallback(void* data, Evas_
 void RenderWidgetHostViewEfl::Init_EvasGL(int width, int height) {
   CHECK(width > 0 && height > 0);
 
-  setenv("EVAS_GL_DIRECT_OVERRIDE", "1", 1);
-  setenv("EVAS_GL_DIRECT_MEM_OPT", "1",1);
-
   evas_gl_config_ = evas_gl_config_new();
-  evas_gl_config_->options_bits = EVAS_GL_OPTIONS_DIRECT;
+  evas_gl_config_->options_bits = (Evas_GL_Options_Bits)(
+      EVAS_GL_OPTIONS_DIRECT | EVAS_GL_OPTIONS_DIRECT_MEMORY_OPTIMIZE |
+      EVAS_GL_OPTIONS_DIRECT_OVERRIDE);
   evas_gl_config_->color_format = EVAS_GL_RGBA_8888;
   evas_gl_config_->depth_bits = EVAS_GL_DEPTH_BIT_24;
   evas_gl_config_->stencil_bits = EVAS_GL_STENCIL_BIT_8;