Implement gl.getParameter(gl.ALIASED_POINT_SIZE_RANGE)

This commit is contained in:
Anthony Ramine 2018-03-24 16:12:18 +01:00
parent 2ab34d5969
commit d6ebbd3e17
13 changed files with 230 additions and 32 deletions

View file

@ -16,7 +16,7 @@ compositing = {path = "../compositing"}
cssparser = "0.23.0"
euclid = "0.17"
fnv = "1.0"
gleam = "0.4"
gleam = "0.4.29"
ipc-channel = "0.10"
log = "0.3.5"
num-traits = "0.1.32"

View file

@ -892,6 +892,9 @@ impl WebGLImpl {
ctx.gl().delete_vertex_arrays(&[id.get()]),
WebGLCommand::BindVertexArray(id) =>
ctx.gl().bind_vertex_array(id.map_or(0, WebGLVertexArrayId::get)),
WebGLCommand::AliasedPointSizeRange(sender) => {
sender.send(ctx.gl().alias_point_size_range()).unwrap()
}
}
// TODO: update test expectations in order to enable debug assertions

View file

@ -274,6 +274,7 @@ pub enum WebGLCommand {
CreateVertexArray(WebGLSender<Option<WebGLVertexArrayId>>),
DeleteVertexArray(WebGLVertexArrayId),
BindVertexArray(Option<WebGLVertexArrayId>),
AliasedPointSizeRange(WebGLSender<(f32, f32)>),
}
macro_rules! define_resource_id_struct {
@ -546,7 +547,8 @@ impl fmt::Debug for WebGLCommand {
GenerateMipmap(..) => "GenerateMipmap",
CreateVertexArray(..) => "CreateVertexArray",
DeleteVertexArray(..) => "DeleteVertexArray",
BindVertexArray(..) => "BindVertexArray"
BindVertexArray(..) => "BindVertexArray",
AliasedPointSizeRange(..) => "AliasedPointSizeRange",
};
write!(f, "CanvasWebGLMsg::{}(..)", name)

View file

@ -13,7 +13,7 @@ path = "lib.rs"
[dependencies]
euclid = "0.17"
gfx_traits = {path = "../gfx_traits"}
gleam = "0.4"
gleam = "0.4.29"
image = "0.18"
ipc-channel = "0.10"
libc = "0.2"

View file

@ -45,7 +45,7 @@ domobject_derive = {path = "../domobject_derive"}
encoding_rs = "0.7"
euclid = "0.17"
fnv = "1.0"
gleam = "0.4"
gleam = "0.4.29"
half = "1.0"
html5ever = "0.22"
hyper = "0.10"

View file

@ -1328,6 +1328,14 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
[x, y, width, height].to_jsval(cx, rval.handle_mut());
return rval.get();
}
constants::ALIASED_POINT_SIZE_RANGE => {
let (sender, receiver) = webgl_channel().unwrap();
self.send_command(WebGLCommand::AliasedPointSizeRange(sender));
let (width, height) = receiver.recv().unwrap();
rooted!(in(cx) let mut rval = UndefinedValue());
[width, height].to_jsval(cx, rval.handle_mut());
return rval.get();
}
_ => {
if !self.extension_manager.is_get_parameter_name_enabled(parameter) {
self.webgl_error(WebGLError::InvalidEnum);

View file

@ -40,7 +40,7 @@ devtools_traits = {path = "../devtools_traits"}
env_logger = "0.4"
euclid = "0.17"
gfx = {path = "../gfx"}
gleam = "0.4"
gleam = "0.4.29"
ipc-channel = "0.10"
layout_thread = {path = "../layout_thread"}
log = "0.3"