From db19ca9c53c843ae33634dc543d0c22e24733e10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCri=20Valdmann?= Date: Thu, 12 Dec 2019 12:31:12 +0100 Subject: Fix FlingScheduler in viz mode FlingScheduler needs access to our ui::Compositor in RWHVQt if in viz mode. Task-number: QTBUG-80089 Change-Id: I1628cb7bbeca95101ae0db83a559c3ff56cbadc6 Reviewed-by: Allan Sandfeld Jensen --- chromium/content/browser/renderer_host/input/fling_scheduler.cc | 4 ++++ chromium/content/public/browser/render_widget_host_view.h | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/chromium/content/browser/renderer_host/input/fling_scheduler.cc b/chromium/content/browser/renderer_host/input/fling_scheduler.cc index cf220cb41b0..993efe1e07b 100644 --- a/chromium/content/browser/renderer_host/input/fling_scheduler.cc +++ b/chromium/content/browser/renderer_host/input/fling_scheduler.cc @@ -71,6 +71,10 @@ void FlingScheduler::ProgressFlingOnBeginFrameIfneeded( } ui::Compositor* FlingScheduler::GetCompositor() { +#if defined(TOOLKIT_QT) + if (host_->GetView()) + return host_->GetView()->GetCompositor(); +#endif #if defined(USE_AURA) if (host_->GetView() && host_->GetView()->GetNativeView() && host_->GetView()->GetNativeView()->GetHost() && diff --git a/chromium/content/public/browser/render_widget_host_view.h b/chromium/content/public/browser/render_widget_host_view.h index 07d4351d0a8..541d7bf524b 100644 --- a/chromium/content/public/browser/render_widget_host_view.h +++ b/chromium/content/public/browser/render_widget_host_view.h @@ -27,6 +27,9 @@ class Size; namespace ui { enum class DomCode; class TextInputClient; +#if defined(TOOLKIT_QT) +class Compositor; +#endif } namespace viz { @@ -109,6 +112,10 @@ class CONTENT_EXPORT RenderWidgetHostView { virtual gfx::NativeView GetNativeView() = 0; virtual gfx::NativeViewAccessible GetNativeViewAccessible() = 0; +#if defined(TOOLKIT_QT) + virtual ui::Compositor *GetCompositor() { return nullptr; } +#endif + // Returns a ui::TextInputClient to support text input or nullptr if this RWHV // doesn't support text input. // Note: Not all the platforms use ui::InputMethod and ui::TextInputClient for -- cgit v1.2.1