Open Bug 1960515 Opened 5 days ago Updated 2 days ago

Add support for compositor rounded clips on mac

Categories

(Core :: Graphics: WebRender, task)

task

Tracking

()

ASSIGNED

People

(Reporter: gw, Assigned: gw)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

No description provided.

** WIP ** - Bbasic plumbing for compositor rounded clips on mac

To test:

  • Apply the other patch in this stack from phabricator
    (that adds support to DirectComposition).
  • Apply this patch
  • Enable sidebar.revamp and sidebar.revamp.round-content-area

Note:

  • This patch only sets the rounded clip on the existing wrapping
    CA layer. We need to extend it to have an extra wrapping layer.
Assignee: nobody → gwatson
Status: NEW → ASSIGNED

Some notes:

CSS allows for elliptical corner radii, and for different corner radii per corner.
CALayer supports a single uniform circular corner radius with CALayer.cornerRadius.
It also allows "turning off" the corner radius for an arbitrary subset of corners using a bit mask stored in CALayer.maskedCorners. (maskedCorners is available on macOS 10.13+, and Firefox only supports 10.15+, so we can use it unconditionally.)
But CALayer does not natively support elliptical corners, or mixed non-zero radii. For these cases, Webkit sets the clipping layer's mask property to a CAShapeLayer, and sets a path on that shape layer:
https://searchfox.org/wubkat/rev/cad44ec1d1a0b821876b31b36b0c7aaff2c567e4/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp#3151-3196

For the sidebar, we need to support a single circular corner, with the other corners being square (zero radius). This case does not need a shape layer, so maybe we don't need to have shape layer support in the first implementation.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: