| 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_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <cmath> | 10 #include <cmath> |
| (...skipping 9986 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9997 host_impl_->WillBeginImplFrame(begin_frame_args); | 9997 host_impl_->WillBeginImplFrame(begin_frame_args); |
| 9998 host_impl_->Animate(); | 9998 host_impl_->Animate(); |
| 9999 host_impl_->UpdateAnimationState(true); | 9999 host_impl_->UpdateAnimationState(true); |
| 10000 | 10000 |
| 10001 EXPECT_VECTOR_EQ(gfx::ScrollOffset(0, 100), | 10001 EXPECT_VECTOR_EQ(gfx::ScrollOffset(0, 100), |
| 10002 scrolling_layer->CurrentScrollOffset()); | 10002 scrolling_layer->CurrentScrollOffset()); |
| 10003 EXPECT_EQ(NULL, host_impl_->CurrentlyScrollingLayer()); | 10003 EXPECT_EQ(NULL, host_impl_->CurrentlyScrollingLayer()); |
| 10004 host_impl_->DidFinishImplFrame(); | 10004 host_impl_->DidFinishImplFrame(); |
| 10005 } | 10005 } |
| 10006 | 10006 |
| 10007 TEST_F(LayerTreeHostImplTest, SecondScrollAnimatedBeginNotIgnored) { |
| 10008 const gfx::Size content_size(1000, 1000); |
| 10009 const gfx::Size viewport_size(50, 100); |
| 10010 CreateBasicVirtualViewportLayers(viewport_size, content_size); |
| 10011 |
| 10012 EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD, |
| 10013 host_impl_->ScrollAnimatedBegin(gfx::Point()).thread); |
| 10014 |
| 10015 // The second ScrollAnimatedBegin should not get ignored. |
| 10016 EXPECT_EQ(InputHandler::SCROLL_ON_IMPL_THREAD, |
| 10017 host_impl_->ScrollAnimatedBegin(gfx::Point()).thread); |
| 10018 } |
| 10019 |
| 10007 // Verfify that a smooth scroll animation doesn't jump when UpdateTarget gets | 10020 // Verfify that a smooth scroll animation doesn't jump when UpdateTarget gets |
| 10008 // called before the animation is started. | 10021 // called before the animation is started. |
| 10009 TEST_F(LayerTreeHostImplTest, AnimatedScrollUpdateTargetBeforeStarting) { | 10022 TEST_F(LayerTreeHostImplTest, AnimatedScrollUpdateTargetBeforeStarting) { |
| 10010 const gfx::Size content_size(1000, 1000); | 10023 const gfx::Size content_size(1000, 1000); |
| 10011 const gfx::Size viewport_size(50, 100); | 10024 const gfx::Size viewport_size(50, 100); |
| 10012 CreateBasicVirtualViewportLayers(viewport_size, content_size); | 10025 CreateBasicVirtualViewportLayers(viewport_size, content_size); |
| 10013 | 10026 |
| 10014 DrawFrame(); | 10027 DrawFrame(); |
| 10015 | 10028 |
| 10016 base::TimeTicks start_time = | 10029 base::TimeTicks start_time = |
| (...skipping 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11149 EXPECT_TRUE(host_impl_->use_gpu_rasterization()); | 11162 EXPECT_TRUE(host_impl_->use_gpu_rasterization()); |
| 11150 | 11163 |
| 11151 // Re-initialize with a software output surface. | 11164 // Re-initialize with a software output surface. |
| 11152 output_surface_ = FakeOutputSurface::CreateDelegatingSoftware(); | 11165 output_surface_ = FakeOutputSurface::CreateDelegatingSoftware(); |
| 11153 host_impl_->InitializeRenderer(output_surface_.get()); | 11166 host_impl_->InitializeRenderer(output_surface_.get()); |
| 11154 EXPECT_FALSE(host_impl_->use_gpu_rasterization()); | 11167 EXPECT_FALSE(host_impl_->use_gpu_rasterization()); |
| 11155 } | 11168 } |
| 11156 | 11169 |
| 11157 } // namespace | 11170 } // namespace |
| 11158 } // namespace cc | 11171 } // namespace cc |
| OLD | NEW |