| 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 EXPECT_GE(x, 0); | 113 EXPECT_GE(x, 0); |
| 114 EXPECT_GE(y, 0); | 114 EXPECT_GE(y, 0); |
| 115 EXPECT_LT(x, tiling_.num_tiles_x()); | 115 EXPECT_LT(x, tiling_.num_tiles_x()); |
| 116 EXPECT_LT(y, tiling_.num_tiles_y()); | 116 EXPECT_LT(y, tiling_.num_tiles_y()); |
| 117 | 117 |
| 118 if (HasRecordingAt(x, y)) | 118 if (HasRecordingAt(x, y)) |
| 119 return; | 119 return; |
| 120 gfx::Rect bounds(tiling().TileBounds(x, y)); | 120 gfx::Rect bounds(tiling().TileBounds(x, y)); |
| 121 bounds.Inset(-buffer_pixels(), -buffer_pixels()); | 121 bounds.Inset(-buffer_pixels(), -buffer_pixels()); |
| 122 | 122 |
| 123 scoped_refptr<Picture> picture(Picture::Create( | 123 scoped_refptr<Picture> picture( |
| 124 bounds, &client_, tile_grid_size_, true, Picture::RECORD_NORMALLY)); | 124 Picture::Create(bounds, &client_, tile_grid_size_, true, |
| 125 RecordingSource::RECORD_NORMALLY)); |
| 125 picture_map_[std::pair<int, int>(x, y)].SetPicture(picture); | 126 picture_map_[std::pair<int, int>(x, y)].SetPicture(picture); |
| 126 EXPECT_TRUE(HasRecordingAt(x, y)); | 127 EXPECT_TRUE(HasRecordingAt(x, y)); |
| 127 | 128 |
| 128 has_any_recordings_ = true; | 129 has_any_recordings_ = true; |
| 129 } | 130 } |
| 130 | 131 |
| 131 void FakePicturePileImpl::RemoveRecordingAt(int x, int y) { | 132 void FakePicturePileImpl::RemoveRecordingAt(int x, int y) { |
| 132 EXPECT_GE(x, 0); | 133 EXPECT_GE(x, 0); |
| 133 EXPECT_GE(y, 0); | 134 EXPECT_GE(y, 0); |
| 134 EXPECT_LT(x, tiling_.num_tiles_x()); | 135 EXPECT_LT(x, tiling_.num_tiles_x()); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 Clear(); | 184 Clear(); |
| 184 tiling_.SetBorderTexels(new_buffer_pixels); | 185 tiling_.SetBorderTexels(new_buffer_pixels); |
| 185 } | 186 } |
| 186 | 187 |
| 187 void FakePicturePileImpl::Clear() { | 188 void FakePicturePileImpl::Clear() { |
| 188 picture_map_.clear(); | 189 picture_map_.clear(); |
| 189 recorded_viewport_ = gfx::Rect(); | 190 recorded_viewport_ = gfx::Rect(); |
| 190 } | 191 } |
| 191 | 192 |
| 192 } // namespace cc | 193 } // namespace cc |
| OLD | NEW |