From f0ceb4f065f3a7d2e1d66061fa8167c0d6833e0d Mon Sep 17 00:00:00 2001 From: Kevin Sawicki Date: Tue, 20 Dec 2016 09:03:42 -0800 Subject: [PATCH] Use SetNeedsBeginFrames from IPC handler --- .../osr/osr_render_widget_host_view.cc | 24 ++++++++----------- .../browser/osr/osr_render_widget_host_view.h | 1 - 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/atom/browser/osr/osr_render_widget_host_view.cc b/atom/browser/osr/osr_render_widget_host_view.cc index dea3a50971ee..d5452a7abf36 100644 --- a/atom/browser/osr/osr_render_widget_host_view.cc +++ b/atom/browser/osr/osr_render_widget_host_view.cc @@ -424,7 +424,7 @@ bool OffScreenRenderWidgetHostView::OnMessageReceived( bool handled = true; IPC_BEGIN_MESSAGE_MAP(OffScreenRenderWidgetHostView, message) IPC_MESSAGE_HANDLER(ViewHostMsg_SetNeedsBeginFrames, - OnSetNeedsBeginFrames) + SetNeedsBeginFrames) IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() @@ -548,17 +548,6 @@ bool OffScreenRenderWidgetHostView::LockMouse() { void OffScreenRenderWidgetHostView::UnlockMouse() { } -void OffScreenRenderWidgetHostView::SetNeedsBeginFrames( - bool needs_begin_frames) { - SetupFrameRate(false); - - begin_frame_timer_->SetActive(needs_begin_frames); - - if (software_output_device_) { - software_output_device_->SetActive(needs_begin_frames && painting_); - } -} - void OffScreenRenderWidgetHostView::OnSwapCompositorFrame( uint32_t output_surface_id, cc::CompositorFrame frame) { @@ -801,8 +790,15 @@ bool OffScreenRenderWidgetHostView::IsAutoResizeEnabled() const { return false; } -void OffScreenRenderWidgetHostView::OnSetNeedsBeginFrames(bool enabled) { - SetNeedsBeginFrames(enabled); +void OffScreenRenderWidgetHostView::SetNeedsBeginFrames( + bool needs_begin_frames) { + SetupFrameRate(false); + + begin_frame_timer_->SetActive(needs_begin_frames); + + if (software_output_device_) { + software_output_device_->SetActive(needs_begin_frames && painting_); + } } void OffScreenRenderWidgetHostView::OnPaint( diff --git a/atom/browser/osr/osr_render_widget_host_view.h b/atom/browser/osr/osr_render_widget_host_view.h index 6ead7d8cf7ac..ca5dae52f9de 100644 --- a/atom/browser/osr/osr_render_widget_host_view.h +++ b/atom/browser/osr/osr_render_widget_host_view.h @@ -175,7 +175,6 @@ class OffScreenRenderWidgetHostView bool InstallTransparency(); bool IsAutoResizeEnabled() const; - void OnSetNeedsBeginFrames(bool enabled); // NativeWindowObserver: void OnWindowResize() override;