OLD | NEW |
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/layers/layer_iterator.h" | 5 #include "cc/layers/layer_iterator.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "cc/layers/layer.h" | 9 #include "cc/layers/layer.h" |
10 #include "cc/test/fake_layer_tree_host.h" | 10 #include "cc/test/fake_layer_tree_host.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 int count_representing_contributing_surface_; | 31 int count_representing_contributing_surface_; |
32 int count_representing_itself_; | 32 int count_representing_itself_; |
33 | 33 |
34 virtual bool DrawsContent() const OVERRIDE { return draws_content_; } | 34 virtual bool DrawsContent() const OVERRIDE { return draws_content_; } |
35 void set_draws_content(bool draws_content) { draws_content_ = draws_content; } | 35 void set_draws_content(bool draws_content) { draws_content_ = draws_content; } |
36 | 36 |
37 private: | 37 private: |
38 TestLayer() : Layer(), draws_content_(true) { | 38 TestLayer() : Layer(), draws_content_(true) { |
39 SetBounds(gfx::Size(100, 100)); | 39 SetBounds(gfx::Size(100, 100)); |
40 SetPosition(gfx::Point()); | 40 SetPosition(gfx::Point()); |
41 SetAnchorPoint(gfx::Point()); | |
42 } | 41 } |
43 virtual ~TestLayer() {} | 42 virtual ~TestLayer() {} |
44 | 43 |
45 bool draws_content_; | 44 bool draws_content_; |
46 }; | 45 }; |
47 | 46 |
48 #define EXPECT_COUNT(layer, target, contrib, itself) \ | 47 #define EXPECT_COUNT(layer, target, contrib, itself) \ |
49 EXPECT_EQ(target, layer->count_representing_target_surface_); \ | 48 EXPECT_EQ(target, layer->count_representing_target_surface_); \ |
50 EXPECT_EQ(contrib, layer->count_representing_contributing_surface_); \ | 49 EXPECT_EQ(contrib, layer->count_representing_contributing_surface_); \ |
51 EXPECT_EQ(itself, layer->count_representing_itself_); | 50 EXPECT_EQ(itself, layer->count_representing_itself_); |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 EXPECT_COUNT(root21, -1, -1, 9); | 207 EXPECT_COUNT(root21, -1, -1, 9); |
209 EXPECT_COUNT(root22, 7, 8, 6); | 208 EXPECT_COUNT(root22, 7, 8, 6); |
210 EXPECT_COUNT(root221, -1, -1, 5); | 209 EXPECT_COUNT(root221, -1, -1, 5); |
211 EXPECT_COUNT(root23, 3, 4, 2); | 210 EXPECT_COUNT(root23, 3, 4, 2); |
212 EXPECT_COUNT(root231, -1, -1, 1); | 211 EXPECT_COUNT(root231, -1, -1, 1); |
213 EXPECT_COUNT(root3, -1, -1, 0); | 212 EXPECT_COUNT(root3, -1, -1, 0); |
214 } | 213 } |
215 | 214 |
216 } // namespace | 215 } // namespace |
217 } // namespace cc | 216 } // namespace cc |
OLD | NEW |