Commit graph

6 commits

Author SHA1 Message Date
MacDue
064ca625df LibGfx: Add BitmapPaintStyle
This is a simple paint style for filling a path with a bitmap.
2023-04-09 18:42:45 +02:00
MacDue
7bd78d40e9 LibGfx+LibWeb: Propagate OOM when appending CanvasGradient color stops 2023-03-02 11:49:13 +01:00
MacDue
3a0a7e3e96 LibGfx+LibWeb: Propagate OOM when creating PaintStyles 2023-03-02 11:49:13 +01:00
MacDue
63b11030f0 Everywhere: Use ReadonlySpan<T> instead of Span<T const> 2023-02-08 19:15:45 +00:00
MacDue
1a89d77688 LibGfx: Implement paint styles required for HTML canvas gradients
This implements the gradients for:

- CanvasRenderingContext2D.createLinearGradient()
- CanvasRenderingContext2D.createConicGradient()
- CanvasRenderingContext2D.createRadialGradient()

As loosely defined in: https://html.spec.whatwg.org/multipage/canvas.html#fill-and-stroke-styles
(It's really not very well defined for radial gradients)

Actual implementation (for radial gradients) was done with a lot
of trial and error, then visually comparing to other browsers.
2023-01-22 18:15:52 +01:00
MacDue
b31d768e95 LibGfx: Add paint styles and allow gradients to be used as them
Also while here add option to disable pre-multiplied alpha for gradients
(this will be handy later).
2023-01-22 18:15:52 +01:00