Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: cc/layer_tree_host_unittest_animation.cc

Issue 11571068: Use WeakPtr for posting cc tasks to main thread (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/layer_tree_host_unittest.cc ('k') | cc/scoped_thread_proxy.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/layer_tree_host.h" 5 #include "cc/layer_tree_host.h"
6 6
7 #include "cc/animation_curve.h" 7 #include "cc/animation_curve.h"
8 #include "cc/layer.h" 8 #include "cc/layer.h"
9 #include "cc/layer_animation_controller.h" 9 #include "cc/layer_animation_controller.h"
10 #include "cc/layer_impl.h" 10 #include "cc/layer_impl.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 // handling the case where setNeedsAnimate() is called inside the begin frame 79 // handling the case where setNeedsAnimate() is called inside the begin frame
80 // flow. 80 // flow.
81 class LayerTreeHostAnimationTestSetNeedsAnimateInsideAnimationCallback : 81 class LayerTreeHostAnimationTestSetNeedsAnimateInsideAnimationCallback :
82 public LayerTreeHostAnimationTest { 82 public LayerTreeHostAnimationTest {
83 public: 83 public:
84 LayerTreeHostAnimationTestSetNeedsAnimateInsideAnimationCallback() 84 LayerTreeHostAnimationTestSetNeedsAnimateInsideAnimationCallback()
85 : num_animates_(0) { 85 : num_animates_(0) {
86 } 86 }
87 87
88 virtual void beginTest() OVERRIDE { 88 virtual void beginTest() OVERRIDE {
89 postSetNeedsAnimateToMainThread(); 89 postSetNeedsCommitToMainThread();
90 } 90 }
91 91
92 virtual void animate(base::TimeTicks) OVERRIDE { 92 virtual void animate(base::TimeTicks) OVERRIDE {
93 if (!num_animates_) { 93 if (!num_animates_) {
94 m_layerTreeHost->setNeedsAnimate(); 94 m_layerTreeHost->setNeedsAnimate();
95 num_animates_++; 95 num_animates_++;
96 return; 96 return;
97 } 97 }
98 endTest(); 98 endTest();
99 } 99 }
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 532
533 private: 533 private:
534 int num_commit_complete_; 534 int num_commit_complete_;
535 int num_draw_layers_; 535 int num_draw_layers_;
536 }; 536 };
537 537
538 MULTI_THREAD_TEST_F(LayerTreeHostAnimationTestContinuousAnimate) 538 MULTI_THREAD_TEST_F(LayerTreeHostAnimationTestContinuousAnimate)
539 539
540 } // namespace 540 } // namespace
541 } // namespace cc 541 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layer_tree_host_unittest.cc ('k') | cc/scoped_thread_proxy.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698