From 84c0ef7217cd287c25162a3ceee9a7ecc4c71d36 Mon Sep 17 00:00:00 2001 From: Arman Uguray Date: Sat, 21 Oct 2023 13:36:50 -0400 Subject: [PATCH] [encoding] Replace linewidth stream with the new style encoding * The linewidth stream is now the "style" stream. This has been wired up all the way up to the `flatten` pipeline which uses the new encoding to extract the fill rule. * Pipelines downstream of `flatten` still use the old linewidth scheme. They will be fixed up in a follow-up change. --- crates/encoding/src/encoding.rs | 33 +++++++++++++---------------- crates/encoding/src/glyph_cache.rs | 2 +- crates/encoding/src/lib.rs | 2 +- crates/encoding/src/path.rs | 13 ++++++------ crates/encoding/src/resolve.rs | 34 +++++++++++++++--------------- shader/flatten.wgsl | 8 ++++++- shader/shared/config.wgsl | 2 +- shader/shared/pathtag.wgsl | 15 +++++++++---- src/cpu_shader/flatten.rs | 18 ++++++++++++---- 9 files changed, 74 insertions(+), 53 deletions(-) diff --git a/crates/encoding/src/encoding.rs b/crates/encoding/src/encoding.rs index 997fada65..e56964629 100644 --- a/crates/encoding/src/encoding.rs +++ b/crates/encoding/src/encoding.rs @@ -1,7 +1,7 @@ // Copyright 2022 The Vello authors // SPDX-License-Identifier: Apache-2.0 OR MIT -use super::{DrawColor, DrawTag, PathEncoder, PathTag, Transform}; +use super::{DrawColor, DrawTag, PathEncoder, PathTag, Style, Transform}; use peniko::{kurbo::Shape, BlendMode, BrushRef, Color, Fill}; @@ -25,8 +25,8 @@ pub struct Encoding { pub draw_data: Vec, /// The transform stream. pub transforms: Vec, - /// The line width stream. - pub linewidths: Vec, + /// The style stream + pub styles: Vec