-
-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
implement svg renderers (resvg and vello_svg)
- Loading branch information
1 parent
408ac7d
commit 0d86229
Showing
19 changed files
with
709 additions
and
139 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,7 +62,6 @@ impl NodeArena { | |
id | ||
} | ||
|
||
|
||
pub fn nodes(&self) -> &HashMap<NodeId, Node> { | ||
&self.nodes | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -496,7 +496,6 @@ impl Document { | |
false | ||
} | ||
|
||
|
||
pub fn nodes(&self) -> &HashMap<NodeId, Node> { | ||
self.arena.nodes() | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,16 @@ | ||
use crate::RenderBackend; | ||
use gosub_html5::node::NodeId; | ||
use gosub_html5::parser::document::DocumentHandle; | ||
use gosub_shared::types::Result; | ||
|
||
use crate::{ImageBuffer, RenderBackend}; | ||
|
||
pub trait SvgRenderer<B: RenderBackend> { | ||
type SvgDocument; | ||
|
||
fn new(wd: &mut B::WindowData<'_>) -> Self; | ||
|
||
pub trait SvgRenderer<B: RenderBackend> { | ||
fn parse_external(data: String) -> Result<Self::SvgDocument>; | ||
fn parse_internal(tree: DocumentHandle, id: NodeId) -> Result<Self::SvgDocument>; | ||
|
||
fn render(&mut self, doc: &Self::SvgDocument) -> Result<ImageBuffer<B>>; | ||
} |
Oops, something went wrong.