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

Unified Diff: cc/trees/property_tree.cc

Issue 2856043002: cc : Layers with singular transforms and copy request should be drawn (Closed)
Patch Set: Created 3 years, 8 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
« cc/trees/effect_node.h ('K') | « cc/trees/property_tree.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/property_tree.cc
diff --git a/cc/trees/property_tree.cc b/cc/trees/property_tree.cc
index 58555f3017b82eb528340bcacb9510666308cfaf..2a3ab10f6317411f0144f7f4e3ecf52dbbd3cfba 100644
--- a/cc/trees/property_tree.cc
+++ b/cc/trees/property_tree.cc
@@ -784,6 +784,19 @@ float EffectTree::EffectiveOpacity(const EffectNode* node) const {
return node->subtree_hidden ? 0.f : node->opacity;
}
+void EffectTree::UpdateClosestAncestorWithCopyRequestId(
+ EffectNode* node,
+ EffectNode* parent_node) {
+ if (node->has_copy_request)
+ node->closest_ancestor_with_copy_request_id = node->id;
+ else if (parent_node)
+ node->closest_ancestor_with_copy_request_id =
+ parent_node->closest_ancestor_with_copy_request_id;
+ else
+ DCHECK_EQ(node->closest_ancestor_with_copy_request_id,
+ EffectTree::kInvalidNodeId);
+}
+
void EffectTree::UpdateOpacities(EffectNode* node, EffectNode* parent_node) {
node->screen_space_opacity = EffectiveOpacity(node);
@@ -896,6 +909,7 @@ void EffectTree::UpdateEffects(int id) {
EffectNode* node = Node(id);
EffectNode* parent_node = parent(node);
+ UpdateClosestAncestorWithCopyRequestId(node, parent_node);
UpdateOpacities(node, parent_node);
UpdateIsDrawn(node, parent_node);
UpdateEffectChanged(node, parent_node);
@@ -986,22 +1000,6 @@ void EffectTree::ClearCopyRequests() {
set_needs_update(true);
}
-int EffectTree::ClosestAncestorWithCopyRequest(int id) const {
- DCHECK_GE(id, EffectTree::kRootNodeId);
- const EffectNode* node = Node(id);
- while (node->id > EffectTree::kContentsRootNodeId) {
- if (node->has_copy_request)
- return node->id;
-
- node = parent(node);
- }
-
- if (node->has_copy_request)
- return node->id;
- else
- return EffectTree::kInvalidNodeId;
-}
-
int EffectTree::LowestCommonAncestorWithRenderSurface(int id_1,
int id_2) const {
DCHECK(GetRenderSurface(id_1));
« cc/trees/effect_node.h ('K') | « cc/trees/property_tree.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698