diff options
author | brianderson@chromium.org <brianderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-12 21:58:22 +0000 |
---|---|---|
committer | brianderson@chromium.org <brianderson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-03-12 21:58:22 +0000 |
commit | 0c7a561ae2ea208ba1103d9cdab6c3ee4264c8b7 (patch) | |
tree | c93b244a447ce963d68c22175047ed7aa0777304 /cc/trees/layer_tree_host_unittest_animation.cc | |
parent | 718e922a6d41e4465a11ac9536240878394c1626 (diff) | |
download | chromium_src-0c7a561ae2ea208ba1103d9cdab6c3ee4264c8b7.zip chromium_src-0c7a561ae2ea208ba1103d9cdab6c3ee4264c8b7.tar.gz chromium_src-0c7a561ae2ea208ba1103d9cdab6c3ee4264c8b7.tar.bz2 |
cc: Allow sending BeginMainFrame before draw or activation
BeginMainFrame before draw:
Enabled by default because of concurrency benefits.
When main thread painting, this will block the main thread from
finishing the commit until the active tree has been drawn.
When impl side painting, this does not block the main thread.
The following flag will disable sending BeginMainFrame to the
main thread before we draw the previous commit:
--disable-main-frame-before-draw
BeginMainFrame before activation:
Disabled by default because of latency concerns.
This applies only when impl-side-painting is enabled and will
cause the main thread to block finishing the commit until the
pending tree is activated.
The following flags control whether BeginMainFrame is sent to
the main thread before or after the previous commit has
activated:
--enable-main-frame-before-activation
--disable-main-frame-before-activation
BUG=293941
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=256454
Review URL: https://codereview.chromium.org/23907006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256669 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/trees/layer_tree_host_unittest_animation.cc')
-rw-r--r-- | cc/trees/layer_tree_host_unittest_animation.cc | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/cc/trees/layer_tree_host_unittest_animation.cc b/cc/trees/layer_tree_host_unittest_animation.cc index 7a9b63f..aeeb4f5 100644 --- a/cc/trees/layer_tree_host_unittest_animation.cc +++ b/cc/trees/layer_tree_host_unittest_animation.cc @@ -829,33 +829,43 @@ MULTI_THREAD_TEST_F(LayerTreeHostAnimationTestContinuousAnimate); class LayerTreeHostAnimationTestCancelAnimateCommit : public LayerTreeHostAnimationTest { public: - LayerTreeHostAnimationTestCancelAnimateCommit() : num_animate_calls_(0) {} + LayerTreeHostAnimationTestCancelAnimateCommit() + : num_animate_calls_(0), num_commit_calls_(0), num_draw_calls_(0) {} virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } virtual void Animate(base::TimeTicks) OVERRIDE { + num_animate_calls_++; // No-op animate will cancel the commit. - if (++num_animate_calls_ == 2) { + if (layer_tree_host()->source_frame_number() == 1) { EndTest(); return; } layer_tree_host()->SetNeedsAnimate(); } - virtual void CommitCompleteOnThread(LayerTreeHostImpl* tree_impl) OVERRIDE { - if (num_animate_calls_ > 1) + virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE { + num_commit_calls_++; + if (impl->active_tree()->source_frame_number() > 1) FAIL() << "Commit should have been canceled."; } virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE { - if (num_animate_calls_ > 1) + num_draw_calls_++; + if (impl->active_tree()->source_frame_number() > 1) FAIL() << "Draw should have been canceled."; } - virtual void AfterTest() OVERRIDE { EXPECT_EQ(2, num_animate_calls_); } + virtual void AfterTest() OVERRIDE { + EXPECT_EQ(2, num_animate_calls_); + EXPECT_EQ(1, num_commit_calls_); + EXPECT_EQ(1, num_draw_calls_); + } private: int num_animate_calls_; + int num_commit_calls_; + int num_draw_calls_; FakeContentLayerClient client_; scoped_refptr<FakeContentLayer> content_; }; |