diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2018-04-04 15:43:09 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2018-04-04 15:49:21 +0200 |
commit | fc6335c01d2f4e3048f4043070a79100faff16e6 (patch) | |
tree | e2a5fd12d96eb87813ef45cf36ba8c6ad433a78e /components/script/dom | |
parent | 15272d2c3b4683c97ac44065429360016bae998b (diff) | |
download | servo-fc6335c01d2f4e3048f4043070a79100faff16e6.tar.gz servo-fc6335c01d2f4e3048f4043070a79100faff16e6.zip |
Properly allow more than FUNC_ADD in blendEquationSeparate
Diffstat (limited to 'components/script/dom')
-rw-r--r-- | components/script/dom/webglrenderingcontext.rs | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs index 612a62602ef..5819b33357e 100644 --- a/components/script/dom/webglrenderingcontext.rs +++ b/components/script/dom/webglrenderingcontext.rs @@ -1482,17 +1482,25 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext { constants::FUNC_SUBTRACT | constants::FUNC_REVERSE_SUBTRACT => { self.send_command(WebGLCommand::BlendEquation(mode)) - }, - _ => self.webgl_error(InvalidEnum) + } + _ => self.webgl_error(InvalidEnum), } } // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3 fn BlendEquationSeparate(&self, mode_rgb: u32, mode_alpha: u32) { - if mode_rgb != constants::FUNC_ADD || mode_alpha != constants::FUNC_ADD { - return self.webgl_error(InvalidEnum); + match mode_rgb { + constants::FUNC_ADD | + constants::FUNC_SUBTRACT | + constants::FUNC_REVERSE_SUBTRACT => {}, + _ => return self.webgl_error(InvalidEnum), + } + match mode_alpha { + constants::FUNC_ADD | + constants::FUNC_SUBTRACT | + constants::FUNC_REVERSE_SUBTRACT => {}, + _ => return self.webgl_error(InvalidEnum), } - self.send_command(WebGLCommand::BlendEquationSeparate(mode_rgb, mode_alpha)); } |