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 847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 if (clip_children_->empty()) | 858 if (clip_children_->empty()) |
859 clip_children_ = nullptr; | 859 clip_children_ = nullptr; |
860 SetNeedsCommit(); | 860 SetNeedsCommit(); |
861 } | 861 } |
862 | 862 |
863 void Layer::SetScrollOffset(const gfx::ScrollOffset& scroll_offset) { | 863 void Layer::SetScrollOffset(const gfx::ScrollOffset& scroll_offset) { |
864 DCHECK(IsPropertyChangeAllowed()); | 864 DCHECK(IsPropertyChangeAllowed()); |
865 | 865 |
866 if (scroll_offset_ == scroll_offset) | 866 if (scroll_offset_ == scroll_offset) |
867 return; | 867 return; |
| 868 |
| 869 TRACE_EVENT2("compositor-worker", "Layer::SetScrollOffset", "x", |
| 870 scroll_offset.x(), "y", scroll_offset.y()); |
| 871 |
868 scroll_offset_ = scroll_offset; | 872 scroll_offset_ = scroll_offset; |
869 | 873 |
870 if (!layer_tree_host_) | 874 if (!layer_tree_host_) |
871 return; | 875 return; |
872 | 876 |
873 if (TransformNode* transform_node = | 877 if (TransformNode* transform_node = |
874 layer_tree_host_->property_trees()->transform_tree.Node( | 878 layer_tree_host_->property_trees()->transform_tree.Node( |
875 transform_tree_index())) { | 879 transform_tree_index())) { |
876 if (transform_node->owner_id == id()) { | 880 if (transform_node->owner_id == id()) { |
877 transform_node->data.scroll_offset = CurrentScrollOffset(); | 881 transform_node->data.scroll_offset = CurrentScrollOffset(); |
(...skipping 1141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2019 this, layer_tree_host_->property_trees()->transform_tree); | 2023 this, layer_tree_host_->property_trees()->transform_tree); |
2020 } | 2024 } |
2021 | 2025 |
2022 gfx::Transform Layer::screen_space_transform() const { | 2026 gfx::Transform Layer::screen_space_transform() const { |
2023 DCHECK_NE(transform_tree_index_, -1); | 2027 DCHECK_NE(transform_tree_index_, -1); |
2024 return ScreenSpaceTransformFromPropertyTrees( | 2028 return ScreenSpaceTransformFromPropertyTrees( |
2025 this, layer_tree_host_->property_trees()->transform_tree); | 2029 this, layer_tree_host_->property_trees()->transform_tree); |
2026 } | 2030 } |
2027 | 2031 |
2028 } // namespace cc | 2032 } // namespace cc |
OLD | NEW |