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

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

Issue 27710005: cc: Use HighResNow as timebase if it is fast and reliable (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add missing include Created 7 years, 2 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"
11 #include "cc/animation/timing_function.h" 11 #include "cc/animation/timing_function.h"
12 #include "cc/base/switches.h" 12 #include "cc/base/switches.h"
13 #include "cc/debug/test_context_provider.h" 13 #include "cc/debug/test_context_provider.h"
14 #include "cc/input/input_handler.h" 14 #include "cc/input/input_handler.h"
15 #include "cc/layers/content_layer.h" 15 #include "cc/layers/content_layer.h"
16 #include "cc/layers/layer.h" 16 #include "cc/layers/layer.h"
17 #include "cc/layers/layer_impl.h" 17 #include "cc/layers/layer_impl.h"
18 #include "cc/test/animation_test_common.h" 18 #include "cc/test/animation_test_common.h"
19 #include "cc/test/fake_layer_tree_host_client.h" 19 #include "cc/test/fake_layer_tree_host_client.h"
20 #include "cc/test/fake_output_surface.h" 20 #include "cc/test/fake_output_surface.h"
21 #include "cc/test/occlusion_tracker_test_common.h" 21 #include "cc/test/occlusion_tracker_test_common.h"
22 #include "cc/test/tiled_layer_test_common.h" 22 #include "cc/test/tiled_layer_test_common.h"
23 #include "cc/trees/layer_tree_host_impl.h" 23 #include "cc/trees/layer_tree_host_impl.h"
24 #include "cc/trees/single_thread_proxy.h" 24 #include "cc/trees/single_thread_proxy.h"
25 #include "testing/gmock/include/gmock/gmock.h" 25 #include "testing/gmock/include/gmock/gmock.h"
26 #include "ui/gfx/frame_time.h"
26 #include "ui/gfx/size_conversions.h" 27 #include "ui/gfx/size_conversions.h"
27 28
28 namespace cc { 29 namespace cc {
29 30
30 TestHooks::TestHooks() {} 31 TestHooks::TestHooks() {}
31 32
32 TestHooks::~TestHooks() {} 33 TestHooks::~TestHooks() {}
33 34
34 bool TestHooks::PrepareToDrawOnThread(LayerTreeHostImpl* host_impl, 35 bool TestHooks::PrepareToDrawOnThread(LayerTreeHostImpl* host_impl,
35 LayerTreeHostImpl::FrameData* frame_data, 36 LayerTreeHostImpl::FrameData* frame_data,
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after
579 return; 580 return;
580 581
581 // If the LTH is not visible, defer the composite until the LTH is made 582 // If the LTH is not visible, defer the composite until the LTH is made
582 // visible. 583 // visible.
583 if (!layer_tree_host_->visible()) { 584 if (!layer_tree_host_->visible()) {
584 schedule_when_set_visible_true_ = true; 585 schedule_when_set_visible_true_ = true;
585 return; 586 return;
586 } 587 }
587 588
588 schedule_when_set_visible_true_ = false; 589 schedule_when_set_visible_true_ = false;
589 base::TimeTicks now = base::TimeTicks::Now(); 590 base::TimeTicks now = gfx::FrameTime::Now();
590 layer_tree_host_->Composite(now); 591 layer_tree_host_->Composite(now);
591 } 592 }
592 593
593 void LayerTreeTest::RunTest(bool threaded, 594 void LayerTreeTest::RunTest(bool threaded,
594 bool delegating_renderer, 595 bool delegating_renderer,
595 bool impl_side_painting) { 596 bool impl_side_painting) {
596 if (threaded) { 597 if (threaded) {
597 impl_thread_.reset(new base::Thread("Compositor")); 598 impl_thread_.reset(new base::Thread("Compositor"));
598 ASSERT_TRUE(impl_thread_->Start()); 599 ASSERT_TRUE(impl_thread_->Start());
599 } 600 }
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 } 656 }
656 657
657 scoped_refptr<ContextProvider> LayerTreeTest::OffscreenContextProvider() { 658 scoped_refptr<ContextProvider> LayerTreeTest::OffscreenContextProvider() {
658 if (!compositor_contexts_.get() || 659 if (!compositor_contexts_.get() ||
659 compositor_contexts_->DestroyedOnMainThread()) 660 compositor_contexts_->DestroyedOnMainThread())
660 compositor_contexts_ = TestContextProvider::Create(); 661 compositor_contexts_ = TestContextProvider::Create();
661 return compositor_contexts_; 662 return compositor_contexts_;
662 } 663 }
663 664
664 } // namespace cc 665 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698