Make renderer and SVG module dependencies explicit

This commit is contained in:
Dylan M. Taylor
2026-10-28 05:03:00 +00:00
parent 317d270823
commit 7e44df55a9
27 changed files with 76 additions and 27 deletions
+3 -1
View File
@@ -1,6 +1,8 @@
use super::predicates::{has_fx, has_object_fx};
use super::raster::doc_raster_ppi;
use super::*;
use super::{
Affine, AppearanceItem, Arc, BezPath, Document, Effect, FillRule, GeomContext, Node, NodeKind, Rect, Renderer, Shape, SymbolBoxes, effects,
};
fn node_bezpath(n: &Node) -> Option<BezPath> {
match &n.kind {
+4 -1
View File
@@ -1,5 +1,8 @@
use super::raster::ViewCrop;
use super::*;
use super::{
Affine, AppearanceItem, Arc, BezPath, Channels, Cms, DefaultHasher, FillRule, Hash, Hasher, Node, NodeId, NodeKind, PathEl, Point, RasterFx,
Rect, Size, Weak, effects,
};
/// What [`Renderer::raster_fx`] paints effects around.
pub(super) struct Content<'a> {
+4 -1
View File
@@ -6,7 +6,10 @@ use super::raster::{
DRAG_PIXEL_BUDGET, PIXEL_BUDGET, PixelEntry, ViewCrop, content_changing, doc_raster_ppi, drag_scale, draw_placed, draw_scaled, filter_region,
filter_region_within, hard_edged, image_size, linear_key, looks_around, pan_margin,
};
use super::*;
use super::{
Affine, AppearanceItem, Arc, BezPath, Channels, DefaultHasher, Document, FillRule, Frame, GeomContext, Hash, Hasher, Ink, Node, PixelFx,
RasterFx, Rect, RenderContext, Renderer, Shape, blend_mode, effects, fill_rule, paint, peniko,
};
impl Renderer {
/// Paint `content` through the content-changing effects of `rfx` (Gaussian Blur, Feather, the
+1 -1
View File
@@ -1,5 +1,5 @@
use super::bounds::drawn_bounds;
use super::*;
use super::{Affine, AppearanceItem, Effect, Frame, Node, NodeKind, RasterFx, Rect, SymbolBoxes, Vec2, effects};
fn visible(effects: &[Effect]) -> bool {
effects.iter().any(|e| e.visible)
+1 -1
View File
@@ -1,5 +1,5 @@
use super::entries::{Drawn, Inputs, Made, raster_bytes};
use super::*;
use super::{Affine, Document, EdgeMode, Filter, FilterPrimitive, Ink, RasterFx, Rect, RenderContext, Vec2, effects, peniko};
pub(super) fn shadow_filter(dx: f64, dy: f64, blur: f64, color: peniko::Color) -> Filter {
Filter::from_primitive(FilterPrimitive::DropShadowOnly {
+4 -1
View File
@@ -5,7 +5,10 @@ use super::raster::{
DRAG_PIXEL_BUDGET, MAX_RASTERIZE, PIXEL_BUDGET, ViewCrop, content_changing, doc_raster_ppi, image_size, linear_key, pan_margin, pcolor, shade,
shade_filter, shadow_filter, silhouette,
};
use super::*;
use super::{
Affine, Arc, BezPath, FillRule, Frame, GeomContext, Ink, Node, NodeKind, RasterFx, Rect, RenderContext, Renderer, Shape, Vec2, blend_mode,
effects, fill_rule, peniko,
};
impl Renderer {
/// Drop shadow / outer glow `fx` (shadow-cache slot `i` of `n`) as a cached raster: the