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