Skip to content

Commit

Permalink
Add support for context-fill and context-stroke.
Browse files Browse the repository at this point in the history
Closes #708
  • Loading branch information
LaurenzV committed Mar 5, 2024
1 parent 4d27b8c commit 25fd250
Show file tree
Hide file tree
Showing 42 changed files with 763 additions and 94 deletions.
1 change: 0 additions & 1 deletion crates/resvg/src/path.rs
Expand Up @@ -72,7 +72,6 @@ pub fn fill_path(
paint.blend_mode = blend_mode;

pixmap.fill_path(path.data(), &paint, rule, transform, None);

Some(())
}

Expand Down
16 changes: 16 additions & 0 deletions crates/resvg/tests/integration/render.rs
Expand Up @@ -642,7 +642,23 @@ use crate::render;
#[test] fn paint_servers_stop_opacity_50percent() { assert_eq!(render("tests/paint-servers/stop-opacity/50percent"), 0); }
#[test] fn paint_servers_stop_opacity_simple_case() { assert_eq!(render("tests/paint-servers/stop-opacity/simple-case"), 0); }
#[test] fn painting_color_inherit() { assert_eq!(render("tests/painting/color/inherit"), 0); }
#[test] fn painting_color_recursive_nested_context_without_color() { assert_eq!(render("tests/painting/color/recursive-nested-context-without-color"), 0); }
#[test] fn painting_color_recursive_nested_context() { assert_eq!(render("tests/painting/color/recursive-nested-context"), 0); }
#[test] fn painting_color_simple_case() { assert_eq!(render("tests/painting/color/simple-case"), 0); }
#[test] fn painting_context_in_marker() { assert_eq!(render("tests/painting/context/in-marker"), 0); }
#[test] fn painting_context_in_nested_marker() { assert_eq!(render("tests/painting/context/in-nested-marker"), 0); }
#[test] fn painting_context_in_nested_use_and_marker() { assert_eq!(render("tests/painting/context/in-nested-use-and-marker"), 0); }
#[test] fn painting_context_in_nested_use() { assert_eq!(render("tests/painting/context/in-nested-use"), 0); }
#[test] fn painting_context_in_use() { assert_eq!(render("tests/painting/context/in-use"), 0); }
#[test] fn painting_context_with_gradient_and_gradient_transform() { assert_eq!(render("tests/painting/context/with-gradient-and-gradient-transform"), 0); }
#[test] fn painting_context_with_gradient_in_use() { assert_eq!(render("tests/painting/context/with-gradient-in-use"), 0); }
#[test] fn painting_context_with_gradient_on_marker() { assert_eq!(render("tests/painting/context/with-gradient-on-marker"), 0); }
#[test] fn painting_context_with_pattern_and_transform_in_use() { assert_eq!(render("tests/painting/context/with-pattern-and-transform-in-use"), 0); }
#[test] fn painting_context_with_pattern_in_use() { assert_eq!(render("tests/painting/context/with-pattern-in-use"), 0); }
#[test] fn painting_context_with_pattern_objectBoundingBox_in_use() { assert_eq!(render("tests/painting/context/with-pattern-objectBoundingBox-in-use"), 0); }
#[test] fn painting_context_with_pattern_on_marker() { assert_eq!(render("tests/painting/context/with-pattern-on-marker"), 0); }
#[test] fn painting_context_with_text() { assert_eq!(render("tests/painting/context/with-text"), 0); }
#[test] fn painting_context_without_context_element() { assert_eq!(render("tests/painting/context/without-context-element"), 0); }
#[test] fn painting_display_bBox_impact() { assert_eq!(render("tests/painting/display/bBox-impact"), 0); }
#[test] fn painting_display_none_on_clipPath() { assert_eq!(render("tests/painting/display/none-on-clipPath"), 0); }
#[test] fn painting_display_none_on_defs() { assert_eq!(render("tests/painting/display/none-on-defs"), 0); }
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions crates/resvg/tests/tests/painting/context/in-marker.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 16 additions & 0 deletions crates/resvg/tests/tests/painting/context/in-nested-marker.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 15 additions & 0 deletions crates/resvg/tests/tests/painting/context/in-nested-use.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions crates/resvg/tests/tests/painting/context/in-use.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions crates/resvg/tests/tests/painting/context/with-gradient-in-use.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions crates/resvg/tests/tests/painting/context/with-pattern-in-use.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions crates/resvg/tests/tests/painting/context/with-text.svg

0 comments on commit 25fd250

Please sign in to comment.