From 07d30e0f1d8793eb1505d3a4e33f6a710235f96b Mon Sep 17 00:00:00 2001 From: "Austin M. Reppert" Date: Mon, 2 Dec 2024 06:20:05 -0500 Subject: [PATCH] Cleanup. --- examples/headless/Cargo.toml | 2 +- examples/scenes/Cargo.toml | 2 +- examples/scenes/src/cosmic_text_scene.rs | 10 ++++------ examples/scenes/src/test_scenes.rs | 2 +- vello_tests/Cargo.toml | 2 +- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/examples/headless/Cargo.toml b/examples/headless/Cargo.toml index eeea0efb4..371341709 100644 --- a/examples/headless/Cargo.toml +++ b/examples/headless/Cargo.toml @@ -22,4 +22,4 @@ png = "0.17.14" futures-intrusive = { workspace = true } [features] -cosmic_text = ["scenes/cosmic_text"] \ No newline at end of file +cosmic_text = ["scenes/cosmic_text"] diff --git a/examples/scenes/Cargo.toml b/examples/scenes/Cargo.toml index ea27fe1f9..3b9396c0b 100644 --- a/examples/scenes/Cargo.toml +++ b/examples/scenes/Cargo.toml @@ -30,4 +30,4 @@ web-time = { workspace = true } getrandom = { version = "0.2.15", features = ["js"] } [features] -cosmic_text = ["dep:cosmic-text", "dep:unicode-segmentation"] \ No newline at end of file +cosmic_text = ["dep:cosmic-text", "dep:unicode-segmentation"] diff --git a/examples/scenes/src/cosmic_text_scene.rs b/examples/scenes/src/cosmic_text_scene.rs index 6133aefbb..9750e0885 100644 --- a/examples/scenes/src/cosmic_text_scene.rs +++ b/examples/scenes/src/cosmic_text_scene.rs @@ -21,9 +21,7 @@ use std::cmp; use std::collections::HashMap; use std::sync::Arc; -pub struct CosmicData {} - -impl TestScene for CosmicTextSceneState { +impl TestScene for CosmicTextScene { fn render(&mut self, scene: &mut Scene, _scene_params: &mut SceneParams) { let buffer_glyphs = &self.buffer_glyphs; let vello_fonts = &self.vello_fonts; @@ -67,13 +65,13 @@ impl TestScene for CosmicTextSceneState { } } -pub struct CosmicTextSceneState { +pub struct CosmicTextScene { pub font_system: FontSystem, pub vello_fonts: HashMap, pub buffer_glyphs: BufferGlyphs, } -impl Default for CosmicTextSceneState { +impl Default for CosmicTextScene { fn default() -> Self { Self::new() } @@ -96,7 +94,7 @@ impl AsRef<[u8]> for CosmicFontBlobAdapter { } } -impl CosmicTextSceneState { +impl CosmicTextScene { pub fn new() -> Self { let mut font_system = FontSystem::new(); let mut vello_fonts = HashMap::new(); diff --git a/examples/scenes/src/test_scenes.rs b/examples/scenes/src/test_scenes.rs index ec8564ba3..fe9f53328 100644 --- a/examples/scenes/src/test_scenes.rs +++ b/examples/scenes/src/test_scenes.rs @@ -89,7 +89,7 @@ export_scenes!( blurred_rounded_rect(blurred_rounded_rect), image_sampling(image_sampling), image_extend_modes(image_extend_modes), - #[cfg(feature = "cosmic_text")] cosmic_text_scene(crate::cosmic_text_scene::CosmicTextSceneState::default(), "cosmic_text", false) + #[cfg(feature = "cosmic_text")] cosmic_text_scene(crate::cosmic_text_scene::CosmicTextScene::default(), "cosmic_text", false) ); /// Implementations for the test scenes. diff --git a/vello_tests/Cargo.toml b/vello_tests/Cargo.toml index 504ef4faa..c81dc5848 100644 --- a/vello_tests/Cargo.toml +++ b/vello_tests/Cargo.toml @@ -24,4 +24,4 @@ image = { workspace = true, features = ["png"] } scenes = { workspace = true } [features] -cosmic_text = ["scenes/cosmic_text"] \ No newline at end of file +cosmic_text = ["scenes/cosmic_text"]