Auto merge of #24616 - teapotd:imageinfo-option-refactoring, r=jdm

Store Option<ImageInfo> instead of making fields of ImageInfo optional

Fixes #24582

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #24582
- [X] These changes do not require tests
This commit is contained in:
bors-servo 2019-11-01 20:13:59 -04:00 committed by GitHub
commit 56537fad58
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 47 additions and 69 deletions

View file

@ -264,12 +264,16 @@ impl WebGLFramebuffer {
Some(WebGLFramebufferAttachment::Texture {
texture: ref att_tex,
level,
}) => {
let info = att_tex.image_info_at_face(0, level as u32);
(
info.internal_format().map(|t| t.as_gl_constant()),
}) => match att_tex.image_info_at_face(0, level as u32) {
Some(info) => (
Some(info.internal_format().as_gl_constant()),
Some((info.width() as i32, info.height() as i32)),
)
),
None => {
self.status
.set(constants::FRAMEBUFFER_INCOMPLETE_ATTACHMENT);
return;
},
},
None => (None, None),
};