mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 12:37:44 +00:00
LibWeb: Add BorderRadiusCornerClipper
This is a helper class for clipping the corners off a element. This works in a similar way to how (outline) borders are painted. The steps are: 1. A small bitmap that fits only the corners is allocated 2. The corners are painted into the bitmap 3. The existing pixels (where the corners will be painted) are copied using the (inverse) corner bitmap as a mask (done before the element is painted) 4. The element is painted 5. The areas outside the corner radii are restored Like with the borders, this only requires allocation on the first paint.
This commit is contained in:
parent
4dfbbd5965
commit
830632407f
3 changed files with 155 additions and 0 deletions
|
@ -289,6 +289,7 @@ set(SOURCES
|
|||
Page/Page.cpp
|
||||
Painting/BackgroundPainting.cpp
|
||||
Painting/BorderPainting.cpp
|
||||
Painting/BorderRadiusCornerClipper.cpp
|
||||
Painting/ButtonPaintable.cpp
|
||||
Painting/CanvasPaintable.cpp
|
||||
Painting/CheckBoxPaintable.cpp
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue