| 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/memory/weak_ptr.h" | 7 #include "base/memory/weak_ptr.h" |
| 8 #include "cc/layers/content_layer.h" | 8 #include "cc/layers/content_layer.h" |
| 9 #include "cc/layers/layer.h" | 9 #include "cc/layers/layer.h" |
| 10 #include "cc/layers/layer_impl.h" | 10 #include "cc/layers/layer_impl.h" |
| (...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 564 // change of main_thread_scroll. | 564 // change of main_thread_scroll. |
| 565 root->SetScrollOffset(initial_scroll_ + main_thread_scroll_ + | 565 root->SetScrollOffset(initial_scroll_ + main_thread_scroll_ + |
| 566 impl_thread_scroll1_); | 566 impl_thread_scroll1_); |
| 567 } | 567 } |
| 568 } | 568 } |
| 569 | 569 |
| 570 virtual bool CanActivatePendingTree(LayerTreeHostImpl* impl) OVERRIDE { | 570 virtual bool CanActivatePendingTree(LayerTreeHostImpl* impl) OVERRIDE { |
| 571 return can_activate_; | 571 return can_activate_; |
| 572 } | 572 } |
| 573 | 573 |
| 574 virtual bool CanActivatePendingTreeIfNeeded(LayerTreeHostImpl* impl) |
| 575 OVERRIDE { |
| 576 return can_activate_; |
| 577 } |
| 578 |
| 574 virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE { | 579 virtual void CommitCompleteOnThread(LayerTreeHostImpl* impl) OVERRIDE { |
| 575 // We force a second draw here of the first commit before activating | 580 // We force a second draw here of the first commit before activating |
| 576 // the second commit. | 581 // the second commit. |
| 577 if (impl->active_tree()->source_frame_number() == 0) | 582 if (impl->active_tree()->source_frame_number() == 0) |
| 578 impl->SetNeedsRedraw(); | 583 impl->SetNeedsRedraw(); |
| 579 } | 584 } |
| 580 | 585 |
| 581 virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE { | 586 virtual void DrawLayersOnThread(LayerTreeHostImpl* impl) OVERRIDE { |
| 582 ImplSidePaintingScrollTest::DrawLayersOnThread(impl); | 587 ImplSidePaintingScrollTest::DrawLayersOnThread(impl); |
| 583 | 588 |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 840 RunTest(true, false, false); | 845 RunTest(true, false, false); |
| 841 } | 846 } |
| 842 | 847 |
| 843 TEST_F(LayerTreeHostScrollTestLayerStructureChange, ScrollDestroyWholeTree) { | 848 TEST_F(LayerTreeHostScrollTestLayerStructureChange, ScrollDestroyWholeTree) { |
| 844 scroll_destroy_whole_tree_ = true; | 849 scroll_destroy_whole_tree_ = true; |
| 845 RunTest(true, false, false); | 850 RunTest(true, false, false); |
| 846 } | 851 } |
| 847 | 852 |
| 848 } // namespace | 853 } // namespace |
| 849 } // namespace cc | 854 } // namespace cc |
| OLD | NEW |