[SPv2] Implement rounded clip as synthetic effect nodes

Desktop / Chromium - Tien-Ren Chen [chromium.org] - 10 August 2017 01:14 EDT

This CL implements composited rounded clip for SPv2. Currently the compositor only supports applying clips that are rects orthogonal to target render surface. Therefore we implement rounded clips as mask layers. As mask layers need to be applied as effect nodes, these rounded-clip-induced effects are called "synthetic effect node" as oppose to real effect nodes that represents a grouping effect.

This CL changes PropertyTreeManager so that the converted cc effect tree have synthetic effect nodes inserted in the tree while maintaining proper nesting for layers.

For example with the following clip and effect tree and pending layers: E0 <-- E1 C0 <-- C1(rounded) P0(E1,C0), P1(E1,C1), P2(E0, C1) In effect stack diagram: P0(C0) P1(C1) [ E1 ] P2(C1) [ E0 ]

The following cc property trees and layers will be generated: E0 <+- E1 <-- E_C1_1 <-- E_C1_1M +- E_C1_2 <-- E_C1_2M C0 <-- C1 L0(E1,C0), L1(E_C1_1, C1), L_C1_1(E_C1_1M, C1), L2(E0, C1), L_C1_2(E_C1_2M, C1) In effect stack diagram: L_C1_1 L1(C1) [ E_C1_1M ] L_C2_2 L0(C0) [ E_C1_1 ] L2(C1) [ E_C1_2M ] [ E1 ][ E_C1_2 ] [ E0 ]

Two mask layers L1_C1_1 and L2_C1_2 are generated for clip C1 because it can't apply to P1 and P2 as a group due to nesting. Two synthetic effects E_C1_1 and E_C1_2 are generated to isolate the masked contents, and another two synthetic effects E_C1_1M and E_C1_2M are generated to apply the mask layer.

BUG=699834

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Change-Id: I0b8ddf2cc9f81966b570bb085d8cb57a06a0b125 Reviewed-on: https://chromium-review.googlesource.com/597126 Commit-Queue: Tien-Ren Chen

74cabe3 [SPv2] Implement rounded clip as synthetic effect nodes
.../FlagExpectations/enable-slimming-paint-v2 | 39 +-
.../platform/graphics/CompositorElementId.cpp | 6 +
.../Source/platform/graphics/CompositorElementId.h | 5 +
.../compositing/PaintArtifactCompositor.cpp | 110 ++++-
.../graphics/compositing/PaintArtifactCompositor.h | 17 +-
.../compositing/PaintArtifactCompositorTest.cpp | 543 +++++++++++++++++++++
.../graphics/compositing/PropertyTreeManager.cpp | 298 +++++++++--
.../graphics/compositing/PropertyTreeManager.h | 87 +++-
.../platform/graphics/paint/PaintPropertyNode.h | 8 +
9 files changed, 1016 insertions(+), 97 deletions(-)

Upstream: git.chromium.org


  • Share