Auto merge of #20648 - mattnenterprise:aliased-line-width-range, r=nox

Implement gl.getParameter(gl.ALIASED_LINE_WIDTH_RANGE)

<!-- Please describe your changes on the following line: -->

Implement gl.getParameter(gl.ALIASED_LINE_WIDTH_RANGE)

---
<!-- 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 build-geckolib` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #20535

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/20648)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2018-04-18 02:05:35 -04:00 committed by GitHub
commit b182d7c2ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 31 additions and 24 deletions

24
Cargo.lock generated
View file

@ -269,7 +269,7 @@ dependencies = [
"cssparser 0.23.2 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.29 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.34 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
"num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)",
@ -330,7 +330,7 @@ name = "cgl"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"gleam 0.4.29 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.34 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -418,7 +418,7 @@ version = "0.0.1"
dependencies = [
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
"gfx_traits 0.0.1",
"gleam 0.4.29 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.34 (registry+https://github.com/rust-lang/crates.io-index)",
"image 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1081,7 +1081,7 @@ dependencies = [
[[package]]
name = "gleam"
version = "0.4.29"
version = "0.4.34"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"gl_generator 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1307,7 +1307,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cgl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.29 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.34 (registry+https://github.com/rust-lang/crates.io-index)",
"leaky-cow 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -1559,7 +1559,7 @@ dependencies = [
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
"gaol 0.0.1 (git+https://github.com/servo/gaol)",
"gfx 0.0.1",
"gleam 0.4.29 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.34 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"layout_thread 0.0.1",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2051,7 +2051,7 @@ dependencies = [
"core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
"gl_generator 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.29 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.34 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libloading 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2497,7 +2497,7 @@ dependencies = [
"encoding_rs 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.29 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.34 (registry+https://github.com/rust-lang/crates.io-index)",
"half 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"html5ever 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.10.13 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2717,7 +2717,7 @@ dependencies = [
"bitflags 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
"gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.29 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.34 (registry+https://github.com/rust-lang/crates.io-index)",
"glutin 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libservo 0.0.1",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2778,7 +2778,7 @@ dependencies = [
"cmake 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
"expat-sys 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.29 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.34 (registry+https://github.com/rust-lang/crates.io-index)",
"glutin 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
"glx 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"io-surface 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -3547,7 +3547,7 @@ dependencies = [
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
"freetype 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.29 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.34 (registry+https://github.com/rust-lang/crates.io-index)",
"image 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -3869,7 +3869,7 @@ dependencies = [
"checksum getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9047cfbd08a437050b363d35ef160452c5fe8ea5187ae0a624708c91581d685"
"checksum gif 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8a80d6fe9e52f637df9afd4779449a7be17c39cc9c35b01589bb833f956ba596"
"checksum gl_generator 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a795170cbd85b5a7baa58d6d7525cae6a03e486859860c220f7ebbbdd379d0a"
"checksum gleam 0.4.29 (registry+https://github.com/rust-lang/crates.io-index)" = "b74def65dc2902b459fc7dd258b10695130408b79fd8f8beb59f475b1536ed81"
"checksum gleam 0.4.34 (registry+https://github.com/rust-lang/crates.io-index)" = "b4e5e2cdcadecdf3886e7808b6a38eae0a48dfe98c5c12b776fc861b80edf4a2"
"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb"
"checksum glutin 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90de8e0391e57098acfbfe693b23065e9186255d370ebae12c933b7d77df8424"
"checksum glx 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "63a6e7c2846e12626455f45ebaff9d92161436dd0fa703d9d198012e528ca7b9"

View file

@ -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"

View file

@ -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()
}
}

View file

@ -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 {
@ -548,6 +549,7 @@ impl fmt::Debug for WebGLCommand {
DeleteVertexArray(..) => "DeleteVertexArray",
BindVertexArray(..) => "BindVertexArray",
AliasedPointSizeRange(..) => "AliasedPointSizeRange",
AliasedLineWidthRange(..) => "AliasedLineWidthRange",
};
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.29"
gleam = "0.4.34"
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.29"
gleam = "0.4.34"
half = "1.0"
html5ever = "0.22"
hyper = "0.10"

View file

@ -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);

View file

@ -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"

View file

@ -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"

View file

@ -1,5 +0,0 @@
[quickCheckAPI-L_S.html]
type: testharness
[WebGL test #0: testValidArgs]
expected: FAIL