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 <limits> | 7 #include <limits> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "cc/test/fake_rendering_stats_instrumentation.h" | 10 #include "cc/test/fake_rendering_stats_instrumentation.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 EXPECT_LT(y, tiling_.num_tiles_y()); | 59 EXPECT_LT(y, tiling_.num_tiles_y()); |
60 | 60 |
61 if (HasRecordingAt(x, y)) | 61 if (HasRecordingAt(x, y)) |
62 return; | 62 return; |
63 gfx::Rect bounds(tiling().TileBounds(x, y)); | 63 gfx::Rect bounds(tiling().TileBounds(x, y)); |
64 bounds.Inset(-buffer_pixels(), -buffer_pixels()); | 64 bounds.Inset(-buffer_pixels(), -buffer_pixels()); |
65 | 65 |
66 FakeRenderingStatsInstrumentation stats_instrumentation; | 66 FakeRenderingStatsInstrumentation stats_instrumentation; |
67 | 67 |
68 scoped_refptr<Picture> picture(Picture::Create(bounds)); | 68 scoped_refptr<Picture> picture(Picture::Create(bounds)); |
69 picture->Record(&client_, tile_grid_info_, &stats_instrumentation); | 69 picture->Record(&client_, tile_grid_info_); |
70 picture->GatherPixelRefs(tile_grid_info_, &stats_instrumentation); | 70 picture->GatherPixelRefs(tile_grid_info_, &stats_instrumentation); |
71 picture_list_map_[std::pair<int, int>(x, y)].push_back(picture); | 71 picture_list_map_[std::pair<int, int>(x, y)].push_back(picture); |
72 EXPECT_TRUE(HasRecordingAt(x, y)); | 72 EXPECT_TRUE(HasRecordingAt(x, y)); |
73 | 73 |
74 UpdateRecordedRegion(); | 74 UpdateRecordedRegion(); |
75 } | 75 } |
76 | 76 |
77 void FakePicturePileImpl::AddPictureToRecording( | 77 void FakePicturePileImpl::AddPictureToRecording( |
78 int x, | 78 int x, |
79 int y, | 79 int y, |
(...skipping 18 matching lines...) Expand all Loading... |
98 void FakePicturePileImpl::RerecordPile() { | 98 void FakePicturePileImpl::RerecordPile() { |
99 for (int y = 0; y < num_tiles_y(); ++y) { | 99 for (int y = 0; y < num_tiles_y(); ++y) { |
100 for (int x = 0; x < num_tiles_x(); ++x) { | 100 for (int x = 0; x < num_tiles_x(); ++x) { |
101 RemoveRecordingAt(x, y); | 101 RemoveRecordingAt(x, y); |
102 AddRecordingAt(x, y); | 102 AddRecordingAt(x, y); |
103 } | 103 } |
104 } | 104 } |
105 } | 105 } |
106 | 106 |
107 } // namespace cc | 107 } // namespace cc |
OLD | NEW |