[Ozone Wayland] Fix for evasgl issue/crash in efl_webview_app/mini_browser on Note4
authorChandan Padhi <c.padhi@samsung.com>
Fri, 29 May 2015 13:12:41 +0000 (18:42 +0530)
committerYoungsoo Choi <kenshin.choi@samsung.com>
Tue, 10 Jul 2018 06:57:09 +0000 (06:57 +0000)
Below evasl gl errors are seen when we run efl_webview_app/mini_browser on Note4:
ERR<5058>:EvasGL modules/evas/engines/gl_common/evas_gl_api_ext.c:327 evgl_api_ext_init()
glGetString returned NULL! Something is very wrong...
ERR<5058>:EvasGL modules/evas/engines/gl_common/evas_gl_core.c:1437
evgl_engine_init() Extensions failed to load. This shouldn't happen, Evas GL load fails.
ERR<5058>:evas_main lib/evas/canvas/evas_gl.c:367 evas_gl_context_version_create() Failed
creating a context from the engine.
[0518/235828:FATAL:gl_shared_context_efl.cc(33)] GLSharedContextEflPrivate(): Create evas
gl context Fail

However, these errors are not seen for ubrowser.

On Note4, tt seems like all gl/egl initialization must be completed
before the evas_object is created and its evas canvas is used to
created an Evas GL object. Platform team may explain more on this.

In chromium-efl, this initialization is done in the ewk_context_default_get() call.
In case of efl_webview_app/mini_browser, ewk_context_default_get() call is made after the
main window gets created whereas its called before main window creation for ubrowser.

Bug: http://web.sec.samsung.net/bugzilla/show_bug.cgi?id=12492
Reviewed by: DaeHyun Ko, Siba Samal

Change-Id: Iceec7d29c7057cd00d62453c2fd753b876c096cd
Signed-off-by: Chandan Padhi <c.padhi@samsung.com>
tizen_src/ewk/efl_integration/efl_integration.gypi
tizen_src/ewk/efl_integration/public/ewk_main.cc
tizen_src/ewk/efl_webview_app/app.c
tizen_src/ewk/efl_webview_app/mini_browser.c

index 4bcf1a1..e14c13c 100644 (file)
       '-fvisibility=hidden',
     ],
     'conditions': [
-      ['use_wayland==0', {
-        'defines': [
-          'HAVE_ECORE_X=<!(if pkg-config ecore-x; then echo 1; fi)'
-        ],
-      }],
       ['building_for_tizen==1', {
         'sources/': [
           [ 'exclude', 'browser/sound_effect\\.(cc|h)$' ],
index 5a787de..d5b6afc 100644 (file)
@@ -90,7 +90,12 @@ int ewk_init(void)
       goto error_ecore_imf;
   }
 
-#if defined(HAVE_ECORE_X)
+#if defined(USE_WAYLAND)
+  if (!ecore_wl_init(0)) {
+      CRITICAL("could not init ecore_wl.");
+      goto error_ecore_wl;
+  }
+#else
   if (!ecore_x_init(0)) {
       CRITICAL("could not init ecore_x.");
       goto error_ecore_x;
@@ -118,7 +123,10 @@ int ewk_init(void)
   return ++_ewkInitCount;
 
 error_edje:
-#if defined(HAVE_ECORE_X)
+#if defined(USE_WAYLAND)
+  ecore_wl_shutdown();
+error_ecore_wl:
+#else
   ecore_x_shutdown();
 error_ecore_x:
 #endif
@@ -146,7 +154,9 @@ int ewk_shutdown(void)
   _ewk_shutdown_web_engine();
 
   edje_shutdown();
-#if defined(HAVE_ECORE_X)
+#if defined(USE_WAYLAND)
+  ecore_wl_shutdown();
+#else
   ecore_x_shutdown();
 #endif
   ecore_imf_shutdown();
index a6dcdc8..7e0e2f4 100644 (file)
@@ -407,6 +407,13 @@ int main(int argc, char** argv)
     start_url = strdup("http://www.google.com");
   }
 
+  Ewk_Context* context = NULL;
+
+  // TODO : ewk content creation for incognito mode also has to be moved here.
+  if (incognito == EINA_FALSE) {
+    context = ewk_context_default_get();
+  }
+
   int width = 800;
   int height = 600;
 
@@ -437,15 +444,12 @@ int main(int argc, char** argv)
     ecore_evas_size_base_set(ee, width, height);
   }
 
-  Ewk_Context* context = NULL;
-
   if (incognito == EINA_TRUE) {
     fprintf(stderr, "Creating incognito web view\n");
     view = ewk_view_add_in_incognito_mode(e);
     context = ewk_view_context_get(view);
   } else {
     fprintf(stderr, "Creating normal web view\n");
-    context = ewk_context_default_get();
     view = ewk_view_add_with_context(e, context);
   }
 
index 77a6428..3a9fded 100755 (executable)
@@ -118,6 +118,7 @@ typedef struct
   Eina_Stringshare *popup_url;
   Ewk_Geolocation_Permission_Request* geolRequest;
   Ewk_User_Media_Permission_Request* userMediaRequest;
+  Ewk_Context* context;
 } app_data;
 
 // Added to Support customized context menu
@@ -328,7 +329,7 @@ Evas_Object* _create_view(Evas_Object *parent, app_data *data)
   int width, height;
   evas_object_geometry_get(parent, NULL, NULL, &width, &height);
 
-  Evas_Object *webview = ewk_view_add_with_context(evas_object_evas_get(parent), ewk_context_default_get() );
+  Evas_Object *webview = ewk_view_add_with_context(evas_object_evas_get(parent), data->context);
   evas_object_resize(webview, width, height - TOOL_BOX_HEIGHT);
 
   evas_object_show(webview);
@@ -651,12 +652,13 @@ static bool __br_app_create(void *data)
 
   app_data *ad = (app_data *) data;
 
+  ad->context = ewk_context_default_get();
+
   ad->main_window = _create_main_window(ad);
 
   // All ewk things go here
   ad->e = evas_object_evas_get (ad->main_window);
 
-
   // Create view and tool bar
   _create_view(ad->main_window, ad);