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/layers/picture_layer_impl.h" | 5 #include "cc/layers/picture_layer_impl.h" |
6 | 6 |
7 #include "cc/layers/picture_layer.h" | 7 #include "cc/layers/picture_layer.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" |
11 #include "cc/test/fake_output_surface.h" | 11 #include "cc/test/fake_output_surface.h" |
| 12 #include "cc/test/fake_rendering_stats_instrumentation.h" |
12 #include "cc/test/impl_side_painting_settings.h" | 13 #include "cc/test/impl_side_painting_settings.h" |
13 #include "cc/trees/layer_tree_impl.h" | 14 #include "cc/trees/layer_tree_impl.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
15 #include "third_party/skia/include/core/SkDevice.h" | 16 #include "third_party/skia/include/core/SkDevice.h" |
16 #include "ui/gfx/rect_conversions.h" | 17 #include "ui/gfx/rect_conversions.h" |
17 | 18 |
18 namespace cc { | 19 namespace cc { |
19 namespace { | 20 namespace { |
20 | 21 |
21 class TestablePictureLayerImpl : public PictureLayerImpl { | 22 class TestablePictureLayerImpl : public PictureLayerImpl { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 void AddRecordingAt(int x, int y) { | 87 void AddRecordingAt(int x, int y) { |
87 EXPECT_GE(x, 0); | 88 EXPECT_GE(x, 0); |
88 EXPECT_GE(y, 0); | 89 EXPECT_GE(y, 0); |
89 EXPECT_LT(x, tiling_.num_tiles_x()); | 90 EXPECT_LT(x, tiling_.num_tiles_x()); |
90 EXPECT_LT(y, tiling_.num_tiles_y()); | 91 EXPECT_LT(y, tiling_.num_tiles_y()); |
91 | 92 |
92 if (HasRecordingAt(x, y)) | 93 if (HasRecordingAt(x, y)) |
93 return; | 94 return; |
94 gfx::Rect bounds(tiling().TileBounds(x, y)); | 95 gfx::Rect bounds(tiling().TileBounds(x, y)); |
95 scoped_refptr<Picture> picture(Picture::Create(bounds)); | 96 scoped_refptr<Picture> picture(Picture::Create(bounds)); |
96 picture->Record(&client_, NULL, tile_grid_info_); | 97 FakeRenderingStatsInstrumentation stats_instrumentation; |
| 98 picture->Record(&client_, &stats_instrumentation, tile_grid_info_); |
97 picture_list_map_[std::pair<int, int>(x, y)].push_back(picture); | 99 picture_list_map_[std::pair<int, int>(x, y)].push_back(picture); |
98 EXPECT_TRUE(HasRecordingAt(x, y)); | 100 EXPECT_TRUE(HasRecordingAt(x, y)); |
99 | 101 |
100 UpdateRecordedRegion(); | 102 UpdateRecordedRegion(); |
101 } | 103 } |
102 | 104 |
103 void RemoveRecordingAt(int x, int y) { | 105 void RemoveRecordingAt(int x, int y) { |
104 EXPECT_GE(x, 0); | 106 EXPECT_GE(x, 0); |
105 EXPECT_GE(y, 0); | 107 EXPECT_GE(y, 0); |
106 EXPECT_LT(x, tiling_.num_tiles_x()); | 108 EXPECT_LT(x, tiling_.num_tiles_x()); |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 used_tilings.push_back(active_layer_->tilings().tiling_at(1)); | 687 used_tilings.push_back(active_layer_->tilings().tiling_at(1)); |
686 active_layer_->CleanUpTilingsOnActiveLayer(used_tilings); | 688 active_layer_->CleanUpTilingsOnActiveLayer(used_tilings); |
687 ASSERT_EQ(3u, active_layer_->tilings().num_tilings()); | 689 ASSERT_EQ(3u, active_layer_->tilings().num_tilings()); |
688 used_tilings.clear(); | 690 used_tilings.clear(); |
689 active_layer_->CleanUpTilingsOnActiveLayer(used_tilings); | 691 active_layer_->CleanUpTilingsOnActiveLayer(used_tilings); |
690 ASSERT_EQ(2u, active_layer_->tilings().num_tilings()); | 692 ASSERT_EQ(2u, active_layer_->tilings().num_tilings()); |
691 } | 693 } |
692 | 694 |
693 } // namespace | 695 } // namespace |
694 } // namespace cc | 696 } // namespace cc |
OLD | NEW |