| 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.h" | 5 #include "cc/trees/layer_tree_host.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 #include "cc/test/fake_layer_tree_host_client.h" | 38 #include "cc/test/fake_layer_tree_host_client.h" |
| 39 #include "cc/test/fake_output_surface.h" | 39 #include "cc/test/fake_output_surface.h" |
| 40 #include "cc/test/fake_painted_scrollbar_layer.h" | 40 #include "cc/test/fake_painted_scrollbar_layer.h" |
| 41 #include "cc/test/fake_picture_layer.h" | 41 #include "cc/test/fake_picture_layer.h" |
| 42 #include "cc/test/fake_picture_layer_impl.h" | 42 #include "cc/test/fake_picture_layer_impl.h" |
| 43 #include "cc/test/fake_proxy.h" | 43 #include "cc/test/fake_proxy.h" |
| 44 #include "cc/test/fake_recording_source.h" | 44 #include "cc/test/fake_recording_source.h" |
| 45 #include "cc/test/fake_scoped_ui_resource.h" | 45 #include "cc/test/fake_scoped_ui_resource.h" |
| 46 #include "cc/test/fake_video_frame_provider.h" | 46 #include "cc/test/fake_video_frame_provider.h" |
| 47 #include "cc/test/geometry_test_utils.h" | 47 #include "cc/test/geometry_test_utils.h" |
| 48 #include "cc/test/layer_internals_for_test.h" | |
| 49 #include "cc/test/layer_tree_test.h" | 48 #include "cc/test/layer_tree_test.h" |
| 50 #include "cc/test/push_properties_counting_layer.h" | 49 #include "cc/test/push_properties_counting_layer.h" |
| 51 #include "cc/test/push_properties_counting_layer_impl.h" | 50 #include "cc/test/push_properties_counting_layer_impl.h" |
| 52 #include "cc/test/render_pass_test_utils.h" | 51 #include "cc/test/render_pass_test_utils.h" |
| 53 #include "cc/test/skia_common.h" | 52 #include "cc/test/skia_common.h" |
| 54 #include "cc/test/test_compositor_frame_sink.h" | 53 #include "cc/test/test_compositor_frame_sink.h" |
| 55 #include "cc/test/test_web_graphics_context_3d.h" | 54 #include "cc/test/test_web_graphics_context_3d.h" |
| 56 #include "cc/trees/effect_node.h" | 55 #include "cc/trees/effect_node.h" |
| 57 #include "cc/trees/layer_tree_host_common.h" | 56 #include "cc/trees/layer_tree_host_common.h" |
| 58 #include "cc/trees/layer_tree_host_impl.h" | 57 #include "cc/trees/layer_tree_host_impl.h" |
| (...skipping 1338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1397 // to be updated at draw time. | 1396 // to be updated at draw time. |
| 1398 class LayerTreeHostTestTransformTreeDamageIsUpdated : public LayerTreeHostTest { | 1397 class LayerTreeHostTestTransformTreeDamageIsUpdated : public LayerTreeHostTest { |
| 1399 protected: | 1398 protected: |
| 1400 void SetupTree() override { | 1399 void SetupTree() override { |
| 1401 root_ = Layer::Create(); | 1400 root_ = Layer::Create(); |
| 1402 child_ = Layer::Create(); | 1401 child_ = Layer::Create(); |
| 1403 grand_child_ = Layer::Create(); | 1402 grand_child_ = Layer::Create(); |
| 1404 | 1403 |
| 1405 root_->SetBounds(gfx::Size(50, 50)); | 1404 root_->SetBounds(gfx::Size(50, 50)); |
| 1406 | 1405 |
| 1406 // Make sure child is registerd for animation. |
| 1407 child_->SetElementId(ElementId(2, 0)); |
| 1408 |
| 1407 // Make sure child and grand_child have transform nodes. | 1409 // Make sure child and grand_child have transform nodes. |
| 1408 gfx::Transform rotation; | 1410 gfx::Transform rotation; |
| 1409 rotation.RotateAboutZAxis(45.0); | 1411 rotation.RotateAboutZAxis(45.0); |
| 1410 child_->SetTransform(rotation); | 1412 child_->SetTransform(rotation); |
| 1411 grand_child_->SetTransform(rotation); | 1413 grand_child_->SetTransform(rotation); |
| 1412 | 1414 |
| 1413 root_->AddChild(child_); | 1415 root_->AddChild(child_); |
| 1414 child_->AddChild(grand_child_); | 1416 child_->AddChild(grand_child_); |
| 1415 layer_tree_host()->SetRootLayer(root_); | 1417 layer_tree_host()->SetRootLayer(root_); |
| 1416 LayerTreeHostTest::SetupTree(); | 1418 LayerTreeHostTest::SetupTree(); |
| 1417 } | 1419 } |
| 1418 | 1420 |
| 1419 void BeginTest() override { PostSetNeedsCommitToMainThread(); } | 1421 void BeginTest() override { PostSetNeedsCommitToMainThread(); } |
| 1420 | 1422 |
| 1421 void DidCommit() override { | 1423 void DidCommit() override { |
| 1422 if (layer_tree_host()->SourceFrameNumber() == 1) { | 1424 if (layer_tree_host()->SourceFrameNumber() == 1) { |
| 1423 gfx::Transform scale; | 1425 gfx::Transform scale; |
| 1424 scale.Scale(2.0, 2.0); | 1426 scale.Scale(2.0, 2.0); |
| 1425 LayerInternalsForTest(child_.get()).OnTransformAnimated(scale); | 1427 layer_tree_host()->SetElementTransformMutated( |
| 1428 child_->element_id(), ElementListType::ACTIVE, scale); |
| 1426 } | 1429 } |
| 1427 } | 1430 } |
| 1428 | 1431 |
| 1429 void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { | 1432 void CommitCompleteOnThread(LayerTreeHostImpl* impl) override { |
| 1430 if (impl->sync_tree()->source_frame_number() == 0) | 1433 if (impl->sync_tree()->source_frame_number() == 0) |
| 1431 PostSetNeedsCommitToMainThread(); | 1434 PostSetNeedsCommitToMainThread(); |
| 1432 } | 1435 } |
| 1433 | 1436 |
| 1434 DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* impl, | 1437 DrawResult PrepareToDrawOnThread(LayerTreeHostImpl* impl, |
| 1435 LayerTreeHostImpl::FrameData* frame_data, | 1438 LayerTreeHostImpl::FrameData* frame_data, |
| (...skipping 5575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7011 EndTest(); | 7014 EndTest(); |
| 7012 } | 7015 } |
| 7013 | 7016 |
| 7014 void AfterTest() override {} | 7017 void AfterTest() override {} |
| 7015 }; | 7018 }; |
| 7016 | 7019 |
| 7017 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSubmitFrameResources); | 7020 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestSubmitFrameResources); |
| 7018 | 7021 |
| 7019 } // namespace | 7022 } // namespace |
| 7020 } // namespace cc | 7023 } // namespace cc |
| OLD | NEW |