Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(228)

Side by Side Diff: cc/trees/property_tree.cc

Issue 2832743002: Add ScrollTree::FindNodeFromElementId (Closed)
Patch Set: Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/trees/property_tree.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after
1218 1218
1219 #if DCHECK_IS_ON() 1219 #if DCHECK_IS_ON()
1220 void ScrollTree::CopyCompleteTreeState(const ScrollTree& other) { 1220 void ScrollTree::CopyCompleteTreeState(const ScrollTree& other) {
1221 currently_scrolling_node_id_ = other.currently_scrolling_node_id_; 1221 currently_scrolling_node_id_ = other.currently_scrolling_node_id_;
1222 layer_id_to_scroll_offset_map_ = other.layer_id_to_scroll_offset_map_; 1222 layer_id_to_scroll_offset_map_ = other.layer_id_to_scroll_offset_map_;
1223 layer_id_to_synced_scroll_offset_map_ = 1223 layer_id_to_synced_scroll_offset_map_ =
1224 other.layer_id_to_synced_scroll_offset_map_; 1224 other.layer_id_to_synced_scroll_offset_map_;
1225 } 1225 }
1226 #endif 1226 #endif
1227 1227
1228 ScrollNode* ScrollTree::FindNodeFromElementId(ElementId id) {
1229 auto iterator = property_trees()->element_id_to_scroll_node_index.find(id);
1230 if (iterator == property_trees()->element_id_to_scroll_node_index.end())
1231 return nullptr;
1232
1233 return Node(iterator->second);
1234 }
1235
1228 void ScrollTree::clear() { 1236 void ScrollTree::clear() {
1229 PropertyTree<ScrollNode>::clear(); 1237 PropertyTree<ScrollNode>::clear();
1230 1238
1231 if (property_trees()->is_main_thread) { 1239 if (property_trees()->is_main_thread) {
1232 currently_scrolling_node_id_ = kInvalidNodeId; 1240 currently_scrolling_node_id_ = kInvalidNodeId;
1233 layer_id_to_scroll_offset_map_.clear(); 1241 layer_id_to_scroll_offset_map_.clear();
1234 } 1242 }
1235 1243
1236 #if DCHECK_IS_ON() 1244 #if DCHECK_IS_ON()
1237 ScrollTree tree; 1245 ScrollTree tree;
(...skipping 908 matching lines...) Expand 10 before | Expand all | Expand 10 after
2146 const EffectNode* effect_node = effect_tree.Node(effect_id); 2154 const EffectNode* effect_node = effect_tree.Node(effect_id);
2147 2155
2148 if (effect_node->surface_contents_scale.x() != 0.0 && 2156 if (effect_node->surface_contents_scale.x() != 0.0 &&
2149 effect_node->surface_contents_scale.y() != 0.0) 2157 effect_node->surface_contents_scale.y() != 0.0)
2150 screen_space_transform.Scale(1.0 / effect_node->surface_contents_scale.x(), 2158 screen_space_transform.Scale(1.0 / effect_node->surface_contents_scale.x(),
2151 1.0 / effect_node->surface_contents_scale.y()); 2159 1.0 / effect_node->surface_contents_scale.y());
2152 return screen_space_transform; 2160 return screen_space_transform;
2153 } 2161 }
2154 2162
2155 } // namespace cc 2163 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/property_tree.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698