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/resources/tile_priority.h" | 8 #include "cc/resources/tile_priority.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" |
(...skipping 14 matching lines...) Expand all Loading... |
25 : PictureImageLayerImpl(tree_impl, id) { | 25 : PictureImageLayerImpl(tree_impl, id) { |
26 } | 26 } |
27 using PictureLayerImpl::UpdateIdealScales; | 27 using PictureLayerImpl::UpdateIdealScales; |
28 using PictureLayerImpl::MaximumTilingContentsScale; | 28 using PictureLayerImpl::MaximumTilingContentsScale; |
29 using PictureLayerImpl::ManageTilings; | 29 using PictureLayerImpl::ManageTilings; |
30 using PictureLayerImpl::DoPostCommitInitializationIfNeeded; | 30 using PictureLayerImpl::DoPostCommitInitializationIfNeeded; |
31 | 31 |
32 void ScaleAndManageTilings(bool animating_transform_to_screen, | 32 void ScaleAndManageTilings(bool animating_transform_to_screen, |
33 float maximum_animation_contents_scale) { | 33 float maximum_animation_contents_scale) { |
34 DoPostCommitInitializationIfNeeded(); | 34 DoPostCommitInitializationIfNeeded(); |
35 UpdateIdealScales(); | |
36 if (CanHaveTilings()) { | 35 if (CanHaveTilings()) { |
| 36 UpdateIdealScales(); |
37 ManageTilings(animating_transform_to_screen, | 37 ManageTilings(animating_transform_to_screen, |
38 maximum_animation_contents_scale); | 38 maximum_animation_contents_scale); |
39 } | 39 } |
40 } | 40 } |
41 PictureLayerTilingSet* tilings() { return tilings_.get(); } | 41 PictureLayerTilingSet* tilings() { return tilings_.get(); } |
42 | 42 |
43 friend class PictureImageLayerImplTest; | 43 friend class PictureImageLayerImplTest; |
44 }; | 44 }; |
45 | 45 |
46 class PictureImageLayerImplTest : public testing::Test { | 46 class PictureImageLayerImplTest : public testing::Test { |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 active_layer->DidDraw(NULL); | 164 active_layer->DidDraw(NULL); |
165 | 165 |
166 EXPECT_EQ(DrawQuad::TILED_CONTENT, quad_culler.quad_list()[0]->material); | 166 EXPECT_EQ(DrawQuad::TILED_CONTENT, quad_culler.quad_list()[0]->material); |
167 | 167 |
168 // Tiles are ready at correct scale, so should not set had_incomplete_tile. | 168 // Tiles are ready at correct scale, so should not set had_incomplete_tile. |
169 EXPECT_FALSE(data.had_incomplete_tile); | 169 EXPECT_FALSE(data.had_incomplete_tile); |
170 } | 170 } |
171 | 171 |
172 } // namespace | 172 } // namespace |
173 } // namespace cc | 173 } // namespace cc |
OLD | NEW |