Fix main thread block issue after manual rotation. 05/305405/4
authorYongGeol Jung <yg48.jung@samsung.com>
Thu, 1 Feb 2024 07:13:01 +0000 (23:13 -0800)
committerBot Blink <blinkbot@samsung.com>
Tue, 13 Feb 2024 08:03:26 +0000 (08:03 +0000)
Currently, when rotating on a static page, there is a problem that the screen
stops for about 10 seconds from the second rotation. It seems that the main
thread is blocked during the dequeue process when a screen lock occurs while
performing manual rotation again on a previously used buffer.
We can avoid this problem by forcibly refreshing the screen once more after
manual rotation is complete.

Change-Id: I396f05109d641ab49d41862f729c30d7262553a8
Signed-off-by: YongGeol Jung <yg48.jung@samsung.com>
tizen_src/chromium_impl/content/browser/renderer_host/render_widget_host_view_efl.cc
tizen_src/chromium_impl/content/browser/renderer_host/render_widget_host_view_efl.h

index 260f7ff6d337a8f904c7e5c1ae54d6b540a40f14..8616f6eff7fe04b6d8ccd593559dd8b8e07c5b0f 100644 (file)
@@ -275,6 +275,8 @@ void RenderWidgetHostViewEfl::InitAsChild(gfx::NativeView /* parent_view */) {
                                  OnMouseMove, this);
   evas_object_event_callback_add(content_image_, EVAS_CALLBACK_MOUSE_OUT,
                                  OnMouseOut, this);
+  evas_object_event_callback_add(content_image_, EVAS_CALLBACK_MOUSE_IN,
+                                 OnMouseIn, this);
   evas_object_event_callback_add(content_image_, EVAS_CALLBACK_MOUSE_WHEEL,
                                  OnMouseWheel, this);
   evas_object_event_callback_add(content_image_, EVAS_CALLBACK_KEY_DOWN,
@@ -359,6 +361,8 @@ RenderWidgetHostViewEfl::~RenderWidgetHostViewEfl() {
                                  OnMouseMove);
   evas_object_event_callback_del(content_image_, EVAS_CALLBACK_MOUSE_OUT,
                                  OnMouseOut);
+  evas_object_event_callback_del(content_image_, EVAS_CALLBACK_MOUSE_IN,
+                                 OnMouseIn);
   evas_object_event_callback_del(content_image_, EVAS_CALLBACK_MOUSE_WHEEL,
                                  OnMouseWheel);
   evas_object_event_callback_del(content_image_, EVAS_CALLBACK_KEY_DOWN,
@@ -2289,6 +2293,27 @@ void RenderWidgetHostViewEfl::OnMouseOut(void* data,
   rwhv->host_->ForwardMouseEvent(event);
 }
 
+void RenderWidgetHostViewEfl::OnMouseIn(void* data,
+                                        Evas* evas,
+                                        Evas_Object* obj,
+                                        void* event_info) {
+  LOG(INFO) << "OnMouseIn";
+#if defined(OS_TIZEN_TV_PRODUCT)
+  if (content::IsWebBrowser()) {
+    // When rotating on a static page, there is a problem that the screen stops
+    // for about 10 seconds from the second rotation. It seems that the main
+    // thread is blocked during the dequeue process when a screen lock occurs
+    // while performing manual rotation again on a previously used buffer. We
+    // can avoid this problem by forcibly refreshing the screen once more after
+    // manual rotation is complete. In the case of browser, "mouse in" event
+    // is occurred at this timing.
+    RenderWidgetHostViewEfl* rwhv =
+        static_cast<RenderWidgetHostViewEfl*>(data);
+    rwhv->Invalidate(false);
+  }
+#endif
+}
+
 void RenderWidgetHostViewEfl::OnMultiTouchDownEvent(void* data,
                                                     Evas* evas,
                                                     Evas_Object* obj,
@@ -3433,6 +3458,8 @@ void RenderWidgetHostViewEfl::SetMouseEventsEnabled(bool enable) {
                                  OnMouseMove);
   evas_object_event_callback_del(content_image_, EVAS_CALLBACK_MOUSE_OUT,
                                  OnMouseOut);
+  evas_object_event_callback_del(content_image_, EVAS_CALLBACK_MOUSE_IN,
+                                 OnMouseIn);
   evas_object_event_callback_del(content_image_, EVAS_CALLBACK_MOUSE_WHEEL,
                                  OnMouseWheel);
   if (enable) {
@@ -3444,6 +3471,8 @@ void RenderWidgetHostViewEfl::SetMouseEventsEnabled(bool enable) {
                                    OnMouseMove, this);
     evas_object_event_callback_add(content_image_, EVAS_CALLBACK_MOUSE_OUT,
                                    OnMouseOut, this);
+    evas_object_event_callback_add(content_image_, EVAS_CALLBACK_MOUSE_IN,
+                                   OnMouseIn, this);
     evas_object_event_callback_add(content_image_, EVAS_CALLBACK_MOUSE_WHEEL,
                                    OnMouseWheel, this);
   }
index 5f0151ac6e445df333e296f9107d0bd2fbd00dd4..c82480226cd01b36011c7251942b50e934280650 100644 (file)
@@ -511,6 +511,7 @@ class CONTENT_EXPORT RenderWidgetHostViewEfl
   static void OnMouseUp(void* data, Evas*, Evas_Object*, void*);
   static void OnMouseMove(void* data, Evas*, Evas_Object*, void*);
   static void OnMouseOut(void* data, Evas*, Evas_Object*, void*);
+  static void OnMouseIn(void* data, Evas*, Evas_Object*, void*);
   static void OnMouseWheel(void* data, Evas*, Evas_Object*, void*);
   static void OnKeyDown(void*, Evas*, Evas_Object*, void*);
   static void OnKeyUp(void*, Evas*, Evas_Object*, void*);