mirror of
https://github.com/servo/servo.git
synced 2025-07-01 20:43:39 +01:00
Properly allow more than FUNC_ADD in blendEquationSeparate
This commit is contained in:
parent
15272d2c3b
commit
fc6335c01d
1 changed files with 13 additions and 5 deletions
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue