mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Auto merge of #20754 - anholt:webgl-fixes, r=emilio
Webgl fixes <!-- Please describe your changes on the following line: --> Add gl.getParameter() support for webgl unpack settings, and remove some unreachable and incorrect error-generation code --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] These changes fix #20372 - [x] These changes fix #20553 - [x] These changes fix #20554 <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20754) <!-- Reviewable:end -->
This commit is contained in:
commit
a4b298c002
2 changed files with 9 additions and 13 deletions
|
@ -1326,6 +1326,14 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
"WebGL GLSL ES 1.0".to_jsval(cx, rval.handle_mut());
|
"WebGL GLSL ES 1.0".to_jsval(cx, rval.handle_mut());
|
||||||
return rval.get();
|
return rval.get();
|
||||||
}
|
}
|
||||||
|
constants::UNPACK_FLIP_Y_WEBGL => {
|
||||||
|
let unpack = self.texture_unpacking_settings.get();
|
||||||
|
return BooleanValue(unpack.contains(TextureUnpacking::FLIP_Y_AXIS));
|
||||||
|
}
|
||||||
|
constants::UNPACK_PREMULTIPLY_ALPHA_WEBGL => {
|
||||||
|
let unpack = self.texture_unpacking_settings.get();
|
||||||
|
return BooleanValue(unpack.contains(TextureUnpacking::PREMULTIPLY_ALPHA));
|
||||||
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1412,13 +1420,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
let (sender, receiver) = webgl_channel().unwrap();
|
let (sender, receiver) = webgl_channel().unwrap();
|
||||||
self.send_command(WebGLCommand::GetTexParameter(target, pname, sender));
|
self.send_command(WebGLCommand::GetTexParameter(target, pname, sender));
|
||||||
|
|
||||||
match receiver.recv().unwrap() {
|
Int32Value(receiver.recv().unwrap())
|
||||||
value if value != 0 => Int32Value(value),
|
|
||||||
_ => {
|
|
||||||
self.webgl_error(InvalidEnum);
|
|
||||||
NullValue()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3
|
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3
|
||||||
|
|
|
@ -57,12 +57,6 @@
|
||||||
[WebGL test #47: context.getParameter(context.SCISSOR_TEST) should be false (of type boolean). Was null (of type object).]
|
[WebGL test #47: context.getParameter(context.SCISSOR_TEST) should be false (of type boolean). Was null (of type object).]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[WebGL test #85: context.getParameter(context.UNPACK_FLIP_Y_WEBGL) should be false (of type boolean). Was null (of type object).]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[WebGL test #86: context.getParameter(context.UNPACK_PREMULTIPLY_ALPHA_WEBGL) should be false (of type boolean). Was null (of type object).]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[WebGL test #88: context.getParameter(context.VIEWPORT) is not an instance of Int32Array]
|
[WebGL test #88: context.getParameter(context.VIEWPORT) is not an instance of Int32Array]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue