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_image_layer_impl.h" | 5 #include "cc/layers/picture_image_layer_impl.h" |
6 | 6 |
7 #include "cc/layers/append_quads_data.h" | 7 #include "cc/layers/append_quads_data.h" |
8 #include "cc/quads/draw_quad.h" | 8 #include "cc/quads/draw_quad.h" |
9 #include "cc/resources/tile_priority.h" | 9 #include "cc/resources/tile_priority.h" |
10 #include "cc/test/fake_impl_proxy.h" | 10 #include "cc/test/fake_impl_proxy.h" |
11 #include "cc/test/fake_layer_tree_host_impl.h" | 11 #include "cc/test/fake_layer_tree_host_impl.h" |
12 #include "cc/test/fake_output_surface.h" | 12 #include "cc/test/fake_output_surface.h" |
13 #include "cc/test/fake_picture_pile_impl.h" | 13 #include "cc/test/fake_picture_pile_impl.h" |
14 #include "cc/test/impl_side_painting_settings.h" | 14 #include "cc/test/impl_side_painting_settings.h" |
15 #include "cc/test/test_shared_bitmap_manager.h" | 15 #include "cc/test/test_shared_bitmap_manager.h" |
16 #include "cc/trees/layer_tree_impl.h" | 16 #include "cc/trees/layer_tree_impl.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 17 #include "testing/gtest/include/gtest/gtest.h" |
18 | 18 |
19 namespace cc { | 19 namespace cc { |
20 namespace { | 20 namespace { |
21 | 21 |
22 class TestablePictureImageLayerImpl : public PictureImageLayerImpl { | 22 class TestablePictureImageLayerImpl : public PictureImageLayerImpl { |
23 public: | 23 public: |
24 TestablePictureImageLayerImpl(LayerTreeImpl* tree_impl, int id) | 24 TestablePictureImageLayerImpl(LayerTreeImpl* tree_impl, int id) |
25 : PictureImageLayerImpl(tree_impl, id) { | 25 : PictureImageLayerImpl(tree_impl, id, false) {} |
26 } | |
27 using PictureLayerImpl::UpdateIdealScales; | 26 using PictureLayerImpl::UpdateIdealScales; |
28 using PictureLayerImpl::MaximumTilingContentsScale; | 27 using PictureLayerImpl::MaximumTilingContentsScale; |
29 using PictureLayerImpl::DoPostCommitInitializationIfNeeded; | 28 using PictureLayerImpl::DoPostCommitInitializationIfNeeded; |
30 | 29 |
31 PictureLayerTilingSet* tilings() { return tilings_.get(); } | 30 PictureLayerTilingSet* tilings() { return tilings_.get(); } |
32 | 31 |
33 friend class PictureImageLayerImplTest; | 32 friend class PictureImageLayerImplTest; |
34 }; | 33 }; |
35 | 34 |
36 class PictureImageLayerImplTest : public testing::Test { | 35 class PictureImageLayerImplTest : public testing::Test { |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 active_layer->DidDraw(nullptr); | 155 active_layer->DidDraw(nullptr); |
157 | 156 |
158 EXPECT_EQ(DrawQuad::TILED_CONTENT, render_pass->quad_list.front()->material); | 157 EXPECT_EQ(DrawQuad::TILED_CONTENT, render_pass->quad_list.front()->material); |
159 | 158 |
160 // Tiles are ready at correct scale, so should not set had_incomplete_tile. | 159 // Tiles are ready at correct scale, so should not set had_incomplete_tile. |
161 EXPECT_EQ(0, data.num_incomplete_tiles); | 160 EXPECT_EQ(0, data.num_incomplete_tiles); |
162 } | 161 } |
163 | 162 |
164 } // namespace | 163 } // namespace |
165 } // namespace cc | 164 } // namespace cc |
OLD | NEW |