[M126 Migration] Apply SW backend related patches 85/319485/3
authorchiragmaheshwari <c.maheshwari@samsung.com>
Thu, 24 Oct 2024 06:44:52 +0000 (12:14 +0530)
committerChirag Maheshwari <c.maheshwari@samsung.com>
Thu, 24 Oct 2024 07:17:10 +0000 (07:17 +0000)
Adding sw backend related changes to fix issues with Web app launch.

References:
- https://review.tizen.org/gerrit/317838
- https://review.tizen.org/gerrit/319331

Change-Id: I567623d2472eab25b5419f4721756b354f5d6d77
Signed-off-by: chiragmaheshwari <c.maheshwari@samsung.com>
tizen_src/chromium_impl/ui/ozone/platform/efl/efl_window.cc

index 186ada5493de2b6acef580ef9b28018922621c7e..5b15c10de49c56a6f944b472e43ac7710fae6954 100644 (file)
@@ -63,6 +63,7 @@ bool g_evas_init = false;
 }  // namespace
 
 Ecore_Evas* prepared_ee = nullptr;
+Ecore_Evas* dummy_hw_ee = nullptr;
 
 #if BUILDFLAG(IS_TIZEN_TV)
 bool EflWindow::is_cursor_initialized_ = false;
@@ -71,7 +72,7 @@ bool EflWindow::is_cursor_initialized_ = false;
 // static
 Ecore_Evas* EflWindow::CreateEvasObject(const gfx::Rect& bounds) {
 #if defined(USE_WAYLAND)
-  return ecore_evas_new("wayland_egl", 0, 0, bounds.width(), bounds.height(),
+  return ecore_evas_new("wayland_shm", 0, 0, bounds.width(), bounds.height(),
                         nullptr);
 #else
   return ecore_evas_new("opengl_x11", 0, 0, bounds.width(), bounds.height(),
@@ -111,6 +112,11 @@ EflWindow::~EflWindow() {
   if (ee_)
     ecore_evas_free(ee_);
 
+  if (dummy_hw_ee) {
+    ecore_evas_free(dummy_hw_ee);
+    dummy_hw_ee = nullptr;
+  }
+
 #if defined(TIZEN_VIDEO_HOLE)
   media::VideoPlaneController::SetSharedVideoWindowHandle(
       nullptr, media::VideoPlaneController::RenderingMode::ONSCREEN);
@@ -383,6 +389,18 @@ void EflWindow::Initialize(const PlatformWindowInitProperties& properties) {
     }
   }
 
+  // In the case of onscreen rendering, if Evas engine creates an egl window
+  // then two egl windows will be created overall and it causes the egl
+  // specification violation. So we use sw backend for main window rendering.
+  // In the case of a Popup, it appears as a separate HW window. When this
+  // Popup is closed, |eglTerminate| is called within the Evas engine. (When
+  // the last window is released, the EGL resources are freed in the Evas
+  // engine.) This will release all EGL resources for the entire process and it
+  // causes rendering issue. To prevent this, creates dummy hw window.
+  if (!dummy_hw_ee) {
+    dummy_hw_ee = ecore_evas_new("wayland_egl", 0, 0, 1, 1, nullptr);
+  }
+
   evas_ = ecore_evas_get(ee_);
 
   // Evas engine creates it's own egl window and egl surface to render.