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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 }; | 101 }; |
102 | 102 |
103 class ScrollbarLayerTest : public testing::Test { | 103 class ScrollbarLayerTest : public testing::Test { |
104 public: | 104 public: |
105 ScrollbarLayerTest() { | 105 ScrollbarLayerTest() { |
106 layer_tree_settings_.single_thread_proxy_scheduler = false; | 106 layer_tree_settings_.single_thread_proxy_scheduler = false; |
107 layer_tree_settings_.use_zero_copy = true; | 107 layer_tree_settings_.use_zero_copy = true; |
108 layer_tree_settings_.scrollbar_animator = LayerTreeSettings::LINEAR_FADE; | 108 layer_tree_settings_.scrollbar_animator = LayerTreeSettings::LINEAR_FADE; |
109 layer_tree_settings_.scrollbar_fade_delay_ms = 20; | 109 layer_tree_settings_.scrollbar_fade_delay_ms = 20; |
110 layer_tree_settings_.scrollbar_fade_duration_ms = 20; | 110 layer_tree_settings_.scrollbar_fade_duration_ms = 20; |
111 layer_tree_settings_.verify_transform_tree_calculations = true; | |
112 layer_tree_settings_.verify_clip_tree_calculations = true; | 111 layer_tree_settings_.verify_clip_tree_calculations = true; |
113 | 112 |
114 scrollbar_layer_id_ = -1; | 113 scrollbar_layer_id_ = -1; |
115 | 114 |
116 LayerTreeHost::InitParams params; | 115 LayerTreeHost::InitParams params; |
117 params.client = &fake_client_; | 116 params.client = &fake_client_; |
118 params.settings = &layer_tree_settings_; | 117 params.settings = &layer_tree_settings_; |
119 params.task_graph_runner = &task_graph_runner_; | 118 params.task_graph_runner = &task_graph_runner_; |
120 params.animation_host = | 119 params.animation_host = |
121 AnimationHost::CreateForTesting(ThreadInstance::MAIN); | 120 AnimationHost::CreateForTesting(ThreadInstance::MAIN); |
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
627 EffectNode* node = | 626 EffectNode* node = |
628 host_impl->active_tree()->property_trees()->effect_tree.Node( | 627 host_impl->active_tree()->property_trees()->effect_tree.Node( |
629 scrollbar_layer->effect_tree_index()); | 628 scrollbar_layer->effect_tree_index()); |
630 EXPECT_EQ(node->opacity, 1.f); | 629 EXPECT_EQ(node->opacity, 1.f); |
631 } | 630 } |
632 | 631 |
633 class ScrollbarLayerSolidColorThumbTest : public testing::Test { | 632 class ScrollbarLayerSolidColorThumbTest : public testing::Test { |
634 public: | 633 public: |
635 ScrollbarLayerSolidColorThumbTest() { | 634 ScrollbarLayerSolidColorThumbTest() { |
636 LayerTreeSettings layer_tree_settings; | 635 LayerTreeSettings layer_tree_settings; |
637 layer_tree_settings.verify_transform_tree_calculations = true; | |
638 layer_tree_settings.verify_clip_tree_calculations = true; | 636 layer_tree_settings.verify_clip_tree_calculations = true; |
639 host_impl_.reset(new FakeLayerTreeHostImpl( | 637 host_impl_.reset(new FakeLayerTreeHostImpl( |
640 layer_tree_settings, &task_runner_provider_, &shared_bitmap_manager_, | 638 layer_tree_settings, &task_runner_provider_, &shared_bitmap_manager_, |
641 &task_graph_runner_)); | 639 &task_graph_runner_)); |
642 | 640 |
643 const int kThumbThickness = 3; | 641 const int kThumbThickness = 3; |
644 const int kTrackStart = 0; | 642 const int kTrackStart = 0; |
645 const bool kIsLeftSideVerticalScrollbar = false; | 643 const bool kIsLeftSideVerticalScrollbar = false; |
646 const bool kIsOverlayScrollbar = false; | 644 const bool kIsOverlayScrollbar = false; |
647 | 645 |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1089 TestScale(gfx::Rect(1240, 0, 15, 1333), 2.7754839f); | 1087 TestScale(gfx::Rect(1240, 0, 15, 1333), 2.7754839f); |
1090 TestScale(gfx::Rect(1240, 0, 15, 677), 2.46677136f); | 1088 TestScale(gfx::Rect(1240, 0, 15, 677), 2.46677136f); |
1091 | 1089 |
1092 // Horizontal Scrollbars. | 1090 // Horizontal Scrollbars. |
1093 TestScale(gfx::Rect(0, 1240, 1333, 15), 2.7754839f); | 1091 TestScale(gfx::Rect(0, 1240, 1333, 15), 2.7754839f); |
1094 TestScale(gfx::Rect(0, 1240, 677, 15), 2.46677136f); | 1092 TestScale(gfx::Rect(0, 1240, 677, 15), 2.46677136f); |
1095 } | 1093 } |
1096 | 1094 |
1097 } // namespace | 1095 } // namespace |
1098 } // namespace cc | 1096 } // namespace cc |
OLD | NEW |