mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 19:59:17 +00:00
LibWeb+LibGfx: Replace usage of Gfx::PaintStyle in fill{stoke}_commands
...with a struct defined in LibWeb. This is a step towards uncoupling LibWeb from LibGfx, so we can try third-party libraries for painting.
This commit is contained in:
parent
6e419db26c
commit
7a04a95c8a
Notes:
sideshowbarker
2024-07-16 18:06:41 +09:00
Author: https://github.com/kalenikaliaksandr
Commit: 7a04a95c8a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/143
Reviewed-by: https://github.com/alimpfard ✅
Reviewed-by: https://github.com/awesomekling
16 changed files with 242 additions and 42 deletions
|
@ -7,6 +7,7 @@
|
|||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/Bindings/SVGGradientElementPrototype.h>
|
||||
#include <LibWeb/DOM/Document.h>
|
||||
#include <LibWeb/Painting/PaintStyle.h>
|
||||
#include <LibWeb/SVG/AttributeNames.h>
|
||||
#include <LibWeb/SVG/SVGGradientElement.h>
|
||||
#include <LibWeb/SVG/SVGGraphicsElement.h>
|
||||
|
@ -93,7 +94,7 @@ Gfx::AffineTransform SVGGradientElement::gradient_paint_transform(SVGPaintContex
|
|||
return Gfx::AffineTransform { paint_context.transform }.multiply(transform);
|
||||
}
|
||||
|
||||
void SVGGradientElement::add_color_stops(Gfx::SVGGradientPaintStyle& paint_style) const
|
||||
void SVGGradientElement::add_color_stops(Painting::SVGGradientPaintStyle& paint_style) const
|
||||
{
|
||||
for_each_color_stop([&](auto& stop) {
|
||||
// https://svgwg.org/svg2-draft/pservers.html#StopNotes
|
||||
|
@ -104,7 +105,7 @@ void SVGGradientElement::add_color_stops(Gfx::SVGGradientPaintStyle& paint_style
|
|||
// stop's offset value. If a given gradient stop's offset value is not equal to or greater than all
|
||||
// previous offset values, then the offset value is adjusted to be equal to the largest of all previous
|
||||
// offset values.
|
||||
paint_style.add_color_stop(stop_offset, stop.stop_color().with_opacity(stop.stop_opacity())).release_value_but_fixme_should_propagate_errors();
|
||||
paint_style.add_color_stop(stop_offset, stop.stop_color().with_opacity(stop.stop_opacity()));
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue