Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(515)

Unified Diff: content/browser/renderer_host/render_widget_host_view_mac.mm

Issue 2372873003: Move synthetic gesture input to be aligned with BeginFrame. (Closed)
Patch Set: Fix unittests Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_mac.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/render_widget_host_view_mac.mm
diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
index b5444dc934af1ad077e899962eb9a4054d536c96..fa22008815a79b8747088da8dfaeb84b2c7bd229 100644
--- a/content/browser/renderer_host/render_widget_host_view_mac.mm
+++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
@@ -415,6 +415,9 @@ void RenderWidgetHostViewMac::BrowserCompositorMacOnLostCompositorResources() {
void RenderWidgetHostViewMac::BrowserCompositorMacSendBeginFrame(
const cc::BeginFrameArgs& args) {
+ needs_flush_input_ = false;
+ render_widget_host_->FlushInput();
+ UpdateNeedsBeginFramesInternal();
render_widget_host_->Send(
new ViewMsg_BeginFrame(render_widget_host_->GetRoutingID(), args));
}
@@ -451,6 +454,8 @@ RenderWidgetHostViewMac::RenderWidgetHostViewMac(RenderWidgetHost* widget,
allow_pause_for_resize_or_repaint_(true),
is_guest_view_hack_(is_guest_view_hack),
fullscreen_parent_host_view_(nullptr),
+ needs_begin_frames_(false),
+ needs_flush_input_(false),
weak_factory_(this) {
// |cocoa_view_| owns us and we will be deleted when |cocoa_view_|
// goes away. Since we autorelease it, our caller must put
@@ -1188,7 +1193,18 @@ void RenderWidgetHostViewMac::ForwardMouseEvent(const WebMouseEvent& event) {
}
void RenderWidgetHostViewMac::SetNeedsBeginFrames(bool needs_begin_frames) {
- browser_compositor_->SetNeedsBeginFrames(needs_begin_frames);
+ needs_begin_frames_ = needs_begin_frames;
+ UpdateNeedsBeginFramesInternal();
+}
+
+void RenderWidgetHostViewMac::OnSetNeedsFlushInput() {
+ needs_flush_input_ = true;
+ UpdateNeedsBeginFramesInternal();
+}
+
+void RenderWidgetHostViewMac::UpdateNeedsBeginFramesInternal() {
+ browser_compositor_->SetNeedsBeginFrames(needs_begin_frames_ ||
+ needs_flush_input_);
}
void RenderWidgetHostViewMac::KillSelf() {
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698