mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibGfx+LibWeb: Add new Path class with Skia backend, use for 2D canvas
This thing is essentially a wrapper around an SkPath, although we do some indirection via a PathImpl class to keep the door open for alternative rasterizer/path backends in the future. We also update the 2D canvas code, since that was the only code that used Painter+DeprecatedPath, and this allows us to just drop that code instead of temporarily supporting it until the next commit.
This commit is contained in:
parent
c8f09312f7
commit
a3cc03f180
Notes:
github-actions[bot]
2024-08-20 07:38:18 +00:00
Author: https://github.com/awesomekling
Commit: a3cc03f180
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1024
15 changed files with 417 additions and 93 deletions
|
@ -11,10 +11,9 @@
|
|||
#include <AK/Variant.h>
|
||||
#include <LibGfx/AffineTransform.h>
|
||||
#include <LibGfx/Color.h>
|
||||
#include <LibGfx/DeprecatedPath.h>
|
||||
#include <LibGfx/Forward.h>
|
||||
#include <LibGfx/Painter.h>
|
||||
#include <LibGfx/PathClipper.h>
|
||||
#include <LibGfx/Path.h>
|
||||
#include <LibWeb/Bindings/PlatformObject.h>
|
||||
#include <LibWeb/HTML/Canvas/CanvasCompositing.h>
|
||||
#include <LibWeb/HTML/Canvas/CanvasDrawImage.h>
|
||||
|
@ -124,13 +123,12 @@ private:
|
|||
|
||||
PreparedText prepare_text(ByteString const& text, float max_width = INFINITY);
|
||||
|
||||
Gfx::DeprecatedPath rect_path(float x, float y, float width, float height);
|
||||
[[nodiscard]] Gfx::Path rect_path(float x, float y, float width, float height);
|
||||
[[nodiscard]] Gfx::Path text_path(StringView text, float x, float y, Optional<double> max_width);
|
||||
|
||||
Gfx::DeprecatedPath text_path(StringView text, float x, float y, Optional<double> max_width);
|
||||
|
||||
void stroke_internal(Gfx::DeprecatedPath const&);
|
||||
void fill_internal(Gfx::DeprecatedPath const&, Gfx::WindingRule);
|
||||
void clip_internal(Gfx::DeprecatedPath&, Gfx::WindingRule);
|
||||
void stroke_internal(Gfx::Path const&);
|
||||
void fill_internal(Gfx::Path const&, Gfx::WindingRule);
|
||||
void clip_internal(Gfx::Path&, Gfx::WindingRule);
|
||||
|
||||
JS::NonnullGCPtr<HTMLCanvasElement> m_element;
|
||||
OwnPtr<Gfx::Painter> m_painter;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue