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

Unified Diff: cc/layers/layer.cc

Issue 953093002: cc: Derive draw opacity from property trees (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make opacity tree-building optional Created 5 years, 10 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/layer.h ('k') | cc/trees/draw_property_utils.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer.cc
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index ca0e3b8e99f607d3a3e284abcbc5e454b8ec7c21..fbee936256810d0001476f3775b846c044b3333c 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -1318,6 +1318,24 @@ gfx::Transform Layer::draw_transform_from_property_trees(
return xform;
}
+float Layer::DrawOpacityFromPropertyTrees(const OpacityTree& tree) const {
+ if (!render_target())
+ return 0.f;
+
+ const OpacityNode* target_node =
+ tree.Node(render_target()->opacity_tree_index());
+ const OpacityNode* node = tree.Node(opacity_tree_index());
+ if (node == target_node)
+ return 1.f;
+
+ float draw_opacity = 1.f;
+ while (node != target_node) {
+ draw_opacity *= node->data;
+ node = tree.parent(node);
+ }
+ return draw_opacity;
+}
+
void Layer::SetFrameTimingRequests(
const std::vector<FrameTimingRequest>& requests) {
frame_timing_requests_ = requests;
« no previous file with comments | « cc/layers/layer.h ('k') | cc/trees/draw_property_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698