OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/layers/layer.h" | 5 #include "cc/layers/layer.h" |
6 | 6 |
7 #include "cc/resources/layer_painter.h" | 7 #include "cc/resources/layer_painter.h" |
8 #include "cc/test/fake_impl_proxy.h" | 8 #include "cc/test/fake_impl_proxy.h" |
9 #include "cc/test/fake_layer_tree_host.h" | 9 #include "cc/test/fake_layer_tree_host.h" |
10 #include "cc/test/fake_layer_tree_host_client.h" | 10 #include "cc/test/fake_layer_tree_host_client.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 public: | 25 public: |
26 virtual void Paint(SkCanvas* canvas, | 26 virtual void Paint(SkCanvas* canvas, |
27 const gfx::Rect& content_rect, | 27 const gfx::Rect& content_rect, |
28 gfx::RectF* opaque) OVERRIDE {} | 28 gfx::RectF* opaque) OVERRIDE {} |
29 }; | 29 }; |
30 | 30 |
31 | 31 |
32 class LayerPerfTest : public testing::Test { | 32 class LayerPerfTest : public testing::Test { |
33 public: | 33 public: |
34 LayerPerfTest() | 34 LayerPerfTest() |
35 : host_impl_(&proxy_), | 35 : host_impl_(&proxy_, &shared_bitmap_manager_), |
36 fake_client_(FakeLayerTreeHostClient::DIRECT_3D), | 36 fake_client_(FakeLayerTreeHostClient::DIRECT_3D), |
37 timer_(kWarmupRuns, | 37 timer_(kWarmupRuns, |
38 base::TimeDelta::FromMilliseconds(kTimeLimitMillis), | 38 base::TimeDelta::FromMilliseconds(kTimeLimitMillis), |
39 kTimeCheckInterval) {} | 39 kTimeCheckInterval) {} |
40 | 40 |
41 protected: | 41 protected: |
42 virtual void SetUp() OVERRIDE { | 42 virtual void SetUp() OVERRIDE { |
43 layer_tree_host_ = FakeLayerTreeHost::Create(); | 43 layer_tree_host_ = FakeLayerTreeHost::Create(); |
44 layer_tree_host_->InitializeSingleThreaded(&fake_client_); | 44 layer_tree_host_->InitializeSingleThreaded(&fake_client_); |
45 } | 45 } |
46 | 46 |
47 virtual void TearDown() OVERRIDE { | 47 virtual void TearDown() OVERRIDE { |
48 layer_tree_host_->SetRootLayer(NULL); | 48 layer_tree_host_->SetRootLayer(NULL); |
49 layer_tree_host_.reset(); | 49 layer_tree_host_.reset(); |
50 } | 50 } |
51 | 51 |
52 FakeImplProxy proxy_; | 52 FakeImplProxy proxy_; |
| 53 TestSharedBitmapManager shared_bitmap_manager_; |
53 FakeLayerTreeHostImpl host_impl_; | 54 FakeLayerTreeHostImpl host_impl_; |
54 | 55 |
55 FakeLayerTreeHostClient fake_client_; | 56 FakeLayerTreeHostClient fake_client_; |
56 scoped_ptr<FakeLayerTreeHost> layer_tree_host_; | 57 scoped_ptr<FakeLayerTreeHost> layer_tree_host_; |
57 LapTimer timer_; | 58 LapTimer timer_; |
58 }; | 59 }; |
59 | 60 |
60 TEST_F(LayerPerfTest, PushPropertiesTo) { | 61 TEST_F(LayerPerfTest, PushPropertiesTo) { |
61 scoped_refptr<Layer> test_layer = Layer::Create(); | 62 scoped_refptr<Layer> test_layer = Layer::Create(); |
62 scoped_ptr<LayerImpl> impl_layer = | 63 scoped_ptr<LayerImpl> impl_layer = |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 "", | 113 "", |
113 "props_didnt_change", | 114 "props_didnt_change", |
114 timer_.LapsPerSecond(), | 115 timer_.LapsPerSecond(), |
115 "runs/s", | 116 "runs/s", |
116 true); | 117 true); |
117 } | 118 } |
118 | 119 |
119 | 120 |
120 } // namespace | 121 } // namespace |
121 } // namespace cc | 122 } // namespace cc |
OLD | NEW |