Replace rustybuzz with HarfRust (#417)
* Use HarfRust for shaping * Replace ttf-parser with skrifa entirely * Fix clippy lints * Add shape plan cache * Bump harfrust and skrifa * Fix no_std build * Simplify the shape plan cache * Please the paperclip * Cache font ID with plan * Tune shape plan cache for "BiDi Processing" bench
This commit is contained in:
parent
3c1f6c9e8a
commit
2610c869f6
7 changed files with 221 additions and 121 deletions
|
|
@ -44,6 +44,28 @@ fn bench_bidi_processing(c: &mut Criterion) {
|
|||
});
|
||||
}
|
||||
|
||||
fn bench_lang_mixed(c: &mut Criterion) {
|
||||
let mut fs = ct::FontSystem::new();
|
||||
let mut buffer = ct::Buffer::new(&mut fs, ct::Metrics::new(14.0, 20.0));
|
||||
buffer.set_size(&mut fs, Some(500.0), None);
|
||||
|
||||
let bidi_text = include_str!("../sample/hello.txt");
|
||||
|
||||
c.benchmark_group("bench_lang_mixed")
|
||||
.sample_size(10)
|
||||
.bench_function("ShapeLine/Mixed-Language Text", |b| {
|
||||
b.iter(|| {
|
||||
buffer.set_text(
|
||||
&mut fs,
|
||||
black_box(&bidi_text),
|
||||
&ct::Attrs::new(),
|
||||
ct::Shaping::Advanced,
|
||||
);
|
||||
buffer.shape_until_scroll(&mut fs, false);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
fn bench_layout_heavy(c: &mut Criterion) {
|
||||
let mut fs = ct::FontSystem::new();
|
||||
let mut buffer = ct::Buffer::new(&mut fs, ct::Metrics::new(14.0, 20.0));
|
||||
|
|
@ -117,6 +139,7 @@ criterion_group!(
|
|||
benches,
|
||||
bench_ascii_fast_path,
|
||||
bench_bidi_processing,
|
||||
bench_lang_mixed,
|
||||
bench_layout_heavy,
|
||||
bench_combined_stress,
|
||||
bench_bidi_paragraphs_ascii,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue