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 SkTileGridPicture::TileGridInfo grid_info; |
| 94 grid_info.fMargin.set(1, 1); |
| 95 grid_info.fOffset.set(-1, -1); |
| 96 grid_info.fTileInterval.set(100, 100); |
| 97 picture->Record(&client, NULL, grid_info); |
94 picture_list_map_[std::pair<int, int>(x, y)].push_back(picture); | 98 picture_list_map_[std::pair<int, int>(x, y)].push_back(picture); |
95 EXPECT_TRUE(HasRecordingAt(x, y)); | 99 EXPECT_TRUE(HasRecordingAt(x, y)); |
96 | 100 |
97 UpdateRecordedRegion(); | 101 UpdateRecordedRegion(); |
98 } | 102 } |
99 | 103 |
100 void RemoveRecordingAt(int x, int y) { | 104 void RemoveRecordingAt(int x, int y) { |
101 EXPECT_GE(x, 0); | 105 EXPECT_GE(x, 0); |
102 EXPECT_GE(y, 0); | 106 EXPECT_GE(y, 0); |
103 EXPECT_LT(x, tiling_.num_tiles_x()); | 107 EXPECT_LT(x, tiling_.num_tiles_x()); |
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 active_layer_->CleanUpTilingsOnActiveLayer(used_tilings); | 607 active_layer_->CleanUpTilingsOnActiveLayer(used_tilings); |
604 ASSERT_EQ(3u, active_layer_->tilings().num_tilings()); | 608 ASSERT_EQ(3u, active_layer_->tilings().num_tilings()); |
605 used_tilings.clear(); | 609 used_tilings.clear(); |
606 active_layer_->CleanUpTilingsOnActiveLayer(used_tilings); | 610 active_layer_->CleanUpTilingsOnActiveLayer(used_tilings); |
607 ASSERT_EQ(2u, active_layer_->tilings().num_tilings()); | 611 ASSERT_EQ(2u, active_layer_->tilings().num_tilings()); |
608 | 612 |
609 } | 613 } |
610 | 614 |
611 } // namespace | 615 } // namespace |
612 } // namespace cc | 616 } // namespace cc |
OLD | NEW |