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/trees/layer_tree_host.h" | 5 #include "cc/trees/layer_tree_host.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/location.h" | 9 #include "base/location.h" |
10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 ++did_swaps_; | 427 ++did_swaps_; |
428 EXPECT_TRUE(result); | 428 EXPECT_TRUE(result); |
429 LayerImpl* root = host_impl->active_tree()->root_layer(); | 429 LayerImpl* root = host_impl->active_tree()->root_layer(); |
430 LayerImpl* scroll_clip_layer = root->children()[0]; | 430 LayerImpl* scroll_clip_layer = root->children()[0]; |
431 LayerImpl* scroll_layer = scroll_clip_layer->children()[0]; | 431 LayerImpl* scroll_layer = scroll_clip_layer->children()[0]; |
432 switch (did_swaps_) { | 432 switch (did_swaps_) { |
433 case 1: | 433 case 1: |
434 // Test that modifying the position of the content layer (not | 434 // Test that modifying the position of the content layer (not |
435 // scrolling) won't damage the scrollbar. | 435 // scrolling) won't damage the scrollbar. |
436 scroll_layer->SetPosition(gfx::Point(1, 1)); | 436 scroll_layer->SetPosition(gfx::Point(1, 1)); |
437 scroll_layer->SetScrollOffset(scroll_layer->scroll_offset()); | 437 scroll_layer->PushScrollOffsetFromMainThread( |
| 438 scroll_layer->BaseScrollOffset()); |
438 host_impl->SetNeedsRedraw(); | 439 host_impl->SetNeedsRedraw(); |
439 break; | 440 break; |
440 case 2: | 441 case 2: |
441 scroll_layer->ScrollBy(gfx::Vector2dF(10.f, 10.f)); | 442 scroll_layer->ScrollBy(gfx::Vector2dF(10.f, 10.f)); |
442 host_impl->SetNeedsRedraw(); | 443 host_impl->SetNeedsRedraw(); |
443 break; | 444 break; |
444 case 3: | 445 case 3: |
445 scroll_layer->SetBounds(gfx::Size(root->bounds().width() + 60, | 446 scroll_layer->SetBounds(gfx::Size(root->bounds().width() + 60, |
446 root->bounds().height() + 100)); | 447 root->bounds().height() + 100)); |
447 host_impl->SetNeedsRedraw(); | 448 host_impl->SetNeedsRedraw(); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 | 525 |
525 void AfterTest() override { EXPECT_EQ(3, did_swaps_); } | 526 void AfterTest() override { EXPECT_EQ(3, did_swaps_); } |
526 | 527 |
527 int did_swaps_; | 528 int did_swaps_; |
528 }; | 529 }; |
529 | 530 |
530 MULTI_THREAD_TEST_F(LayerTreeHostDamageTestScrollbarCommitDoesNoDamage); | 531 MULTI_THREAD_TEST_F(LayerTreeHostDamageTestScrollbarCommitDoesNoDamage); |
531 | 532 |
532 } // namespace | 533 } // namespace |
533 } // namespace cc | 534 } // namespace cc |
OLD | NEW |