aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/xrray.rs
diff options
context:
space:
mode:
authorTaym Haddadi <haddadi.taym@gmail.com>2024-01-29 12:57:50 +0100
committerGitHub <noreply@github.com>2024-01-29 11:57:50 +0000
commit742d3ed97f8e439a5807dbbfece6c23935525bce (patch)
treeceb5c9a387a141ff1e91366fdb9cecd15df9af1a /components/script/dom/xrray.rs
parent7d1b19c865855101561dd2030631feed2409a96d (diff)
downloadservo-742d3ed97f8e439a5807dbbfece6c23935525bce.tar.gz
servo-742d3ed97f8e439a5807dbbfece6c23935525bce.zip
Make HeapFloat32Array generic (#31167)
* Make HeapFloat32Array generic Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Define all the methods defaults on the HeapTypedArray trait Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Use generic type instead of trait Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> --------- Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
Diffstat (limited to 'components/script/dom/xrray.rs')
-rw-r--r--components/script/dom/xrray.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/components/script/dom/xrray.rs b/components/script/dom/xrray.rs
index 62d1d1aa6eb..a91395acb8a 100644
--- a/components/script/dom/xrray.rs
+++ b/components/script/dom/xrray.rs
@@ -5,15 +5,15 @@
use dom_struct::dom_struct;
use euclid::{Angle, RigidTransform3D, Rotation3D, Vector3D};
use js::rust::HandleObject;
-use js::typedarray::Float32Array;
+use js::typedarray::{Float32, Float32Array};
use webxr_api::{ApiSpace, Ray};
+use super::bindings::typedarrays::HeapTypedArray;
use crate::dom::bindings::codegen::Bindings::DOMPointBinding::DOMPointInit;
use crate::dom::bindings::codegen::Bindings::XRRayBinding::{XRRayDirectionInit, XRRayMethods};
use crate::dom::bindings::error::{Error, Fallible};
use crate::dom::bindings::reflector::{reflect_dom_object_with_proto, DomObject, Reflector};
use crate::dom::bindings::root::DomRoot;
-use crate::dom::bindings::typedarrays::HeapFloat32Array;
use crate::dom::dompointreadonly::DOMPointReadOnly;
use crate::dom::globalscope::GlobalScope;
use crate::dom::window::Window;
@@ -27,7 +27,7 @@ pub struct XRRay {
#[no_trace]
ray: Ray<ApiSpace>,
#[ignore_malloc_size_of = "defined in mozjs"]
- matrix: HeapFloat32Array,
+ matrix: HeapTypedArray<Float32>,
}
impl XRRay {
@@ -35,7 +35,7 @@ impl XRRay {
XRRay {
reflector_: Reflector::new(),
ray,
- matrix: HeapFloat32Array::default(),
+ matrix: HeapTypedArray::default(),
}
}