RenderWidget and RenderWidgetCompositor cleanup
This patch can be considered as two logical changes that are orthogonal.
Both of the changes don't affect code behavior.
[2/2] Add LayerTreeHostSingleThreadClient::ScheduleAnimation
widget_->scheduleAnimation() should be routed through SingleThreadProxy::
SetNeedsAnimate().
This way we can reduce many CC API inconsistencies between single thread and
threaded mode.
[1/2] Remove ScheduleCompositeImpl
The force_redraw parameter of ScheduleCompositeImpl only makes a difference
in threaded-compositing mode. The only user of ScheduleCompositeImpl(true)
always calls SetNeedsAnimate, so it doesn't harm to call it one more time.
--> ScheduleCompositeImpl is fully equivalent to scheduleComposite
This patch merges ScheduleCompositeImpl into scheduleComposite.
R=jamesr,piman
Review URL: https://codereview.chromium.org/80173002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236718 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
index df344d32..e2b49d8 100644
--- a/content/renderer/render_widget.cc
+++ b/content/renderer/render_widget.cc
@@ -568,24 +568,7 @@
// non-threaded case.
compositor_->SetNeedsForcedRedraw();
}
- ScheduleCompositeImpl(true);
-}
-
-void RenderWidget::ScheduleCompositeImpl(bool force_redraw) {
- 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));
- }
+ scheduleComposite();
}
bool RenderWidget::OnMessageReceived(const IPC::Message& message) {
@@ -1923,7 +1906,18 @@
}
void RenderWidget::scheduleComposite() {
- ScheduleCompositeImpl(false);
+ if (RenderThreadImpl::current()->compositor_message_loop_proxy().get() &&
+ compositor_) {
+ compositor_->setNeedsAnimate();
+ } 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));
+ }
}
void RenderWidget::scheduleAnimation() {