mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Expose DOMHighResTimeStamps at lower res
This commit is contained in:
parent
5f55cd5d71
commit
8e65782efb
10 changed files with 46 additions and 51 deletions
|
@ -19,7 +19,6 @@ use crate::dom::bindings::codegen::Bindings::XRSessionBinding::XRVisibilityState
|
|||
use crate::dom::bindings::codegen::Bindings::XRWebGLLayerBinding::XRWebGLLayerMethods;
|
||||
use crate::dom::bindings::error::{Error, ErrorResult};
|
||||
use crate::dom::bindings::inheritance::Castable;
|
||||
use crate::dom::bindings::num::Finite;
|
||||
use crate::dom::bindings::refcounted::Trusted;
|
||||
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject};
|
||||
use crate::dom::bindings::root::{Dom, DomRoot, MutDom, MutNullableDom};
|
||||
|
@ -28,6 +27,7 @@ use crate::dom::eventtarget::EventTarget;
|
|||
use crate::dom::globalscope::GlobalScope;
|
||||
use crate::dom::node::Node;
|
||||
use crate::dom::node::NodeDamage;
|
||||
use crate::dom::performance::reduce_timing_resolution;
|
||||
use crate::dom::promise::Promise;
|
||||
use crate::dom::xrframe::XRFrame;
|
||||
use crate::dom::xrinputsourcearray::XRInputSourceArray;
|
||||
|
@ -336,7 +336,7 @@ impl XRSession {
|
|||
// Step 4-5
|
||||
let mut callbacks = mem::replace(&mut *self.raf_callback_list.borrow_mut(), vec![]);
|
||||
let start = self.global().as_window().get_navigation_start();
|
||||
let time = (frame.time_ns - start).to_ms();
|
||||
let time = reduce_timing_resolution((frame.time_ns - start).to_ms());
|
||||
|
||||
let frame = XRFrame::new(&self.global(), self, frame);
|
||||
// Step 6,7
|
||||
|
@ -347,7 +347,7 @@ impl XRSession {
|
|||
self.outside_raf.set(false);
|
||||
for (_, callback) in callbacks.drain(..) {
|
||||
if let Some(callback) = callback {
|
||||
let _ = callback.Call__(Finite::wrap(time), &frame, ExceptionHandling::Report);
|
||||
let _ = callback.Call__(time, &frame, ExceptionHandling::Report);
|
||||
}
|
||||
}
|
||||
self.outside_raf.set(true);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue