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/picture_layer_impl.h" | 5 #include "cc/picture_layer_impl.h" |
6 | 6 |
7 #include "cc/layer_tree_impl.h" | 7 #include "cc/layer_tree_impl.h" |
8 #include "cc/test/fake_content_layer_client.h" | 8 #include "cc/test/fake_content_layer_client.h" |
9 #include "cc/test/fake_impl_proxy.h" | 9 #include "cc/test/fake_impl_proxy.h" |
10 #include "cc/test/fake_layer_tree_host_impl.h" | 10 #include "cc/test/fake_layer_tree_host_impl.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 EXPECT_GE(x, 0); | 83 EXPECT_GE(x, 0); |
84 EXPECT_GE(y, 0); | 84 EXPECT_GE(y, 0); |
85 EXPECT_LT(x, tiling_.num_tiles_x()); | 85 EXPECT_LT(x, tiling_.num_tiles_x()); |
86 EXPECT_LT(y, tiling_.num_tiles_y()); | 86 EXPECT_LT(y, tiling_.num_tiles_y()); |
87 | 87 |
88 if (HasRecordingAt(x, y)) | 88 if (HasRecordingAt(x, y)) |
89 return; | 89 return; |
90 gfx::Rect bounds(tiling().TileBounds(x, y)); | 90 gfx::Rect bounds(tiling().TileBounds(x, y)); |
91 scoped_refptr<Picture> picture(Picture::Create(bounds)); | 91 scoped_refptr<Picture> picture(Picture::Create(bounds)); |
92 FakeContentLayerClient client; | 92 FakeContentLayerClient client; |
93 picture->Record(&client, NULL); | 93 picture->Record(&client, NULL, tiling().TileStride()); |
94 picture_list_map_[std::pair<int, int>(x, y)].push_back(picture); | 94 picture_list_map_[std::pair<int, int>(x, y)].push_back(picture); |
95 EXPECT_TRUE(HasRecordingAt(x, y)); | 95 EXPECT_TRUE(HasRecordingAt(x, y)); |
96 | 96 |
97 UpdateRecordedRegion(); | 97 UpdateRecordedRegion(); |
98 } | 98 } |
99 | 99 |
100 void RemoveRecordingAt(int x, int y) { | 100 void RemoveRecordingAt(int x, int y) { |
101 EXPECT_GE(x, 0); | 101 EXPECT_GE(x, 0); |
102 EXPECT_GE(y, 0); | 102 EXPECT_GE(y, 0); |
103 EXPECT_LT(x, tiling_.num_tiles_x()); | 103 EXPECT_LT(x, tiling_.num_tiles_x()); |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
599 active_layer_->CleanUpTilingsOnActiveLayer(used_tilings); | 599 active_layer_->CleanUpTilingsOnActiveLayer(used_tilings); |
600 ASSERT_EQ(3u, active_layer_->tilings().num_tilings()); | 600 ASSERT_EQ(3u, active_layer_->tilings().num_tilings()); |
601 used_tilings.clear(); | 601 used_tilings.clear(); |
602 active_layer_->CleanUpTilingsOnActiveLayer(used_tilings); | 602 active_layer_->CleanUpTilingsOnActiveLayer(used_tilings); |
603 ASSERT_EQ(2u, active_layer_->tilings().num_tilings()); | 603 ASSERT_EQ(2u, active_layer_->tilings().num_tilings()); |
604 | 604 |
605 } | 605 } |
606 | 606 |
607 } // namespace | 607 } // namespace |
608 } // namespace cc | 608 } // namespace cc |
OLD | NEW |