diff options
author | Eric Anholt <eric@anholt.net> | 2016-11-05 10:30:40 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2016-11-05 10:30:40 -0700 |
commit | bf5a3db745151f79aaa6cd45d4a1ebd4648bcb62 (patch) | |
tree | 320b2b713d556328c0e30b1db74e879c3f26ec11 /components/script/dom/webglframebuffer.rs | |
parent | 59634cf78e002eaae971524c21ef0f3462f11dac (diff) | |
download | servo-bf5a3db745151f79aaa6cd45d4a1ebd4648bcb62.tar.gz servo-bf5a3db745151f79aaa6cd45d4a1ebd4648bcb62.zip |
webgl: Don't update texture attachment state if we throw an error.
If we're going to return from this function without updating the
underlying GL state because of a WebGLError, we shouldn't have updated
our shadow of the GL state.
Diffstat (limited to 'components/script/dom/webglframebuffer.rs')
-rw-r--r-- | components/script/dom/webglframebuffer.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/components/script/dom/webglframebuffer.rs b/components/script/dom/webglframebuffer.rs index 029c794616c..44f9586adb1 100644 --- a/components/script/dom/webglframebuffer.rs +++ b/components/script/dom/webglframebuffer.rs @@ -190,11 +190,6 @@ impl WebGLFramebuffer { // Note, from the GLES 2.0.25 spec, page 113: // "If texture is zero, then textarget and level are ignored." Some(texture) => { - *binding.borrow_mut() = Some(WebGLFramebufferAttachment::Texture { - texture: JS::from_ref(texture), - level: level } - ); - // From the GLES 2.0.25 spec, page 113: // // "level specifies the mipmap level of the texture image @@ -234,6 +229,11 @@ impl WebGLFramebuffer { _ => return Err(WebGLError::InvalidOperation), } + *binding.borrow_mut() = Some(WebGLFramebufferAttachment::Texture { + texture: JS::from_ref(texture), + level: level } + ); + Some(texture.id()) } |