Reindent the WebGL 2 case of canvas.toDataURL

This commit is contained in:
Anthony Ramine 2018-10-03 10:44:36 +02:00
parent cfd446218b
commit 5efbeea61c

View file

@ -383,12 +383,11 @@ impl HTMLCanvasElementMethods for HTMLCanvasElement {
None => return Ok(USVString("data:,".into())), None => return Ok(USVString("data:,".into())),
} }
}, },
Some(CanvasContext::WebGL2(ref context)) => match context Some(CanvasContext::WebGL2(ref context)) => {
.base_context() match context.base_context().get_image_data(self.Width(), self.Height()) {
.get_image_data(self.Width(), self.Height()) Some(data) => data,
{ None => return Ok(USVString("data:,".into())),
Some(data) => data, }
None => return Ok(USVString("data:,".into())),
}, },
None => { None => {
// Each pixel is fully-transparent black. // Each pixel is fully-transparent black.