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

Unified Diff: cc/trees/draw_property_utils.cc

Issue 1613583002: cc:: Remove RenderSurfaceImpl::TargetEffectTreeIndex (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | « cc/layers/render_surface_impl.cc ('k') | cc/trees/layer_tree_host_common_unittest.cc » ('j') | 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 07270db1dbd5ab4cdb9e62d17464c0f9a9ee8341..fa522368a32906f731ec11a2e986cfad063a7587 100644
--- a/cc/trees/draw_property_utils.cc
+++ b/cc/trees/draw_property_utils.cc
@@ -915,15 +915,13 @@ static float LayerDrawOpacity(const LayerImpl* layer, const EffectTree& tree) {
static float SurfaceDrawOpacity(RenderSurfaceImpl* render_surface,
const EffectTree& tree) {
+ // Draw opacity of a surface is the product of opacities between the surface
+ // (included) and its target surface (excluded).
const EffectNode* node = tree.Node(render_surface->EffectTreeIndex());
- float target_opacity_tree_index = render_surface->TargetEffectTreeIndex();
- if (target_opacity_tree_index < 0)
- return node->data.screen_space_opacity;
- const EffectNode* target_node = tree.Node(target_opacity_tree_index);
- float draw_opacity = 1.f;
- while (node != target_node) {
+ float draw_opacity = node->data.opacity;
+ for (node = tree.parent(node); node && !node->data.has_render_surface;
+ node = tree.parent(node)) {
draw_opacity *= node->data.opacity;
- node = tree.parent(node);
}
return draw_opacity;
}
« no previous file with comments | « cc/layers/render_surface_impl.cc ('k') | cc/trees/layer_tree_host_common_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698