Compare commits
10 commits
a456d1c17b
...
5e16f105e0
| Author | SHA1 | Date | |
|---|---|---|---|
| 5e16f105e0 | |||
|
|
c49de15bce | ||
|
|
0e025ed813 | ||
|
|
bb8f59f9f0 | ||
|
|
99b4695936 | ||
|
|
1d68a54059 | ||
|
|
453cedec0d | ||
|
|
b36979ec18 | ||
|
|
36459b06ca | ||
|
|
1b72c1fe9e |
4 changed files with 18 additions and 19 deletions
14
Cargo.toml
14
Cargo.toml
|
|
@ -1,20 +1,20 @@
|
||||||
[package]
|
[package]
|
||||||
name = "cryoglyph"
|
name = "cryoglyph"
|
||||||
description = "Fast, simple 2D text rendering for wgpu"
|
description = "Fast, simple 2D text rendering for wgpu. A fork of glyphon for iced."
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
authors = ["Héctor Ramón Jiménez <hector@hecrj.dev>"]
|
||||||
repository = "https://github.com/iced-rs/cryoglyph"
|
repository = "https://github.com/iced-rs/cryoglyph"
|
||||||
license = "MIT OR Apache-2.0 OR Zlib"
|
license = "MIT OR Apache-2.0 OR Zlib"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
wgpu = { version = "24", default-features = false, features = ["wgsl"] }
|
wgpu = { version = "27", default-features = false, features = ["wgsl"] }
|
||||||
etagere = "0.2.10"
|
etagere = "0.2"
|
||||||
cosmic-text = "0.14"
|
cosmic-text = { path = "../cosmic-text" }
|
||||||
lru = { version = "0.12.1", default-features = false }
|
lru = { version = "0.16", default-features = false }
|
||||||
rustc-hash = "2.0"
|
rustc-hash = "2"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
wgpu = "24"
|
|
||||||
winit = "0.30"
|
winit = "0.30"
|
||||||
pollster = "0.4"
|
pollster = "0.4"
|
||||||
criterion = { version = "0.5", features = ["html_reports"] }
|
criterion = { version = "0.5", features = ["html_reports"] }
|
||||||
|
|
|
||||||
|
|
@ -74,7 +74,7 @@ fn run_bench(ctx: &mut Criterion) {
|
||||||
.map(|s| {
|
.map(|s| {
|
||||||
let mut text_buffer = Buffer::new(&mut font_system, Metrics::relative(1.0, 10.0));
|
let mut text_buffer = Buffer::new(&mut font_system, Metrics::relative(1.0, 10.0));
|
||||||
text_buffer.set_size(&mut font_system, Some(20.0), None);
|
text_buffer.set_size(&mut font_system, Some(20.0), None);
|
||||||
text_buffer.set_text(&mut font_system, s, attrs, shaping);
|
text_buffer.set_text(&mut font_system, s, &attrs, shaping, None);
|
||||||
text_buffer.shape_until_scroll(&mut font_system, false);
|
text_buffer.shape_until_scroll(&mut font_system, false);
|
||||||
text_buffer
|
text_buffer
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -14,15 +14,13 @@ impl State {
|
||||||
))
|
))
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
let (device, queue) = block_on(adapter.request_device(
|
let (device, queue) = block_on(adapter.request_device(&wgpu::DeviceDescriptor {
|
||||||
&wgpu::DeviceDescriptor {
|
label: Some("Benchmark Device"),
|
||||||
label: Some("Benchmark Device"),
|
required_features: adapter.features(),
|
||||||
required_features: adapter.features(),
|
required_limits: adapter.limits(),
|
||||||
required_limits: adapter.limits(),
|
memory_hints: wgpu::MemoryHints::Performance,
|
||||||
memory_hints: wgpu::MemoryHints::Performance,
|
..wgpu::DeviceDescriptor::default()
|
||||||
},
|
}))
|
||||||
None,
|
|
||||||
))
|
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
Self { device, queue }
|
Self { device, queue }
|
||||||
|
|
|
||||||
|
|
@ -49,7 +49,7 @@ impl WindowState {
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
let (device, queue) = adapter
|
let (device, queue) = adapter
|
||||||
.request_device(&DeviceDescriptor::default(), None)
|
.request_device(&DeviceDescriptor::default())
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
|
@ -87,7 +87,7 @@ impl WindowState {
|
||||||
Some(physical_width),
|
Some(physical_width),
|
||||||
Some(physical_height),
|
Some(physical_height),
|
||||||
);
|
);
|
||||||
text_buffer.set_text(&mut font_system, "Hello world! 👋\nThis is rendered with 🦅 glyphon 🦁\nThe text below should be partially clipped.\na b c d e f g h i j k l m n o p q r s t u v w x y z", &Attrs::new().family(Family::SansSerif), Shaping::Advanced);
|
text_buffer.set_text(&mut font_system, "Hello world! 👋\nThis is rendered with 🦅 glyphon 🦁\nThe text below should be partially clipped.\na b c d e f g h i j k l m n o p q r s t u v w x y z", &Attrs::new().family(Family::SansSerif), Shaping::Advanced, None);
|
||||||
text_buffer.shape_until_scroll(&mut font_system, false);
|
text_buffer.shape_until_scroll(&mut font_system, false);
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
|
|
@ -203,6 +203,7 @@ impl winit::application::ApplicationHandler for Application {
|
||||||
label: None,
|
label: None,
|
||||||
color_attachments: &[Some(RenderPassColorAttachment {
|
color_attachments: &[Some(RenderPassColorAttachment {
|
||||||
view: &view,
|
view: &view,
|
||||||
|
depth_slice: None,
|
||||||
resolve_target: None,
|
resolve_target: None,
|
||||||
ops: Operations {
|
ops: Operations {
|
||||||
load: LoadOp::Clear(wgpu::Color::BLACK),
|
load: LoadOp::Clear(wgpu::Color::BLACK),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue