| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/input/single_scrollbar_animation_controller_thinning.h" | 5 #include "cc/input/single_scrollbar_animation_controller_thinning.h" |
| 6 | 6 |
| 7 #include "cc/layers/solid_color_scrollbar_layer_impl.h" | 7 #include "cc/layers/solid_color_scrollbar_layer_impl.h" |
| 8 #include "cc/test/fake_impl_task_runner_provider.h" | 8 #include "cc/test/fake_impl_task_runner_provider.h" |
| 9 #include "cc/test/fake_layer_tree_host_impl.h" | 9 #include "cc/test/fake_layer_tree_host_impl.h" |
| 10 #include "cc/test/geometry_test_utils.h" | 10 #include "cc/test/geometry_test_utils.h" |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 std::unique_ptr<SolidColorScrollbarLayerImpl> scrollbar = | 80 std::unique_ptr<SolidColorScrollbarLayerImpl> scrollbar = |
| 81 SolidColorScrollbarLayerImpl::Create( | 81 SolidColorScrollbarLayerImpl::Create( |
| 82 host_impl_.active_tree(), kId, HORIZONTAL, kThumbThickness, | 82 host_impl_.active_tree(), kId, HORIZONTAL, kThumbThickness, |
| 83 kTrackStart, kIsLeftSideVerticalScrollbar, kIsOverlayScrollbar); | 83 kTrackStart, kIsLeftSideVerticalScrollbar, kIsOverlayScrollbar); |
| 84 scrollbar_layer_ = scrollbar.get(); | 84 scrollbar_layer_ = scrollbar.get(); |
| 85 | 85 |
| 86 scroll_layer->test_properties()->AddChild(std::move(scrollbar)); | 86 scroll_layer->test_properties()->AddChild(std::move(scrollbar)); |
| 87 clip_layer_->test_properties()->AddChild(std::move(scroll_layer)); | 87 clip_layer_->test_properties()->AddChild(std::move(scroll_layer)); |
| 88 host_impl_.active_tree()->SetRootLayerForTesting(std::move(clip)); | 88 host_impl_.active_tree()->SetRootLayerForTesting(std::move(clip)); |
| 89 | 89 |
| 90 scrollbar_layer_->SetScrollInfo(scroll_layer_ptr->id(), | 90 scrollbar_layer_->SetScrollElementId(scroll_layer_ptr->element_id()); |
| 91 scroll_layer_ptr->element_id()); | |
| 92 scrollbar_layer_->test_properties()->opacity_can_animate = true; | 91 scrollbar_layer_->test_properties()->opacity_can_animate = true; |
| 93 clip_layer_->SetBounds(gfx::Size(100, 100)); | 92 clip_layer_->SetBounds(gfx::Size(100, 100)); |
| 94 scroll_layer_ptr->SetBounds(gfx::Size(200, 200)); | 93 scroll_layer_ptr->SetBounds(gfx::Size(200, 200)); |
| 95 host_impl_.active_tree()->BuildLayerListAndPropertyTreesForTesting(); | 94 host_impl_.active_tree()->BuildLayerListAndPropertyTreesForTesting(); |
| 96 | 95 |
| 97 scrollbar_controller_ = SingleScrollbarAnimationControllerThinning::Create( | 96 scrollbar_controller_ = SingleScrollbarAnimationControllerThinning::Create( |
| 98 scroll_layer_ptr->element_id(), HORIZONTAL, &client_, | 97 scroll_layer_ptr->element_id(), HORIZONTAL, &client_, |
| 99 kThinningDuration); | 98 kThinningDuration); |
| 100 } | 99 } |
| 101 | 100 |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 377 scrollbar_layer_->thumb_thickness_scale_factor()); | 376 scrollbar_layer_->thumb_thickness_scale_factor()); |
| 378 | 377 |
| 379 time += kThinningDuration / 2; | 378 time += kThinningDuration / 2; |
| 380 scrollbar_controller_->Animate(time); | 379 scrollbar_controller_->Animate(time); |
| 381 EXPECT_FLOAT_EQ(kIdleThicknessScale, | 380 EXPECT_FLOAT_EQ(kIdleThicknessScale, |
| 382 scrollbar_layer_->thumb_thickness_scale_factor()); | 381 scrollbar_layer_->thumb_thickness_scale_factor()); |
| 383 } | 382 } |
| 384 | 383 |
| 385 } // namespace | 384 } // namespace |
| 386 } // namespace cc | 385 } // namespace cc |
| OLD | NEW |