| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 <stddef.h> | 5 #include <stddef.h> |
| 6 | 6 |
| 7 #include <unordered_map> | 7 #include <unordered_map> |
| 8 | 8 |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 class ScrollbarLayerTest : public testing::Test { | 101 class ScrollbarLayerTest : public testing::Test { |
| 102 public: | 102 public: |
| 103 ScrollbarLayerTest() { | 103 ScrollbarLayerTest() { |
| 104 layer_tree_settings_.single_thread_proxy_scheduler = false; | 104 layer_tree_settings_.single_thread_proxy_scheduler = false; |
| 105 layer_tree_settings_.use_zero_copy = true; | 105 layer_tree_settings_.use_zero_copy = true; |
| 106 layer_tree_settings_.scrollbar_animator = LayerTreeSettings::LINEAR_FADE; | 106 layer_tree_settings_.scrollbar_animator = LayerTreeSettings::LINEAR_FADE; |
| 107 layer_tree_settings_.scrollbar_fade_delay = | 107 layer_tree_settings_.scrollbar_fade_delay = |
| 108 base::TimeDelta::FromMilliseconds(20); | 108 base::TimeDelta::FromMilliseconds(20); |
| 109 layer_tree_settings_.scrollbar_fade_duration = | 109 layer_tree_settings_.scrollbar_fade_duration = |
| 110 base::TimeDelta::FromMilliseconds(20); | 110 base::TimeDelta::FromMilliseconds(20); |
| 111 layer_tree_settings_.verify_clip_tree_calculations = true; | |
| 112 | 111 |
| 113 scrollbar_layer_id_ = -1; | 112 scrollbar_layer_id_ = -1; |
| 114 | 113 |
| 115 animation_host_ = AnimationHost::CreateForTesting(ThreadInstance::MAIN); | 114 animation_host_ = AnimationHost::CreateForTesting(ThreadInstance::MAIN); |
| 116 | 115 |
| 117 LayerTreeHostInProcess::InitParams params; | 116 LayerTreeHostInProcess::InitParams params; |
| 118 params.client = &fake_client_; | 117 params.client = &fake_client_; |
| 119 params.settings = &layer_tree_settings_; | 118 params.settings = &layer_tree_settings_; |
| 120 params.task_graph_runner = &task_graph_runner_; | 119 params.task_graph_runner = &task_graph_runner_; |
| 121 params.mutator_host = animation_host_.get(); | 120 params.mutator_host = animation_host_.get(); |
| (...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 689 EffectNode* node = | 688 EffectNode* node = |
| 690 host_impl->active_tree()->property_trees()->effect_tree.Node( | 689 host_impl->active_tree()->property_trees()->effect_tree.Node( |
| 691 scrollbar_layer->effect_tree_index()); | 690 scrollbar_layer->effect_tree_index()); |
| 692 EXPECT_EQ(node->opacity, 1.f); | 691 EXPECT_EQ(node->opacity, 1.f); |
| 693 } | 692 } |
| 694 | 693 |
| 695 class ScrollbarLayerSolidColorThumbTest : public testing::Test { | 694 class ScrollbarLayerSolidColorThumbTest : public testing::Test { |
| 696 public: | 695 public: |
| 697 ScrollbarLayerSolidColorThumbTest() { | 696 ScrollbarLayerSolidColorThumbTest() { |
| 698 LayerTreeSettings layer_tree_settings; | 697 LayerTreeSettings layer_tree_settings; |
| 699 layer_tree_settings.verify_clip_tree_calculations = true; | |
| 700 host_impl_.reset(new FakeLayerTreeHostImpl( | 698 host_impl_.reset(new FakeLayerTreeHostImpl( |
| 701 layer_tree_settings, &task_runner_provider_, &task_graph_runner_)); | 699 layer_tree_settings, &task_runner_provider_, &task_graph_runner_)); |
| 702 | 700 |
| 703 const int kThumbThickness = 3; | 701 const int kThumbThickness = 3; |
| 704 const int kTrackStart = 0; | 702 const int kTrackStart = 0; |
| 705 const bool kIsLeftSideVerticalScrollbar = false; | 703 const bool kIsLeftSideVerticalScrollbar = false; |
| 706 const bool kIsOverlayScrollbar = false; | 704 const bool kIsOverlayScrollbar = false; |
| 707 | 705 |
| 708 horizontal_scrollbar_layer_ = | 706 horizontal_scrollbar_layer_ = |
| 709 SolidColorScrollbarLayerImpl::Create(host_impl_->active_tree(), | 707 SolidColorScrollbarLayerImpl::Create(host_impl_->active_tree(), |
| (...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1170 TestScale(gfx::Rect(1240, 0, 15, 1333), 2.7754839f); | 1168 TestScale(gfx::Rect(1240, 0, 15, 1333), 2.7754839f); |
| 1171 TestScale(gfx::Rect(1240, 0, 15, 677), 2.46677136f); | 1169 TestScale(gfx::Rect(1240, 0, 15, 677), 2.46677136f); |
| 1172 | 1170 |
| 1173 // Horizontal Scrollbars. | 1171 // Horizontal Scrollbars. |
| 1174 TestScale(gfx::Rect(0, 1240, 1333, 15), 2.7754839f); | 1172 TestScale(gfx::Rect(0, 1240, 1333, 15), 2.7754839f); |
| 1175 TestScale(gfx::Rect(0, 1240, 677, 15), 2.46677136f); | 1173 TestScale(gfx::Rect(0, 1240, 677, 15), 2.46677136f); |
| 1176 } | 1174 } |
| 1177 | 1175 |
| 1178 } // namespace | 1176 } // namespace |
| 1179 } // namespace cc | 1177 } // namespace cc |
| OLD | NEW |