| 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.h" | 5 #include "cc/layers/layer.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/thread_task_runner_handle.h" | 9 #include "base/thread_task_runner_handle.h" |
| 10 #include "cc/animation/animation_host.h" | 10 #include "cc/animation/animation_host.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 EXPECT_EQ(src->transform_, dest->transform_); | 173 EXPECT_EQ(src->transform_, dest->transform_); |
| 174 EXPECT_EQ(src->transform_is_invertible_, dest->transform_is_invertible_); | 174 EXPECT_EQ(src->transform_is_invertible_, dest->transform_is_invertible_); |
| 175 EXPECT_EQ(src->sorting_context_id_, dest->sorting_context_id_); | 175 EXPECT_EQ(src->sorting_context_id_, dest->sorting_context_id_); |
| 176 EXPECT_EQ(src->num_descendants_that_draw_content_, | 176 EXPECT_EQ(src->num_descendants_that_draw_content_, |
| 177 dest->num_descendants_that_draw_content_); | 177 dest->num_descendants_that_draw_content_); |
| 178 EXPECT_EQ(src->scroll_clip_layer_id_, dest->scroll_clip_layer_id_); | 178 EXPECT_EQ(src->scroll_clip_layer_id_, dest->scroll_clip_layer_id_); |
| 179 EXPECT_EQ(src->user_scrollable_horizontal_, | 179 EXPECT_EQ(src->user_scrollable_horizontal_, |
| 180 dest->user_scrollable_horizontal_); | 180 dest->user_scrollable_horizontal_); |
| 181 EXPECT_EQ(src->user_scrollable_vertical_, dest->user_scrollable_vertical_); | 181 EXPECT_EQ(src->user_scrollable_vertical_, dest->user_scrollable_vertical_); |
| 182 EXPECT_EQ(src->scroll_offset_, dest->scroll_offset_); | 182 EXPECT_EQ(src->scroll_offset_, dest->scroll_offset_); |
| 183 EXPECT_EQ(src->scroll_compensation_adjustment_, | |
| 184 dest->scroll_compensation_adjustment_); | |
| 185 EXPECT_EQ(update_rect, dest->update_rect_); | 183 EXPECT_EQ(update_rect, dest->update_rect_); |
| 186 | 184 |
| 187 if (src->scroll_parent_) { | 185 if (src->scroll_parent_) { |
| 188 ASSERT_TRUE(dest->scroll_parent_); | 186 ASSERT_TRUE(dest->scroll_parent_); |
| 189 EXPECT_EQ(src->scroll_parent_->id(), dest->scroll_parent_->id()); | 187 EXPECT_EQ(src->scroll_parent_->id(), dest->scroll_parent_->id()); |
| 190 } else { | 188 } else { |
| 191 EXPECT_FALSE(dest->scroll_parent_); | 189 EXPECT_FALSE(dest->scroll_parent_); |
| 192 } | 190 } |
| 193 if (src->scroll_children_) { | 191 if (src->scroll_children_) { |
| 194 ASSERT_TRUE(dest->scroll_children_); | 192 ASSERT_TRUE(dest->scroll_children_); |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 gfx::Transform transform; | 278 gfx::Transform transform; |
| 281 transform.Rotate(90); | 279 transform.Rotate(90); |
| 282 layer->transform_ = transform; | 280 layer->transform_ = transform; |
| 283 layer->transform_is_invertible_ = true; | 281 layer->transform_is_invertible_ = true; |
| 284 layer->sorting_context_id_ = 0; | 282 layer->sorting_context_id_ = 0; |
| 285 layer->num_descendants_that_draw_content_ = 5; | 283 layer->num_descendants_that_draw_content_ = 5; |
| 286 layer->scroll_clip_layer_id_ = Layer::INVALID_ID; | 284 layer->scroll_clip_layer_id_ = Layer::INVALID_ID; |
| 287 layer->user_scrollable_horizontal_ = false; | 285 layer->user_scrollable_horizontal_ = false; |
| 288 layer->user_scrollable_vertical_ = true; | 286 layer->user_scrollable_vertical_ = true; |
| 289 layer->scroll_offset_ = gfx::ScrollOffset(3, 14); | 287 layer->scroll_offset_ = gfx::ScrollOffset(3, 14); |
| 290 layer->scroll_compensation_adjustment_ = gfx::Vector2dF(6.28f, 3.14f); | |
| 291 layer->update_rect_ = gfx::Rect(14, 15); | 288 layer->update_rect_ = gfx::Rect(14, 15); |
| 292 | 289 |
| 293 VerifyBaseLayerPropertiesSerializationAndDeserialization(layer.get()); | 290 VerifyBaseLayerPropertiesSerializationAndDeserialization(layer.get()); |
| 294 } | 291 } |
| 295 | 292 |
| 296 void RunAllMembersChangedTest() { | 293 void RunAllMembersChangedTest() { |
| 297 scoped_refptr<Layer> layer = Layer::Create(); | 294 scoped_refptr<Layer> layer = Layer::Create(); |
| 298 layer->transform_origin_ = gfx::Point3F(3.0f, 1.0f, 4.0f); | 295 layer->transform_origin_ = gfx::Point3F(3.0f, 1.0f, 4.0f); |
| 299 layer->background_color_ = SK_ColorRED; | 296 layer->background_color_ = SK_ColorRED; |
| 300 layer->bounds_ = gfx::Size(3, 14); | 297 layer->bounds_ = gfx::Size(3, 14); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 330 gfx::Transform transform; | 327 gfx::Transform transform; |
| 331 transform.Rotate(90); | 328 transform.Rotate(90); |
| 332 layer->transform_ = transform; | 329 layer->transform_ = transform; |
| 333 layer->transform_is_invertible_ = !layer->transform_is_invertible_; | 330 layer->transform_is_invertible_ = !layer->transform_is_invertible_; |
| 334 layer->sorting_context_id_ = 42; | 331 layer->sorting_context_id_ = 42; |
| 335 layer->num_descendants_that_draw_content_ = 5; | 332 layer->num_descendants_that_draw_content_ = 5; |
| 336 layer->scroll_clip_layer_id_ = 17; | 333 layer->scroll_clip_layer_id_ = 17; |
| 337 layer->user_scrollable_horizontal_ = !layer->user_scrollable_horizontal_; | 334 layer->user_scrollable_horizontal_ = !layer->user_scrollable_horizontal_; |
| 338 layer->user_scrollable_vertical_ = !layer->user_scrollable_vertical_; | 335 layer->user_scrollable_vertical_ = !layer->user_scrollable_vertical_; |
| 339 layer->scroll_offset_ = gfx::ScrollOffset(3, 14); | 336 layer->scroll_offset_ = gfx::ScrollOffset(3, 14); |
| 340 layer->scroll_compensation_adjustment_ = gfx::Vector2dF(6.28f, 3.14f); | |
| 341 layer->update_rect_ = gfx::Rect(14, 15); | 337 layer->update_rect_ = gfx::Rect(14, 15); |
| 342 | 338 |
| 343 VerifyBaseLayerPropertiesSerializationAndDeserialization(layer.get()); | 339 VerifyBaseLayerPropertiesSerializationAndDeserialization(layer.get()); |
| 344 } | 340 } |
| 345 | 341 |
| 346 void RunScrollAndClipLayersTest() { | 342 void RunScrollAndClipLayersTest() { |
| 347 scoped_refptr<Layer> layer = Layer::Create(); | 343 scoped_refptr<Layer> layer = Layer::Create(); |
| 348 | 344 |
| 349 scoped_refptr<Layer> scroll_parent = Layer::Create(); | 345 scoped_refptr<Layer> scroll_parent = Layer::Create(); |
| 350 layer->scroll_parent_ = scroll_parent.get(); | 346 layer->scroll_parent_ = scroll_parent.get(); |
| (...skipping 2281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2632 EXPECT_EQ(MutableProperty::kNone, impl_layer->mutable_properties()); | 2628 EXPECT_EQ(MutableProperty::kNone, impl_layer->mutable_properties()); |
| 2633 | 2629 |
| 2634 test_layer->PushPropertiesTo(impl_layer.get()); | 2630 test_layer->PushPropertiesTo(impl_layer.get()); |
| 2635 | 2631 |
| 2636 EXPECT_EQ(2lu, impl_layer->element_id()); | 2632 EXPECT_EQ(2lu, impl_layer->element_id()); |
| 2637 EXPECT_EQ(MutableProperty::kTransform, impl_layer->mutable_properties()); | 2633 EXPECT_EQ(MutableProperty::kTransform, impl_layer->mutable_properties()); |
| 2638 } | 2634 } |
| 2639 | 2635 |
| 2640 } // namespace | 2636 } // namespace |
| 2641 } // namespace cc | 2637 } // namespace cc |
| OLD | NEW |