diff options
author | Eric Anholt <eric@anholt.net> | 2016-10-30 18:41:04 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2016-11-05 10:30:15 -0700 |
commit | 59634cf78e002eaae971524c21ef0f3462f11dac (patch) | |
tree | 2a5020867e330a33aee991552563b7fcda5d0d56 /components/script/dom/webglframebuffer.rs | |
parent | 08938499a0bfbc0b2c52fd1f7d29c57fceab6c76 (diff) | |
download | servo-59634cf78e002eaae971524c21ef0f3462f11dac.tar.gz servo-59634cf78e002eaae971524c21ef0f3462f11dac.zip |
webgl: Track the level with texture attachments.
We need this to be able to get the size of the attached texture for
completeness validation.
Signed-off-by: Eric Anholt <eric@anholt.net>
Diffstat (limited to 'components/script/dom/webglframebuffer.rs')
-rw-r--r-- | components/script/dom/webglframebuffer.rs | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/components/script/dom/webglframebuffer.rs b/components/script/dom/webglframebuffer.rs index 8e22f17d079..029c794616c 100644 --- a/components/script/dom/webglframebuffer.rs +++ b/components/script/dom/webglframebuffer.rs @@ -21,7 +21,7 @@ use webrender_traits::{WebGLCommand, WebGLFramebufferBindingRequest, WebGLFrameb #[derive(JSTraceable, Clone, HeapSizeOf)] enum WebGLFramebufferAttachment { Renderbuffer(JS<WebGLRenderbuffer>), - Texture(JS<WebGLTexture>), + Texture { texture: JS<WebGLTexture>, level: i32 }, } impl HeapGCValue for WebGLFramebufferAttachment {} @@ -190,7 +190,10 @@ 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(JS::from_ref(texture))); + *binding.borrow_mut() = Some(WebGLFramebufferAttachment::Texture { + texture: JS::from_ref(texture), + level: level } + ); // From the GLES 2.0.25 spec, page 113: // @@ -282,7 +285,7 @@ impl WebGLFramebuffer { for attachment in &attachments { let matched = { match *attachment.borrow() { - Some(WebGLFramebufferAttachment::Texture(ref att_texture)) + Some(WebGLFramebufferAttachment::Texture { texture: ref att_texture, .. }) if texture.id() == att_texture.id() => true, _ => false, } |