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

Unified Diff: cc/trees/draw_property_utils.cc

Issue 2901393004: cc : Workaround for null layer impls and invalid property tree indices (Closed)
Patch Set: 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/draw_property_utils.cc
diff --git a/cc/trees/draw_property_utils.cc b/cc/trees/draw_property_utils.cc
index 43120259e3db8674761c76254eedd46c3418a0a0..bd0375f2ceabd1058af4290c95d3cc5c4b2606e2 100644
--- a/cc/trees/draw_property_utils.cc
+++ b/cc/trees/draw_property_utils.cc
@@ -458,6 +458,15 @@ static inline bool LayerShouldBeSkippedInternal(
transform_tree.Node(layer->transform_tree_index());
const EffectNode* effect_node = effect_tree.Node(layer->effect_tree_index());
+ DCHECK(effect_node);
+ DCHECK(transform_node);
+ // TODO(crbug.com/726423) : This is a workaround for crbug.com/726225 to
+ // avoid crashing when there is no effect or transform node. Effect node and
+ // transform node should always exist here and this workaround should be
+ // removed.
+ if (!transform_node || !effect_node)
+ return true;
+
if (effect_node->has_render_surface && effect_node->subtree_has_copy_request)
return false;
@@ -843,6 +852,13 @@ void FindLayersThatNeedUpdates(LayerTreeImpl* layer_tree_impl,
const EffectTree& effect_tree = property_trees->effect_tree;
for (auto* layer_impl : *layer_tree_impl) {
+ DCHECK(layer_impl);
+ DCHECK(layer_impl->layer_tree_impl());
+ // TODO(crbug.com/726423) : This is a workaround for crbug.com/725851 to
+ // avoid crashing when layer_impl is nullptr. This workaround should be
+ // removed as layer_impl should not be nullptr here.
+ if (!layer_impl)
+ continue;
if (!IsRootLayer(layer_impl) &&
LayerShouldBeSkippedForDrawPropertiesComputation(
layer_impl, transform_tree, effect_tree))
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698