fixup! Create dummy window to prevent |eglTerminate| call after closing popup window. 79/320179/1
authorsidpaswan <s.paswan@samsung.com>
Mon, 28 Oct 2024 13:52:33 +0000 (19:22 +0530)
committerUzair Jaleel <uzair.jaleel@samsung.com>
Fri, 8 Nov 2024 11:38:54 +0000 (11:38 +0000)
Change-Id: Ib21331a91ed780c46fe562ccc5b421f819c7247f
Signed-off-by: sidpaswan <s.paswan@samsung.com>
(cherry picked from commit 7bca9fc4ac60c0611d187cfb0aa5c28b0ff9f1d8)

tizen_src/chromium_impl/ui/ozone/platform/efl/efl_window.cc
tizen_src/chromium_impl/ui/ozone/platform/efl/efl_window_manager.cc
tizen_src/chromium_impl/ui/ozone/platform/efl/efl_window_manager.h

index 5b15c10de49c56a6f944b472e43ac7710fae6954..97c6533c6c58fd5979a927a265db1a57fb8c2013 100644 (file)
@@ -63,7 +63,6 @@ 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;
@@ -112,11 +111,6 @@ 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);
@@ -389,18 +383,6 @@ 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.
index 76012a1cec720b6f3970e19ef512e44b73d2def9..8ccc90e4b6b1e53caf000d5fc386d5c008a0c109 100644 (file)
@@ -8,8 +8,24 @@
 
 namespace ui {
 
-EflWindowManager::EflWindowManager() = default;
-EflWindowManager::~EflWindowManager() = default;
+EflWindowManager::EflWindowManager() {
+  // 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.
+  dummy_hw_ee_ = ecore_evas_new("wayland_egl", 0, 0, 1, 1, nullptr);
+}
+
+EflWindowManager::~EflWindowManager() {
+  if (dummy_hw_ee_) {
+    ecore_evas_free(dummy_hw_ee_);
+    dummy_hw_ee_ = nullptr;
+  }
+}
 
 void EflWindowManager::AddWindow(EflWindow* window, Evas_Object* eo) {
   window_map_[eo] = window;
index 39dff103ca8039e37e69f6777fce5aa8c6570590..9e3b3431b09ff4e42a2e18d4b0a39a2ae1d55358 100644 (file)
@@ -38,6 +38,7 @@ class EflWindowManager {
   EflWindow* located_events_grabber() const { return located_events_grabber_; }
 
  private:
+  Ecore_Evas* dummy_hw_ee_ = nullptr;
   base::flat_map<Evas_Object*, EflWindow*> window_map_;
   EflWindow* located_events_grabber_ = nullptr;
 };