aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/webglframebuffer.rs
diff options
context:
space:
mode:
authorteapotd <teapot404@gmail.com>2019-10-31 19:20:52 +0100
committerteapotd <teapot404@gmail.com>2019-11-01 14:48:16 +0100
commita4fa36f9fb540357b8c9452598b729fba6688c46 (patch)
treea8f6c58f02634c3513c4784b8af465c548f55088 /components/script/dom/webglframebuffer.rs
parent48d918dcdead5fcf38dbda1dfc0d0ca8284108c2 (diff)
downloadservo-a4fa36f9fb540357b8c9452598b729fba6688c46.tar.gz
servo-a4fa36f9fb540357b8c9452598b729fba6688c46.zip
Store Option<ImageInfo> instead of making fields optional
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 3a31e99be33..7e96edb4baf 100644
--- a/components/script/dom/webglframebuffer.rs
+++ b/components/script/dom/webglframebuffer.rs
@@ -221,12 +221,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),
};