mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Don't bother with the global in ImageData::get_image_data
This commit is contained in:
parent
854a3dff68
commit
2400b91d05
4 changed files with 6 additions and 8 deletions
|
@ -53,12 +53,12 @@ impl ImageData {
|
|||
}
|
||||
|
||||
#[allow(unsafe_code)]
|
||||
pub fn get_data_array(&self, global: &GlobalRef) -> Vec<u8> {
|
||||
pub fn get_data_array(&self) -> Vec<u8> {
|
||||
unsafe {
|
||||
let cx = global.get_cx();
|
||||
let mut is_shared = false;
|
||||
assert!(!self.data.get().is_null());
|
||||
let data: *const uint8_t =
|
||||
JS_GetUint8ClampedArrayData(self.Data(cx), &mut is_shared, ptr::null()) as *const uint8_t;
|
||||
JS_GetUint8ClampedArrayData(self.data.get(), &mut is_shared, ptr::null()) as *const uint8_t;
|
||||
assert!(!data.is_null());
|
||||
assert!(!is_shared);
|
||||
let len = self.Width() * self.Height() * 4;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue