Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slightly clean up the final URL creation in canvas.toDataURL #21850

Merged
merged 7 commits into from Oct 3, 2018
Prev

Reindent the WebGL 2 case of canvas.toDataURL

  • Loading branch information
nox committed Oct 3, 2018
commit 5efbeea61ca619cbded91acb4b1b468aaa5e50b0
@@ -383,12 +383,11 @@ impl HTMLCanvasElementMethods for HTMLCanvasElement {
None => return Ok(USVString("data:,".into())),
}
},
Some(CanvasContext::WebGL2(ref context)) => match context
.base_context()
.get_image_data(self.Width(), self.Height())
{
Some(data) => data,
None => return Ok(USVString("data:,".into())),
Some(CanvasContext::WebGL2(ref context)) => {
match context.base_context().get_image_data(self.Width(), self.Height()) {
Some(data) => data,
None => return Ok(USVString("data:,".into())),
}
},
None => {
// Each pixel is fully-transparent black.
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.