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

Side by Side Diff: cc/trees/property_tree.cc

Issue 2067783002: cc: Calculate visible rect inside non root copy request (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@rectF
Patch Set: edit comment to be more explicit Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « cc/trees/property_tree.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <stddef.h> 5 #include <stddef.h>
6 6
7 #include <set> 7 #include <set>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 1607 matching lines...) Expand 10 before | Expand all | Expand 10 after
1618 node.data.num_copy_requests_in_subtree = 0; 1618 node.data.num_copy_requests_in_subtree = 0;
1619 node.data.has_copy_request = false; 1619 node.data.has_copy_request = false;
1620 } 1620 }
1621 1621
1622 // Any copy requests that are still left will be aborted (sending an empty 1622 // Any copy requests that are still left will be aborted (sending an empty
1623 // result) on destruction. 1623 // result) on destruction.
1624 copy_requests_.clear(); 1624 copy_requests_.clear();
1625 set_needs_update(true); 1625 set_needs_update(true);
1626 } 1626 }
1627 1627
1628 int EffectTree::ClosestAncestorWithCopyRequest(int id) const {
1629 DCHECK_GE(id, 0);
1630 const EffectNode* node = Node(id);
1631 while (node->id > 1) {
1632 if (node->data.has_copy_request)
1633 return node->id;
1634
1635 node = parent(node);
1636 }
1637
1638 if (node->data.has_copy_request)
1639 return node->id;
1640 else
1641 return -1;
1642 }
1643
1628 void EffectTree::AddMaskOrReplicaLayerId(int id) { 1644 void EffectTree::AddMaskOrReplicaLayerId(int id) {
1629 mask_replica_layer_ids_.push_back(id); 1645 mask_replica_layer_ids_.push_back(id);
1630 } 1646 }
1631 1647
1632 bool EffectTree::ContributesToDrawnSurface(int id) { 1648 bool EffectTree::ContributesToDrawnSurface(int id) {
1633 // All drawn nodes contribute to drawn surface. 1649 // All drawn nodes contribute to drawn surface.
1634 // Exception : Nodes that are hidden and are drawn only for the sake of 1650 // Exception : Nodes that are hidden and are drawn only for the sake of
1635 // copy requests. 1651 // copy requests.
1636 EffectNode* node = Node(id); 1652 EffectNode* node = Node(id);
1637 EffectNode* parent_node = parent(node); 1653 EffectNode* parent_node = parent(node);
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after
2375 value->EndDictionary(); 2391 value->EndDictionary();
2376 2392
2377 value->BeginDictionary("scroll_tree"); 2393 value->BeginDictionary("scroll_tree");
2378 scroll_tree.AsValueInto(value.get()); 2394 scroll_tree.AsValueInto(value.get());
2379 value->EndDictionary(); 2395 value->EndDictionary();
2380 2396
2381 return value; 2397 return value;
2382 } 2398 }
2383 2399
2384 } // namespace cc 2400 } // namespace cc
OLDNEW
« 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