Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(246)

Side by Side Diff: third_party/WebKit/Source/platform/graphics/CompositorMutableStateTest.cpp

Issue 2890953002: [SPv1] Always set a CompositorElementId on main graphics layers; use PaintLayer id. (Closed)
Patch Set: none Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/CompositorMutableStateProvider.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/CompositorMutableStateProvider.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698