OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 "cc/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
(...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1151 layer_tree_host()->root_layer()->AddChild(scroll_layer_); | 1151 layer_tree_host()->root_layer()->AddChild(scroll_layer_); |
1152 // This test requires the page_scale and inner viewport layers to be | 1152 // This test requires the page_scale and inner viewport layers to be |
1153 // identified. | 1153 // identified. |
1154 layer_tree_host()->RegisterViewportLayers( | 1154 layer_tree_host()->RegisterViewportLayers( |
1155 root_layer, scroll_layer_.get(), NULL); | 1155 root_layer, scroll_layer_.get(), NULL); |
1156 layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 0.5f, 2.f); | 1156 layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 0.5f, 2.f); |
1157 } | 1157 } |
1158 | 1158 |
1159 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } | 1159 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } |
1160 | 1160 |
1161 virtual void ApplyScrollAndScale(gfx::Vector2d scroll_delta, | 1161 virtual void ApplyScrollAndScale(const gfx::Vector2d& scroll_delta, |
1162 float scale) OVERRIDE { | 1162 float scale) OVERRIDE { |
1163 gfx::Vector2d offset = scroll_layer_->scroll_offset(); | 1163 gfx::Vector2d offset = scroll_layer_->scroll_offset(); |
1164 scroll_layer_->SetScrollOffset(offset + scroll_delta); | 1164 scroll_layer_->SetScrollOffset(offset + scroll_delta); |
1165 layer_tree_host()->SetPageScaleFactorAndLimits(scale, 0.5f, 2.f); | 1165 layer_tree_host()->SetPageScaleFactorAndLimits(scale, 0.5f, 2.f); |
1166 } | 1166 } |
1167 | 1167 |
1168 virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE { | 1168 virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE { |
1169 // We get one commit before the first draw, and the animation doesn't happen | 1169 // We get one commit before the first draw, and the animation doesn't happen |
1170 // until the second draw. | 1170 // until the second draw. |
1171 switch (impl->active_tree()->source_frame_number()) { | 1171 switch (impl->active_tree()->source_frame_number()) { |
(...skipping 3793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4965 | 4965 |
4966 EndTest(); | 4966 EndTest(); |
4967 } | 4967 } |
4968 | 4968 |
4969 virtual void AfterTest() OVERRIDE {} | 4969 virtual void AfterTest() OVERRIDE {} |
4970 }; | 4970 }; |
4971 | 4971 |
4972 MULTI_THREAD_TEST_F(LayerTreeHostTestSimpleSwapPromiseMonitor); | 4972 MULTI_THREAD_TEST_F(LayerTreeHostTestSimpleSwapPromiseMonitor); |
4973 | 4973 |
4974 } // namespace cc | 4974 } // namespace cc |
OLD | NEW |