aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/webglframebuffer.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2019-11-01 20:13:59 -0400
committerGitHub <noreply@github.com>2019-11-01 20:13:59 -0400
commit56537fad5801143d70d923a612720a4606abcd75 (patch)
tree72775c3a86c1c5544f1aba71837a8d3ad5453bb5 /components/script/dom/webglframebuffer.rs
parent8b7e872ba75376efe3ed170b674a3dfd9a3fcdbb (diff)
parenta4fa36f9fb540357b8c9452598b729fba6688c46 (diff)
downloadservo-56537fad5801143d70d923a612720a4606abcd75.tar.gz
servo-56537fad5801143d70d923a612720a4606abcd75.zip
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
Diffstat (limited to 'components/script/dom/webglframebuffer.rs')
-rw-r--r--components/script/dom/webglframebuffer.rs14
1 files changed, 9 insertions, 5 deletions
diff --git a/components/script/dom/webglframebuffer.rs b/components/script/dom/webglframebuffer.rs
index 0ab85f14e2f..df9e194962e 100644
--- a/components/script/dom/webglframebuffer.rs
+++ b/components/script/dom/webglframebuffer.rs
@@ -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),
};