Chromium Code Reviews| 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 5e9ac7f4336855f02f5919902d211eb4e5509d2d..3e687018cd9d9e31d79d3d078806796015d65b97 100644 |
| --- a/cc/trees/layer_tree_host_common.cc |
| +++ b/cc/trees/layer_tree_host_common.cc |
| @@ -584,6 +584,33 @@ 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->uses_default_blend_mode()) { |
| + TRACE_EVENT_INSTANT0( |
| + "cc", |
| + "LayerTreeHostCommon::SubtreeShouldRenderToSeparateSurface blending", |
| + TRACE_EVENT_SCOPE_THREAD); |
| + DCHECK(!is_root); |
| + 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) |
| + // https://code.google.com/p/chromium/issues/detail?id=301738 |
| + if (layer->is_root_for_isolated_group()) { |
| + TRACE_EVENT_INSTANT0( |
| + "cc", |
| + "LayerTreeHostCommon::SubtreeShouldRenderToSeparateSurface isolation", |
| + TRACE_EVENT_SCOPE_THREAD); |
| + DCHECK(!is_root); |
| + return true; |
| + } |
| + |
| // If the layer clips its descendants but it is not axis-aligned with respect |
| // to its parent. |
| bool layer_clips_external_content = |
| @@ -1852,6 +1879,14 @@ static void CalculateDrawPropertiesInternal( |
| return; |
| } |
| + // Layers having a non-default blend mode will blend with the content |
| + // inside its parent's render target. This render target should be |
| + // either root_for_isolated_group, or the root of the layer tree. |
|
enne (OOO)
2013/11/01 18:49:02
Can you also mention that if this is not true, the
rosca
2013/11/04 17:14:34
Done.
|
| + DCHECK(layer->uses_default_blend_mode() || !layer->parent() || |
| + !layer->parent()->render_target() || |
| + IsRootLayer(layer->parent()->render_target()) || |
| + layer->parent()->render_target()->is_root_for_isolated_group()); |
| + |
| render_surface->SetContentRect(clipped_content_rect); |
| // The owning layer's screen_space_transform has a scale from content to |