| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 882 if (clip_children_->empty()) | 882 if (clip_children_->empty()) |
| 883 clip_children_ = nullptr; | 883 clip_children_ = nullptr; |
| 884 SetNeedsCommit(); | 884 SetNeedsCommit(); |
| 885 } | 885 } |
| 886 | 886 |
| 887 void Layer::SetScrollOffset(const gfx::ScrollOffset& scroll_offset) { | 887 void Layer::SetScrollOffset(const gfx::ScrollOffset& scroll_offset) { |
| 888 DCHECK(IsPropertyChangeAllowed()); | 888 DCHECK(IsPropertyChangeAllowed()); |
| 889 | 889 |
| 890 if (scroll_offset_ == scroll_offset) | 890 if (scroll_offset_ == scroll_offset) |
| 891 return; | 891 return; |
| 892 |
| 893 TRACE_EVENT2("compositor-worker", "Layer::SetScrollOffset", "x", |
| 894 scroll_offset.x(), "y", scroll_offset.y()); |
| 895 |
| 892 scroll_offset_ = scroll_offset; | 896 scroll_offset_ = scroll_offset; |
| 893 | 897 |
| 894 if (!layer_tree_host_) | 898 if (!layer_tree_host_) |
| 895 return; | 899 return; |
| 896 | 900 |
| 897 if (TransformNode* transform_node = | 901 if (TransformNode* transform_node = |
| 898 layer_tree_host_->property_trees()->transform_tree.Node( | 902 layer_tree_host_->property_trees()->transform_tree.Node( |
| 899 transform_tree_index())) { | 903 transform_tree_index())) { |
| 900 if (transform_node->owner_id == id()) { | 904 if (transform_node->owner_id == id()) { |
| 901 transform_node->data.scroll_offset = CurrentScrollOffset(); | 905 transform_node->data.scroll_offset = CurrentScrollOffset(); |
| (...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2041 this, layer_tree_host_->property_trees()->transform_tree); | 2045 this, layer_tree_host_->property_trees()->transform_tree); |
| 2042 } | 2046 } |
| 2043 | 2047 |
| 2044 gfx::Transform Layer::screen_space_transform() const { | 2048 gfx::Transform Layer::screen_space_transform() const { |
| 2045 DCHECK_NE(transform_tree_index_, -1); | 2049 DCHECK_NE(transform_tree_index_, -1); |
| 2046 return ScreenSpaceTransformFromPropertyTrees( | 2050 return ScreenSpaceTransformFromPropertyTrees( |
| 2047 this, layer_tree_host_->property_trees()->transform_tree); | 2051 this, layer_tree_host_->property_trees()->transform_tree); |
| 2048 } | 2052 } |
| 2049 | 2053 |
| 2050 } // namespace cc | 2054 } // namespace cc |
| OLD | NEW |