| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "platform/graphics/CompositorMutableState.h" | 5 #include "platform/graphics/CompositorMutableState.h" |
| 6 | 6 |
| 7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
| 8 #include "cc/test/fake_compositor_frame_sink.h" | 8 #include "cc/test/fake_compositor_frame_sink.h" |
| 9 #include "cc/test/fake_impl_task_runner_provider.h" | 9 #include "cc/test/fake_impl_task_runner_provider.h" |
| 10 #include "cc/test/fake_layer_tree_host_impl.h" | 10 #include "cc/test/fake_layer_tree_host_impl.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 | 92 |
| 93 std::unique_ptr<LayerImpl> scoped_layer = | 93 std::unique_ptr<LayerImpl> scoped_layer = |
| 94 LayerImpl::Create(HostImpl().active_tree(), 11); | 94 LayerImpl::Create(HostImpl().active_tree(), 11); |
| 95 LayerImpl* layer = scoped_layer.get(); | 95 LayerImpl* layer = scoped_layer.get(); |
| 96 layer->SetScrollClipLayer(root->id()); | 96 layer->SetScrollClipLayer(root->id()); |
| 97 | 97 |
| 98 root->test_properties()->AddChild(std::move(scoped_layer)); | 98 root->test_properties()->AddChild(std::move(scoped_layer)); |
| 99 | 99 |
| 100 SetLayerPropertiesForTesting(layer); | 100 SetLayerPropertiesForTesting(layer); |
| 101 | 101 |
| 102 int primary_id = 12; | 102 uint64_t primary_id = 12; |
| 103 root->SetElementId(CompositorElementIdFromDOMNodeId( | 103 root->SetElementId(CompositorElementIdFromDOMNodeId( |
| 104 primary_id, CompositorElementIdNamespace::kPrimary)); | 104 primary_id, CompositorElementIdNamespace::kPrimaryCompositorProxy)); |
| 105 layer->SetElementId(CompositorElementIdFromDOMNodeId( | 105 layer->SetElementId(CompositorElementIdFromDOMNodeId( |
| 106 primary_id, CompositorElementIdNamespace::kScroll)); | 106 primary_id, CompositorElementIdNamespace::kScrollCompositorProxy)); |
| 107 | 107 |
| 108 root->SetMutableProperties(CompositorMutableProperty::kOpacity | | 108 root->SetMutableProperties(CompositorMutableProperty::kOpacity | |
| 109 CompositorMutableProperty::kTransform); | 109 CompositorMutableProperty::kTransform); |
| 110 layer->SetMutableProperties(CompositorMutableProperty::kScrollLeft | | 110 layer->SetMutableProperties(CompositorMutableProperty::kScrollLeft | |
| 111 CompositorMutableProperty::kScrollTop); | 111 CompositorMutableProperty::kScrollTop); |
| 112 | 112 |
| 113 HostImpl().SetViewportSize(layer->bounds()); | 113 HostImpl().SetViewportSize(layer->bounds()); |
| 114 HostImpl().active_tree()->SetRootLayerForTesting(std::move(root)); | 114 HostImpl().active_tree()->SetRootLayerForTesting(std::move(root)); |
| 115 HostImpl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); | 115 HostImpl().UpdateNumChildrenAndDrawPropertiesForActiveTree(); |
| 116 | 116 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 146 EXPECT_TRUE(mutation.IsScrollLeftMutated()); | 146 EXPECT_TRUE(mutation.IsScrollLeftMutated()); |
| 147 EXPECT_TRUE(mutation.IsScrollTopMutated()); | 147 EXPECT_TRUE(mutation.IsScrollTopMutated()); |
| 148 | 148 |
| 149 EXPECT_EQ(0.5, mutation.Opacity()); | 149 EXPECT_EQ(0.5, mutation.Opacity()); |
| 150 EXPECT_EQ(zero.ToString(), gfx::Transform(mutation.Transform()).ToString()); | 150 EXPECT_EQ(zero.ToString(), gfx::Transform(mutation.Transform()).ToString()); |
| 151 EXPECT_EQ(1.0, mutation.ScrollLeft()); | 151 EXPECT_EQ(1.0, mutation.ScrollLeft()); |
| 152 EXPECT_EQ(1.0, mutation.ScrollTop()); | 152 EXPECT_EQ(1.0, mutation.ScrollTop()); |
| 153 } | 153 } |
| 154 | 154 |
| 155 } // namespace blink | 155 } // namespace blink |
| OLD | NEW |