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

Unified Diff: cc/trees/layer_tree_host_common.cc

Issue 23455060: mix-blend-mode implementation for accelerated layers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moving blend_mode property to SharedQuadState Created 7 years, 3 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
Index: cc/trees/layer_tree_host_common.cc
diff --git a/cc/trees/layer_tree_host_common.cc b/cc/trees/layer_tree_host_common.cc
index 378e7c800bdab9a241ac7838ccd9b718ae727bd4..a5fe7679c761a89c621fb081dabbb6a7cd83f0c0 100644
--- a/cc/trees/layer_tree_host_common.cc
+++ b/cc/trees/layer_tree_host_common.cc
@@ -576,6 +576,30 @@ static bool SubtreeShouldRenderToSeparateSurface(
return true;
}
+ // If the layer has blending.
+ // TODO(rosca): this is temporary, until blending is implemented for other
+ // types of quads than RenderPassQuad. Layers having descendants that draw
+ // content will still create a separate rendering surface.
+ if (layer->has_blend_mode()) {
+ TRACE_EVENT_INSTANT0(
+ "cc",
+ "LayerTreeHostCommon::SubtreeShouldRenderToSeparateSurface blending",
+ TRACE_EVENT_SCOPE_THREAD);
+ return true;
+ }
+
+ // If the layer has isolation.
+ // TODO(rosca): to be optimized - create separate rendering surface only when
+ // the blending descendants might have access to the content behind this layer
+ // (layer has transparent background or descendants overflow)
+ if (layer->is_root_for_isolated_group()) {
+ TRACE_EVENT_INSTANT0(
+ "cc",
+ "LayerTreeHostCommon::SubtreeShouldRenderToSeparateSurface isolation",
+ TRACE_EVENT_SCOPE_THREAD);
+ return true;
+ }
+
// If the layer clips its descendants but it is not axis-aligned with respect
// to its parent.
bool layer_clips_external_content =

Powered by Google App Engine
This is Rietveld 408576698