2024-06-14 19:01:45 +02:00
|
|
|
diff --git components/input/fling_scheduler_base.h components/input/fling_scheduler_base.h
|
|
|
|
index 76057b3e50f78..d3b63a3b07805 100644
|
|
|
|
--- components/input/fling_scheduler_base.h
|
|
|
|
+++ components/input/fling_scheduler_base.h
|
|
|
|
@@ -5,14 +5,26 @@
|
|
|
|
#ifndef COMPONENTS_INPUT_FLING_SCHEDULER_BASE_H_
|
|
|
|
#define COMPONENTS_INPUT_FLING_SCHEDULER_BASE_H_
|
|
|
|
|
|
|
|
+#include "base/memory/raw_ptr.h"
|
|
|
|
#include "components/input/fling_controller.h"
|
|
|
|
|
|
|
|
+namespace ui {
|
|
|
|
+class Compositor;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
namespace input {
|
|
|
|
|
|
|
|
class FlingSchedulerBase : public FlingControllerSchedulerClient {
|
|
|
|
public:
|
|
|
|
virtual void ProgressFlingOnBeginFrameIfneeded(
|
|
|
|
base::TimeTicks current_time) = 0;
|
|
|
|
+
|
|
|
|
+ void SetCompositor(ui::Compositor* compositor) {
|
|
|
|
+ compositor_ = compositor;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ protected:
|
|
|
|
+ raw_ptr<ui::Compositor> compositor_ = nullptr;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace input
|
2024-07-29 19:09:20 +02:00
|
|
|
diff --git components/input/render_input_router.h components/input/render_input_router.h
|
2024-09-27 16:15:44 +02:00
|
|
|
index 82f462173913b..05b4824ec8329 100644
|
2024-07-29 19:09:20 +02:00
|
|
|
--- components/input/render_input_router.h
|
|
|
|
+++ components/input/render_input_router.h
|
|
|
|
@@ -66,6 +66,7 @@ class COMPONENT_EXPORT(INPUT) RenderInputRouter
|
|
|
|
|
|
|
|
InputRouter* input_router() { return input_router_.get(); }
|
|
|
|
RenderInputRouterDelegate* delegate() { return delegate_; }
|
|
|
|
+ input::FlingSchedulerBase* fling_scheduler() { return fling_scheduler_.get(); }
|
|
|
|
|
|
|
|
void SetForceEnableZoom(bool);
|
|
|
|
void SetDeviceScaleFactor(float device_scale_factor);
|
2019-11-26 20:04:19 +01:00
|
|
|
diff --git content/browser/renderer_host/input/fling_scheduler.cc content/browser/renderer_host/input/fling_scheduler.cc
|
2024-07-29 19:09:20 +02:00
|
|
|
index f1030a744809c..c222a209949e6 100644
|
2019-11-26 20:04:19 +01:00
|
|
|
--- content/browser/renderer_host/input/fling_scheduler.cc
|
|
|
|
+++ content/browser/renderer_host/input/fling_scheduler.cc
|
2024-06-14 19:01:45 +02:00
|
|
|
@@ -98,6 +98,9 @@ void FlingScheduler::ProgressFlingOnBeginFrameIfneeded(
|
2019-11-26 20:04:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
ui::Compositor* FlingScheduler::GetCompositor() {
|
|
|
|
+ if (compositor_) {
|
|
|
|
+ return compositor_;
|
|
|
|
+ }
|
2023-02-27 19:52:38 +01:00
|
|
|
if (!host_->GetView()) {
|
|
|
|
return nullptr;
|
|
|
|
}
|
2019-11-26 20:04:19 +01:00
|
|
|
diff --git content/browser/renderer_host/render_widget_host_impl.cc content/browser/renderer_host/render_widget_host_impl.cc
|
2024-10-24 17:05:31 +02:00
|
|
|
index 5a521aa5a6117..1a6454eb4f300 100644
|
2019-11-26 20:04:19 +01:00
|
|
|
--- content/browser/renderer_host/render_widget_host_impl.cc
|
|
|
|
+++ content/browser/renderer_host/render_widget_host_impl.cc
|
2024-10-24 17:05:31 +02:00
|
|
|
@@ -3232,6 +3232,11 @@ void RenderWidgetHostImpl::DecrementInFlightEventCount(
|
2024-07-29 19:09:20 +02:00
|
|
|
}
|
2019-11-26 20:04:19 +01:00
|
|
|
}
|
|
|
|
|
2024-03-19 22:11:42 +01:00
|
|
|
+void RenderWidgetHostImpl::SetCompositorForFlingScheduler(
|
|
|
|
+ ui::Compositor* compositor) {
|
|
|
|
+ GetRenderInputRouter()->fling_scheduler()->SetCompositor(compositor);
|
2019-11-26 20:04:19 +01:00
|
|
|
+}
|
|
|
|
+
|
|
|
|
void RenderWidgetHostImpl::AddPendingUserActivation(
|
|
|
|
const WebInputEvent& event) {
|
2020-03-04 01:29:39 +01:00
|
|
|
if ((base::FeatureList::IsEnabled(
|
2019-11-26 20:04:19 +01:00
|
|
|
diff --git content/browser/renderer_host/render_widget_host_impl.h content/browser/renderer_host/render_widget_host_impl.h
|
2024-10-24 17:05:31 +02:00
|
|
|
index b8dadc4cca462..f5bbd83de86ab 100644
|
2019-11-26 20:04:19 +01:00
|
|
|
--- content/browser/renderer_host/render_widget_host_impl.h
|
|
|
|
+++ content/browser/renderer_host/render_widget_host_impl.h
|
2024-10-24 17:05:31 +02:00
|
|
|
@@ -836,6 +836,7 @@ class CONTENT_EXPORT RenderWidgetHostImpl
|
2020-03-04 01:29:39 +01:00
|
|
|
|
2019-11-26 20:04:19 +01:00
|
|
|
void ProgressFlingIfNeeded(base::TimeTicks current_time);
|
|
|
|
void StopFling();
|
|
|
|
+ void SetCompositorForFlingScheduler(ui::Compositor* compositor);
|
|
|
|
|
2024-01-26 03:12:43 +01:00
|
|
|
RenderWidgetHostViewBase* GetRenderWidgetHostViewBase();
|
|
|
|
|