While raqote does already passes this test, but small line is still
visible and this PR will fix this. Vello will not work correctly without
this.

Testing: `/html/canvas/element/path-objects/2d.path.arc.twopie.1.html`
---------
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This causes wrong rendering on vello. Current backends already handle
one dim zero correctly by themself (this was probably needed for azure),
but if we ever needed this, it should be implemented inside faulty
backend.
Testing: Existing WPT tests
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
We pass all other options as ref too.
Testing: Just refactor, but the code is covered by WPT tests.
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
All other draw functions already have them non-optional and we always
passed `Some` anyway.
Testing: Existing WPT tests
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
There is no reason to require this impls, because we already have
written them in generic way.
Testing: Just refactoring, but there are WPT tests
---------
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
`surface()` returns `SourceSurface` which is/was meant as optimization
when passing from canvas to canvas (in vello that would be wgpu texture;
but raquote does not really have this) while bytes returns something
that must impl AsRef<[u8]> (this is more generic then `&[u8]` as it
allows us to have type with drop impl - wgpu's BufferView).
Testing: This is just refactoring (protected by rust), but there are WPT
tests.
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Small fixes of abstraction.
We do not need to generalize `CompositionOrBlending`, because it's from
canvas_traits.
Ellipse impl that uses arc is not backend specific, so it serves as good
trait default.
Reviewable per commit.
Testing: Only refactoring, but there are WPT tests
---------
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Current abstraction was leaky and very hard to understand/impl because
it was so intervened with actual implementation.
Now we generalize both `CanvasState` and `CanvasData` over `B: Beckend`,
meaning that every type/method must be part of trait interface (that
lives in `beckend.rs`). Using associated trait types instead of `Box<dyn
>` allows us too remove the need for wrapper types (and `to_raquote()`
methods) as we can implement helper traits on (foreign) raquote types.
The only time we actually do dispatch (by enum) is at `Canvas` methods.
Implementation now only need to implement all backend traits and
helpers. I tried to restrain myself from actually cleaning abstraction
(where possible), to keep this change as much mechanical as possible,
but we should absolutely do that as a follow up.
Testing: Rust as we only do refactor, but there are also WPT tests
try run: https://github.com/sagudev/servo/actions/runs/14760658522
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>