[M120 Migration] NUI related patch 99/307099/3
authorQiang Ji <qiang.ji@samsung.com>
Mon, 4 Mar 2024 08:40:37 +0000 (16:40 +0800)
committerBot Blink <blinkbot@samsung.com>
Tue, 5 Mar 2024 07:12:41 +0000 (07:12 +0000)
1. Fix rotation issue for NUI app
Ecore_Evas can't sense that NUI app has rotated,
so get the wrong value from ecore_evas_rotation_get API

refs:
https://review.tizen.org/gerrit/#/c/platform/framework/web/chromium-efl/+/305631/

2. Fix NUI video can't play issue
NUI app use wayland window but video hole
set as evas window default.

refs:
https://review.tizen.org/gerrit/#/c/platform/framework/web/chromium-efl/+/295315/

3. Fix crash

refs:
https://review.tizen.org/gerrit/#/c/platform/framework/web/chromium-efl/+/297840/

Change-Id: Id043740ee26661581c754b5b2cbf71f65130f7ee
Signed-off-by: Qiang Ji <qiang.ji@samsung.com>
cc/trees/draw_property_utils.cc
content/browser/web_contents/web_contents_view_aura.cc
tizen_src/chromium_impl/media/base/tizen/video_plane_controller.cc
tizen_src/chromium_impl/media/base/tizen/video_plane_controller.h
tizen_src/chromium_impl/media/filters/media_player_esplusplayer.cc
tizen_src/ewk/efl_integration/eweb_view.cc
tizen_src/ewk/efl_integration/public/ewk_view.cc

index f55ffb1..c17fc58 100644 (file)
@@ -255,9 +255,10 @@ ConditionalClip ComputeAccumulatedClip(PropertyTrees* property_trees,
   // contributing layer that escapes clip, this will find the nearest ancestor
   // that doesn't.
   while (target_node->clip_id > clip_node->id ||
-         property_trees->effect_tree()
-             .GetRenderSurface(target_node->id)
-             ->has_contributing_layer_that_escapes_clip()) {
+         (property_trees->effect_tree().GetRenderSurface(target_node->id) &&
+          property_trees->effect_tree()
+              .GetRenderSurface(target_node->id)
+              ->has_contributing_layer_that_escapes_clip())) {
     target_node = effect_tree.Node(target_node->target_id);
   }
 
index 4831918..ca6e320 100644 (file)
 #include "wrt/public/browser/wrt.h"
 #endif
 
+#if BUILDFLAG(IS_TIZEN_TV)
+#include "ewk/efl_integration/common/application_type.h"
+#include "ui/ozone/platform/efl/efl_screen.h"
+#endif
+
+#if defined(TIZEN_TBM_SUPPORT)
+#include "ui/compositor/compositor.h"
+#endif
+
 namespace content {
 
 std::unique_ptr<WebContentsView> CreateWebContentsView(
@@ -919,7 +928,21 @@ void WebContentsViewAura::Focus() {
 #if BUILDFLAG(IS_TIZEN)
 void WebContentsViewAura::SetOrientation(int orientation) {
   LOG(INFO) << __FUNCTION__ << " " << orientation;
-  NOTIMPLEMENTED();
+
+  RenderWidgetHostViewAura* rwhv_aura = static_cast<RenderWidgetHostViewAura*>(
+      web_contents_->GetRenderWidgetHostView());
+  if (rwhv_aura) {
+#if defined(TIZEN_TBM_SUPPORT)
+    if (rwhv_aura->GetCompositor() &&
+        rwhv_aura->GetCompositor()->use_tbm_surface_for_offscreen_rendering()) {
+      display::DeviceDisplayInfoEfl display_info;
+      display_info.SetRotationDegrees(orientation);
+    }
+#endif
+  }
+
+  TRACE_EVENT1("viz", "WebContentsViewAura::SetOrientation", "orientation", orientation);
+  orientation_ = orientation;
 }
 #endif
 
index 01f35de..582fbe1 100644 (file)
@@ -13,6 +13,7 @@ namespace media {
 void* VideoPlaneController::main_window_handle_ = nullptr;
 VideoPlaneController::RenderingMode VideoPlaneController::rendering_mode_ =
     VideoPlaneController::RenderingMode::OFFSCREEN;
+bool VideoPlaneController::use_wayland_window = false;
 
 VideoPlaneController::VideoPlaneController() : should_crop_video_(false) {}
 
index ccfc550..3520722 100644 (file)
@@ -26,6 +26,12 @@ class MEDIA_EXPORT VideoPlaneController {
   }
   static RenderingMode rendering_mode() { return rendering_mode_; }
 
+  static void set_use_wayland_window(bool use) { use_wayland_window = use; }
+
+  static bool get_use_wayland_window() { return use_wayland_window; }
+
+  static bool use_wayland_window;
+
   VideoPlaneController();
   virtual ~VideoPlaneController();
 
index 4afa7e3..d7bd803 100644 (file)
@@ -1407,7 +1407,8 @@ void MediaPlayerESPlusPlayer::PrepareVideoHole() {
   LOG(INFO) << __func__ << " set ESPLUSPLAYER_DISPLAY_TYPE_OVERLAY";
   int player_error = ESPLUSPLAYER_ERROR_TYPE_NONE;
   if (video_plane_controller_->rendering_mode() ==
-      VideoPlaneController::RenderingMode::OFFSCREEN) {
+      VideoPlaneController::RenderingMode::OFFSCREEN &&
+      !video_plane_controller_->get_use_wayland_window()) {
     player_error = esplusplayer_set_display(
         esplayer_, ESPLUSPLAYER_DISPLAY_TYPE_OVERLAY,
         video_plane_controller_->GetVideoPlaneHandle());
index 7e64d85..23037c1 100644 (file)
@@ -166,6 +166,21 @@ void GetEinaRectFromGfxRect(const gfx::Rect& gfx_rect,
 #if BUILDFLAG(IS_TIZEN)
 static Eina_Bool RotateWindowCb(void* data, int type, void* event) {
   auto wv = static_cast<EWebView*>(data);
+#if defined(TIZEN_TBM_SUPPORT)
+  if (wv->rwhva() && wv->rwhva()->GetCompositor() &&
+      wv->rwhva()->GetCompositor()->use_tbm_surface_for_offscreen_rendering()) {
+    Ecore_Wl2_Event_Window_Rotation* rotateEvent =
+        static_cast<Ecore_Wl2_Event_Window_Rotation*>(event);
+    if (rotateEvent != nullptr) {
+      LOG(INFO) << "For NUI app, new ori " << rotateEvent->angle;
+      wv->SetOrientation(rotateEvent->angle);
+    }
+    return ECORE_CALLBACK_PASS_ON;
+  }
+#endif
+  LOG(INFO) << "New ori "
+            << ecore_evas_rotation_get(
+                   ecore_evas_ecore_evas_get(wv->GetEvas()));
   wv->SetOrientation(
       ecore_evas_rotation_get(ecore_evas_ecore_evas_get(wv->GetEvas())));
   return ECORE_CALLBACK_PASS_ON;
index a96a0cb..61f536b 100644 (file)
@@ -1653,6 +1653,9 @@ void ewk_view_offscreen_rendering_enabled_set(Evas_Object* o, Eina_Bool enabled)
 #if defined(TIZEN_TBM_SUPPORT)
   EWK_VIEW_IMPL_GET_OR_RETURN(o, impl);
   impl->SetOffscreenRendering(enabled);
+#if defined(TIZEN_VIDEO_HOLE)
+  media::VideoPlaneController::set_use_wayland_window(true);
+#endif
 #else
   LOG_EWK_API_MOCKUP();
 #endif