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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 = | 106 layer_tree_settings_.scrollbar_animator = |
107 LayerTreeSettings::ANDROID_OVERLAY; | 107 LayerTreeSettings::ANDROID_OVERLAY; |
108 layer_tree_settings_.scrollbar_show_delay = | 108 layer_tree_settings_.scrollbar_show_delay = |
109 base::TimeDelta::FromMilliseconds(20); | 109 base::TimeDelta::FromMilliseconds(20); |
110 layer_tree_settings_.scrollbar_fade_out_delay = | 110 layer_tree_settings_.scrollbar_fade_out_delay = |
111 base::TimeDelta::FromMilliseconds(20); | 111 base::TimeDelta::FromMilliseconds(20); |
112 layer_tree_settings_.scrollbar_fade_out_duration = | 112 layer_tree_settings_.scrollbar_fade_out_duration = |
113 base::TimeDelta::FromMilliseconds(20); | 113 base::TimeDelta::FromMilliseconds(20); |
114 layer_tree_settings_.verify_clip_tree_calculations = true; | |
115 | 114 |
116 scrollbar_layer_id_ = -1; | 115 scrollbar_layer_id_ = -1; |
117 | 116 |
118 animation_host_ = AnimationHost::CreateForTesting(ThreadInstance::MAIN); | 117 animation_host_ = AnimationHost::CreateForTesting(ThreadInstance::MAIN); |
119 | 118 |
120 LayerTreeHost::InitParams params; | 119 LayerTreeHost::InitParams params; |
121 params.client = &fake_client_; | 120 params.client = &fake_client_; |
122 params.settings = &layer_tree_settings_; | 121 params.settings = &layer_tree_settings_; |
123 params.task_graph_runner = &task_graph_runner_; | 122 params.task_graph_runner = &task_graph_runner_; |
124 params.mutator_host = animation_host_.get(); | 123 params.mutator_host = animation_host_.get(); |
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
686 EffectNode* node = | 685 EffectNode* node = |
687 host_impl->active_tree()->property_trees()->effect_tree.Node( | 686 host_impl->active_tree()->property_trees()->effect_tree.Node( |
688 scrollbar_layer->effect_tree_index()); | 687 scrollbar_layer->effect_tree_index()); |
689 EXPECT_EQ(node->opacity, 1.f); | 688 EXPECT_EQ(node->opacity, 1.f); |
690 } | 689 } |
691 | 690 |
692 class ScrollbarLayerSolidColorThumbTest : public testing::Test { | 691 class ScrollbarLayerSolidColorThumbTest : public testing::Test { |
693 public: | 692 public: |
694 ScrollbarLayerSolidColorThumbTest() { | 693 ScrollbarLayerSolidColorThumbTest() { |
695 LayerTreeSettings layer_tree_settings; | 694 LayerTreeSettings layer_tree_settings; |
696 layer_tree_settings.verify_clip_tree_calculations = true; | |
697 host_impl_.reset(new FakeLayerTreeHostImpl( | 695 host_impl_.reset(new FakeLayerTreeHostImpl( |
698 layer_tree_settings, &task_runner_provider_, &task_graph_runner_)); | 696 layer_tree_settings, &task_runner_provider_, &task_graph_runner_)); |
699 | 697 |
700 const int kThumbThickness = 3; | 698 const int kThumbThickness = 3; |
701 const int kTrackStart = 0; | 699 const int kTrackStart = 0; |
702 const bool kIsLeftSideVerticalScrollbar = false; | 700 const bool kIsLeftSideVerticalScrollbar = false; |
703 const bool kIsOverlayScrollbar = false; | 701 const bool kIsOverlayScrollbar = false; |
704 | 702 |
705 horizontal_scrollbar_layer_ = | 703 horizontal_scrollbar_layer_ = |
706 SolidColorScrollbarLayerImpl::Create(host_impl_->active_tree(), | 704 SolidColorScrollbarLayerImpl::Create(host_impl_->active_tree(), |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1167 TestScale(gfx::Rect(1240, 0, 15, 1333), 2.7754839f); | 1165 TestScale(gfx::Rect(1240, 0, 15, 1333), 2.7754839f); |
1168 TestScale(gfx::Rect(1240, 0, 15, 677), 2.46677136f); | 1166 TestScale(gfx::Rect(1240, 0, 15, 677), 2.46677136f); |
1169 | 1167 |
1170 // Horizontal Scrollbars. | 1168 // Horizontal Scrollbars. |
1171 TestScale(gfx::Rect(0, 1240, 1333, 15), 2.7754839f); | 1169 TestScale(gfx::Rect(0, 1240, 1333, 15), 2.7754839f); |
1172 TestScale(gfx::Rect(0, 1240, 677, 15), 2.46677136f); | 1170 TestScale(gfx::Rect(0, 1240, 677, 15), 2.46677136f); |
1173 } | 1171 } |
1174 | 1172 |
1175 } // namespace | 1173 } // namespace |
1176 } // namespace cc | 1174 } // namespace cc |
OLD | NEW |