Skip to content

Commit ae2477d

Browse files
committed
Stop using time@0.1
1 parent 5a9bfec commit ae2477d

File tree

14 files changed

+141
-16
lines changed

14 files changed

+141
-16
lines changed

webrender/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ rayon = "1"
4343
ron = { optional = true, version = "0.10.0" }
4444
serde = { optional = true, version = "1.0", features = ["serde_derive"] }
4545
smallvec = "1"
46-
time = "0.1"
4746
api = { version = "0.66.0", path = "../webrender_api", package = "webrender_api" }
4847
webrender_build = { version = "0.0.2", path = "../webrender_build" }
4948
malloc_size_of = { version = "0.2.0", path = "../wr_malloc_size_of", package = "wr_malloc_size_of" }

webrender/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,6 @@ extern crate rayon;
156156
extern crate ron;
157157
#[macro_use]
158158
extern crate smallvec;
159-
extern crate time;
160159
#[cfg(all(feature = "capture", feature = "png"))]
161160
extern crate png;
162161
#[cfg(test)]

webrender/src/prim_store/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,7 +1332,7 @@ impl PrimitiveScratchBuffer {
13321332
const LINE_HEIGHT: f32 = 20.0;
13331333
const X0: f32 = 32.0;
13341334
const Y0: f32 = 32.0;
1335-
let now = time::precise_time_ns();
1335+
let now = api::precise_time_ns();
13361336

13371337
let msgs_to_remove = self.messages.len().max(MSGS_TO_RETAIN) - MSGS_TO_RETAIN;
13381338
let mut msgs_removed = 0;
@@ -1438,7 +1438,7 @@ impl PrimitiveScratchBuffer {
14381438
) {
14391439
self.messages.push(DebugMessage {
14401440
msg,
1441-
timestamp: time::precise_time_ns(),
1441+
timestamp: api::precise_time_ns(),
14421442
})
14431443
}
14441444
}

webrender/src/profiler.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
//! - A '|' token to start a new column.
2020
//! - A '_' token to start a new row.
2121
22-
use api::{ColorF, ColorU};
22+
use api::{ColorF, ColorU, precise_time_ns};
2323
use glyph_rasterizer::profiler::GlyphRasterizeProfiler;
2424
use crate::renderer::DebugRenderer;
2525
use crate::device::query::GpuTimer;
@@ -32,7 +32,6 @@ use std::fmt::{Write, Debug};
3232
use std::f32;
3333
use std::ops::Range;
3434
use std::time::Duration;
35-
use time::precise_time_ns;
3635

3736
macro_rules! set_text {
3837
($dst:expr, $($arg:tt)*) => {

webrender/src/render_api.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@
44

55
#![deny(missing_docs)]
66

7+
use api::precise_time_ns;
78
use std::cell::Cell;
89
use std::fmt;
910
use std::marker::PhantomData;
1011
use std::path::PathBuf;
1112
use std::sync::Arc;
1213
use std::u32;
1314
use api::{HitTestFlags, MinimapData, SnapshotImageKey};
14-
use time::precise_time_ns;
1515
use crate::api::channel::{Sender, single_msg_channel, unbounded_channel};
1616
use crate::api::{BuiltDisplayList, IdNamespace, ExternalScrollId, Parameter, BoolParameter};
1717
use crate::api::{FontKey, FontInstanceKey, NativeFontHandle};

webrender/src/render_backend.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use api::{DocumentId, ExternalScrollId, HitTestResult};
1313
use api::{IdNamespace, PipelineId, RenderNotifier, SampledScrollOffset};
1414
use api::{NotificationRequest, Checkpoint, QualitySettings};
1515
use api::{FramePublishId, PrimitiveKeyKind, RenderReasons};
16+
use api::precise_time_ns;
1617
use api::units::*;
1718
use api::channel::{single_msg_channel, Sender, Receiver};
1819
use crate::bump_allocator::ChunkPool;
@@ -71,7 +72,6 @@ use std::{mem, u32};
7172
use std::path::PathBuf;
7273
#[cfg(feature = "replay")]
7374
use crate::frame_builder::Frame;
74-
use time::precise_time_ns;
7575
use core::time::Duration;
7676
use crate::util::{Recycler, VecHelper, drain_filter};
7777

webrender/src/renderer/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ use api::{PipelineId, ImageRendering, Checkpoint, NotificationRequest, ImageBuff
4343
#[cfg(feature = "replay")]
4444
use api::ExternalImage;
4545
use api::FramePublishId;
46+
use api::precise_time_ns;
4647
use api::units::*;
4748
use api::channel::{Sender, Receiver};
4849
pub use api::DebugFlags;
@@ -115,7 +116,6 @@ use std::{
115116
};
116117
#[cfg(any(feature = "capture", feature = "replay"))]
117118
use std::collections::hash_map::Entry;
118-
use time::precise_time_ns;
119119

120120
mod debug;
121121
mod gpu_buffer;

webrender/src/renderer/shade.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* License, v. 2.0. If a copy of the MPL was not distributed with this
33
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
44

5-
use api::{ImageBufferKind, units::DeviceSize};
5+
use api::{precise_time_ns, ImageBufferKind, units::DeviceSize};
66
use crate::batch::{BatchKey, BatchKind, BrushBatchKind, BatchFeatures};
77
use crate::composite::{CompositeFeatures, CompositeSurfaceFormat};
88
use crate::device::{Device, Program, ShaderError};
@@ -18,7 +18,6 @@ use crate::renderer::{
1818
use crate::profiler::{self, TransactionProfile, ns_to_ms};
1919

2020
use gleam::gl::GlType;
21-
use time::precise_time_ns;
2221

2322
use std::cell::RefCell;
2423
use std::collections::VecDeque;

webrender/src/renderer/upload.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@
1616
//! here relies on submitting draw calls via the renderer.
1717
1818

19+
use api::precise_time_ns;
1920
use std::mem;
2021
use std::collections::VecDeque;
2122
use std::sync::Arc;
2223
use std::time::Duration;
2324
use euclid::{Transform3D, point2};
24-
use time::precise_time_ns;
2525
use malloc_size_of::MallocSizeOfOps;
2626
use api::units::*;
2727
use api::{ExternalImageSource, ImageBufferKind, ImageFormat};

webrender/src/scene_builder_thread.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ use api::{DocumentId, PipelineId, ExternalEvent, BlobImageRequest};
77
use api::{NotificationRequest, Checkpoint, IdNamespace, QualitySettings};
88
use api::{PrimitiveKeyKind, GlyphDimensionRequest, GlyphIndexRequest};
99
use api::channel::{unbounded_channel, single_msg_channel, Receiver, Sender};
10+
use api::precise_time_ns;
1011
use api::units::*;
1112
use crate::render_api::{ApiMsg, FrameMsg, SceneMsg, ResourceUpdate, TransactionMsg, MemoryReport};
1213
use crate::box_shadow::BoxShadow;
@@ -35,7 +36,6 @@ use crate::spatial_tree::{SceneSpatialTree, SpatialTreeUpdates};
3536
use crate::telemetry::Telemetry;
3637
use crate::SceneBuilderHooks;
3738
use std::iter;
38-
use time::precise_time_ns;
3939
use crate::util::drain_filter;
4040
use std::thread;
4141
use std::time::Duration;

0 commit comments

Comments
 (0)