Chromium Code Reviews| Index: cc/layers/layer.cc |
| diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc |
| index 4a52bf3a8669ca402f82b2951f055c9537baa63f..4f7c8efbfeb9fcc6b5ac6d492e4872e682a6c9a0 100644 |
| --- a/cc/layers/layer.cc |
| +++ b/cc/layers/layer.cc |
| @@ -467,8 +467,22 @@ void Layer::SetOpacity(float opacity) { |
| DCHECK(IsPropertyChangeAllowed()); |
| if (opacity_ == opacity) |
| return; |
| + bool force_rebuild = opacity == 1.f || opacity_ == 1.f; |
|
ajuma
2016/05/16 22:05:20
Please add a comment explaining why we need to unc
jaydasika
2016/05/17 01:40:00
Done.
|
| opacity_ = opacity; |
| SetSubtreePropertyChanged(); |
|
ajuma
2016/05/16 22:05:20
I think this is only needed if we rebuild (Layer::
jaydasika
2016/05/17 01:40:00
I think we will need to mark both on the layer and
|
| + if (layer_tree_host_ && !force_rebuild) { |
| + PropertyTrees* property_trees = layer_tree_host_->property_trees(); |
| + auto effect_id_to_index = property_trees->effect_id_to_index_map.find(id()); |
| + if (effect_id_to_index != property_trees->effect_id_to_index_map.end()) { |
| + EffectNode* node = |
| + property_trees->effect_tree.Node(effect_id_to_index->second); |
| + node->data.opacity = opacity; |
| + node->data.effect_changed = true; |
| + property_trees->effect_tree.set_needs_update(true); |
| + SetNeedsCommitNoRebuild(); |
| + return; |
| + } |
| + } |
| SetNeedsCommit(); |
| } |