Chromium Code Reviews| Index: cc/trees/property_tree.cc |
| diff --git a/cc/trees/property_tree.cc b/cc/trees/property_tree.cc |
| index 1bf2af33f0b238e34fd5bca6609f536d13aed9e7..e01fc6d986ea4a0776f4fa8551b8d3bdd94df2d0 100644 |
| --- a/cc/trees/property_tree.cc |
| +++ b/cc/trees/property_tree.cc |
| @@ -1625,6 +1625,22 @@ void EffectTree::ClearCopyRequests() { |
| set_needs_update(true); |
| } |
| +int EffectTree::ClosestAncestorWithCopyRequest(int id) const { |
| + DCHECK_GE(id, 0); |
| + const EffectNode* node = Node(id); |
| + while (node->id > 1) { |
| + if (node->data.has_copy_request) |
| + return node->id; |
| + |
| + node = parent(node); |
| + } |
| + |
| + if (node->data.has_copy_request) |
| + return 0; |
|
ajuma
2016/06/14 15:09:53
Could node->id be 1 here, and if so, should this r
weiliangc
2016/06/15 12:27:57
Done.
|
| + else |
| + return -1; |
| +} |
| + |
| void EffectTree::AddMaskOrReplicaLayerId(int id) { |
| mask_replica_layer_ids_.push_back(id); |
| } |