| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 2454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2465 void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { | 2465 void DidActivateTreeOnThread(LayerTreeHostImpl* impl) override { |
| 2466 // We get one commit before the first draw, and the animation doesn't happen | 2466 // We get one commit before the first draw, and the animation doesn't happen |
| 2467 // until the second draw. | 2467 // until the second draw. |
| 2468 switch (impl->active_tree()->source_frame_number()) { | 2468 switch (impl->active_tree()->source_frame_number()) { |
| 2469 case 0: | 2469 case 0: |
| 2470 EXPECT_EQ(1.f, impl->active_tree()->current_page_scale_factor()); | 2470 EXPECT_EQ(1.f, impl->active_tree()->current_page_scale_factor()); |
| 2471 // We'll start an animation when we get back to the main thread. | 2471 // We'll start an animation when we get back to the main thread. |
| 2472 break; | 2472 break; |
| 2473 case 1: | 2473 case 1: |
| 2474 EXPECT_EQ(1.f, impl->active_tree()->current_page_scale_factor()); | 2474 EXPECT_EQ(1.f, impl->active_tree()->current_page_scale_factor()); |
| 2475 // Once the animation starts, an ImplFrame will be requested. However, |
| 2476 // main frames may be happening in the mean-time due to high-latency |
| 2477 // mode. If one happens before the next impl frame, then the source |
| 2478 // frame number may increment twice instead of just once. |
| 2475 break; | 2479 break; |
| 2476 case 2: | 2480 case 2: |
| 2481 case 3: |
| 2477 EXPECT_EQ(1.25f, impl->active_tree()->current_page_scale_factor()); | 2482 EXPECT_EQ(1.25f, impl->active_tree()->current_page_scale_factor()); |
| 2478 EndTest(); | 2483 EndTest(); |
| 2479 break; | 2484 break; |
| 2480 case 3: | |
| 2481 break; | |
| 2482 default: | |
| 2483 NOTREACHED(); | |
| 2484 } | 2485 } |
| 2485 } | 2486 } |
| 2486 | 2487 |
| 2487 void DidCommitAndDrawFrame() override { | 2488 void DidCommitAndDrawFrame() override { |
| 2488 switch (layer_tree_host()->SourceFrameNumber()) { | 2489 switch (layer_tree_host()->SourceFrameNumber()) { |
| 2489 case 1: | 2490 case 1: |
| 2490 layer_tree_host()->StartPageScaleAnimation(gfx::Vector2d(), false, | 2491 layer_tree_host()->StartPageScaleAnimation(gfx::Vector2d(), false, |
| 2491 1.25f, base::TimeDelta()); | 2492 1.25f, base::TimeDelta()); |
| 2492 break; | 2493 break; |
| 2493 } | 2494 } |
| (...skipping 5151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7645 void AfterTest() override {} | 7646 void AfterTest() override {} |
| 7646 | 7647 |
| 7647 private: | 7648 private: |
| 7648 bool received_ack_ = false; | 7649 bool received_ack_ = false; |
| 7649 }; | 7650 }; |
| 7650 | 7651 |
| 7651 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestDiscardAckAfterRelease); | 7652 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestDiscardAckAfterRelease); |
| 7652 | 7653 |
| 7653 } // namespace | 7654 } // namespace |
| 7654 } // namespace cc | 7655 } // namespace cc |
| OLD | NEW |