Add support for compositor rounded clips on mac
Categories
(Core :: Graphics: WebRender, task)
Tracking
()
People
(Reporter: gw, Assigned: gw)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
Assignee | ||
Comment 1•5 days ago
|
||
** 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
andsidebar.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.
Updated•5 days ago
|
Comment 2•4 days ago
|
||
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.
Description
•