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/test/fake_picture_pile_impl.h" | 5 #include "cc/test/fake_picture_pile_impl.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "cc/test/impl_side_painting_settings.h" | 9 #include "cc/test/impl_side_painting_settings.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 return; | 52 return; |
53 gfx::Rect bounds(tiling().TileBounds(x, y)); | 53 gfx::Rect bounds(tiling().TileBounds(x, y)); |
54 scoped_refptr<Picture> picture(Picture::Create(bounds)); | 54 scoped_refptr<Picture> picture(Picture::Create(bounds)); |
55 picture->Record(&client_, NULL, tile_grid_info_); | 55 picture->Record(&client_, NULL, tile_grid_info_); |
56 picture_list_map_[std::pair<int, int>(x, y)].push_back(picture); | 56 picture_list_map_[std::pair<int, int>(x, y)].push_back(picture); |
57 EXPECT_TRUE(HasRecordingAt(x, y)); | 57 EXPECT_TRUE(HasRecordingAt(x, y)); |
58 | 58 |
59 UpdateRecordedRegion(); | 59 UpdateRecordedRegion(); |
60 } | 60 } |
61 | 61 |
| 62 void FakePicturePileImpl::AddPictureToRecording( |
| 63 int x, |
| 64 int y, |
| 65 scoped_refptr<Picture> picture) { |
| 66 picture_list_map_[std::pair<int, int>(x, y)].push_back(picture); |
| 67 } |
| 68 |
62 void FakePicturePileImpl::RemoveRecordingAt(int x, int y) { | 69 void FakePicturePileImpl::RemoveRecordingAt(int x, int y) { |
63 EXPECT_GE(x, 0); | 70 EXPECT_GE(x, 0); |
64 EXPECT_GE(y, 0); | 71 EXPECT_GE(y, 0); |
65 EXPECT_LT(x, tiling_.num_tiles_x()); | 72 EXPECT_LT(x, tiling_.num_tiles_x()); |
66 EXPECT_LT(y, tiling_.num_tiles_y()); | 73 EXPECT_LT(y, tiling_.num_tiles_y()); |
67 | 74 |
68 if (!HasRecordingAt(x, y)) | 75 if (!HasRecordingAt(x, y)) |
69 return; | 76 return; |
70 picture_list_map_.erase(std::pair<int, int>(x, y)); | 77 picture_list_map_.erase(std::pair<int, int>(x, y)); |
71 EXPECT_FALSE(HasRecordingAt(x, y)); | 78 EXPECT_FALSE(HasRecordingAt(x, y)); |
72 | 79 |
73 UpdateRecordedRegion(); | 80 UpdateRecordedRegion(); |
74 } | 81 } |
75 | 82 |
76 } // namespace cc | 83 } // namespace cc |
OLD | NEW |