Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unify most clip-path code paths of pre-CAP and CAP #24440

Merged
merged 1 commit into from
Jul 6, 2020

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Jul 3, 2020

Previously in pre-CAP, because we always created a composited mask
layer for any mask and/or clip-path (either path-based or mask-based)
if the object needed to be composited, we needed to handle clip-path
differently in pre-CAP and CAP,

Now always apply path-based clip-path after paint. No longer create
a mask layer for path-based clip-path in pre-CAP.

Rename ClipPath to ClipPathMask to make it clear that this effect node
is for the mask created for a mask-based clip-path.

If there are both mask and mask-based clip-path, always let ClipPathMask
effect node be the child of the Mask effect node. This is required by
pre-CAP (unchanged) to apply the clip-path in the mask layer, but also
works in CAP (previously both Mask ClipPathMask were directly under
Effect) because:
DstIn(DstIn(A, Mask), ClipPathMask)
== DstIn(A, DstIn(Mask, ClipPathMask)
where ClipPathMask is black-and-white.

If there is only a mask-based clip-path, we'll only create ClipPathMask
for both pre-CAP (now no Mask and MaskClip nodes) and CAP (unchanged).
The pre-CAP mask layer will use ClipPathMask as the effect state, which
avoids the need of filling a black mask before applying the clip path
mask.

Now the only difference between pre-CAP and CAP about clip-path is that
that when a LayerObject with mask-based clip-path is composited, pre-CAP
creates a GraphicsLayer for the clip-path mask before paint, while CAP
creates a cc::Layer for the mask after paint.

Bug: 1100224
Change-Id: I243e463b3c94e09b64ed3c171ece12145c9deec9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2274177
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#785435}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Chromium project.

@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-2274177 branch 3 times, most recently from cc3cbbc to eb2f5a1 Compare July 4, 2020 19:26
Previously in pre-CAP, because we always created a composited mask
layer for any mask and/or clip-path (either path-based or mask-based)
if the object needed to be composited, we needed to handle clip-path
differently in pre-CAP and CAP,

Now always apply path-based clip-path after paint. No longer create
a mask layer for path-based clip-path in pre-CAP.

Rename ClipPath to ClipPathMask to make it clear that this effect node
is for the mask created for a mask-based clip-path.

If there are both mask and mask-based clip-path, always let ClipPathMask
effect node be the child of the Mask effect node. This is required by
pre-CAP (unchanged) to apply the clip-path in the mask layer, but also
works in CAP (previously both Mask ClipPathMask were directly under
Effect) because:
     DstIn(DstIn(A, Mask), ClipPathMask)
  == DstIn(A, DstIn(Mask, ClipPathMask)
where ClipPathMask is black-and-white.

If there is only a mask-based clip-path, we'll only create ClipPathMask
for both pre-CAP (now no Mask and MaskClip nodes) and CAP (unchanged).
The pre-CAP mask layer will use ClipPathMask as the effect state, which
avoids the need of filling a black mask before applying the clip path
mask.

Now the only difference between pre-CAP and CAP about clip-path is that
that when a LayerObject with mask-based clip-path is composited, pre-CAP
creates a GraphicsLayer for the clip-path mask before paint, while CAP
creates a cc::Layer for the mask after paint.

Bug: 1100224
Change-Id: I243e463b3c94e09b64ed3c171ece12145c9deec9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2274177
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#785435}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants