diff options
author | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-05 22:38:51 +0000 |
---|---|---|
committer | enne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-05 22:38:51 +0000 |
commit | bac0e556066f3b10a46a0c479a25096acc07e40c (patch) | |
tree | ee769163851dd08b21f11148dee67730996d451b /cc/trees | |
parent | 86137956129413201db0be8c9d94f601b63ade61 (diff) | |
download | chromium_src-bac0e556066f3b10a46a0c479a25096acc07e40c.zip chromium_src-bac0e556066f3b10a46a0c479a25096acc07e40c.tar.gz chromium_src-bac0e556066f3b10a46a0c479a25096acc07e40c.tar.bz2 |
cc: Don't ManageTiles twice in one frame
Any external callers of ManageTiles should inform the Scheduler that
ManageTiles happened so that (1) it can clear the "needs manage tiles"
flag and (2) it can avoid doing a second ManageTiles on the same frame.
Other than after commit, where ManageTiles needs to be called
immediately in order to kick off new raster tasks (or determine that no
raster tasks are required to activate the tree), ManageTiles just needs
to be called periodically to keep the raster jobs working on the most
important content. Delaying the periodic caller to prevent these bad
frames with commits is a worthwhile tradeoff.
R=brianderson@chromium.org
BUG=314882
Review URL: https://codereview.chromium.org/45923005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@233111 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/trees')
-rw-r--r-- | cc/trees/layer_tree_host_impl.h | 1 | ||||
-rw-r--r-- | cc/trees/layer_tree_host_impl_unittest.cc | 1 | ||||
-rw-r--r-- | cc/trees/single_thread_proxy.h | 1 | ||||
-rw-r--r-- | cc/trees/thread_proxy.cc | 5 | ||||
-rw-r--r-- | cc/trees/thread_proxy.h | 1 |
5 files changed, 9 insertions, 0 deletions
diff --git a/cc/trees/layer_tree_host_impl.h b/cc/trees/layer_tree_host_impl.h index 83b92c8..3345d15 100644 --- a/cc/trees/layer_tree_host_impl.h +++ b/cc/trees/layer_tree_host_impl.h @@ -79,6 +79,7 @@ class LayerTreeHostImplClient { virtual void RenewTreePriority() = 0; virtual void RequestScrollbarAnimationOnImplThread(base::TimeDelta delay) = 0; virtual void DidActivatePendingTree() = 0; + virtual void DidManageTiles() = 0; protected: virtual ~LayerTreeHostImplClient() {} diff --git a/cc/trees/layer_tree_host_impl_unittest.cc b/cc/trees/layer_tree_host_impl_unittest.cc index c2ec456..0e69b72 100644 --- a/cc/trees/layer_tree_host_impl_unittest.cc +++ b/cc/trees/layer_tree_host_impl_unittest.cc @@ -144,6 +144,7 @@ class LayerTreeHostImplTest : public testing::Test, virtual void RequestScrollbarAnimationOnImplThread(base::TimeDelta delay) OVERRIDE { requested_scrollbar_animation_delay_ = delay; } virtual void DidActivatePendingTree() OVERRIDE {} + virtual void DidManageTiles() OVERRIDE {} void set_reduce_memory_result(bool reduce_memory_result) { reduce_memory_result_ = reduce_memory_result; diff --git a/cc/trees/single_thread_proxy.h b/cc/trees/single_thread_proxy.h index 843be729..e5b706f 100644 --- a/cc/trees/single_thread_proxy.h +++ b/cc/trees/single_thread_proxy.h @@ -73,6 +73,7 @@ class SingleThreadProxy : public Proxy, LayerTreeHostImplClient { virtual void RequestScrollbarAnimationOnImplThread(base::TimeDelta delay) OVERRIDE {} virtual void DidActivatePendingTree() OVERRIDE {} + virtual void DidManageTiles() OVERRIDE {} // Called by the legacy path where RenderWidget does the scheduling. void CompositeImmediately(base::TimeTicks frame_begin_time); diff --git a/cc/trees/thread_proxy.cc b/cc/trees/thread_proxy.cc index 4f2f488..b25f8c2 100644 --- a/cc/trees/thread_proxy.cc +++ b/cc/trees/thread_proxy.cc @@ -1591,4 +1591,9 @@ void ThreadProxy::DidActivatePendingTree() { base::TimeTicks::HighResNow() - commit_complete_time_); } +void ThreadProxy::DidManageTiles() { + DCHECK(IsImplThread()); + scheduler_on_impl_thread_->DidManageTiles(); +} + } // namespace cc diff --git a/cc/trees/thread_proxy.h b/cc/trees/thread_proxy.h index 3a213b9..0bd1f4b 100644 --- a/cc/trees/thread_proxy.h +++ b/cc/trees/thread_proxy.h @@ -90,6 +90,7 @@ class ThreadProxy : public Proxy, virtual void RequestScrollbarAnimationOnImplThread(base::TimeDelta delay) OVERRIDE; virtual void DidActivatePendingTree() OVERRIDE; + virtual void DidManageTiles() OVERRIDE; // SchedulerClient implementation virtual void SetNeedsBeginImplFrame(bool enable) OVERRIDE; |