mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Modify *::get_cx methods to return a safe JSContext instead of a raw one
This commit is contained in:
parent
2c5d0a6ebc
commit
88cacfb009
43 changed files with 306 additions and 321 deletions
|
@ -119,10 +119,9 @@ impl XRRigidTransformMethods for XRRigidTransform {
|
|||
})
|
||||
}
|
||||
// https://immersive-web.github.io/webxr/#dom-xrrigidtransform-matrix
|
||||
#[allow(unsafe_code)]
|
||||
fn Matrix(&self, _cx: JSContext) -> NonNull<JSObject> {
|
||||
if self.matrix.get().is_null() {
|
||||
let cx = unsafe { JSContext::from_ptr(self.global().get_cx()) };
|
||||
let cx = self.global().get_cx();
|
||||
// According to the spec all matrices are column-major,
|
||||
// however euclid uses row vectors so we use .to_row_major_array()
|
||||
let arr = self.transform.to_transform().to_row_major_array();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue