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/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
6 | 6 |
7 #include "cc/test/fake_content_layer_client.h" | 7 #include "cc/test/fake_content_layer_client.h" |
8 #include "cc/test/fake_picture_layer.h" | 8 #include "cc/test/fake_picture_layer.h" |
9 #include "cc/test/fake_picture_layer_impl.h" | 9 #include "cc/test/fake_picture_layer_impl.h" |
10 #include "cc/test/layer_tree_test.h" | 10 #include "cc/test/layer_tree_test.h" |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 int num_tiles_y = tiling->TilingDataForTesting().num_tiles_y(); | 243 int num_tiles_y = tiling->TilingDataForTesting().num_tiles_y(); |
244 | 244 |
245 // There should be tiles at the top of the picture layer but not at the | 245 // There should be tiles at the top of the picture layer but not at the |
246 // bottom. | 246 // bottom. |
247 EXPECT_TRUE(tiling->TileAt(0, 0)); | 247 EXPECT_TRUE(tiling->TileAt(0, 0)); |
248 EXPECT_FALSE(tiling->TileAt(0, num_tiles_y)); | 248 EXPECT_FALSE(tiling->TileAt(0, num_tiles_y)); |
249 | 249 |
250 // Make the bottom of the layer visible. | 250 // Make the bottom of the layer visible. |
251 gfx::Transform transform; | 251 gfx::Transform transform; |
252 transform.Translate(0.f, -100000.f + 100.f); | 252 transform.Translate(0.f, -100000.f + 100.f); |
253 impl->active_tree() | 253 impl->active_tree()->SetTransformMutated(picture_impl->element_id(), |
254 ->property_trees() | 254 transform); |
255 ->transform_tree.OnTransformAnimated( | |
256 transform, picture_impl->transform_tree_index(), | |
257 impl->active_tree()); | |
258 impl->SetNeedsRedraw(); | 255 impl->SetNeedsRedraw(); |
259 break; | 256 break; |
260 } | 257 } |
261 case 2: { | 258 case 2: { |
262 PictureLayerTiling* tiling = picture_impl->HighResTiling(); | 259 PictureLayerTiling* tiling = picture_impl->HighResTiling(); |
263 | 260 |
264 // There not be tiles at the top of the layer now. | 261 // There not be tiles at the top of the layer now. |
265 EXPECT_FALSE(tiling->TileAt(0, 0)); | 262 EXPECT_FALSE(tiling->TileAt(0, 0)); |
266 | 263 |
267 // Make the top of the layer visible again. | 264 // Make the top of the layer visible again. |
268 impl->active_tree() | 265 impl->active_tree()->SetTransformMutated(picture_impl->element_id(), |
269 ->property_trees() | 266 gfx::Transform()); |
270 ->transform_tree.OnTransformAnimated( | |
271 gfx::Transform(), picture_impl->transform_tree_index(), | |
272 impl->active_tree()); | |
273 impl->SetNeedsRedraw(); | 267 impl->SetNeedsRedraw(); |
274 break; | 268 break; |
275 } | 269 } |
276 case 3: { | 270 case 3: { |
277 PictureLayerTiling* tiling = picture_impl->HighResTiling(); | 271 PictureLayerTiling* tiling = picture_impl->HighResTiling(); |
278 int num_tiles_y = tiling->TilingDataForTesting().num_tiles_y(); | 272 int num_tiles_y = tiling->TilingDataForTesting().num_tiles_y(); |
279 | 273 |
280 // There should be tiles at the top of the picture layer again. | 274 // There should be tiles at the top of the picture layer again. |
281 EXPECT_TRUE(tiling->TileAt(0, 0)); | 275 EXPECT_TRUE(tiling->TileAt(0, 0)); |
282 EXPECT_FALSE(tiling->TileAt(0, num_tiles_y)); | 276 EXPECT_FALSE(tiling->TileAt(0, num_tiles_y)); |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
671 void AfterTest() override {} | 665 void AfterTest() override {} |
672 | 666 |
673 scoped_refptr<FakePictureLayer> will_change_layer_; | 667 scoped_refptr<FakePictureLayer> will_change_layer_; |
674 scoped_refptr<FakePictureLayer> normal_layer_; | 668 scoped_refptr<FakePictureLayer> normal_layer_; |
675 }; | 669 }; |
676 | 670 |
677 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostPictureTestForceRecalculateScales); | 671 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostPictureTestForceRecalculateScales); |
678 | 672 |
679 } // namespace | 673 } // namespace |
680 } // namespace cc | 674 } // namespace cc |
OLD | NEW |