| 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 22 matching lines...) Expand all Loading... |
| 33 int count_representing_contributing_surface_; | 33 int count_representing_contributing_surface_; |
| 34 int count_representing_itself_; | 34 int count_representing_itself_; |
| 35 | 35 |
| 36 private: | 36 private: |
| 37 explicit TestLayerImpl(LayerTreeImpl* tree, int id) | 37 explicit TestLayerImpl(LayerTreeImpl* tree, int id) |
| 38 : LayerImpl(tree, id, new SyncedScrollOffset), | 38 : LayerImpl(tree, id, new SyncedScrollOffset), |
| 39 count_representing_target_surface_(-1), | 39 count_representing_target_surface_(-1), |
| 40 count_representing_contributing_surface_(-1), | 40 count_representing_contributing_surface_(-1), |
| 41 count_representing_itself_(-1) { | 41 count_representing_itself_(-1) { |
| 42 SetBounds(gfx::Size(100, 100)); | 42 SetBounds(gfx::Size(100, 100)); |
| 43 SetPosition(gfx::Point()); | 43 SetPosition(gfx::PointF()); |
| 44 SetDrawsContent(true); | 44 SetDrawsContent(true); |
| 45 } | 45 } |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 #define EXPECT_COUNT(layer, target, contrib, itself) \ | 48 #define EXPECT_COUNT(layer, target, contrib, itself) \ |
| 49 EXPECT_EQ(target, layer->count_representing_target_surface_); \ | 49 EXPECT_EQ(target, layer->count_representing_target_surface_); \ |
| 50 EXPECT_EQ(contrib, layer->count_representing_contributing_surface_); \ | 50 EXPECT_EQ(contrib, layer->count_representing_contributing_surface_); \ |
| 51 EXPECT_EQ(itself, layer->count_representing_itself_); | 51 EXPECT_EQ(itself, layer->count_representing_itself_); |
| 52 | 52 |
| 53 void ResetCounts(LayerImplList* render_surface_layer_list) { | 53 void ResetCounts(LayerImplList* render_surface_layer_list) { |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 EXPECT_COUNT(root21_ptr, -1, -1, 9); | 248 EXPECT_COUNT(root21_ptr, -1, -1, 9); |
| 249 EXPECT_COUNT(root22_ptr, 7, 8, 6); | 249 EXPECT_COUNT(root22_ptr, 7, 8, 6); |
| 250 EXPECT_COUNT(root221_ptr, -1, -1, 5); | 250 EXPECT_COUNT(root221_ptr, -1, -1, 5); |
| 251 EXPECT_COUNT(root23_ptr, 3, 4, 2); | 251 EXPECT_COUNT(root23_ptr, 3, 4, 2); |
| 252 EXPECT_COUNT(root231_ptr, -1, -1, 1); | 252 EXPECT_COUNT(root231_ptr, -1, -1, 1); |
| 253 EXPECT_COUNT(root3_ptr, -1, -1, 0); | 253 EXPECT_COUNT(root3_ptr, -1, -1, 0); |
| 254 } | 254 } |
| 255 | 255 |
| 256 } // namespace | 256 } // namespace |
| 257 } // namespace cc | 257 } // namespace cc |
| OLD | NEW |