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 "base/containers/hash_tables.h" | 5 #include "base/containers/hash_tables.h" |
6 #include "base/thread_task_runner_handle.h" | 6 #include "base/thread_task_runner_handle.h" |
7 #include "cc/animation/scrollbar_animation_controller.h" | 7 #include "cc/animation/scrollbar_animation_controller.h" |
8 #include "cc/layers/append_quads_data.h" | 8 #include "cc/layers/append_quads_data.h" |
9 #include "cc/layers/painted_scrollbar_layer.h" | 9 #include "cc/layers/painted_scrollbar_layer.h" |
10 #include "cc/layers/painted_scrollbar_layer_impl.h" | 10 #include "cc/layers/painted_scrollbar_layer_impl.h" |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
114 | 114 |
115 int next_id_; | 115 int next_id_; |
116 int total_ui_resource_created_; | 116 int total_ui_resource_created_; |
117 int total_ui_resource_deleted_; | 117 int total_ui_resource_deleted_; |
118 }; | 118 }; |
119 | 119 |
120 class ScrollbarLayerTest : public testing::Test { | 120 class ScrollbarLayerTest : public testing::Test { |
121 public: | 121 public: |
122 ScrollbarLayerTest() : fake_client_(FakeLayerTreeHostClient::DIRECT_3D) { | 122 ScrollbarLayerTest() : fake_client_(FakeLayerTreeHostClient::DIRECT_3D) { |
123 layer_tree_settings_.single_thread_proxy_scheduler = false; | 123 layer_tree_settings_.single_thread_proxy_scheduler = false; |
124 layer_tree_settings_.use_zero_copy = true; | |
125 layer_tree_settings_.use_one_copy = false; | |
enne (OOO)
2015/06/15 22:58:46
Why does this test need zero copy?
danakj
2015/06/15 23:02:35
No scheduler.
| |
124 | 126 |
125 LayerTreeHost::InitParams params; | 127 LayerTreeHost::InitParams params; |
126 params.client = &fake_client_; | 128 params.client = &fake_client_; |
127 params.settings = &layer_tree_settings_; | 129 params.settings = &layer_tree_settings_; |
130 params.task_graph_runner = &task_graph_runner_; | |
128 | 131 |
129 layer_tree_host_.reset( | 132 layer_tree_host_.reset( |
130 new FakeResourceTrackingLayerTreeHost(&fake_client_, ¶ms)); | 133 new FakeResourceTrackingLayerTreeHost(&fake_client_, ¶ms)); |
131 fake_client_.SetLayerTreeHost(layer_tree_host_.get()); | 134 fake_client_.SetLayerTreeHost(layer_tree_host_.get()); |
132 // Force output surface creation for renderer capabilities. | 135 // Force output surface creation for renderer capabilities. |
133 layer_tree_host_->Composite(base::TimeTicks()); | 136 layer_tree_host_->Composite(base::TimeTicks()); |
134 EXPECT_FALSE(layer_tree_host_->output_surface_lost()); | 137 EXPECT_FALSE(layer_tree_host_->output_surface_lost()); |
135 } | 138 } |
136 | 139 |
137 const LayerSettings& layer_settings() { return layer_settings_; } | 140 const LayerSettings& layer_settings() { return layer_settings_; } |
138 | 141 |
139 protected: | 142 protected: |
140 FakeLayerTreeHostClient fake_client_; | 143 FakeLayerTreeHostClient fake_client_; |
144 TestTaskGraphRunner task_graph_runner_; | |
141 LayerTreeSettings layer_tree_settings_; | 145 LayerTreeSettings layer_tree_settings_; |
142 LayerSettings layer_settings_; | 146 LayerSettings layer_settings_; |
143 scoped_ptr<FakeResourceTrackingLayerTreeHost> layer_tree_host_; | 147 scoped_ptr<FakeResourceTrackingLayerTreeHost> layer_tree_host_; |
144 }; | 148 }; |
145 | 149 |
146 TEST_F(ScrollbarLayerTest, ResolveScrollLayerPointer) { | 150 TEST_F(ScrollbarLayerTest, ResolveScrollLayerPointer) { |
147 scoped_ptr<Scrollbar> scrollbar(new FakeScrollbar); | 151 scoped_ptr<Scrollbar> scrollbar(new FakeScrollbar); |
148 LayerImpl* layer_impl_tree_root = LayerImplForScrollAreaAndScrollbar( | 152 LayerImpl* layer_impl_tree_root = LayerImplForScrollAreaAndScrollbar( |
149 layer_settings(), layer_tree_host_.get(), scrollbar.Pass(), false, false, | 153 layer_settings(), layer_tree_host_.get(), scrollbar.Pass(), false, false, |
150 0, 0); | 154 0, 0); |
(...skipping 913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1064 TestScale(gfx::Rect(1240, 0, 15, 1333), 2.7754839f); | 1068 TestScale(gfx::Rect(1240, 0, 15, 1333), 2.7754839f); |
1065 TestScale(gfx::Rect(1240, 0, 15, 677), 2.46677136f); | 1069 TestScale(gfx::Rect(1240, 0, 15, 677), 2.46677136f); |
1066 | 1070 |
1067 // Horizontal Scrollbars. | 1071 // Horizontal Scrollbars. |
1068 TestScale(gfx::Rect(0, 1240, 1333, 15), 2.7754839f); | 1072 TestScale(gfx::Rect(0, 1240, 1333, 15), 2.7754839f); |
1069 TestScale(gfx::Rect(0, 1240, 677, 15), 2.46677136f); | 1073 TestScale(gfx::Rect(0, 1240, 677, 15), 2.46677136f); |
1070 } | 1074 } |
1071 | 1075 |
1072 } // namespace | 1076 } // namespace |
1073 } // namespace cc | 1077 } // namespace cc |
OLD | NEW |