| 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 "cc/layer_tree_host.h" | 5 #include "cc/layer_tree_host.h" |
| 6 | 6 |
| 7 #include "cc/content_layer.h" | 7 #include "cc/content_layer.h" |
| 8 #include "cc/layer.h" | 8 #include "cc/layer.h" |
| 9 #include "cc/layer_impl.h" | 9 #include "cc/layer_impl.h" |
| 10 #include "cc/layer_tree_impl.h" | 10 #include "cc/layer_tree_impl.h" |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 | 368 |
| 369 switch (impl->activeTree()->source_frame_number()) { | 369 switch (impl->activeTree()->source_frame_number()) { |
| 370 case 0: { | 370 case 0: { |
| 371 // Gesture scroll on impl thread. | 371 // Gesture scroll on impl thread. |
| 372 InputHandlerClient::ScrollStatus status = impl->scrollBegin( | 372 InputHandlerClient::ScrollStatus status = impl->scrollBegin( |
| 373 gfx::ToCeiledPoint( | 373 gfx::ToCeiledPoint( |
| 374 expected_scroll_layer_impl->position() + | 374 expected_scroll_layer_impl->position() + |
| 375 gfx::Vector2dF(0.5f, 0.5f)), | 375 gfx::Vector2dF(0.5f, 0.5f)), |
| 376 InputHandlerClient::Gesture); | 376 InputHandlerClient::Gesture); |
| 377 EXPECT_EQ(InputHandlerClient::ScrollStarted, status); | 377 EXPECT_EQ(InputHandlerClient::ScrollStarted, status); |
| 378 impl->scrollBy(gfx::Point(), scroll_amount_); | 378 impl->scrollBy(gfx::Point(), scroll_amount_, true); |
| 379 impl->scrollEnd(); | 379 impl->scrollEnd(); |
| 380 | 380 |
| 381 // Check the scroll is applied as a delta. | 381 // Check the scroll is applied as a delta. |
| 382 EXPECT_VECTOR_EQ( | 382 EXPECT_VECTOR_EQ( |
| 383 initial_offset_, | 383 initial_offset_, |
| 384 expected_scroll_layer_impl->scrollOffset()); | 384 expected_scroll_layer_impl->scrollOffset()); |
| 385 EXPECT_VECTOR_EQ( | 385 EXPECT_VECTOR_EQ( |
| 386 scroll_amount_, | 386 scroll_amount_, |
| 387 expected_scroll_layer_impl->scrollDelta()); | 387 expected_scroll_layer_impl->scrollDelta()); |
| 388 break; | 388 break; |
| 389 } | 389 } |
| 390 case 1: { | 390 case 1: { |
| 391 // Wheel scroll on impl thread. | 391 // Wheel scroll on impl thread. |
| 392 InputHandlerClient::ScrollStatus status = impl->scrollBegin( | 392 InputHandlerClient::ScrollStatus status = impl->scrollBegin( |
| 393 gfx::ToCeiledPoint( | 393 gfx::ToCeiledPoint( |
| 394 expected_scroll_layer_impl->position() + | 394 expected_scroll_layer_impl->position() + |
| 395 gfx::Vector2dF(0.5f, 0.5f)), | 395 gfx::Vector2dF(0.5f, 0.5f)), |
| 396 InputHandlerClient::Wheel); | 396 InputHandlerClient::Wheel); |
| 397 EXPECT_EQ(InputHandlerClient::ScrollStarted, status); | 397 EXPECT_EQ(InputHandlerClient::ScrollStarted, status); |
| 398 impl->scrollBy(gfx::Point(), scroll_amount_); | 398 impl->scrollBy(gfx::Point(), scroll_amount_, true); |
| 399 impl->scrollEnd(); | 399 impl->scrollEnd(); |
| 400 | 400 |
| 401 // Check the scroll is applied as a delta. | 401 // Check the scroll is applied as a delta. |
| 402 EXPECT_VECTOR_EQ( | 402 EXPECT_VECTOR_EQ( |
| 403 javascript_scroll_, | 403 javascript_scroll_, |
| 404 expected_scroll_layer_impl->scrollOffset()); | 404 expected_scroll_layer_impl->scrollOffset()); |
| 405 EXPECT_VECTOR_EQ( | 405 EXPECT_VECTOR_EQ( |
| 406 scroll_amount_, | 406 scroll_amount_, |
| 407 expected_scroll_layer_impl->scrollDelta()); | 407 expected_scroll_layer_impl->scrollDelta()); |
| 408 break; | 408 break; |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 613 gfx::Vector2d impl_thread_scroll1_; | 613 gfx::Vector2d impl_thread_scroll1_; |
| 614 gfx::Vector2d impl_thread_scroll2_; | 614 gfx::Vector2d impl_thread_scroll2_; |
| 615 int num_scrolls_; | 615 int num_scrolls_; |
| 616 bool can_activate_; | 616 bool can_activate_; |
| 617 }; | 617 }; |
| 618 | 618 |
| 619 MULTI_THREAD_TEST_F(ImplSidePaintingScrollTestSimple); | 619 MULTI_THREAD_TEST_F(ImplSidePaintingScrollTestSimple); |
| 620 | 620 |
| 621 } // namespace | 621 } // namespace |
| 622 } // namespace cc | 622 } // namespace cc |
| OLD | NEW |