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 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
859 layer_tree_host()->RegisterViewportLayers( | 859 layer_tree_host()->RegisterViewportLayers( |
860 root_layer, scroll_layer_.get(), NULL); | 860 root_layer, scroll_layer_.get(), NULL); |
861 layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 0.5f, 2.f); | 861 layer_tree_host()->SetPageScaleFactorAndLimits(1.f, 0.5f, 2.f); |
862 } | 862 } |
863 | 863 |
864 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } | 864 virtual void BeginTest() OVERRIDE { PostSetNeedsCommitToMainThread(); } |
865 | 865 |
866 virtual void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta, | 866 virtual void ApplyViewportDeltas(const gfx::Vector2d& scroll_delta, |
867 float scale, | 867 float scale, |
868 float) OVERRIDE { | 868 float) OVERRIDE { |
869 gfx::Vector2d offset = scroll_layer_->scroll_offset(); | 869 gfx::Vector2dF offset = scroll_layer_->scroll_offset(); |
870 scroll_layer_->SetScrollOffset(offset + scroll_delta); | 870 scroll_layer_->SetScrollOffset(offset + scroll_delta); |
871 layer_tree_host()->SetPageScaleFactorAndLimits(scale, 0.5f, 2.f); | 871 layer_tree_host()->SetPageScaleFactorAndLimits(scale, 0.5f, 2.f); |
872 } | 872 } |
873 | 873 |
874 virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE { | 874 virtual void DidActivateTreeOnThread(LayerTreeHostImpl* impl) OVERRIDE { |
875 // We get one commit before the first draw, and the animation doesn't happen | 875 // We get one commit before the first draw, and the animation doesn't happen |
876 // until the second draw. | 876 // until the second draw. |
877 switch (impl->active_tree()->source_frame_number()) { | 877 switch (impl->active_tree()->source_frame_number()) { |
878 case 0: | 878 case 0: |
879 EXPECT_EQ(1.f, impl->active_tree()->page_scale_factor()); | 879 EXPECT_EQ(1.f, impl->active_tree()->page_scale_factor()); |
(...skipping 4151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5031 const gfx::Size bounds_; | 5031 const gfx::Size bounds_; |
5032 FakeContentLayerClient client_; | 5032 FakeContentLayerClient client_; |
5033 scoped_refptr<ContentLayerWithUpdateTracking> content_layer_; | 5033 scoped_refptr<ContentLayerWithUpdateTracking> content_layer_; |
5034 scoped_refptr<FakePictureLayer> picture_layer_; | 5034 scoped_refptr<FakePictureLayer> picture_layer_; |
5035 Layer* child_layer_; | 5035 Layer* child_layer_; |
5036 }; | 5036 }; |
5037 | 5037 |
5038 MULTI_THREAD_TEST_F(LayerTreeHostTestContinuousPainting); | 5038 MULTI_THREAD_TEST_F(LayerTreeHostTestContinuousPainting); |
5039 | 5039 |
5040 } // namespace cc | 5040 } // namespace cc |
OLD | NEW |