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

Unified Diff: cc/trees/property_tree.h

Issue 2866733002: Remove owning_id from EffectNode and replace it by an opaque stable_id (Closed)
Patch Set: none Created 3 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/occlusion_tracker_unittest.cc ('k') | cc/trees/property_tree.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/property_tree.h
diff --git a/cc/trees/property_tree.h b/cc/trees/property_tree.h
index 601cbaf2f74d77f52e744ff0a075d93fd59b904c..915efb8ea5a462ac5a1f4d5d700b14d9a57eafa2 100644
--- a/cc/trees/property_tree.h
+++ b/cc/trees/property_tree.h
@@ -104,6 +104,9 @@ class CC_EXPORT PropertyTree {
return Node(FindNodeIndexFromOwningLayerId(id));
}
T* UpdateNodeFromOwningLayerId(int id) {
+#if DCHECK_IS_ON()
+ DCHECK(LookupByOnwningLayerIdAllowed());
+#endif
int index = FindNodeIndexFromOwningLayerId(id);
if (index == kInvalidNodeId) {
DCHECK(property_trees()->is_main_thread);
@@ -114,6 +117,9 @@ class CC_EXPORT PropertyTree {
}
int FindNodeIndexFromOwningLayerId(int id) const {
+#if DCHECK_IS_ON()
+ DCHECK(LookupByOnwningLayerIdAllowed());
+#endif
auto iter = owning_layer_id_to_node_index_.find(id);
if (iter == owning_layer_id_to_node_index_.end())
return kInvalidNodeId;
@@ -122,6 +128,9 @@ class CC_EXPORT PropertyTree {
}
void SetOwningLayerIdForNode(const T* node, int id) {
+#if DCHECK_IS_ON()
+ DCHECK(LookupByOnwningLayerIdAllowed());
+#endif
if (!node) {
owning_layer_id_to_node_index_[id] = kInvalidNodeId;
return;
@@ -131,6 +140,11 @@ class CC_EXPORT PropertyTree {
owning_layer_id_to_node_index_[id] = node->id;
}
+ protected:
+#if DCHECK_IS_ON()
+ virtual bool LookupByOnwningLayerIdAllowed() const { return true; }
+#endif
+
private:
std::vector<T> nodes_;
@@ -409,6 +423,11 @@ class CC_EXPORT EffectTree final : public PropertyTree<EffectNode> {
std::vector<std::unique_ptr<RenderSurfaceImpl>>* old_render_surfaces,
LayerTreeImpl* layer_tree_impl);
+ protected:
+#if DCHECK_IS_ON()
+ bool LookupByOnwningLayerIdAllowed() const override;
+#endif
+
private:
void UpdateOpacities(EffectNode* node, EffectNode* parent_node);
void UpdateIsDrawn(EffectNode* node, EffectNode* parent_node);
@@ -647,7 +666,7 @@ class CC_EXPORT PropertyTrees final {
base::flat_map<ElementId, int> element_id_to_scroll_node_index;
base::flat_map<ElementId, int> element_id_to_transform_node_index;
- std::vector<int> always_use_active_tree_opacity_effect_ids;
+ std::vector<ElementId> always_use_active_tree_opacity_effect_ids;
TransformTree transform_tree;
EffectTree effect_tree;
ClipTree clip_tree;
« no previous file with comments | « cc/trees/occlusion_tracker_unittest.cc ('k') | cc/trees/property_tree.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698