aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/imagedata.rs
diff options
context:
space:
mode:
authorJosh Matthews <josh@joshmatthews.net>2023-02-16 23:09:50 -0500
committerJosh Matthews <josh@joshmatthews.net>2023-05-20 11:05:09 -0400
commitf79e1e327dfdf047cab9652e1cc3e67a7667faa1 (patch)
tree43c1cf48c9a6448264722780e38315dafacf4a24 /components/script/dom/imagedata.rs
parent4998c65c423f995149f4b314d8ff68024c24cc72 (diff)
downloadservo-f79e1e327dfdf047cab9652e1cc3e67a7667faa1.tar.gz
servo-f79e1e327dfdf047cab9652e1cc3e67a7667faa1.zip
Make GlobalScope.get_cx a static method.
Diffstat (limited to 'components/script/dom/imagedata.rs')
-rw-r--r--components/script/dom/imagedata.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/components/script/dom/imagedata.rs b/components/script/dom/imagedata.rs
index d8574a9b666..43df0951492 100644
--- a/components/script/dom/imagedata.rs
+++ b/components/script/dom/imagedata.rs
@@ -39,7 +39,7 @@ impl ImageData {
) -> Fallible<DomRoot<ImageData>> {
let len = width * height * 4;
unsafe {
- let cx = global.get_cx();
+ let cx = GlobalScope::get_cx();
rooted!(in (*cx) let mut js_object = ptr::null_mut::<JSObject>());
if let Some(ref mut d) = data {
d.resize(len as usize, 0);
@@ -60,7 +60,7 @@ impl ImageData {
jsobject: *mut JSObject,
) -> Fallible<DomRoot<ImageData>> {
// checking jsobject type
- let cx = global.get_cx();
+ let cx = GlobalScope::get_cx();
typedarray!(in(*cx) let array_res: Uint8ClampedArray = jsobject);
let array = array_res.map_err(|_| {
Error::Type("Argument to Image data is not an Uint8ClampedArray".to_owned())
@@ -111,7 +111,7 @@ impl ImageData {
});
let len = width * height * 4;
- let cx = global.get_cx();
+ let cx = GlobalScope::get_cx();
rooted!(in (*cx) let mut array = ptr::null_mut::<JSObject>());
Uint8ClampedArray::create(*cx, CreateWith::Length(len as usize), array.handle_mut())
.unwrap();