mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Implement gl.getParameter(gl.MAX_VIEWPORT_DIMS)
This commit is contained in:
parent
0e6bec65bb
commit
31774e9203
6 changed files with 24 additions and 21 deletions
|
@ -885,6 +885,13 @@ impl WebGLImpl {
|
||||||
}
|
}
|
||||||
sender.send(value[0]).unwrap()
|
sender.send(value[0]).unwrap()
|
||||||
}
|
}
|
||||||
|
WebGLCommand::GetParameterInt2(param, ref sender) => {
|
||||||
|
let mut value = [0; 2];
|
||||||
|
unsafe {
|
||||||
|
ctx.gl().get_integer_v(param as u32, &mut value);
|
||||||
|
}
|
||||||
|
sender.send(value).unwrap()
|
||||||
|
}
|
||||||
WebGLCommand::GetParameterInt4(param, ref sender) => {
|
WebGLCommand::GetParameterInt4(param, ref sender) => {
|
||||||
let mut value = [0; 4];
|
let mut value = [0; 4];
|
||||||
unsafe {
|
unsafe {
|
||||||
|
|
|
@ -268,6 +268,7 @@ pub enum WebGLCommand {
|
||||||
GetParameterBool(ParameterBool, WebGLSender<bool>),
|
GetParameterBool(ParameterBool, WebGLSender<bool>),
|
||||||
GetParameterBool4(ParameterBool4, WebGLSender<[bool; 4]>),
|
GetParameterBool4(ParameterBool4, WebGLSender<[bool; 4]>),
|
||||||
GetParameterInt(ParameterInt, WebGLSender<i32>),
|
GetParameterInt(ParameterInt, WebGLSender<i32>),
|
||||||
|
GetParameterInt2(ParameterInt2, WebGLSender<[i32; 2]>),
|
||||||
GetParameterInt4(ParameterInt4, WebGLSender<[i32; 4]>),
|
GetParameterInt4(ParameterInt4, WebGLSender<[i32; 4]>),
|
||||||
GetParameterFloat(ParameterFloat, WebGLSender<f32>),
|
GetParameterFloat(ParameterFloat, WebGLSender<f32>),
|
||||||
GetParameterFloat2(ParameterFloat2, WebGLSender<[f32; 2]>),
|
GetParameterFloat2(ParameterFloat2, WebGLSender<[f32; 2]>),
|
||||||
|
@ -522,6 +523,9 @@ parameters! {
|
||||||
SubpixelBits = gl::SUBPIXEL_BITS,
|
SubpixelBits = gl::SUBPIXEL_BITS,
|
||||||
UnpackAlignment = gl::UNPACK_ALIGNMENT,
|
UnpackAlignment = gl::UNPACK_ALIGNMENT,
|
||||||
}),
|
}),
|
||||||
|
Int2(ParameterInt2 {
|
||||||
|
MaxViewportDims = gl::MAX_VIEWPORT_DIMS,
|
||||||
|
}),
|
||||||
Int4(ParameterInt4 {
|
Int4(ParameterInt4 {
|
||||||
ScissorBox = gl::SCISSOR_BOX,
|
ScissorBox = gl::SCISSOR_BOX,
|
||||||
Viewport = gl::VIEWPORT,
|
Viewport = gl::VIEWPORT,
|
||||||
|
|
|
@ -1423,6 +1423,17 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
self.send_command(WebGLCommand::GetParameterInt(param, sender));
|
self.send_command(WebGLCommand::GetParameterInt(param, sender));
|
||||||
Int32Value(receiver.recv().unwrap())
|
Int32Value(receiver.recv().unwrap())
|
||||||
}
|
}
|
||||||
|
Parameter::Int2(param) => {
|
||||||
|
let (sender, receiver) = webgl_channel().unwrap();
|
||||||
|
self.send_command(WebGLCommand::GetParameterInt2(param, sender));
|
||||||
|
rooted!(in(cx) let mut rval = ptr::null_mut::<JSObject>());
|
||||||
|
let _ = Int32Array::create(
|
||||||
|
cx,
|
||||||
|
CreateWith::Slice(&receiver.recv().unwrap()),
|
||||||
|
rval.handle_mut(),
|
||||||
|
).unwrap();
|
||||||
|
ObjectValue(rval.get())
|
||||||
|
}
|
||||||
Parameter::Int4(param) => {
|
Parameter::Int4(param) => {
|
||||||
let (sender, receiver) = webgl_channel().unwrap();
|
let (sender, receiver) = webgl_channel().unwrap();
|
||||||
self.send_command(WebGLCommand::GetParameterInt4(param, sender));
|
self.send_command(WebGLCommand::GetParameterInt4(param, sender));
|
||||||
|
|
|
@ -1,12 +1,4 @@
|
||||||
[drawingbuffer-static-canvas-test.html]
|
[drawingbuffer-static-canvas-test.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: ERROR
|
expected: CRASH
|
||||||
[WebGL test #5: maxSize[0\] > 0 should be true. Threw exception TypeError: maxSize is null]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[WebGL test #6: maxSize[1\] > 0 should be true. Threw exception TypeError: maxSize is null]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[WebGL test #7: successfullyParsed should be true (of type boolean). Was undefined (of type undefined).]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
[drawingbuffer-test.html]
|
[drawingbuffer-test.html]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: ERROR
|
expected: CRASH
|
||||||
[WebGL test #3: successfullyParsed should be true (of type boolean). Was undefined (of type undefined).]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
|
|
|
@ -3,15 +3,6 @@
|
||||||
[WebGL test #20: context.getParameter(context.COMPRESSED_TEXTURE_FORMATS) is not an instance of Uint32Array]
|
[WebGL test #20: context.getParameter(context.COMPRESSED_TEXTURE_FORMATS) is not an instance of Uint32Array]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[WebGL test #99: context.getParameter(context.MAX_VIEWPORT_DIMS)[0\] >= window.screen.width should be true. Threw exception TypeError: context.getParameter(...) is null]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[WebGL test #100: context.getParameter(context.MAX_VIEWPORT_DIMS)[1\] >= window.screen.height should be true. Threw exception TypeError: context.getParameter(...) is null]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[WebGL test #101: context.getParameter(context.MAX_VIEWPORT_DIMS) is not an instance of Int32Array]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[WebGL test #310: context.getError() should be 0. Was 1280.]
|
[WebGL test #310: context.getError() should be 0. Was 1280.]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue