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/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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 class ScrollbarLayerTest : public testing::Test { | 100 class ScrollbarLayerTest : public testing::Test { |
101 public: | 101 public: |
102 ScrollbarLayerTest() { | 102 ScrollbarLayerTest() { |
103 layer_tree_settings_.single_thread_proxy_scheduler = false; | 103 layer_tree_settings_.single_thread_proxy_scheduler = false; |
104 layer_tree_settings_.use_zero_copy = true; | 104 layer_tree_settings_.use_zero_copy = true; |
105 layer_tree_settings_.scrollbar_animator = LayerTreeSettings::LINEAR_FADE; | 105 layer_tree_settings_.scrollbar_animator = LayerTreeSettings::LINEAR_FADE; |
106 layer_tree_settings_.scrollbar_fade_delay = | 106 layer_tree_settings_.scrollbar_fade_delay = |
107 base::TimeDelta::FromMilliseconds(20); | 107 base::TimeDelta::FromMilliseconds(20); |
108 layer_tree_settings_.scrollbar_fade_duration = | 108 layer_tree_settings_.scrollbar_fade_duration = |
109 base::TimeDelta::FromMilliseconds(20); | 109 base::TimeDelta::FromMilliseconds(20); |
110 layer_tree_settings_.verify_transform_tree_calculations = true; | |
111 layer_tree_settings_.verify_clip_tree_calculations = true; | 110 layer_tree_settings_.verify_clip_tree_calculations = true; |
112 | 111 |
113 scrollbar_layer_id_ = -1; | 112 scrollbar_layer_id_ = -1; |
114 | 113 |
115 LayerTreeHostInProcess::InitParams params; | 114 LayerTreeHostInProcess::InitParams params; |
116 params.client = &fake_client_; | 115 params.client = &fake_client_; |
117 params.settings = &layer_tree_settings_; | 116 params.settings = &layer_tree_settings_; |
118 params.task_graph_runner = &task_graph_runner_; | 117 params.task_graph_runner = &task_graph_runner_; |
119 params.animation_host = | 118 params.animation_host = |
120 AnimationHost::CreateForTesting(ThreadInstance::MAIN); | 119 AnimationHost::CreateForTesting(ThreadInstance::MAIN); |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
637 EffectNode* node = | 636 EffectNode* node = |
638 host_impl->active_tree()->property_trees()->effect_tree.Node( | 637 host_impl->active_tree()->property_trees()->effect_tree.Node( |
639 scrollbar_layer->effect_tree_index()); | 638 scrollbar_layer->effect_tree_index()); |
640 EXPECT_EQ(node->opacity, 1.f); | 639 EXPECT_EQ(node->opacity, 1.f); |
641 } | 640 } |
642 | 641 |
643 class ScrollbarLayerSolidColorThumbTest : public testing::Test { | 642 class ScrollbarLayerSolidColorThumbTest : public testing::Test { |
644 public: | 643 public: |
645 ScrollbarLayerSolidColorThumbTest() { | 644 ScrollbarLayerSolidColorThumbTest() { |
646 LayerTreeSettings layer_tree_settings; | 645 LayerTreeSettings layer_tree_settings; |
647 layer_tree_settings.verify_transform_tree_calculations = true; | |
648 layer_tree_settings.verify_clip_tree_calculations = true; | 646 layer_tree_settings.verify_clip_tree_calculations = true; |
649 host_impl_.reset(new FakeLayerTreeHostImpl( | 647 host_impl_.reset(new FakeLayerTreeHostImpl( |
650 layer_tree_settings, &task_runner_provider_, &shared_bitmap_manager_, | 648 layer_tree_settings, &task_runner_provider_, &shared_bitmap_manager_, |
651 &task_graph_runner_)); | 649 &task_graph_runner_)); |
652 | 650 |
653 const int kThumbThickness = 3; | 651 const int kThumbThickness = 3; |
654 const int kTrackStart = 0; | 652 const int kTrackStart = 0; |
655 const bool kIsLeftSideVerticalScrollbar = false; | 653 const bool kIsLeftSideVerticalScrollbar = false; |
656 const bool kIsOverlayScrollbar = false; | 654 const bool kIsOverlayScrollbar = false; |
657 | 655 |
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1121 TestScale(gfx::Rect(1240, 0, 15, 1333), 2.7754839f); | 1119 TestScale(gfx::Rect(1240, 0, 15, 1333), 2.7754839f); |
1122 TestScale(gfx::Rect(1240, 0, 15, 677), 2.46677136f); | 1120 TestScale(gfx::Rect(1240, 0, 15, 677), 2.46677136f); |
1123 | 1121 |
1124 // Horizontal Scrollbars. | 1122 // Horizontal Scrollbars. |
1125 TestScale(gfx::Rect(0, 1240, 1333, 15), 2.7754839f); | 1123 TestScale(gfx::Rect(0, 1240, 1333, 15), 2.7754839f); |
1126 TestScale(gfx::Rect(0, 1240, 677, 15), 2.46677136f); | 1124 TestScale(gfx::Rect(0, 1240, 677, 15), 2.46677136f); |
1127 } | 1125 } |
1128 | 1126 |
1129 } // namespace | 1127 } // namespace |
1130 } // namespace cc | 1128 } // namespace cc |
OLD | NEW |