update example to use winit 0.30 (#105)

* update example to use winit 0.30

* omit unneeded field in example
This commit is contained in:
Billy Messenger 2024-07-25 13:05:55 -05:00 committed by Héctor Ramón Jiménez
parent 28512c8630
commit 6b566c5eb1
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
4 changed files with 222 additions and 162 deletions

View file

@ -1,9 +1,9 @@
use cosmic_text::{Attrs, Buffer, Color, Family, FontSystem, Metrics, Shaping, SwashCache};
use criterion::{criterion_group, criterion_main, Criterion};
use glyphon::{
use cryoglyph::{
Cache, ColorMode, Resolution, TextArea, TextAtlas, TextBounds, TextRenderer, Viewport, Weight,
};
use wgpu::{MultisampleState, TextureFormat};
use wgpu::{CommandEncoderDescriptor, MultisampleState, TextureFormat};
mod state;
@ -64,7 +64,11 @@ fn run_bench(ctx: &mut Criterion) {
.collect(),
),
] {
let buffers: Vec<glyphon::Buffer> = text_areas
let mut encoder = state
.device
.create_command_encoder(&CommandEncoderDescriptor { label: None });
let buffers: Vec<cryoglyph::Buffer> = text_areas
.iter()
.copied()
.map(|s| {
@ -92,7 +96,6 @@ fn run_bench(ctx: &mut Criterion) {
bottom: 1000,
},
default_color: Color::rgb(0, 0, 0),
custom_glyphs: &[],
})
.collect();
@ -101,6 +104,7 @@ fn run_bench(ctx: &mut Criterion) {
.prepare(
&state.device,
&state.queue,
&mut encoder,
&mut font_system,
&mut atlas,
&viewport,