Chromium Code Reviews| Index: content/renderer/render_widget.cc |
| diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc |
| index 95a403b8d92f4359a32ad94bf61551872dd60c1f..72d73aa1c899b4a0353697e11007e7238fd3d2c4 100644 |
| --- a/content/renderer/render_widget.cc |
| +++ b/content/renderer/render_widget.cc |
| @@ -370,6 +370,35 @@ bool RenderWidget::UsingSynchronousRendererCompositor() const { |
| #endif |
| } |
| +void RenderWidget::ScheduleCompositeWithForcedRedraw() { |
| + ScheduleCompositeImpl(true); |
| +} |
| + |
| +void RenderWidget::ScheduleCompositeImpl(bool force_redraw) { |
| + if (compositor_ && force_redraw) { |
|
jamesr
2013/10/02 00:06:41
why don't you move this code into ScheduleComposit
|
| + // Regardless of whether threaded compositing is enabled, always |
| + // use this mechanism to force the compositor to redraw. However, |
| + // the invalidation code path below is still needed for the |
| + // non-threaded case. |
| + compositor_->SetNeedsForcedRedraw(); |
| + } |
| + |
| + if (RenderThreadImpl::current()->compositor_message_loop_proxy().get() && |
| + compositor_) { |
| + if (!force_redraw) { |
| + compositor_->setNeedsRedraw(); |
| + } |
| + } else { |
| + // TODO(nduca): replace with something a little less hacky. The reason this |
| + // hack is still used is because the Invalidate-DoDeferredUpdate loop |
| + // contains a lot of host-renderer synchronization logic that is still |
| + // important for the accelerated compositing case. The option of simply |
| + // duplicating all that code is less desirable than "faking out" the |
| + // invalidation path using a magical damage rect. |
| + didInvalidateRect(WebRect(0, 0, 1, 1)); |
| + } |
| +} |
| + |
| bool RenderWidget::OnMessageReceived(const IPC::Message& message) { |
| bool handled = true; |
| IPC_BEGIN_MESSAGE_MAP(RenderWidget, message) |
| @@ -1672,18 +1701,7 @@ void RenderWidget::didCompleteSwapBuffers() { |
| } |
| void RenderWidget::scheduleComposite() { |
| - if (RenderThreadImpl::current()->compositor_message_loop_proxy().get() && |
| - compositor_) { |
| - compositor_->setNeedsRedraw(); |
| - } else { |
| - // TODO(nduca): replace with something a little less hacky. The reason this |
| - // hack is still used is because the Invalidate-DoDeferredUpdate loop |
| - // contains a lot of host-renderer synchronization logic that is still |
| - // important for the accelerated compositing case. The option of simply |
| - // duplicating all that code is less desirable than "faking out" the |
| - // invalidation path using a magical damage rect. |
| - didInvalidateRect(WebRect(0, 0, 1, 1)); |
| - } |
| + ScheduleCompositeImpl(false); |
| } |
| void RenderWidget::scheduleAnimation() { |