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