chromium84: Add a delay to agl ready event 59/26459/2 12.90.0 marlin/12.90.0 marlin_12.90.0
authorRoger Zanoni <rzanoni@igalia.com>
Fri, 25 Jun 2021 09:13:51 +0000 (11:13 +0200)
committerJan-Simon Moeller <jsmoeller@linuxfoundation.org>
Tue, 29 Jun 2021 22:05:59 +0000 (22:05 +0000)
Delay ready() to ensure that all the window and surfaces setup
is done before notifying the compositor

There's a work in progress for enabling wam to display multiple
surfaces for a single widget, which would eliminate the chain
loading that currently causes this issue.

This change includes a temporary patch that should be removed
once wam changes are integrated.

Bug-AGL: SPEC-3799

Signed-off-by: Roger Zanoni <rzanoni@igalia.com>
Change-Id: I9945af60077a79d56052c3fdb358e9fed44874e6

recipes-wam/chromium/chromium84_git.bb
recipes-wam/chromium/files/add-a-delay-to-agl-ready-event.patch [new file with mode: 0644]

index 5846d38..aef9e2e 100644 (file)
@@ -3,6 +3,7 @@ require chromium.inc
 SRC_URI = "\
     git://github.com/igalia/${PN};branch=koi;protocol=https;rev=${SRCREV_chromium84};name=chromium84 \
     git://github.com/webosose/chromium-v8;branch=@chromium84;destsuffix=git/src/v8;rev=${SRCREV_v8};name=v8 \
+    file://add-a-delay-to-agl-ready-event.patch \
     file://chromium-quiche-invalid-offsetof.patch \
     file://chromium-skia-no_sanitize.patch \
 "
diff --git a/recipes-wam/chromium/files/add-a-delay-to-agl-ready-event.patch b/recipes-wam/chromium/files/add-a-delay-to-agl-ready-event.patch
new file mode 100644 (file)
index 0000000..20caccb
--- /dev/null
@@ -0,0 +1,70 @@
+From d2d09d3e13a3874961971d343553106a1f3d5ac7 Mon Sep 17 00:00:00 2001
+From: Roger Zanoni <rzanoni@igalia.com>
+Date: Thu, 3 Jun 2021 10:53:40 +0200
+Subject: [PATCH] Add a delay to agl ready event
+
+Delay ready() to ensure that all the window and surfaces setup
+is done before notifying the compositor
+---
+ .../ozone/platform/wayland/host/wayland_window.cc  | 14 +++++++++++++-
+ .../ozone/platform/wayland/host/wayland_window.h   |  5 +++++
+ 2 files changed, 18 insertions(+), 1 deletion(-)
+
+diff --git a/src/ui/ozone/platform/wayland/host/wayland_window.cc b/src/ui/ozone/platform/wayland/host/wayland_window.cc
+index d2a9b0dae5..27749fd70d 100644
+--- a/src/ui/ozone/platform/wayland/host/wayland_window.cc
++++ b/src/ui/ozone/platform/wayland/host/wayland_window.cc
+@@ -299,7 +299,19 @@ WaylandWindow::SetAglReady(void)
+   if (!connection_->agl_shell_manager) {
+       return;
+   }
+-  connection_->agl_shell_manager->ready();
++
++  // Delay activation to ensure that all the setup is done
++  // TODO(rzanoni): find a more deterministic way of doing this
++  set_ready_timer_.Start(FROM_HERE,
++                         base::TimeDelta::FromMilliseconds(500),
++                         this,
++                         &WaylandWindow::SetReadyCallback);
++}
++
++
++void WaylandWindow::SetReadyCallback() {
++    connection_->agl_shell_manager->ready();
++    connection_->ScheduleFlush();
+ }
+ bool WaylandWindow::CanDispatchEvent(const PlatformEvent& event) {
+diff --git a/src/ui/ozone/platform/wayland/host/wayland_window.h b/src/ui/ozone/platform/wayland/host/wayland_window.h
+index 2acac98ae9..c10db38d21 100644
+--- a/src/ui/ozone/platform/wayland/host/wayland_window.h
++++ b/src/ui/ozone/platform/wayland/host/wayland_window.h
+@@ -15,6 +15,7 @@
+ #include "base/containers/flat_set.h"
+ #include "base/gtest_prod_util.h"
+ #include "base/memory/ref_counted.h"
++#include "base/timer/timer.h"
+ #include "ui/events/platform/platform_event_dispatcher.h"
+ #include "ui/gfx/geometry/rect.h"
+ #include "ui/gfx/native_widget_types.h"
+@@ -232,6 +233,8 @@ class WaylandWindow : public PlatformWindow, public PlatformEventDispatcher {
+   // Returns a root parent window.
+   WaylandWindow* GetRootParentWindow();
++  void SetReadyCallback();
++
+   // Install a surface listener and start getting wl_output enter/leave events.
+   void AddSurfaceListener();
+@@ -311,6 +314,8 @@ class WaylandWindow : public PlatformWindow, public PlatformEventDispatcher {
+   // The type of the current WaylandWindow object.
+   ui::PlatformWindowType type_ = ui::PlatformWindowType::kWindow;
++  base::OneShotTimer set_ready_timer_;
++
+   DISALLOW_COPY_AND_ASSIGN(WaylandWindow);
+ };
+-- 
+2.32.0
+