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

Unified Diff: cc/trees/property_tree.cc

Issue 2014533005: cc : Reland Add IsInIdtoIndexMap to property tres (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/trees/property_tree.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/property_tree.cc
diff --git a/cc/trees/property_tree.cc b/cc/trees/property_tree.cc
index 17ecbbcf4a387dbfb731837408150dd67177eab8..f9b2cfe615679ab5f7933c5fa6a5c762c0e17067 100644
--- a/cc/trees/property_tree.cc
+++ b/cc/trees/property_tree.cc
@@ -2058,6 +2058,32 @@ void PropertyTrees::PushOpacityIfNeeded(PropertyTrees* target_tree) {
}
}
+void PropertyTrees::RemoveIdFromIdToIndexMaps(int id) {
+ transform_id_to_index_map.erase(id);
+ effect_id_to_index_map.erase(id);
+ clip_id_to_index_map.erase(id);
+ scroll_id_to_index_map.erase(id);
+}
+
+bool PropertyTrees::IsInIdToIndexMap(TreeType tree_type, int id) {
+ std::unordered_map<int, int>* id_to_index_map = nullptr;
+ switch (tree_type) {
+ case TRANSFORM:
+ id_to_index_map = &transform_id_to_index_map;
+ break;
+ case EFFECT:
+ id_to_index_map = &effect_id_to_index_map;
+ break;
+ case CLIP:
+ id_to_index_map = &clip_id_to_index_map;
+ break;
+ case SCROLL:
+ id_to_index_map = &scroll_id_to_index_map;
+ break;
+ }
+ return id_to_index_map->find(id) != id_to_index_map->end();
+}
+
void PropertyTrees::UpdateChangeTracking() {
for (int id = 1; id < static_cast<int>(effect_tree.size()); ++id) {
EffectNode* node = effect_tree.Node(id);
« 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