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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 pinch_->SetIsContainerForFixedPositionLayers(true); | 416 pinch_->SetIsContainerForFixedPositionLayers(true); |
417 page_scale_layer->AddChild(pinch_); | 417 page_scale_layer->AddChild(pinch_); |
418 root_clip->AddChild(page_scale_layer); | 418 root_clip->AddChild(page_scale_layer); |
419 | 419 |
420 // Don't be solid color so the layer has tilings/tiles. | 420 // Don't be solid color so the layer has tilings/tiles. |
421 client_.set_fill_with_nonsolid_color(true); | 421 client_.set_fill_with_nonsolid_color(true); |
422 picture_ = FakePictureLayer::Create(&client_); | 422 picture_ = FakePictureLayer::Create(&client_); |
423 picture_->SetBounds(gfx::Size(100, 100)); | 423 picture_->SetBounds(gfx::Size(100, 100)); |
424 pinch_->AddChild(picture_); | 424 pinch_->AddChild(picture_); |
425 | 425 |
426 layer_tree_host()->RegisterViewportLayers(NULL, page_scale_layer, root_clip, | 426 LayerTreeHost::ViewportLayers viewport_layers; |
427 nullptr, pinch_, nullptr); | 427 viewport_layers.page_scale = page_scale_layer; |
| 428 viewport_layers.inner_viewport_container = root_clip; |
| 429 viewport_layers.inner_viewport_scroll = pinch_; |
| 430 layer_tree_host()->RegisterViewportLayers(viewport_layers); |
428 layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 1.f, 4.f); | 431 layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 1.f, 4.f); |
429 layer_tree_host()->SetRootLayer(root_clip); | 432 layer_tree_host()->SetRootLayer(root_clip); |
430 LayerTreeHostPictureTest::SetupTree(); | 433 LayerTreeHostPictureTest::SetupTree(); |
431 client_.set_bounds(picture_->bounds()); | 434 client_.set_bounds(picture_->bounds()); |
432 } | 435 } |
433 | 436 |
434 void InitializeSettings(LayerTreeSettings* settings) override { | 437 void InitializeSettings(LayerTreeSettings* settings) override { |
435 settings->layer_transforms_should_scale_layer_contents = true; | 438 settings->layer_transforms_should_scale_layer_contents = true; |
436 } | 439 } |
437 | 440 |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
676 void AfterTest() override {} | 679 void AfterTest() override {} |
677 | 680 |
678 scoped_refptr<FakePictureLayer> will_change_layer_; | 681 scoped_refptr<FakePictureLayer> will_change_layer_; |
679 scoped_refptr<FakePictureLayer> normal_layer_; | 682 scoped_refptr<FakePictureLayer> normal_layer_; |
680 }; | 683 }; |
681 | 684 |
682 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostPictureTestForceRecalculateScales); | 685 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostPictureTestForceRecalculateScales); |
683 | 686 |
684 } // namespace | 687 } // namespace |
685 } // namespace cc | 688 } // namespace cc |
OLD | NEW |