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/layers/layer_impl.h" | 5 #include "cc/layers/layer_impl.h" |
6 | 6 |
7 #include "cc/animation/mutable_properties.h" | 7 #include "cc/animation/mutable_properties.h" |
8 #include "cc/layers/painted_scrollbar_layer_impl.h" | 8 #include "cc/layers/painted_scrollbar_layer_impl.h" |
9 #include "cc/layers/solid_color_scrollbar_layer_impl.h" | 9 #include "cc/layers/solid_color_scrollbar_layer_impl.h" |
10 #include "cc/output/filter_operation.h" | 10 #include "cc/output/filter_operation.h" |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 root->SetScrollClipLayer(root_clip->id()); | 140 root->SetScrollClipLayer(root_clip->id()); |
141 host_impl.active_tree()->BuildLayerListAndPropertyTreesForTesting(); | 141 host_impl.active_tree()->BuildLayerListAndPropertyTreesForTesting(); |
142 | 142 |
143 // Adding children is an internal operation and should not mark layers as | 143 // Adding children is an internal operation and should not mark layers as |
144 // changed. | 144 // changed. |
145 EXPECT_FALSE(root->LayerPropertyChanged()); | 145 EXPECT_FALSE(root->LayerPropertyChanged()); |
146 EXPECT_FALSE(child->LayerPropertyChanged()); | 146 EXPECT_FALSE(child->LayerPropertyChanged()); |
147 EXPECT_FALSE(grand_child->LayerPropertyChanged()); | 147 EXPECT_FALSE(grand_child->LayerPropertyChanged()); |
148 | 148 |
149 gfx::PointF arbitrary_point_f = gfx::PointF(0.125f, 0.25f); | 149 gfx::PointF arbitrary_point_f = gfx::PointF(0.125f, 0.25f); |
150 gfx::Point3F arbitrary_point_3f = gfx::Point3F(0.125f, 0.25f, 0.f); | |
151 float arbitrary_number = 0.352f; | 150 float arbitrary_number = 0.352f; |
152 gfx::Size arbitrary_size = gfx::Size(111, 222); | 151 gfx::Size arbitrary_size = gfx::Size(111, 222); |
153 gfx::Point arbitrary_point = gfx::Point(333, 444); | 152 gfx::Point arbitrary_point = gfx::Point(333, 444); |
154 gfx::Vector2d arbitrary_vector2d = gfx::Vector2d(111, 222); | 153 gfx::Vector2d arbitrary_vector2d = gfx::Vector2d(111, 222); |
155 gfx::Rect arbitrary_rect = gfx::Rect(arbitrary_point, arbitrary_size); | 154 gfx::Rect arbitrary_rect = gfx::Rect(arbitrary_point, arbitrary_size); |
156 gfx::RectF arbitrary_rect_f = | |
157 gfx::RectF(arbitrary_point_f, gfx::SizeF(1.234f, 5.678f)); | |
158 SkColor arbitrary_color = SkColorSetRGB(10, 20, 30); | 155 SkColor arbitrary_color = SkColorSetRGB(10, 20, 30); |
159 gfx::Transform arbitrary_transform; | 156 gfx::Transform arbitrary_transform; |
160 arbitrary_transform.Scale3d(0.1f, 0.2f, 0.3f); | 157 arbitrary_transform.Scale3d(0.1f, 0.2f, 0.3f); |
161 FilterOperations arbitrary_filters; | 158 FilterOperations arbitrary_filters; |
162 arbitrary_filters.Append(FilterOperation::CreateOpacityFilter(0.5f)); | 159 arbitrary_filters.Append(FilterOperation::CreateOpacityFilter(0.5f)); |
163 SkXfermode::Mode arbitrary_blend_mode = SkXfermode::kMultiply_Mode; | 160 SkXfermode::Mode arbitrary_blend_mode = SkXfermode::kMultiply_Mode; |
164 | 161 |
165 // These properties are internal, and should not be considered "change" when | 162 // These properties are internal, and should not be considered "change" when |
166 // they are used. | 163 // they are used. |
167 EXECUTE_AND_VERIFY_NEEDS_PUSH_PROPERTIES_AND_SUBTREE_DID_NOT_CHANGE( | 164 EXECUTE_AND_VERIFY_NEEDS_PUSH_PROPERTIES_AND_SUBTREE_DID_NOT_CHANGE( |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 std::unique_ptr<LayerImpl> layer2_ptr = | 244 std::unique_ptr<LayerImpl> layer2_ptr = |
248 LayerImpl::Create(host_impl.active_tree(), 3); | 245 LayerImpl::Create(host_impl.active_tree(), 3); |
249 LayerImpl* layer2 = layer2_ptr.get(); | 246 LayerImpl* layer2 = layer2_ptr.get(); |
250 root->AddChild(std::move(layer2_ptr)); | 247 root->AddChild(std::move(layer2_ptr)); |
251 host_impl.active_tree()->BuildLayerListAndPropertyTreesForTesting(); | 248 host_impl.active_tree()->BuildLayerListAndPropertyTreesForTesting(); |
252 DCHECK(host_impl.CanDraw()); | 249 DCHECK(host_impl.CanDraw()); |
253 | 250 |
254 gfx::PointF arbitrary_point_f = gfx::PointF(0.125f, 0.25f); | 251 gfx::PointF arbitrary_point_f = gfx::PointF(0.125f, 0.25f); |
255 float arbitrary_number = 0.352f; | 252 float arbitrary_number = 0.352f; |
256 gfx::Size arbitrary_size = gfx::Size(111, 222); | 253 gfx::Size arbitrary_size = gfx::Size(111, 222); |
257 gfx::Point arbitrary_point = gfx::Point(333, 444); | |
258 gfx::Vector2d arbitrary_vector2d = gfx::Vector2d(111, 222); | 254 gfx::Vector2d arbitrary_vector2d = gfx::Vector2d(111, 222); |
259 gfx::Size large_size = gfx::Size(1000, 1000); | 255 gfx::Size large_size = gfx::Size(1000, 1000); |
260 gfx::Rect arbitrary_rect = gfx::Rect(arbitrary_point, arbitrary_size); | |
261 gfx::RectF arbitrary_rect_f = | |
262 gfx::RectF(arbitrary_point_f, gfx::SizeF(1.234f, 5.678f)); | |
263 SkColor arbitrary_color = SkColorSetRGB(10, 20, 30); | 256 SkColor arbitrary_color = SkColorSetRGB(10, 20, 30); |
264 gfx::Transform arbitrary_transform; | 257 gfx::Transform arbitrary_transform; |
265 arbitrary_transform.Scale3d(0.1f, 0.2f, 0.3f); | 258 arbitrary_transform.Scale3d(0.1f, 0.2f, 0.3f); |
266 FilterOperations arbitrary_filters; | 259 FilterOperations arbitrary_filters; |
267 arbitrary_filters.Append(FilterOperation::CreateOpacityFilter(0.5f)); | 260 arbitrary_filters.Append(FilterOperation::CreateOpacityFilter(0.5f)); |
268 SkXfermode::Mode arbitrary_blend_mode = SkXfermode::kMultiply_Mode; | 261 SkXfermode::Mode arbitrary_blend_mode = SkXfermode::kMultiply_Mode; |
269 | 262 |
270 // Set layer to draw content so that their draw property by property trees is | 263 // Set layer to draw content so that their draw property by property trees is |
271 // verified. | 264 // verified. |
272 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetDrawsContent(true)); | 265 VERIFY_NEEDS_UPDATE_DRAW_PROPERTIES(layer->SetDrawsContent(true)); |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
570 | 563 |
571 pending_layer->PushPropertiesTo(layer()); | 564 pending_layer->PushPropertiesTo(layer()); |
572 | 565 |
573 EXPECT_VECTOR_EQ(gfx::Vector2dF(22, 23), layer()->CurrentScrollOffset()); | 566 EXPECT_VECTOR_EQ(gfx::Vector2dF(22, 23), layer()->CurrentScrollOffset()); |
574 EXPECT_VECTOR_EQ(layer()->CurrentScrollOffset(), | 567 EXPECT_VECTOR_EQ(layer()->CurrentScrollOffset(), |
575 pending_layer->CurrentScrollOffset()); | 568 pending_layer->CurrentScrollOffset()); |
576 } | 569 } |
577 | 570 |
578 } // namespace | 571 } // namespace |
579 } // namespace cc | 572 } // namespace cc |
OLD | NEW |