mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Use FLoat32Array in GamepadPose (#31106)
* Use FLoat32Array in GamepadPose Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> * Remove unused create_typed_array Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com> --------- Signed-off-by: Bentaimia Haddadi <haddadi.taym@gmail.com>
This commit is contained in:
parent
9a698b7bfb
commit
9d2c102fa0
4 changed files with 38 additions and 84 deletions
|
@ -30,7 +30,6 @@ use js::rust::{
|
|||
get_object_class, is_dom_class, GCMethods, Handle, HandleId, HandleObject, HandleValue,
|
||||
MutableHandleValue, ToString,
|
||||
};
|
||||
use js::typedarray::{CreateWith, Float32Array};
|
||||
use js::JS_CALLEE;
|
||||
use malloc_size_of::{MallocSizeOf, MallocSizeOfOps};
|
||||
|
||||
|
@ -133,15 +132,6 @@ pub fn to_frozen_array<T: ToJSValConvertible>(convertibles: &[T], cx: SafeJSCont
|
|||
*ports
|
||||
}
|
||||
|
||||
/// Creates a Float32 array
|
||||
pub fn create_typed_array(cx: SafeJSContext, src: &[f32], dst: &Heap<*mut JSObject>) {
|
||||
rooted!(in (*cx) let mut array = ptr::null_mut::<JSObject>());
|
||||
unsafe {
|
||||
let _ = Float32Array::create(*cx, CreateWith::Slice(src), array.handle_mut());
|
||||
}
|
||||
(*dst).set(array.get());
|
||||
}
|
||||
|
||||
/// Returns the ProtoOrIfaceArray for the given global object.
|
||||
/// Fails if `global` is not a DOM global object.
|
||||
pub fn get_proto_or_iface_array(global: *mut JSObject) -> *mut ProtoOrIfaceArray {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue