mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Replace time with std::time in components/gfx (#31168)
* Replace time with std::time in components/gfx Signed-off-by: devjos <github_11837948@feido.de> * Remove time dependency in components/gfx/Cargo.toml Signed-off-by: devjos <github_11837948@feido.de> --------- Signed-off-by: devjos <github_11837948@feido.de>
This commit is contained in:
parent
af6652fc09
commit
886f6c58d4
3 changed files with 7 additions and 6 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -2065,7 +2065,6 @@ dependencies = [
|
|||
"servo_url",
|
||||
"smallvec",
|
||||
"style",
|
||||
"time 0.1.45",
|
||||
"truetype",
|
||||
"ucd",
|
||||
"unicode-bidi",
|
||||
|
|
|
@ -34,7 +34,6 @@ servo_atoms = { path = "../atoms" }
|
|||
servo_url = { path = "../url" }
|
||||
smallvec = { workspace = true, features = ["union"] }
|
||||
style = { path = "../style", features = ["servo"] }
|
||||
time = { workspace = true }
|
||||
ucd = "0.1.1"
|
||||
unicode-bidi = { workspace = true, features = ["with_serde"] }
|
||||
unicode-script = { workspace = true }
|
||||
|
|
|
@ -8,6 +8,7 @@ use std::collections::HashMap;
|
|||
use std::rc::Rc;
|
||||
use std::sync::atomic::{AtomicUsize, Ordering};
|
||||
use std::sync::Arc;
|
||||
use std::time::Instant;
|
||||
use std::{iter, str};
|
||||
|
||||
use app_units::Au;
|
||||
|
@ -253,7 +254,7 @@ impl Font {
|
|||
.borrow_mut()
|
||||
.entry(lookup_key)
|
||||
.or_insert_with(|| {
|
||||
let start_time = time::precise_time_ns();
|
||||
let start_time = Instant::now();
|
||||
let mut glyphs = GlyphStore::new(
|
||||
text.len(),
|
||||
options
|
||||
|
@ -276,9 +277,11 @@ impl Font {
|
|||
.shape_text(text, options, &mut glyphs);
|
||||
}
|
||||
|
||||
let end_time = time::precise_time_ns();
|
||||
TEXT_SHAPING_PERFORMANCE_COUNTER
|
||||
.fetch_add((end_time - start_time) as usize, Ordering::Relaxed);
|
||||
let end_time = Instant::now();
|
||||
TEXT_SHAPING_PERFORMANCE_COUNTER.fetch_add(
|
||||
(end_time.duration_since(start_time).as_nanos()) as usize,
|
||||
Ordering::Relaxed,
|
||||
);
|
||||
Arc::new(glyphs)
|
||||
})
|
||||
.clone();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue