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: 1476065852
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>