| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <cmath> | 10 #include <cmath> |
| (...skipping 1377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1388 CreateHostImplWithTaskRunnerProvider(DefaultSettings(), | 1388 CreateHostImplWithTaskRunnerProvider(DefaultSettings(), |
| 1389 CreateCompositorFrameSink(), &provider); | 1389 CreateCompositorFrameSink(), &provider); |
| 1390 EXPECT_TRUE(host_impl_->CommitToActiveTree()); | 1390 EXPECT_TRUE(host_impl_->CommitToActiveTree()); |
| 1391 | 1391 |
| 1392 host_impl_->SetViewportSize(gfx::Size(50, 50)); | 1392 host_impl_->SetViewportSize(gfx::Size(50, 50)); |
| 1393 | 1393 |
| 1394 auto root_owned = LayerImpl::Create(host_impl_->active_tree(), 1); | 1394 auto root_owned = LayerImpl::Create(host_impl_->active_tree(), 1); |
| 1395 auto* root = root_owned.get(); | 1395 auto* root = root_owned.get(); |
| 1396 host_impl_->active_tree()->SetRootLayerForTesting(std::move(root_owned)); | 1396 host_impl_->active_tree()->SetRootLayerForTesting(std::move(root_owned)); |
| 1397 root->SetBounds(gfx::Size(50, 50)); | 1397 root->SetBounds(gfx::Size(50, 50)); |
| 1398 root->SetHasRenderSurface(true); | |
| 1399 | 1398 |
| 1400 auto child_owned = LayerImpl::Create(host_impl_->active_tree(), 2); | 1399 auto child_owned = LayerImpl::Create(host_impl_->active_tree(), 2); |
| 1401 auto* child = child_owned.get(); | 1400 auto* child = child_owned.get(); |
| 1402 root->test_properties()->AddChild(std::move(child_owned)); | 1401 root->test_properties()->AddChild(std::move(child_owned)); |
| 1403 child->SetBounds(gfx::Size(10, 10)); | 1402 child->SetBounds(gfx::Size(10, 10)); |
| 1404 child->draw_properties().visible_layer_rect = gfx::Rect(10, 10); | 1403 child->draw_properties().visible_layer_rect = gfx::Rect(10, 10); |
| 1405 child->SetDrawsContent(true); | 1404 child->SetDrawsContent(true); |
| 1406 | 1405 |
| 1407 host_impl_->active_tree()->SetElementIdsForTesting(); | 1406 host_impl_->active_tree()->SetElementIdsForTesting(); |
| 1408 | 1407 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1509 bool has_missing_tiles_; | 1508 bool has_missing_tiles_; |
| 1510 }; | 1509 }; |
| 1511 | 1510 |
| 1512 TEST_F(LayerTreeHostImplTest, AnimationMarksLayerNotReady) { | 1511 TEST_F(LayerTreeHostImplTest, AnimationMarksLayerNotReady) { |
| 1513 host_impl_->SetViewportSize(gfx::Size(50, 50)); | 1512 host_impl_->SetViewportSize(gfx::Size(50, 50)); |
| 1514 | 1513 |
| 1515 host_impl_->active_tree()->SetRootLayerForTesting( | 1514 host_impl_->active_tree()->SetRootLayerForTesting( |
| 1516 LayerImpl::Create(host_impl_->active_tree(), 1)); | 1515 LayerImpl::Create(host_impl_->active_tree(), 1)); |
| 1517 LayerImpl* root = *host_impl_->active_tree()->begin(); | 1516 LayerImpl* root = *host_impl_->active_tree()->begin(); |
| 1518 root->SetBounds(gfx::Size(50, 50)); | 1517 root->SetBounds(gfx::Size(50, 50)); |
| 1519 root->SetHasRenderSurface(true); | |
| 1520 | 1518 |
| 1521 root->test_properties()->AddChild(std::unique_ptr<MissingTilesLayer>( | 1519 root->test_properties()->AddChild(std::unique_ptr<MissingTilesLayer>( |
| 1522 new MissingTilesLayer(host_impl_->active_tree(), 2))); | 1520 new MissingTilesLayer(host_impl_->active_tree(), 2))); |
| 1523 MissingTilesLayer* child = | 1521 MissingTilesLayer* child = |
| 1524 static_cast<MissingTilesLayer*>(root->test_properties()->children[0]); | 1522 static_cast<MissingTilesLayer*>(root->test_properties()->children[0]); |
| 1525 child->SetBounds(gfx::Size(10, 10)); | 1523 child->SetBounds(gfx::Size(10, 10)); |
| 1526 child->draw_properties().visible_layer_rect = gfx::Rect(10, 10); | 1524 child->draw_properties().visible_layer_rect = gfx::Rect(10, 10); |
| 1527 child->SetDrawsContent(true); | 1525 child->SetDrawsContent(true); |
| 1528 | 1526 |
| 1529 host_impl_->active_tree()->SetElementIdsForTesting(); | 1527 host_impl_->active_tree()->SetElementIdsForTesting(); |
| (...skipping 10188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11718 SetupMouseMoveAtTestScrollbarStates(true); | 11716 SetupMouseMoveAtTestScrollbarStates(true); |
| 11719 } | 11717 } |
| 11720 | 11718 |
| 11721 TEST_F(LayerTreeHostImplTest, | 11719 TEST_F(LayerTreeHostImplTest, |
| 11722 LayerTreeHostImplTestScrollbarStatesInNotMainThreadScorlling) { | 11720 LayerTreeHostImplTestScrollbarStatesInNotMainThreadScorlling) { |
| 11723 SetupMouseMoveAtTestScrollbarStates(false); | 11721 SetupMouseMoveAtTestScrollbarStates(false); |
| 11724 } | 11722 } |
| 11725 | 11723 |
| 11726 } // namespace | 11724 } // namespace |
| 11727 } // namespace cc | 11725 } // namespace cc |
| OLD | NEW |