| 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 1294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1305 host_impl_->SetViewportSize(gfx::Size(50, 50)); | 1305 host_impl_->SetViewportSize(gfx::Size(50, 50)); |
| 1306 | 1306 |
| 1307 host_impl_->CreatePendingTree(); | 1307 host_impl_->CreatePendingTree(); |
| 1308 host_impl_->pending_tree()->SetRootLayer( | 1308 host_impl_->pending_tree()->SetRootLayer( |
| 1309 LayerImpl::Create(host_impl_->pending_tree(), 1)); | 1309 LayerImpl::Create(host_impl_->pending_tree(), 1)); |
| 1310 LayerImpl* root = host_impl_->pending_tree()->root_layer(); | 1310 LayerImpl* root = host_impl_->pending_tree()->root_layer(); |
| 1311 root->SetBounds(gfx::Size(50, 50)); | 1311 root->SetBounds(gfx::Size(50, 50)); |
| 1312 root->test_properties()->force_render_surface = true; | 1312 root->test_properties()->force_render_surface = true; |
| 1313 | 1313 |
| 1314 root->AddChild(LayerImpl::Create(host_impl_->pending_tree(), 2)); | 1314 root->AddChild(LayerImpl::Create(host_impl_->pending_tree(), 2)); |
| 1315 host_impl_->pending_tree()->BuildLayerListForTesting(); |
| 1315 LayerImpl* child = root->children()[0]; | 1316 LayerImpl* child = root->children()[0]; |
| 1316 child->SetBounds(gfx::Size(10, 10)); | 1317 child->SetBounds(gfx::Size(10, 10)); |
| 1317 child->draw_properties().visible_layer_rect = gfx::Rect(10, 10); | 1318 child->draw_properties().visible_layer_rect = gfx::Rect(10, 10); |
| 1318 child->SetDrawsContent(true); | 1319 child->SetDrawsContent(true); |
| 1319 AddAnimatedTransformToLayerWithPlayer(child->id(), timeline(), 10.0, 3, 0); | 1320 AddAnimatedTransformToLayerWithPlayer(child->id(), timeline(), 10.0, 3, 0); |
| 1320 | 1321 |
| 1321 EXPECT_FALSE(did_request_next_frame_); | 1322 EXPECT_FALSE(did_request_next_frame_); |
| 1322 EXPECT_FALSE(did_request_redraw_); | 1323 EXPECT_FALSE(did_request_redraw_); |
| 1323 EXPECT_FALSE(did_request_commit_); | 1324 EXPECT_FALSE(did_request_commit_); |
| 1324 | 1325 |
| (...skipping 8906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10231 host_impl_->CreatePendingTree(); | 10232 host_impl_->CreatePendingTree(); |
| 10232 host_impl_->ActivateSyncTree(); | 10233 host_impl_->ActivateSyncTree(); |
| 10233 host_impl_->CreatePendingTree(); | 10234 host_impl_->CreatePendingTree(); |
| 10234 | 10235 |
| 10235 LayerTreeImpl* pending_tree = host_impl_->pending_tree(); | 10236 LayerTreeImpl* pending_tree = host_impl_->pending_tree(); |
| 10236 | 10237 |
| 10237 std::unique_ptr<FakePictureLayerImpl> pending_layer = | 10238 std::unique_ptr<FakePictureLayerImpl> pending_layer = |
| 10238 FakePictureLayerImpl::Create(pending_tree, 10); | 10239 FakePictureLayerImpl::Create(pending_tree, 10); |
| 10239 FakePictureLayerImpl* raw_pending_layer = pending_layer.get(); | 10240 FakePictureLayerImpl* raw_pending_layer = pending_layer.get(); |
| 10240 pending_tree->SetRootLayer(std::move(pending_layer)); | 10241 pending_tree->SetRootLayer(std::move(pending_layer)); |
| 10242 pending_tree->BuildLayerListForTesting(); |
| 10241 ASSERT_EQ(raw_pending_layer, pending_tree->root_layer()); | 10243 ASSERT_EQ(raw_pending_layer, pending_tree->root_layer()); |
| 10242 | 10244 |
| 10243 EXPECT_EQ(0u, raw_pending_layer->did_become_active_call_count()); | 10245 EXPECT_EQ(0u, raw_pending_layer->did_become_active_call_count()); |
| 10244 pending_tree->DidBecomeActive(); | 10246 pending_tree->DidBecomeActive(); |
| 10245 EXPECT_EQ(1u, raw_pending_layer->did_become_active_call_count()); | 10247 EXPECT_EQ(1u, raw_pending_layer->did_become_active_call_count()); |
| 10246 | 10248 |
| 10247 std::unique_ptr<FakePictureLayerImpl> mask_layer = | 10249 std::unique_ptr<FakePictureLayerImpl> mask_layer = |
| 10248 FakePictureLayerImpl::Create(pending_tree, 11); | 10250 FakePictureLayerImpl::Create(pending_tree, 11); |
| 10249 FakePictureLayerImpl* raw_mask_layer = mask_layer.get(); | 10251 FakePictureLayerImpl* raw_mask_layer = mask_layer.get(); |
| 10250 raw_pending_layer->SetMaskLayer(std::move(mask_layer)); | 10252 raw_pending_layer->SetMaskLayer(std::move(mask_layer)); |
| (...skipping 568 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10819 | 10821 |
| 10820 // Re-initialize with a software output surface. | 10822 // Re-initialize with a software output surface. |
| 10821 output_surface_ = FakeOutputSurface::CreateSoftware( | 10823 output_surface_ = FakeOutputSurface::CreateSoftware( |
| 10822 base::WrapUnique(new SoftwareOutputDevice)); | 10824 base::WrapUnique(new SoftwareOutputDevice)); |
| 10823 host_impl_->InitializeRenderer(output_surface_.get()); | 10825 host_impl_->InitializeRenderer(output_surface_.get()); |
| 10824 EXPECT_FALSE(host_impl_->use_gpu_rasterization()); | 10826 EXPECT_FALSE(host_impl_->use_gpu_rasterization()); |
| 10825 } | 10827 } |
| 10826 | 10828 |
| 10827 } // namespace | 10829 } // namespace |
| 10828 } // namespace cc | 10830 } // namespace cc |
| OLD | NEW |