avm2: Remove `coerce_to_object` calls in `flash.display.Bitmap`

This commit is contained in:
David Wendt 2022-02-08 20:54:09 -05:00 committed by Mike Welsh
parent 5b5313bf95
commit 5f5f98ecdc
1 changed files with 2 additions and 4 deletions

View File

@ -23,8 +23,7 @@ pub fn instance_init<'gc>(
.get(0) .get(0)
.cloned() .cloned()
.unwrap_or(Value::Null) .unwrap_or(Value::Null)
.coerce_to_object(activation) .as_object()
.ok()
.and_then(|bd| bd.as_bitmap_data()); .and_then(|bd| bd.as_bitmap_data());
//TODO: Pixel snapping is not supported //TODO: Pixel snapping is not supported
let _pixel_snapping = args let _pixel_snapping = args
@ -132,8 +131,7 @@ pub fn set_bitmap_data<'gc>(
.get(0) .get(0)
.cloned() .cloned()
.unwrap_or(Value::Null) .unwrap_or(Value::Null)
.coerce_to_object(activation) .as_object()
.ok()
.and_then(|bd| bd.as_bitmap_data()); .and_then(|bd| bd.as_bitmap_data());
bitmap.set_bitmap_data(&mut activation.context, bitmap_data); bitmap.set_bitmap_data(&mut activation.context, bitmap_data);