From 59634cf78e002eaae971524c21ef0f3462f11dac Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Sun, 30 Oct 2016 18:41:04 -0700 Subject: 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 --- components/script/dom/webglframebuffer.rs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'components/script/dom/webglframebuffer.rs') 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), - Texture(JS), + Texture { texture: JS, 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, } -- cgit v1.2.3