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" | |
11 #include "cc/test/impl_side_painting_settings.h" | 10 #include "cc/test/impl_side_painting_settings.h" |
12 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
13 | 12 |
14 namespace cc { | 13 namespace cc { |
15 | 14 |
16 FakePicturePileImpl::FakePicturePileImpl() {} | 15 FakePicturePileImpl::FakePicturePileImpl() {} |
17 | 16 |
18 FakePicturePileImpl::~FakePicturePileImpl() {} | 17 FakePicturePileImpl::~FakePicturePileImpl() {} |
19 | 18 |
20 scoped_refptr<FakePicturePileImpl> FakePicturePileImpl::CreateFilledPile( | 19 scoped_refptr<FakePicturePileImpl> FakePicturePileImpl::CreateFilledPile( |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 EXPECT_GE(x, 0); | 55 EXPECT_GE(x, 0); |
57 EXPECT_GE(y, 0); | 56 EXPECT_GE(y, 0); |
58 EXPECT_LT(x, tiling_.num_tiles_x()); | 57 EXPECT_LT(x, tiling_.num_tiles_x()); |
59 EXPECT_LT(y, tiling_.num_tiles_y()); | 58 EXPECT_LT(y, tiling_.num_tiles_y()); |
60 | 59 |
61 if (HasRecordingAt(x, y)) | 60 if (HasRecordingAt(x, y)) |
62 return; | 61 return; |
63 gfx::Rect bounds(tiling().TileBounds(x, y)); | 62 gfx::Rect bounds(tiling().TileBounds(x, y)); |
64 bounds.Inset(-buffer_pixels(), -buffer_pixels()); | 63 bounds.Inset(-buffer_pixels(), -buffer_pixels()); |
65 | 64 |
66 FakeRenderingStatsInstrumentation stats_instrumentation; | |
67 | |
68 scoped_refptr<Picture> picture(Picture::Create(bounds)); | 65 scoped_refptr<Picture> picture(Picture::Create(bounds)); |
69 picture->Record(&client_, tile_grid_info_); | 66 picture->Record(&client_, tile_grid_info_); |
70 picture->GatherPixelRefs(tile_grid_info_, &stats_instrumentation); | 67 picture->GatherPixelRefs(tile_grid_info_); |
71 picture_list_map_[std::pair<int, int>(x, y)].push_back(picture); | 68 picture_list_map_[std::pair<int, int>(x, y)].push_back(picture); |
72 EXPECT_TRUE(HasRecordingAt(x, y)); | 69 EXPECT_TRUE(HasRecordingAt(x, y)); |
73 | 70 |
74 UpdateRecordedRegion(); | 71 UpdateRecordedRegion(); |
75 } | 72 } |
76 | 73 |
77 void FakePicturePileImpl::AddPictureToRecording( | 74 void FakePicturePileImpl::AddPictureToRecording( |
78 int x, | 75 int x, |
79 int y, | 76 int y, |
80 scoped_refptr<Picture> picture) { | 77 scoped_refptr<Picture> picture) { |
(...skipping 17 matching lines...) Expand all Loading... |
98 void FakePicturePileImpl::RerecordPile() { | 95 void FakePicturePileImpl::RerecordPile() { |
99 for (int y = 0; y < num_tiles_y(); ++y) { | 96 for (int y = 0; y < num_tiles_y(); ++y) { |
100 for (int x = 0; x < num_tiles_x(); ++x) { | 97 for (int x = 0; x < num_tiles_x(); ++x) { |
101 RemoveRecordingAt(x, y); | 98 RemoveRecordingAt(x, y); |
102 AddRecordingAt(x, y); | 99 AddRecordingAt(x, y); |
103 } | 100 } |
104 } | 101 } |
105 } | 102 } |
106 | 103 |
107 } // namespace cc | 104 } // namespace cc |
OLD | NEW |