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

Side by Side Diff: cc/test/layer_tree_test.cc

Issue 15058004: cc: Rename VSync to BeginFrame (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix Android Created 7 years, 7 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
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/test/layer_tree_test.h" 5 #include "cc/test/layer_tree_test.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "cc/animation/animation.h" 8 #include "cc/animation/animation.h"
9 #include "cc/animation/animation_registrar.h" 9 #include "cc/animation/animation_registrar.h"
10 #include "cc/animation/layer_animation_controller.h" 10 #include "cc/animation/layer_animation_controller.h"
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after
214 214
215 // Implementation of LayerTreeHost callback interface. 215 // Implementation of LayerTreeHost callback interface.
216 class LayerTreeHostClientForTesting : public LayerTreeHostClient { 216 class LayerTreeHostClientForTesting : public LayerTreeHostClient {
217 public: 217 public:
218 static scoped_ptr<LayerTreeHostClientForTesting> Create( 218 static scoped_ptr<LayerTreeHostClientForTesting> Create(
219 TestHooks* test_hooks) { 219 TestHooks* test_hooks) {
220 return make_scoped_ptr(new LayerTreeHostClientForTesting(test_hooks)); 220 return make_scoped_ptr(new LayerTreeHostClientForTesting(test_hooks));
221 } 221 }
222 virtual ~LayerTreeHostClientForTesting() {} 222 virtual ~LayerTreeHostClientForTesting() {}
223 223
224 virtual void WillBeginFrame() OVERRIDE {} 224 virtual void WillBeginMainFrame() OVERRIDE {}
225 225
226 virtual void DidBeginFrame() OVERRIDE {} 226 virtual void DidBeginMainFrame() OVERRIDE {}
227 227
228 virtual void Animate(double monotonic_time) OVERRIDE { 228 virtual void Animate(double monotonic_time) OVERRIDE {
229 test_hooks_->Animate(base::TimeTicks::FromInternalValue( 229 test_hooks_->Animate(base::TimeTicks::FromInternalValue(
230 monotonic_time * base::Time::kMicrosecondsPerSecond)); 230 monotonic_time * base::Time::kMicrosecondsPerSecond));
231 } 231 }
232 232
233 virtual void Layout() OVERRIDE { 233 virtual void Layout() OVERRIDE {
234 test_hooks_->Layout(); 234 test_hooks_->Layout();
235 } 235 }
236 236
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 bool impl_side_painting) { 541 bool impl_side_painting) {
542 if (threaded) { 542 if (threaded) {
543 impl_thread_.reset(new base::Thread("Compositor")); 543 impl_thread_.reset(new base::Thread("Compositor"));
544 ASSERT_TRUE(impl_thread_->Start()); 544 ASSERT_TRUE(impl_thread_->Start());
545 } 545 }
546 546
547 main_ccthread_ = cc::ThreadImpl::CreateForCurrentThread(); 547 main_ccthread_ = cc::ThreadImpl::CreateForCurrentThread();
548 548
549 delegating_renderer_ = delegating_renderer; 549 delegating_renderer_ = delegating_renderer;
550 550
551 // Spend less time waiting for vsync because the output is mocked out. 551 // Spend less time waiting for BeginImplFrame because the output is
552 // mocked out.
552 settings_.refresh_rate = 200.0; 553 settings_.refresh_rate = 200.0;
553 if (impl_side_painting) { 554 if (impl_side_painting) {
554 DCHECK(threaded) << 555 DCHECK(threaded) <<
555 "Don't run single thread + impl side painting, it doesn't exist."; 556 "Don't run single thread + impl side painting, it doesn't exist.";
556 settings_.impl_side_painting = true; 557 settings_.impl_side_painting = true;
557 } 558 }
558 InitializeSettings(&settings_); 559 InitializeSettings(&settings_);
559 560
560 main_ccthread_->PostTask( 561 main_ccthread_->PostTask(
561 base::Bind(&LayerTreeTest::DoBeginTest, base::Unretained(this))); 562 base::Bind(&LayerTreeTest::DoBeginTest, base::Unretained(this)));
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 603
603 scoped_refptr<cc::ContextProvider> LayerTreeTest:: 604 scoped_refptr<cc::ContextProvider> LayerTreeTest::
604 OffscreenContextProviderForCompositorThread() { 605 OffscreenContextProviderForCompositorThread() {
605 if (!compositor_thread_contexts_ || 606 if (!compositor_thread_contexts_ ||
606 compositor_thread_contexts_->DestroyedOnMainThread()) 607 compositor_thread_contexts_->DestroyedOnMainThread())
607 compositor_thread_contexts_ = FakeContextProvider::Create(); 608 compositor_thread_contexts_ = FakeContextProvider::Create();
608 return compositor_thread_contexts_; 609 return compositor_thread_contexts_;
609 } 610 }
610 611
611 } // namespace cc 612 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698