Apply GL backend setting to WebProcess
authorYunchan Cho <yunchan.cho@samsung.com>
Wed, 23 Jan 2013 09:16:08 +0000 (18:16 +0900)
committerGerrit Code Review <gerrit2@kim11>
Wed, 23 Jan 2013 10:15:59 +0000 (19:15 +0900)
[Issue#] N/A
[Problem] WebProcess is crashed when processing WebGL
[Cause] WRT forked WebProcess, not applying ENV variables regarding gl backend.
[Solution] GL backend setting is moved in front of forking WebProcess in main function
[SCMRequest] N/A

Change-Id: I24e359807d94868d23487ae9e42b161a0c771896

src/wrt-client/wrt-client.cpp

index d3af09a..e69a1f3 100755 (executable)
@@ -689,6 +689,23 @@ int main(int argc,
         // Set log tagging
         DPL::Log::LogSystemSingleton::Instance().SetTag("WRT");
 
+        // set evas backend type
+        if (!getenv("ELM_ENGINE")) {
+            if (!setenv("ELM_ENGINE", "gl", 1)) {
+                    LogDebug("Enable backend");
+            }
+        }
+        else {
+            LogDebug("ELM_ENGINE : " << getenv("ELM_ENGINE"));
+        }
+
+    #ifndef TIZEN_PUBLIC
+        setenv("COREGL_FASTPATH", "1", 1);
+    #endif
+        setenv("CAIRO_GL_COMPOSITOR", "msaa", 1);
+        setenv("CAIRO_GL_LAZY_FLUSHING", "yes", 1);
+        setenv("ELM_IMAGE_CACHE", "0", 1);
+
         // This code is to fork a web process without exec.
         std::string tizenId = WrtClient::getTizenIdFromArgument(argc, argv);
 
@@ -711,22 +728,6 @@ int main(int argc,
         // the output may not be flushed).
         setlinebuf(stdout);
 
-        // set evas backend type
-        if (!getenv("ELM_ENGINE")) {
-            if (!setenv("ELM_ENGINE", "gl", 1)) {
-                    LogDebug("Enable backend");
-            }
-        }
-        else {
-            LogDebug("ELM_ENGINE : " << getenv("ELM_ENGINE"));
-        }
-
-    #ifndef TIZEN_PUBLIC
-        setenv("COREGL_FASTPATH", "1", 1);
-    #endif
-        setenv("CAIRO_GL_COMPOSITOR", "msaa", 1);
-        setenv("CAIRO_GL_LAZY_FLUSHING", "yes", 1);
-        setenv("ELM_IMAGE_CACHE", "0", 1);
 
         WrtClient app(argc, argv);