aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/webglframebuffer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/dom/webglframebuffer.rs')
-rw-r--r--components/script/dom/webglframebuffer.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/components/script/dom/webglframebuffer.rs b/components/script/dom/webglframebuffer.rs
index c2798ba4620..53d72857b54 100644
--- a/components/script/dom/webglframebuffer.rs
+++ b/components/script/dom/webglframebuffer.rs
@@ -203,6 +203,16 @@ impl WebGLFramebuffer {
return self.status.get();
}
+ pub fn check_status_for_rendering(&self) -> u32 {
+ let result = self.check_status();
+ if result == constants::FRAMEBUFFER_COMPLETE {
+ if self.color.borrow().is_none() {
+ return constants::FRAMEBUFFER_INCOMPLETE_ATTACHMENT;
+ }
+ }
+ result
+ }
+
pub fn renderbuffer(&self, attachment: u32, rb: Option<&WebGLRenderbuffer>) -> WebGLResult<()> {
let binding = match attachment {
constants::COLOR_ATTACHMENT0 => &self.color,