| OLD | NEW |
| 1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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/layers/layer.h" | 5 #include "cc/layers/layer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/atomic_sequence_num.h" | 9 #include "base/atomic_sequence_num.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 804 return; | 804 return; |
| 805 scroll_offset_ = scroll_offset; | 805 scroll_offset_ = scroll_offset; |
| 806 | 806 |
| 807 if (!layer_tree_host_) | 807 if (!layer_tree_host_) |
| 808 return; | 808 return; |
| 809 | 809 |
| 810 if (TransformNode* transform_node = | 810 if (TransformNode* transform_node = |
| 811 layer_tree_host_->property_trees()->transform_tree.Node( | 811 layer_tree_host_->property_trees()->transform_tree.Node( |
| 812 transform_tree_index())) { | 812 transform_tree_index())) { |
| 813 if (transform_node->owner_id == id()) { | 813 if (transform_node->owner_id == id()) { |
| 814 transform_node->data.scroll_offset = | 814 transform_node->data.scroll_offset = CurrentScrollOffset(); |
| 815 gfx::ScrollOffsetToVector2dF(CurrentScrollOffset()); | |
| 816 transform_node->data.needs_local_transform_update = true; | 815 transform_node->data.needs_local_transform_update = true; |
| 817 layer_tree_host_->property_trees()->transform_tree.set_needs_update(true); | 816 layer_tree_host_->property_trees()->transform_tree.set_needs_update(true); |
| 818 SetNeedsCommitNoRebuild(); | 817 SetNeedsCommitNoRebuild(); |
| 819 return; | 818 return; |
| 820 } | 819 } |
| 821 } | 820 } |
| 822 | 821 |
| 823 SetNeedsCommit(); | 822 SetNeedsCommit(); |
| 824 } | 823 } |
| 825 | 824 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 844 if (scroll_offset_ == scroll_offset) | 843 if (scroll_offset_ == scroll_offset) |
| 845 return; | 844 return; |
| 846 scroll_offset_ = scroll_offset; | 845 scroll_offset_ = scroll_offset; |
| 847 SetNeedsPushProperties(); | 846 SetNeedsPushProperties(); |
| 848 | 847 |
| 849 bool needs_rebuild = true; | 848 bool needs_rebuild = true; |
| 850 if (TransformNode* transform_node = | 849 if (TransformNode* transform_node = |
| 851 layer_tree_host_->property_trees()->transform_tree.Node( | 850 layer_tree_host_->property_trees()->transform_tree.Node( |
| 852 transform_tree_index())) { | 851 transform_tree_index())) { |
| 853 if (transform_node->owner_id == id()) { | 852 if (transform_node->owner_id == id()) { |
| 854 transform_node->data.scroll_offset = | 853 transform_node->data.scroll_offset = CurrentScrollOffset(); |
| 855 gfx::ScrollOffsetToVector2dF(CurrentScrollOffset()); | |
| 856 transform_node->data.needs_local_transform_update = true; | 854 transform_node->data.needs_local_transform_update = true; |
| 857 layer_tree_host_->property_trees()->transform_tree.set_needs_update(true); | 855 layer_tree_host_->property_trees()->transform_tree.set_needs_update(true); |
| 858 needs_rebuild = false; | 856 needs_rebuild = false; |
| 859 } | 857 } |
| 860 } | 858 } |
| 861 | 859 |
| 862 if (needs_rebuild) | 860 if (needs_rebuild) |
| 863 layer_tree_host_->property_trees()->needs_rebuild = true; | 861 layer_tree_host_->property_trees()->needs_rebuild = true; |
| 864 | 862 |
| 865 if (!did_scroll_callback_.is_null()) | 863 if (!did_scroll_callback_.is_null()) |
| (...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1516 | 1514 |
| 1517 void Layer::DidBeginTracing() { | 1515 void Layer::DidBeginTracing() { |
| 1518 // We'll be dumping layer trees as part of trace, so make sure | 1516 // We'll be dumping layer trees as part of trace, so make sure |
| 1519 // PushPropertiesTo() propagates layer debug info to the impl | 1517 // PushPropertiesTo() propagates layer debug info to the impl |
| 1520 // side -- otherwise this won't happen for the the layers that | 1518 // side -- otherwise this won't happen for the the layers that |
| 1521 // remain unchanged since tracing started. | 1519 // remain unchanged since tracing started. |
| 1522 SetNeedsPushProperties(); | 1520 SetNeedsPushProperties(); |
| 1523 } | 1521 } |
| 1524 | 1522 |
| 1525 } // namespace cc | 1523 } // namespace cc |
| OLD | NEW |