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/threading/thread_task_runner_handle.h" | 9 #include "base/threading/thread_task_runner_handle.h" |
10 #include "cc/animation/animation_host.h" | 10 #include "cc/animation/animation_host.h" |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 -1, false, Layer::INVALID_ID); | 382 -1, false, Layer::INVALID_ID); |
383 deserialized_scrollbar->inputs_.layer_id = | 383 deserialized_scrollbar->inputs_.layer_id = |
384 source_scrollbar->inputs_.layer_id; | 384 source_scrollbar->inputs_.layer_id; |
385 | 385 |
386 // FromLayerSpecificPropertiesProto expects a non-null LayerTreeHost to be | 386 // FromLayerSpecificPropertiesProto expects a non-null LayerTreeHost to be |
387 // set. | 387 // set. |
388 deserialized_scrollbar->SetLayerTreeHost(layer_tree_host_.get()); | 388 deserialized_scrollbar->SetLayerTreeHost(layer_tree_host_.get()); |
389 deserialized_scrollbar->FromLayerSpecificPropertiesProto( | 389 deserialized_scrollbar->FromLayerSpecificPropertiesProto( |
390 serialized_scrollbar); | 390 serialized_scrollbar); |
391 | 391 |
392 EXPECT_EQ(source_scrollbar->track_start_, | 392 EXPECT_EQ(source_scrollbar->solid_color_scrollbar_layer_inputs_.track_start, |
393 deserialized_scrollbar->track_start_); | 393 deserialized_scrollbar->solid_color_scrollbar_layer_inputs_ |
394 EXPECT_EQ(source_scrollbar->thumb_thickness_, | 394 .track_start); |
395 deserialized_scrollbar->thumb_thickness_); | 395 EXPECT_EQ( |
396 EXPECT_EQ(source_scrollbar->scroll_layer_id_, | 396 source_scrollbar->solid_color_scrollbar_layer_inputs_.thumb_thickness, |
397 deserialized_scrollbar->scroll_layer_id_); | 397 deserialized_scrollbar->solid_color_scrollbar_layer_inputs_ |
398 EXPECT_EQ(source_scrollbar->is_left_side_vertical_scrollbar_, | 398 .thumb_thickness); |
399 deserialized_scrollbar->is_left_side_vertical_scrollbar_); | 399 EXPECT_EQ( |
400 EXPECT_EQ(source_scrollbar->orientation_, | 400 source_scrollbar->solid_color_scrollbar_layer_inputs_.scroll_layer_id, |
401 deserialized_scrollbar->orientation_); | 401 deserialized_scrollbar->solid_color_scrollbar_layer_inputs_ |
| 402 .scroll_layer_id); |
| 403 EXPECT_EQ(source_scrollbar->solid_color_scrollbar_layer_inputs_ |
| 404 .is_left_side_vertical_scrollbar, |
| 405 deserialized_scrollbar->solid_color_scrollbar_layer_inputs_ |
| 406 .is_left_side_vertical_scrollbar); |
| 407 EXPECT_EQ(source_scrollbar->solid_color_scrollbar_layer_inputs_.orientation, |
| 408 deserialized_scrollbar->solid_color_scrollbar_layer_inputs_ |
| 409 .orientation); |
402 | 410 |
403 deserialized_scrollbar->SetLayerTreeHost(nullptr); | 411 deserialized_scrollbar->SetLayerTreeHost(nullptr); |
404 } | 412 } |
405 | 413 |
406 void RunScrollAndClipLayersTest() { | 414 void RunScrollAndClipLayersTest() { |
407 scoped_refptr<Layer> layer = Layer::Create(); | 415 scoped_refptr<Layer> layer = Layer::Create(); |
408 | 416 |
409 scoped_refptr<Layer> scroll_parent = Layer::Create(); | 417 scoped_refptr<Layer> scroll_parent = Layer::Create(); |
410 layer->inputs_.scroll_parent = scroll_parent.get(); | 418 layer->inputs_.scroll_parent = scroll_parent.get(); |
411 scoped_refptr<Layer> scroll_child = Layer::Create(); | 419 scoped_refptr<Layer> scroll_child = Layer::Create(); |
(...skipping 2119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2531 EXPECT_EQ(MutableProperty::kNone, impl_layer->mutable_properties()); | 2539 EXPECT_EQ(MutableProperty::kNone, impl_layer->mutable_properties()); |
2532 | 2540 |
2533 test_layer->PushPropertiesTo(impl_layer.get()); | 2541 test_layer->PushPropertiesTo(impl_layer.get()); |
2534 | 2542 |
2535 EXPECT_EQ(ElementId(2, 0), impl_layer->element_id()); | 2543 EXPECT_EQ(ElementId(2, 0), impl_layer->element_id()); |
2536 EXPECT_EQ(MutableProperty::kTransform, impl_layer->mutable_properties()); | 2544 EXPECT_EQ(MutableProperty::kTransform, impl_layer->mutable_properties()); |
2537 } | 2545 } |
2538 | 2546 |
2539 } // namespace | 2547 } // namespace |
2540 } // namespace cc | 2548 } // namespace cc |
OLD | NEW |