Skip to content

Commit

Permalink
Implement gl.getParameter(gl.ALIASED_LINE_WIDTH_RANGE)
Browse files Browse the repository at this point in the history
  • Loading branch information
mattnenterprise committed Apr 18, 2018
1 parent be4ac6c commit 36c0e38
Show file tree
Hide file tree
Showing 10 changed files with 31 additions and 24 deletions.
24 changes: 12 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion components/canvas/Cargo.toml
Expand Up @@ -16,7 +16,7 @@ compositing = {path = "../compositing"}
cssparser = "0.23.0"
euclid = "0.17"
fnv = "1.0"
gleam = "0.4.29"
gleam = "0.4.34"
ipc-channel = "0.10"
log = "0.4"
num-traits = "0.1.32"
Expand Down
6 changes: 4 additions & 2 deletions components/canvas/webgl_thread.rs
Expand Up @@ -893,8 +893,10 @@ 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()
WebGLCommand::AliasedPointSizeRange(sender) =>
sender.send(ctx.gl().alias_point_size_range()).unwrap(),
WebGLCommand::AliasedLineWidthRange(sender) => {
sender.send(ctx.gl().alias_line_width_range()).unwrap()
}
}

Expand Down
2 changes: 2 additions & 0 deletions components/canvas_traits/webgl.rs
Expand Up @@ -275,6 +275,7 @@ pub enum WebGLCommand {
DeleteVertexArray(WebGLVertexArrayId),
BindVertexArray(Option<WebGLVertexArrayId>),
AliasedPointSizeRange(WebGLSender<(f32, f32)>),
AliasedLineWidthRange(WebGLSender<(f32, f32)>),
}

macro_rules! define_resource_id_struct {
Expand Down Expand Up @@ -548,6 +549,7 @@ impl fmt::Debug for WebGLCommand {
DeleteVertexArray(..) => "DeleteVertexArray",
BindVertexArray(..) => "BindVertexArray",
AliasedPointSizeRange(..) => "AliasedPointSizeRange",
AliasedLineWidthRange(..) => "AliasedLineWidthRange",
};

write!(f, "CanvasWebGLMsg::{}(..)", name)
Expand Down
2 changes: 1 addition & 1 deletion components/compositing/Cargo.toml
Expand Up @@ -13,7 +13,7 @@ path = "lib.rs"
[dependencies]
euclid = "0.17"
gfx_traits = {path = "../gfx_traits"}
gleam = "0.4.29"
gleam = "0.4.34"
image = "0.18"
ipc-channel = "0.10"
libc = "0.2"
Expand Down
2 changes: 1 addition & 1 deletion components/script/Cargo.toml
Expand Up @@ -45,7 +45,7 @@ domobject_derive = {path = "../domobject_derive"}
encoding_rs = "0.7"
euclid = "0.17"
fnv = "1.0"
gleam = "0.4.29"
gleam = "0.4.34"
half = "1.0"
html5ever = "0.22"
hyper = "0.10"
Expand Down
8 changes: 8 additions & 0 deletions components/script/dom/webglrenderingcontext.rs
Expand Up @@ -1326,6 +1326,14 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
[width, height].to_jsval(cx, rval.handle_mut());
return rval.get();
}
constants::ALIASED_LINE_WIDTH_RANGE => {
let (sender, receiver) = webgl_channel().unwrap();
self.send_command(WebGLCommand::AliasedLineWidthRange(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);
Expand Down
2 changes: 1 addition & 1 deletion components/servo/Cargo.toml
Expand Up @@ -40,7 +40,7 @@ devtools_traits = {path = "../devtools_traits"}
env_logger = "0.5"
euclid = "0.17"
gfx = {path = "../gfx"}
gleam = "0.4.29"
gleam = "0.4.34"
ipc-channel = "0.10"
layout_thread = {path = "../layout_thread"}
log = "0.4"
Expand Down
2 changes: 1 addition & 1 deletion ports/servo/Cargo.toml
Expand Up @@ -37,7 +37,7 @@ unstable = ["libservo/unstable"]
backtrace = "0.3"
bitflags = "1.0"
euclid = "0.17"
gleam = "0.4.29"
gleam = "0.4.34"
glutin = "0.13"
libservo = {path = "../../components/servo"}
log = "0.4"
Expand Down

This file was deleted.

0 comments on commit 36c0e38

Please sign in to comment.