diff options
author | trchen@chromium.org <trchen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-11 04:11:29 +0000 |
---|---|---|
committer | trchen@chromium.org <trchen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-12-11 04:11:29 +0000 |
commit | 807f55ecb7ece39b25866405125d7e58b4bad9f2 (patch) | |
tree | b87e4511156b3da88943957dc91282eff426e47b /content/test | |
parent | c8af3918820921a280bbe9dbaacadeb63d5c65b9 (diff) | |
download | chromium_src-807f55ecb7ece39b25866405125d7e58b4bad9f2.zip chromium_src-807f55ecb7ece39b25866405125d7e58b4bad9f2.tar.gz chromium_src-807f55ecb7ece39b25866405125d7e58b4bad9f2.tar.bz2 |
Unifies LayerTreeHost::SetNeedsUpdateLayers and SetNeedsAnimate
[2/2] Unifies LayerTreeHost::SetNeedsUpdateLayers and SetNeedsAnimate
They basically do the same thing except that SetNeedsAnimate makes the next
commit non-cancellable. However there is really no reason why SetNeedsAnimate
need to enforce a commit even if no tiles are updated and no layer properties
changed.
SetNeedsAnimate is thus merged into SetNeedsUpdateLayers. The proper use of
it is when there are potential layout/tile changes, we can use it to defer
calculation until the next frame. A commit will be scheduled but can be
cancelled if no updates are needed after calculation.
This part of the patch changes code behavior slightly.
SingleThreadProxy::SetNeedsUpdateLayers was originally implemented as
RenderWidget::ScheduleComposite but now it is RenderWidget::ScheduleAnimation.
ThreadProxy::SetNeedsAnimate was non-cancellable but is now cancellable.
[1/2] Cleanup RenderWidget::scheduleComposite/scheduleAnimation
scheduleComposite has been renamed to ScheduleComposite as it is no longer
a part of WebWidgetClient API.
scheduleAnimation has been renamed to ScheduleAnimation. The semantics is to
schedule a composite and also (potentially) animating WebWidget.
A new WebWidgetClient API scheduleUpdate has been added, to replace the old
scheduleAnimation. The semantics is to notify the embedder that something in
the WebWidget may change in 0 seconds. (i.e. it is allowed to be called
during a redraw, in such case another redraw will be scheduled after frame
delay.
This part of the patch should not change code behavior.
BUG=316929
R=danakj,jamesr,piman
Review URL: https://codereview.chromium.org/68893031
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240008 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/test')
-rw-r--r-- | content/test/web_layer_tree_view_impl_for_testing.cc | 11 | ||||
-rw-r--r-- | content/test/web_layer_tree_view_impl_for_testing.h | 5 |
2 files changed, 12 insertions, 4 deletions
diff --git a/content/test/web_layer_tree_view_impl_for_testing.cc b/content/test/web_layer_tree_view_impl_for_testing.cc index 1470e03..3a96c25 100644 --- a/content/test/web_layer_tree_view_impl_for_testing.cc +++ b/content/test/web_layer_tree_view_impl_for_testing.cc @@ -116,12 +116,19 @@ void WebLayerTreeViewImplForTesting::startPageScaleAnimation( float new_page_scale, double duration_sec) {} +// Renamed. Staged for removal. void WebLayerTreeViewImplForTesting::setNeedsAnimate() { - layer_tree_host_->SetNeedsAnimate(); + setNeedsUpdateLayers(); } +void WebLayerTreeViewImplForTesting::setNeedsUpdateLayers() { + layer_tree_host_->SetNeedsUpdateLayers(); +} + +// Unused. Staged for removal. bool WebLayerTreeViewImplForTesting::commitRequested() const { - return layer_tree_host_->CommitRequested(); + NOTREACHED(); + return false; } void WebLayerTreeViewImplForTesting::composite() { diff --git a/content/test/web_layer_tree_view_impl_for_testing.h b/content/test/web_layer_tree_view_impl_for_testing.h index 6fec0e3..47fa8e2 100644 --- a/content/test/web_layer_tree_view_impl_for_testing.h +++ b/content/test/web_layer_tree_view_impl_for_testing.h @@ -48,8 +48,9 @@ class WebLayerTreeViewImplForTesting bool use_anchor, float new_page_scale, double duration_sec); - virtual void setNeedsAnimate(); - virtual bool commitRequested() const; + virtual void setNeedsAnimate(); // Renamed. Staged for removal. + virtual void setNeedsUpdateLayers(); + virtual bool commitRequested() const; // Unused. Staged for removal. virtual void composite(); virtual void didStopFlinging(); virtual bool compositeAndReadback(void* pixels, const blink::WebRect& rect); |