Bug 1498732 - Update gleam to 0.6.9. r=kats
authorJamie Nicol <jnicol@mozilla.com>
Mon, 25 Feb 2019 14:59:01 +0000
changeset 460896 dd8f4d598a431d201ac936435c1b8b96dfcd2dde
parent 460895 e0f409bac9bd1b62d3cb7fa75352e4192f0d8422
child 460897 a9eee2d6d9b84752ec885fe2f55a4c3c4337b83f
push id35613
push usernerli@mozilla.com
push dateTue, 26 Feb 2019 03:52:35 +0000
treeherdermozilla-central@faec87a80ed1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1498732
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1498732 - Update gleam to 0.6.9. r=kats This provides the functions glMapBufferRange and glUnmapBuffer. Differential Revision: https://phabricator.services.mozilla.com/D20491
Cargo.lock
gfx/webrender_bindings/Cargo.toml
gfx/wr/Cargo.lock
gfx/wr/webrender/Cargo.toml
third_party/rust/gleam/.cargo-checksum.json
third_party/rust/gleam/Cargo.toml
third_party/rust/gleam/build.rs
third_party/rust/gleam/rustfmt.toml
third_party/rust/gleam/src/gl.rs
third_party/rust/gleam/src/gl_fns.rs
third_party/rust/gleam/src/gles_fns.rs
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -1158,17 +1158,17 @@ source = "registry+https://github.com/ru
 dependencies = [
  "khronos_api 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "xml-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "gleam"
-version = "0.6.8"
+version = "0.6.9"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "gl_generator 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "glob"
 version = "0.2.11"
@@ -3089,17 +3089,17 @@ dependencies = [
  "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-foundation 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-graphics 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-text 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "cstr 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "dwrote 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "freetype 0.4.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.6.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gleam 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)",
  "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.2.43 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "malloc_size_of_derive 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "num-traits 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "plane-split 0.13.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "rayon 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "ron 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -3140,17 +3140,17 @@ dependencies = [
  "app_units 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "bincode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-foundation 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-graphics 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "dwrote 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "euclid 0.19.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "foreign-types 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.6.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gleam 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "nsstring 0.1.0",
  "rayon 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "thread_profiler 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "uuid 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "webrender 0.60.0",
 ]
 
@@ -3393,17 +3393,17 @@ dependencies = [
 "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
 "checksum futures 0.1.23 (registry+https://github.com/rust-lang/crates.io-index)" = "884dbe32a6ae4cd7da5c6db9b78114449df9953b8d490c9d7e1b51720b922c62"
 "checksum futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4"
 "checksum fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c"
 "checksum gcc 0.3.54 (registry+https://github.com/rust-lang/crates.io-index)" = "5e33ec290da0d127825013597dbdfc28bee4964690c7ce1166cbc2a7bd08b1bb"
 "checksum generic-array 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3c0f28c2f5bfb5960175af447a2da7c18900693738343dc896ffbcabd9839592"
 "checksum generic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ef25c5683767570c2bbd7deba372926a55eaae9982d7726ee2a1050239d45b9d"
 "checksum gl_generator 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a0ffaf173cf76c73a73e080366bf556b4776ece104b06961766ff11449f38604"
-"checksum gleam 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)" = "4b47f5b15742aee359c7895ab98cf2cceecc89bb4feb6f4e42f802d7899877da"
+"checksum gleam 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)" = "369e326d40628f4013f5754fbcf4b01eb999b9d0f13795a1b9d20f3288ab799f"
 "checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb"
 "checksum goblin 0.0.17 (registry+https://github.com/rust-lang/crates.io-index)" = "5911d7df7b8f65ab676c5327b50acea29d3c6a1a4ad05e444cf5dce321b26db2"
 "checksum h2 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "a27e7ed946e8335bdf9a191bc1b9b14a03ba822d013d2f58437f4fabcbd7fc2c"
 "checksum http 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "dca621d0fa606a5ff2850b6e337b57ad6137ee4d67e940449643ff45af6874c6"
 "checksum httparse 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "af2f2dd97457e8fb1ae7c5a420db346af389926e36f43768b96f101546b04a07"
 "checksum humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0484fda3e7007f2a4a0d9c3a703ca38c71c54c55602ce4660c419fd32e188c9e"
 "checksum hyper 0.12.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c087746de95e20e4dabe86606c3a019964a8fde2d5f386152939063c116c5971"
 "checksum ident_case 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3c9826188e666f2ed92071d2dadef6edc430b11b158b5b2b3f4babbcc891eaaa"
--- a/gfx/webrender_bindings/Cargo.toml
+++ b/gfx/webrender_bindings/Cargo.toml
@@ -4,17 +4,17 @@ version = "0.1.0"
 authors = ["The Mozilla Project Developers"]
 license = "MPL-2.0"
 
 [dependencies]
 rayon = "1"
 thread_profiler = "0.1.1"
 euclid = { version = "0.19.4", features = ["serde"] }
 app_units = "0.7"
-gleam = "0.6.8"
+gleam = "0.6.9"
 log = "0.4"
 nsstring = { path = "../../xpcom/rust/nsstring" } 
 bincode = "1.0"
 uuid = { version = "0.6", features = ["v4"] }
 fxhash = "0.2.1"
 
 [dependencies.webrender]
 path = "../wr/webrender"
--- a/gfx/wr/Cargo.lock
+++ b/gfx/wr/Cargo.lock
@@ -138,17 +138,17 @@ name = "cfg-if"
 version = "0.1.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 
 [[package]]
 name = "cgl"
 version = "0.2.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
- "gleam 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gleam 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "clap"
 version = "2.31.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
@@ -365,17 +365,17 @@ dependencies = [
  "generic-array 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "direct-composition"
 version = "0.1.0"
 dependencies = [
  "euclid 0.19.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "gleam 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gleam 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)",
  "mozangle 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "webrender 0.60.0",
  "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "winit 0.16.2 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "dlib"
@@ -564,17 +564,17 @@ source = "registry+https://github.com/ru
 dependencies = [
  "khronos_api 3.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "xml-rs 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "gleam"
-version = "0.6.8"
+version = "0.6.9"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 dependencies = [
  "gl_generator 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "glutin"
 version = "0.17.0"
@@ -1640,17 +1640,17 @@ dependencies = [
  "cfg-if 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-foundation 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-graphics 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-text 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "cstr 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "dwrote 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "freetype 0.4.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.6.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gleam 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)",
  "image 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "libc 0.2.42 (registry+https://github.com/rust-lang/crates.io-index)",
  "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "malloc_size_of_derive 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "mozangle 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "num-traits 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
  "pathfinder_font_renderer 0.5.0 (git+https://github.com/pcwalton/pathfinder?branch=webrender)",
@@ -1676,17 +1676,17 @@ dependencies = [
 
 [[package]]
 name = "webrender-examples"
 version = "0.1.0"
 dependencies = [
  "app_units 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
  "euclid 0.19.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "gleam 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gleam 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)",
  "glutin 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "rayon 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "webrender 0.60.0",
  "winit 0.16.2 (registry+https://github.com/rust-lang/crates.io-index)",
 ]
 
 [[package]]
 name = "webrender_api"
@@ -1794,17 +1794,17 @@ dependencies = [
  "clap 2.31.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-foundation 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "core-graphics 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)",
  "crossbeam 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)",
  "dwrote 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
  "euclid 0.19.5 (registry+https://github.com/rust-lang/crates.io-index)",
  "font-loader 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "gleam 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)",
+ "gleam 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)",
  "glutin 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)",
  "image 0.21.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)",
  "mozangle 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
  "osmesa-src 0.1.1 (git+https://github.com/servo/osmesa-src)",
  "osmesa-sys 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
  "ron 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1941,17 +1941,17 @@ dependencies = [
 "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82"
 "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
 "checksum fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c"
 "checksum gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0912515a8ff24ba900422ecda800b52f4016a56251922d397c576bf92c690518"
 "checksum generic-array 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3c0f28c2f5bfb5960175af447a2da7c18900693738343dc896ffbcabd9839592"
 "checksum gif 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff3414b424657317e708489d2857d9575f4403698428b040b609b9d1c1a84a2c"
 "checksum gl_generator 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a0ffaf173cf76c73a73e080366bf556b4776ece104b06961766ff11449f38604"
 "checksum gl_generator 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a795170cbd85b5a7baa58d6d7525cae6a03e486859860c220f7ebbbdd379d0a"
-"checksum gleam 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)" = "4b47f5b15742aee359c7895ab98cf2cceecc89bb4feb6f4e42f802d7899877da"
+"checksum gleam 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)" = "369e326d40628f4013f5754fbcf4b01eb999b9d0f13795a1b9d20f3288ab799f"
 "checksum glutin 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a70c5fe78efbd5a3b243a804ea1032053c584510f8822819f94cfb29b2100317"
 "checksum half 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d5c5f71a723d10dfc58927cbed37c3071a50afc7f073d86fd7d3e5727db890f"
 "checksum httparse 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "c2f407128745b78abc95c0ffbe4e5d37427fdc0d45470710cfef8c44522a2e37"
 "checksum humantime 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0484fda3e7007f2a4a0d9c3a703ca38c71c54c55602ce4660c419fd32e188c9e"
 "checksum idna 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "014b298351066f1512874135335d62a789ffe78a9974f94b43ed5621951eaf7d"
 "checksum image 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)" = "52fb0666a1273dac46f9725aa4859bcd5595fc3554cf3495051b4de8db745e7d"
 "checksum inflate 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4ec18d981200fd14e65ee8e35fb60ed1ce55227a02407303f3a72517c6146dcc"
 "checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08"
--- a/gfx/wr/webrender/Cargo.toml
+++ b/gfx/wr/webrender/Cargo.toml
@@ -25,17 +25,17 @@ webrender_build = { version = "0.0.1", p
 app_units = "0.7"
 base64 = { optional = true, version = "0.10" }
 bincode = "1.0"
 bitflags = "1.0"
 byteorder = "1.0"
 cfg-if = "0.1.2"
 cstr = "0.1.2"
 fxhash = "0.2.1"
-gleam = "0.6.8"
+gleam = "0.6.9"
 image = { optional = true, version = "0.21" }
 lazy_static = "1"
 log = "0.4"
 malloc_size_of_derive = "0.1"
 num-traits = "0.2"
 plane-split = "0.13.3"
 png = { optional = true, version = "0.14" }
 rayon = "1"
--- a/third_party/rust/gleam/.cargo-checksum.json
+++ b/third_party/rust/gleam/.cargo-checksum.json
@@ -1,1 +1,1 @@
-{"files":{"COPYING":"ec82b96487e9e778ee610c7ab245162464782cfa1f555c2299333f8dbe5c036a","Cargo.toml":"4bb3cfbab2fff43adff71eb4fa74ffa377c311775d89481fb5fb0c5959cd7724","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"62065228e42caebca7e7d7db1204cbb867033de5982ca4009928915e4095f3a3","README.md":"1acb12040be43a3582d5897f11870b3ffdcd7ce0f4f32de158175bb6b33ec0b7","build.rs":"5a9444663f14ecfc4a692409f946ed635c708b480a987b420a2dd15da600228d","src/gl.rs":"7f922e7a2816f12effe22f63e83cb691a0f2a5a92b6434f9af105b7beaa1997f","src/gl_fns.rs":"43302c33d181f897c07f79c677d0183bbb6c15dbffe1b92763c0531aec0b305e","src/gles_fns.rs":"fc67b18cf11c661f8b7031142c762dd1c011550bb9d606a6f78a443c30ba8240","src/lib.rs":"16610c19b45a3f26d56b379a3591aa2e4fc9477e7bd88f86b31c6ea32e834861"},"package":"4b47f5b15742aee359c7895ab98cf2cceecc89bb4feb6f4e42f802d7899877da"}
\ No newline at end of file
+{"files":{"COPYING":"ec82b96487e9e778ee610c7ab245162464782cfa1f555c2299333f8dbe5c036a","Cargo.toml":"e65d462eab3f4a4f9c0978884655399048fdc582b69f2312c2ab4b2fefc501d0","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"62065228e42caebca7e7d7db1204cbb867033de5982ca4009928915e4095f3a3","README.md":"1acb12040be43a3582d5897f11870b3ffdcd7ce0f4f32de158175bb6b33ec0b7","build.rs":"9881de207dd6a0347e66df9190ad0a095a2d7f0f32eff567f9ae7eb7de04c59b","rustfmt.toml":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","src/gl.rs":"7cf869b947e5e3f4bf557f710c48769c07f052b7ec350294f976f9da43b4967f","src/gl_fns.rs":"1d600ffc2644341e85ca0e306d65d9145cbd49fcce799245c953ff90fda064e3","src/gles_fns.rs":"94ad2a3966744eaad34d070332028e21cdb54a398869a4b4adf24748d0b34d2b","src/lib.rs":"16610c19b45a3f26d56b379a3591aa2e4fc9477e7bd88f86b31c6ea32e834861"},"package":"369e326d40628f4013f5754fbcf4b01eb999b9d0f13795a1b9d20f3288ab799f"}
\ No newline at end of file
--- a/third_party/rust/gleam/Cargo.toml
+++ b/third_party/rust/gleam/Cargo.toml
@@ -7,17 +7,17 @@
 #
 # If you believe there's an error in this file please file an
 # issue against the rust-lang/cargo repository. If you're
 # editing this file be aware that the upstream Cargo.toml
 # will likely look very different (and much more reasonable)
 
 [package]
 name = "gleam"
-version = "0.6.8"
+version = "0.6.9"
 authors = ["The Servo Project Developers"]
 build = "build.rs"
 description = "Generated OpenGL bindings and wrapper for Servo."
 documentation = "https://doc.servo.org/gleam/"
 license = "Apache-2.0/MIT"
 repository = "https://github.com/servo/gleam"
 [build-dependencies.gl_generator]
 version = "0.10"
--- a/third_party/rust/gleam/build.rs
+++ b/third_party/rust/gleam/build.rs
@@ -1,18 +1,19 @@
 extern crate gl_generator;
 
+use gl_generator::{Api, Fallbacks, Profile, Registry};
 use std::env;
 use std::fs::File;
 use std::path::Path;
-use gl_generator::{Registry, Api, Profile, Fallbacks};
 
 fn main() {
     let dest = env::var("OUT_DIR").unwrap();
-    let mut file_gl_and_gles = File::create(&Path::new(&dest).join("gl_and_gles_bindings.rs")).unwrap();
+    let mut file_gl_and_gles =
+        File::create(&Path::new(&dest).join("gl_and_gles_bindings.rs")).unwrap();
     let mut file_gl = File::create(&Path::new(&dest).join("gl_bindings.rs")).unwrap();
     let mut file_gles = File::create(&Path::new(&dest).join("gles_bindings.rs")).unwrap();
 
     // OpenGL 3.3 bindings
     let gl_extensions = [
         "GL_APPLE_client_storage",
         "GL_APPLE_fence",
         "GL_APPLE_texture_range",
@@ -21,35 +22,50 @@ fn main() {
         "GL_ARB_get_program_binary",
         "GL_ARB_invalidate_subdata",
         "GL_ARB_texture_rectangle",
         "GL_ARB_texture_storage",
         "GL_EXT_debug_marker",
         "GL_EXT_texture_filter_anisotropic",
         "GL_KHR_debug",
     ];
-    let gl_reg = Registry::new(Api::Gl, (3, 3), Profile::Compatibility, Fallbacks::All, gl_extensions);
-    gl_reg.write_bindings(gl_generator::StructGenerator, &mut file_gl)
+    let gl_reg = Registry::new(
+        Api::Gl,
+        (3, 3),
+        Profile::Compatibility,
+        Fallbacks::All,
+        gl_extensions,
+    );
+    gl_reg
+        .write_bindings(gl_generator::StructGenerator, &mut file_gl)
         .unwrap();
 
     // GLES 3.0 bindings
     let gles_extensions = [
         "GL_EXT_copy_image",
         "GL_EXT_debug_marker",
         "GL_EXT_disjoint_timer_query",
         "GL_EXT_shader_texture_lod",
         "GL_EXT_texture_filter_anisotropic",
         "GL_EXT_texture_format_BGRA8888",
         "GL_EXT_texture_storage",
         "GL_KHR_debug",
         "GL_OES_EGL_image_external",
         "GL_OES_EGL_image",
         "GL_OES_texture_half_float",
     ];
-    let gles_reg = Registry::new(Api::Gles2, (3, 0), Profile::Core, Fallbacks::All, gles_extensions);
-    gles_reg.write_bindings(gl_generator::StructGenerator, &mut file_gles)
+    let gles_reg = Registry::new(
+        Api::Gles2,
+        (3, 0),
+        Profile::Core,
+        Fallbacks::All,
+        gles_extensions,
+    );
+    gles_reg
+        .write_bindings(gl_generator::StructGenerator, &mut file_gles)
         .unwrap();
 
     // OpenGL 3.3 + GLES 3.0 bindings. Used to get all enums
     let gl_reg = gl_reg + gles_reg;
-    gl_reg.write_bindings(gl_generator::StructGenerator, &mut file_gl_and_gles)
+    gl_reg
+        .write_bindings(gl_generator::StructGenerator, &mut file_gl_and_gles)
         .unwrap();
 }
new file mode 100644
--- a/third_party/rust/gleam/src/gl.rs
+++ b/third_party/rust/gleam/src/gl.rs
@@ -2,43 +2,43 @@
 // file at the top-level directory of this distribution.
 //
 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+use ffi;
+use std::ffi::{CStr, CString};
 use std::mem;
 use std::mem::size_of;
 use std::os::raw::{c_char, c_int, c_void};
 use std::ptr;
 use std::rc::Rc;
 use std::str;
-use std::ffi::{CString, CStr};
-use ffi;
 
 pub use ffi::types::*;
 pub use ffi::*;
 
 pub use ffi_gl::Gl as GlFfi;
 pub use ffi_gles::Gles2 as GlesFfi;
 
 #[derive(Debug, Eq, PartialEq)]
 pub enum GlType {
     Gl,
     Gles,
 }
 
 impl Default for GlType {
-    #[cfg(any(target_os="android", target_os="ios"))]
+    #[cfg(any(target_os = "android", target_os = "ios"))]
     fn default() -> GlType {
         GlType::Gles
     }
-    #[cfg(not(any(target_os="android", target_os="ios")))]
+    #[cfg(not(any(target_os = "android", target_os = "ios")))]
     fn default() -> GlType {
         GlType::Gl
     }
 }
 
 fn calculate_length(width: GLsizei, height: GLsizei, format: GLenum, pixel_type: GLenum) -> usize {
     let colors = match format {
         ffi::RED => 1,
@@ -97,16 +97,22 @@ declare_gl_apis! {
                             size: GLsizeiptr,
                             data: *const GLvoid,
                             usage: GLenum);
     fn buffer_sub_data_untyped(&self,
                                 target: GLenum,
                                 offset: isize,
                                 size: GLsizeiptr,
                                 data: *const GLvoid);
+    fn map_buffer_range(&self,
+                        target: GLenum,
+                        offset: GLintptr,
+                        length: GLsizeiptr,
+                        access: GLbitfield) -> *mut c_void;
+    fn unmap_buffer(&self, target: GLenum) -> GLboolean;
     fn tex_buffer(&self, target: GLenum, internal_format: GLenum, buffer: GLuint);
     fn shader_source(&self, shader: GLuint, strings: &[&[u8]]);
     fn read_buffer(&self, mode: GLenum);
     fn read_pixels_into_buffer(&self,
                                 x: GLint,
                                 y: GLint,
                                 width: GLsizei,
                                 height: GLsizei,
@@ -549,32 +555,38 @@ pub struct ErrorCheckingGl {
 impl ErrorCheckingGl {
     pub fn wrap(fns: Rc<Gl>) -> Rc<Gl> {
         Rc::new(ErrorCheckingGl { gl: fns }) as Rc<Gl>
     }
 }
 
 #[inline]
 pub fn buffer_data<T>(gl_: &Gl, target: GLenum, data: &[T], usage: GLenum) {
-    gl_.buffer_data_untyped(target,
-                            (data.len() * size_of::<T>()) as GLsizeiptr,
-                            data.as_ptr() as *const GLvoid,
-                            usage)
+    gl_.buffer_data_untyped(
+        target,
+        (data.len() * size_of::<T>()) as GLsizeiptr,
+        data.as_ptr() as *const GLvoid,
+        usage,
+    )
 }
 
 #[inline]
 pub fn buffer_data_raw<T>(gl_: &Gl, target: GLenum, data: &T, usage: GLenum) {
-    gl_.buffer_data_untyped(target,
-                            size_of::<T>() as GLsizeiptr,
-                            data as *const T as *const GLvoid,
-                            usage)
+    gl_.buffer_data_untyped(
+        target,
+        size_of::<T>() as GLsizeiptr,
+        data as *const T as *const GLvoid,
+        usage,
+    )
 }
 
 #[inline]
 pub fn buffer_sub_data<T>(gl_: &Gl, target: GLenum, offset: isize, data: &[T]) {
-    gl_.buffer_sub_data_untyped(target,
-                                offset,
-                                (data.len() * size_of::<T>()) as GLsizeiptr,
-                                data.as_ptr() as *const GLvoid);
+    gl_.buffer_sub_data_untyped(
+        target,
+        offset,
+        (data.len() * size_of::<T>()) as GLsizeiptr,
+        data.as_ptr() as *const GLvoid,
+    );
 }
 
 include!("gl_fns.rs");
 include!("gles_fns.rs");
--- a/third_party/rust/gleam/src/gl_fns.rs
+++ b/third_party/rust/gleam/src/gl_fns.rs
@@ -6,55 +6,81 @@
 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
 pub struct GlFns {
     ffi_gl_: GlFfi,
 }
 
-impl GlFns
-{
-    pub unsafe fn load_with<'a, F>(loadfn: F) -> Rc<Gl> where F: FnMut(&str) -> *const c_void {
+impl GlFns {
+    pub unsafe fn load_with<'a, F>(loadfn: F) -> Rc<Gl>
+    where
+        F: FnMut(&str) -> *const c_void,
+    {
         let ffi_gl_ = GlFfi::load_with(loadfn);
-        Rc::new(GlFns {
-            ffi_gl_: ffi_gl_,
-        }) as Rc<Gl>
+        Rc::new(GlFns { ffi_gl_: ffi_gl_ }) as Rc<Gl>
     }
 }
 
 impl Gl for GlFns {
     fn get_type(&self) -> GlType {
         GlType::Gl
     }
 
-    fn buffer_data_untyped(&self, target: GLenum, size: GLsizeiptr, data: *const GLvoid, usage: GLenum) {
+    fn buffer_data_untyped(
+        &self,
+        target: GLenum,
+        size: GLsizeiptr,
+        data: *const GLvoid,
+        usage: GLenum,
+    ) {
         unsafe {
-            self.ffi_gl_.BufferData(target,
-                                    size,
-                                    data,
-                                    usage);
+            self.ffi_gl_.BufferData(target, size, data, usage);
         }
     }
 
-    fn buffer_sub_data_untyped(&self, target: GLenum, offset: isize, size: GLsizeiptr, data: *const GLvoid) {
+    fn buffer_sub_data_untyped(
+        &self,
+        target: GLenum,
+        offset: isize,
+        size: GLsizeiptr,
+        data: *const GLvoid,
+    ) {
         unsafe {
-            self.ffi_gl_.BufferSubData(target,
-                                       offset,
-                                       size,
-                                       data);
+            self.ffi_gl_.BufferSubData(target, offset, size, data);
+        }
+    }
+
+    fn map_buffer_range(&self,
+                        target: GLenum,
+                        offset: GLintptr,
+                        length: GLsizeiptr,
+                        access: GLbitfield) -> *mut c_void {
+        unsafe {
+            return self.ffi_gl_.MapBufferRange(target, offset, length, access);
+        }
+    }
+
+    fn unmap_buffer(&self, target: GLenum) -> GLboolean {
+        unsafe {
+            return self.ffi_gl_.UnmapBuffer(target);
         }
     }
 
     fn shader_source(&self, shader: GLuint, strings: &[&[u8]]) {
         let pointers: Vec<*const u8> = strings.iter().map(|string| (*string).as_ptr()).collect();
         let lengths: Vec<GLint> = strings.iter().map(|string| string.len() as GLint).collect();
         unsafe {
-            self.ffi_gl_.ShaderSource(shader, pointers.len() as GLsizei,
-                                      pointers.as_ptr() as *const *const GLchar, lengths.as_ptr());
+            self.ffi_gl_.ShaderSource(
+                shader,
+                pointers.len() as GLsizei,
+                pointers.as_ptr() as *const *const GLchar,
+                lengths.as_ptr(),
+            );
         }
         drop(lengths);
         drop(pointers);
     }
 
     fn tex_buffer(&self, target: GLenum, internal_format: GLenum, buffer: GLuint) {
         unsafe {
             self.ffi_gl_.TexBuffer(target, internal_format, buffer);
@@ -62,35 +88,69 @@ impl Gl for GlFns {
     }
 
     fn read_buffer(&self, mode: GLenum) {
         unsafe {
             self.ffi_gl_.ReadBuffer(mode);
         }
     }
 
-    fn read_pixels_into_buffer(&self, x: GLint, y: GLint, width: GLsizei, height: GLsizei,
-                               format: GLenum, pixel_type: GLenum, dst_buffer: &mut [u8]) {
+    fn read_pixels_into_buffer(
+        &self,
+        x: GLint,
+        y: GLint,
+        width: GLsizei,
+        height: GLsizei,
+        format: GLenum,
+        pixel_type: GLenum,
+        dst_buffer: &mut [u8],
+    ) {
         // Assumes that the user properly allocated the size for dst_buffer.
         assert!(calculate_length(width, height, format, pixel_type) == dst_buffer.len());
 
         unsafe {
             // We don't want any alignment padding on pixel rows.
             self.ffi_gl_.PixelStorei(ffi::PACK_ALIGNMENT, 1);
-            self.ffi_gl_.ReadPixels(x, y, width, height, format, pixel_type, dst_buffer.as_mut_ptr() as *mut c_void);
+            self.ffi_gl_.ReadPixels(
+                x,
+                y,
+                width,
+                height,
+                format,
+                pixel_type,
+                dst_buffer.as_mut_ptr() as *mut c_void,
+            );
         }
     }
 
-    fn read_pixels(&self, x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, pixel_type: GLenum) -> Vec<u8> {
+    fn read_pixels(
+        &self,
+        x: GLint,
+        y: GLint,
+        width: GLsizei,
+        height: GLsizei,
+        format: GLenum,
+        pixel_type: GLenum,
+    ) -> Vec<u8> {
         let len = calculate_length(width, height, format, pixel_type);
         let mut pixels: Vec<u8> = Vec::new();
         pixels.reserve(len);
-        unsafe { pixels.set_len(len); }
+        unsafe {
+            pixels.set_len(len);
+        }
 
-        self.read_pixels_into_buffer(x, y, width, height, format, pixel_type, pixels.as_mut_slice());
+        self.read_pixels_into_buffer(
+            x,
+            y,
+            width,
+            height,
+            format,
+            pixel_type,
+            pixels.as_mut_slice(),
+        );
 
         pixels
     }
 
     fn sample_coverage(&self, value: GLclampf, invert: bool) {
         unsafe {
             self.ffi_gl_.SampleCoverage(value, invert as GLboolean);
         }
@@ -203,73 +263,83 @@ impl Gl for GlFns {
         unsafe {
             self.ffi_gl_.GetQueryObjectui64v(id, pname, &mut result);
         }
         result
     }
 
     fn delete_queries(&self, queries: &[GLuint]) {
         unsafe {
-            self.ffi_gl_.DeleteQueries(queries.len() as GLsizei, queries.as_ptr());
+            self.ffi_gl_
+                .DeleteQueries(queries.len() as GLsizei, queries.as_ptr());
         }
     }
 
     fn delete_vertex_arrays(&self, vertex_arrays: &[GLuint]) {
         unsafe {
-            self.ffi_gl_.DeleteVertexArrays(vertex_arrays.len() as GLsizei, vertex_arrays.as_ptr());
+            self.ffi_gl_
+                .DeleteVertexArrays(vertex_arrays.len() as GLsizei, vertex_arrays.as_ptr());
         }
     }
 
     fn delete_buffers(&self, buffers: &[GLuint]) {
         unsafe {
-            self.ffi_gl_.DeleteBuffers(buffers.len() as GLsizei, buffers.as_ptr());
+            self.ffi_gl_
+                .DeleteBuffers(buffers.len() as GLsizei, buffers.as_ptr());
         }
     }
 
     fn delete_renderbuffers(&self, renderbuffers: &[GLuint]) {
         unsafe {
-            self.ffi_gl_.DeleteRenderbuffers(renderbuffers.len() as GLsizei, renderbuffers.as_ptr());
+            self.ffi_gl_
+                .DeleteRenderbuffers(renderbuffers.len() as GLsizei, renderbuffers.as_ptr());
         }
     }
 
     fn delete_framebuffers(&self, framebuffers: &[GLuint]) {
         unsafe {
-            self.ffi_gl_.DeleteFramebuffers(framebuffers.len() as GLsizei, framebuffers.as_ptr());
+            self.ffi_gl_
+                .DeleteFramebuffers(framebuffers.len() as GLsizei, framebuffers.as_ptr());
         }
     }
 
     fn delete_textures(&self, textures: &[GLuint]) {
         unsafe {
-            self.ffi_gl_.DeleteTextures(textures.len() as GLsizei, textures.as_ptr());
+            self.ffi_gl_
+                .DeleteTextures(textures.len() as GLsizei, textures.as_ptr());
         }
     }
 
-    fn framebuffer_renderbuffer(&self,
-                                target: GLenum,
-                                attachment: GLenum,
-                                renderbuffertarget: GLenum,
-                                renderbuffer: GLuint) {
+    fn framebuffer_renderbuffer(
+        &self,
+        target: GLenum,
+        attachment: GLenum,
+        renderbuffertarget: GLenum,
+        renderbuffer: GLuint,
+    ) {
         unsafe {
-            self.ffi_gl_.FramebufferRenderbuffer(target,
-                                                 attachment,
-                                                 renderbuffertarget,
-                                                 renderbuffer);
+            self.ffi_gl_.FramebufferRenderbuffer(
+                target,
+                attachment,
+                renderbuffertarget,
+                renderbuffer,
+            );
         }
     }
 
-    fn renderbuffer_storage(&self,
-                                target: GLenum,
-                                internalformat: GLenum,
-                                width: GLsizei,
-                                height: GLsizei) {
+    fn renderbuffer_storage(
+        &self,
+        target: GLenum,
+        internalformat: GLenum,
+        width: GLsizei,
+        height: GLsizei,
+    ) {
         unsafe {
-            self.ffi_gl_.RenderbufferStorage(target,
-                                             internalformat,
-                                             width,
-                                             height);
+            self.ffi_gl_
+                .RenderbufferStorage(target, internalformat, width, height);
         }
     }
 
     fn depth_func(&self, func: GLenum) {
         unsafe {
             self.ffi_gl_.DepthFunc(func);
         }
     }
@@ -284,68 +354,88 @@ impl Gl for GlFns {
         unsafe {
             self.ffi_gl_.AttachShader(program, shader);
         }
     }
 
     fn bind_attrib_location(&self, program: GLuint, index: GLuint, name: &str) {
         let c_string = CString::new(name).unwrap();
         unsafe {
-            self.ffi_gl_.BindAttribLocation(program, index, c_string.as_ptr())
+            self.ffi_gl_
+                .BindAttribLocation(program, index, c_string.as_ptr())
         }
     }
 
     // https://www.khronos.org/registry/OpenGL-Refpages/es2.0/xhtml/glGetUniform.xml
     unsafe fn get_uniform_iv(&self, program: GLuint, location: GLint, result: &mut [GLint]) {
         assert!(!result.is_empty());
-        self.ffi_gl_.GetUniformiv(program, location, result.as_mut_ptr());
+        self.ffi_gl_
+            .GetUniformiv(program, location, result.as_mut_ptr());
     }
 
     // https://www.khronos.org/registry/OpenGL-Refpages/es2.0/xhtml/glGetUniform.xml
     unsafe fn get_uniform_fv(&self, program: GLuint, location: GLint, result: &mut [GLfloat]) {
         assert!(!result.is_empty());
-        self.ffi_gl_.GetUniformfv(program, location, result.as_mut_ptr());
+        self.ffi_gl_
+            .GetUniformfv(program, location, result.as_mut_ptr());
     }
 
     fn get_uniform_block_index(&self, program: GLuint, name: &str) -> GLuint {
         let c_string = CString::new(name).unwrap();
         unsafe {
-            self.ffi_gl_.GetUniformBlockIndex(program, c_string.as_ptr())
+            self.ffi_gl_
+                .GetUniformBlockIndex(program, c_string.as_ptr())
         }
     }
 
-    fn get_uniform_indices(&self,  program: GLuint, names: &[&str]) -> Vec<GLuint> {
+    fn get_uniform_indices(&self, program: GLuint, names: &[&str]) -> Vec<GLuint> {
         let c_strings: Vec<CString> = names.iter().map(|n| CString::new(*n).unwrap()).collect();
         let pointers: Vec<*const GLchar> = c_strings.iter().map(|string| string.as_ptr()).collect();
         let mut result = Vec::with_capacity(c_strings.len());
         unsafe {
             result.set_len(c_strings.len());
-            self.ffi_gl_.GetUniformIndices(program,
-                                           pointers.len() as GLsizei,
-                                           pointers.as_ptr(),
-                                           result.as_mut_ptr());
+            self.ffi_gl_.GetUniformIndices(
+                program,
+                pointers.len() as GLsizei,
+                pointers.as_ptr(),
+                result.as_mut_ptr(),
+            );
         }
         result
     }
 
     fn bind_buffer_base(&self, target: GLenum, index: GLuint, buffer: GLuint) {
         unsafe {
             self.ffi_gl_.BindBufferBase(target, index, buffer);
         }
     }
 
-    fn bind_buffer_range(&self, target: GLenum, index: GLuint, buffer: GLuint, offset: GLintptr, size: GLsizeiptr) {
+    fn bind_buffer_range(
+        &self,
+        target: GLenum,
+        index: GLuint,
+        buffer: GLuint,
+        offset: GLintptr,
+        size: GLsizeiptr,
+    ) {
         unsafe {
-            self.ffi_gl_.BindBufferRange(target, index, buffer, offset, size);
+            self.ffi_gl_
+                .BindBufferRange(target, index, buffer, offset, size);
         }
     }
 
-    fn uniform_block_binding(&self, program: GLuint, uniform_block_index: GLuint, uniform_block_binding: GLuint) {
+    fn uniform_block_binding(
+        &self,
+        program: GLuint,
+        uniform_block_index: GLuint,
+        uniform_block_binding: GLuint,
+    ) {
         unsafe {
-            self.ffi_gl_.UniformBlockBinding(program, uniform_block_index, uniform_block_binding);
+            self.ffi_gl_
+                .UniformBlockBinding(program, uniform_block_index, uniform_block_binding);
         }
     }
 
     fn bind_buffer(&self, target: GLenum, buffer: GLuint) {
         unsafe {
             self.ffi_gl_.BindBuffer(target, buffer);
         }
     }
@@ -371,363 +461,417 @@ impl Gl for GlFns {
     fn bind_texture(&self, target: GLenum, texture: GLuint) {
         unsafe {
             self.ffi_gl_.BindTexture(target, texture);
         }
     }
 
     fn draw_buffers(&self, bufs: &[GLenum]) {
         unsafe {
-            self.ffi_gl_.DrawBuffers(bufs.len() as GLsizei, bufs.as_ptr());
+            self.ffi_gl_
+                .DrawBuffers(bufs.len() as GLsizei, bufs.as_ptr());
         }
     }
 
     // FIXME: Does not verify buffer size -- unsafe!
-    fn tex_image_2d(&self,
-                    target: GLenum,
-                    level: GLint,
-                    internal_format: GLint,
-                    width: GLsizei,
-                    height: GLsizei,
-                    border: GLint,
-                    format: GLenum,
-                    ty: GLenum,
-                    opt_data: Option<&[u8]>) {
+    fn tex_image_2d(
+        &self,
+        target: GLenum,
+        level: GLint,
+        internal_format: GLint,
+        width: GLsizei,
+        height: GLsizei,
+        border: GLint,
+        format: GLenum,
+        ty: GLenum,
+        opt_data: Option<&[u8]>,
+    ) {
         match opt_data {
-            Some(data) => {
-                unsafe {
-                    self.ffi_gl_.TexImage2D(target, level, internal_format, width, height, border, format, ty,
-                                            data.as_ptr() as *const GLvoid);
-                }
-            }
-            None => {
-                unsafe {
-                    self.ffi_gl_.TexImage2D(target, level, internal_format, width, height, border, format, ty,
-                                            ptr::null());
-                }
-            }
+            Some(data) => unsafe {
+                self.ffi_gl_.TexImage2D(
+                    target,
+                    level,
+                    internal_format,
+                    width,
+                    height,
+                    border,
+                    format,
+                    ty,
+                    data.as_ptr() as *const GLvoid,
+                );
+            },
+            None => unsafe {
+                self.ffi_gl_.TexImage2D(
+                    target,
+                    level,
+                    internal_format,
+                    width,
+                    height,
+                    border,
+                    format,
+                    ty,
+                    ptr::null(),
+                );
+            },
         }
     }
 
-    fn compressed_tex_image_2d(&self,
-                               target: GLenum,
-                               level: GLint,
-                               internal_format: GLenum,
-                               width: GLsizei,
-                               height: GLsizei,
-                               border: GLint,
-                               data: &[u8]) {
+    fn compressed_tex_image_2d(
+        &self,
+        target: GLenum,
+        level: GLint,
+        internal_format: GLenum,
+        width: GLsizei,
+        height: GLsizei,
+        border: GLint,
+        data: &[u8],
+    ) {
         unsafe {
-            self.ffi_gl_.CompressedTexImage2D(target, level, internal_format, width, height, border,
-                                              data.len() as GLsizei, data.as_ptr() as *const GLvoid);
+            self.ffi_gl_.CompressedTexImage2D(
+                target,
+                level,
+                internal_format,
+                width,
+                height,
+                border,
+                data.len() as GLsizei,
+                data.as_ptr() as *const GLvoid,
+            );
         }
     }
 
-    fn compressed_tex_sub_image_2d(&self,
-                                   target: GLenum,
-                                   level: GLint,
-                                   xoffset: GLint,
-                                   yoffset: GLint,
-                                   width: GLsizei,
-                                   height: GLsizei,
-                                   format: GLenum,
-                                   data: &[u8]) {
+    fn compressed_tex_sub_image_2d(
+        &self,
+        target: GLenum,
+        level: GLint,
+        xoffset: GLint,
+        yoffset: GLint,
+        width: GLsizei,
+        height: GLsizei,
+        format: GLenum,
+        data: &[u8],
+    ) {
         unsafe {
-            self.ffi_gl_.CompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format,
-                                                 data.len() as GLsizei, data.as_ptr() as *const GLvoid);
+            self.ffi_gl_.CompressedTexSubImage2D(
+                target,
+                level,
+                xoffset,
+                yoffset,
+                width,
+                height,
+                format,
+                data.len() as GLsizei,
+                data.as_ptr() as *const GLvoid,
+            );
         }
     }
 
     // FIXME: Does not verify buffer size -- unsafe!
-    fn tex_image_3d(&self,
-                    target: GLenum,
-                    level: GLint,
-                    internal_format: GLint,
-                    width: GLsizei,
-                    height: GLsizei,
-                    depth: GLsizei,
-                    border: GLint,
-                    format: GLenum,
-                    ty: GLenum,
-                    opt_data: Option<&[u8]>) {
+    fn tex_image_3d(
+        &self,
+        target: GLenum,
+        level: GLint,
+        internal_format: GLint,
+        width: GLsizei,
+        height: GLsizei,
+        depth: GLsizei,
+        border: GLint,
+        format: GLenum,
+        ty: GLenum,
+        opt_data: Option<&[u8]>,
+    ) {
         unsafe {
             let pdata = match opt_data {
                 Some(data) => mem::transmute(data.as_ptr()),
                 None => ptr::null(),
             };
-            self.ffi_gl_.TexImage3D(target,
-                                    level,
-                                    internal_format,
-                                    width,
-                                    height,
-                                    depth,
-                                    border,
-                                    format,
-                                    ty,
-                                    pdata);
-        }
-    }
-
-    fn copy_tex_image_2d(&self,
-                         target: GLenum,
-                         level: GLint,
-                         internal_format: GLenum,
-                         x: GLint,
-                         y: GLint,
-                         width: GLsizei,
-                         height: GLsizei,
-                         border: GLint) {
-        unsafe {
-            self.ffi_gl_.CopyTexImage2D(target,
-                                        level,
-                                        internal_format,
-                                        x,
-                                        y,
-                                        width,
-                                        height,
-                                        border);
+            self.ffi_gl_.TexImage3D(
+                target,
+                level,
+                internal_format,
+                width,
+                height,
+                depth,
+                border,
+                format,
+                ty,
+                pdata,
+            );
         }
     }
 
-    fn copy_tex_sub_image_2d(&self,
-                             target: GLenum,
-                             level: GLint,
-                             xoffset: GLint,
-                             yoffset: GLint,
-                             x: GLint,
-                             y: GLint,
-                             width: GLsizei,
-                             height: GLsizei) {
+    fn copy_tex_image_2d(
+        &self,
+        target: GLenum,
+        level: GLint,
+        internal_format: GLenum,
+        x: GLint,
+        y: GLint,
+        width: GLsizei,
+        height: GLsizei,
+        border: GLint,
+    ) {
         unsafe {
-            self.ffi_gl_.CopyTexSubImage2D(target,
-                                           level,
-                                           xoffset,
-                                           yoffset,
-                                           x,
-                                           y,
-                                           width,
-                                           height);
+            self.ffi_gl_.CopyTexImage2D(
+                target,
+                level,
+                internal_format,
+                x,
+                y,
+                width,
+                height,
+                border,
+            );
         }
     }
 
-    fn copy_tex_sub_image_3d(&self,
-                             target: GLenum,
-                             level: GLint,
-                             xoffset: GLint,
-                             yoffset: GLint,
-                             zoffset: GLint,
-                             x: GLint,
-                             y: GLint,
-                             width: GLsizei,
-                             height: GLsizei) {
+    fn copy_tex_sub_image_2d(
+        &self,
+        target: GLenum,
+        level: GLint,
+        xoffset: GLint,
+        yoffset: GLint,
+        x: GLint,
+        y: GLint,
+        width: GLsizei,
+        height: GLsizei,
+    ) {
         unsafe {
-            self.ffi_gl_.CopyTexSubImage3D(target,
-                                           level,
-                                           xoffset,
-                                           yoffset,
-                                           zoffset,
-                                           x,
-                                           y,
-                                           width,
-                                           height);
+            self.ffi_gl_
+                .CopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
+        }
+    }
+
+    fn copy_tex_sub_image_3d(
+        &self,
+        target: GLenum,
+        level: GLint,
+        xoffset: GLint,
+        yoffset: GLint,
+        zoffset: GLint,
+        x: GLint,
+        y: GLint,
+        width: GLsizei,
+        height: GLsizei,
+    ) {
+        unsafe {
+            self.ffi_gl_.CopyTexSubImage3D(
+                target, level, xoffset, yoffset, zoffset, x, y, width, height,
+            );
         }
     }
 
-    fn tex_sub_image_2d(&self,
-                        target: GLenum,
-                        level: GLint,
-                        xoffset: GLint,
-                        yoffset: GLint,
-                        width: GLsizei,
-                        height: GLsizei,
-                        format: GLenum,
-                        ty: GLenum,
-                        data: &[u8]) {
+    fn tex_sub_image_2d(
+        &self,
+        target: GLenum,
+        level: GLint,
+        xoffset: GLint,
+        yoffset: GLint,
+        width: GLsizei,
+        height: GLsizei,
+        format: GLenum,
+        ty: GLenum,
+        data: &[u8],
+    ) {
         unsafe {
-            self.ffi_gl_.TexSubImage2D(target, level, xoffset, yoffset, width, height, format, ty, data.as_ptr() as *const c_void);
+            self.ffi_gl_.TexSubImage2D(
+                target,
+                level,
+                xoffset,
+                yoffset,
+                width,
+                height,
+                format,
+                ty,
+                data.as_ptr() as *const c_void,
+            );
         }
     }
 
-    fn tex_sub_image_2d_pbo(&self,
-                            target: GLenum,
-                            level: GLint,
-                            xoffset: GLint,
-                            yoffset: GLint,
-                            width: GLsizei,
-                            height: GLsizei,
-                            format: GLenum,
-                            ty: GLenum,
-                            offset: usize) {
+    fn tex_sub_image_2d_pbo(
+        &self,
+        target: GLenum,
+        level: GLint,
+        xoffset: GLint,
+        yoffset: GLint,
+        width: GLsizei,
+        height: GLsizei,
+        format: GLenum,
+        ty: GLenum,
+        offset: usize,
+    ) {
         unsafe {
-            self.ffi_gl_.TexSubImage2D(target, level, xoffset, yoffset, width, height, format, ty, offset as *const c_void);
+            self.ffi_gl_.TexSubImage2D(
+                target,
+                level,
+                xoffset,
+                yoffset,
+                width,
+                height,
+                format,
+                ty,
+                offset as *const c_void,
+            );
         }
     }
 
-    fn tex_sub_image_3d(&self,
-                        target: GLenum,
-                        level: GLint,
-                        xoffset: GLint,
-                        yoffset: GLint,
-                        zoffset: GLint,
-                        width: GLsizei,
-                        height: GLsizei,
-                        depth: GLsizei,
-                        format: GLenum,
-                        ty: GLenum,
-                        data: &[u8]) {
+    fn tex_sub_image_3d(
+        &self,
+        target: GLenum,
+        level: GLint,
+        xoffset: GLint,
+        yoffset: GLint,
+        zoffset: GLint,
+        width: GLsizei,
+        height: GLsizei,
+        depth: GLsizei,
+        format: GLenum,
+        ty: GLenum,
+        data: &[u8],
+    ) {
         unsafe {
-            self.ffi_gl_.TexSubImage3D(target,
-                                       level,
-                                       xoffset,
-                                       yoffset,
-                                       zoffset,
-                                       width,
-                                       height,
-                                       depth,
-                                       format,
-                                       ty,
-                                       data.as_ptr() as *const c_void);
+            self.ffi_gl_.TexSubImage3D(
+                target,
+                level,
+                xoffset,
+                yoffset,
+                zoffset,
+                width,
+                height,
+                depth,
+                format,
+                ty,
+                data.as_ptr() as *const c_void,
+            );
         }
     }
 
-    fn tex_sub_image_3d_pbo(&self,
-                            target: GLenum,
-                            level: GLint,
-                            xoffset: GLint,
-                            yoffset: GLint,
-                            zoffset: GLint,
-                            width: GLsizei,
-                            height: GLsizei,
-                            depth: GLsizei,
-                            format: GLenum,
-                            ty: GLenum,
-                            offset: usize) {
+    fn tex_sub_image_3d_pbo(
+        &self,
+        target: GLenum,
+        level: GLint,
+        xoffset: GLint,
+        yoffset: GLint,
+        zoffset: GLint,
+        width: GLsizei,
+        height: GLsizei,
+        depth: GLsizei,
+        format: GLenum,
+        ty: GLenum,
+        offset: usize,
+    ) {
         unsafe {
-            self.ffi_gl_.TexSubImage3D(target,
-                                       level,
-                                       xoffset,
-                                       yoffset,
-                                       zoffset,
-                                       width,
-                                       height,
-                                       depth,
-                                       format,
-                                       ty,
-                                       offset as *const c_void);
+            self.ffi_gl_.TexSubImage3D(
+                target,
+                level,
+                xoffset,
+                yoffset,
+                zoffset,
+                width,
+                height,
+                depth,
+                format,
+                ty,
+                offset as *const c_void,
+            );
         }
     }
 
-    fn tex_storage_2d(&self,
-                      target: GLenum,
-                      levels: GLint,
-                      internal_format: GLenum,
-                      width: GLsizei,
-                      height: GLsizei) {
+    fn tex_storage_2d(
+        &self,
+        target: GLenum,
+        levels: GLint,
+        internal_format: GLenum,
+        width: GLsizei,
+        height: GLsizei,
+    ) {
         if self.ffi_gl_.TexStorage2D.is_loaded() {
             unsafe {
-                self.ffi_gl_.TexStorage2D(target,
-                                          levels,
-                                          internal_format,
-                                          width,
-                                          height);
+                self.ffi_gl_
+                    .TexStorage2D(target, levels, internal_format, width, height);
             }
         }
     }
 
-    fn tex_storage_3d(&self,
-                      target: GLenum,
-                      levels: GLint,
-                      internal_format: GLenum,
-                      width: GLsizei,
-                      height: GLsizei,
-                      depth: GLsizei) {
+    fn tex_storage_3d(
+        &self,
+        target: GLenum,
+        levels: GLint,
+        internal_format: GLenum,
+        width: GLsizei,
+        height: GLsizei,
+        depth: GLsizei,
+    ) {
         if self.ffi_gl_.TexStorage3D.is_loaded() {
             unsafe {
-                self.ffi_gl_.TexStorage3D(target,
-                                          levels,
-                                          internal_format,
-                                          width,
-                                          height,
-                                          depth);
+                self.ffi_gl_
+                    .TexStorage3D(target, levels, internal_format, width, height, depth);
             }
         }
     }
 
-
-    fn get_tex_image_into_buffer(&self,
-                                 target: GLenum,
-                                 level: GLint,
-                                 format: GLenum,
-                                 ty: GLenum,
-                                 output: &mut [u8]) {
+    fn get_tex_image_into_buffer(
+        &self,
+        target: GLenum,
+        level: GLint,
+        format: GLenum,
+        ty: GLenum,
+        output: &mut [u8],
+    ) {
         unsafe {
-            self.ffi_gl_.GetTexImage(target,
-                                     level,
-                                     format,
-                                     ty,
-                                     output.as_mut_ptr() as *mut _);
+            self.ffi_gl_
+                .GetTexImage(target, level, format, ty, output.as_mut_ptr() as *mut _);
         }
     }
 
-    unsafe fn copy_image_sub_data(&self,
-                                  src_name: GLuint,
-                                  src_target: GLenum,
-                                  src_level: GLint,
-                                  src_x: GLint,
-                                  src_y: GLint,
-                                  src_z: GLint,
-                                  dst_name: GLuint,
-                                  dst_target: GLenum,
-                                  dst_level: GLint,
-                                  dst_x: GLint,
-                                  dst_y: GLint,
-                                  dst_z: GLint,
-                                  src_width: GLsizei,
-                                  src_height: GLsizei,
-                                  src_depth: GLsizei) {
+    unsafe fn copy_image_sub_data(
+        &self,
+        src_name: GLuint,
+        src_target: GLenum,
+        src_level: GLint,
+        src_x: GLint,
+        src_y: GLint,
+        src_z: GLint,
+        dst_name: GLuint,
+        dst_target: GLenum,
+        dst_level: GLint,
+        dst_x: GLint,
+        dst_y: GLint,
+        dst_z: GLint,
+        src_width: GLsizei,
+        src_height: GLsizei,
+        src_depth: GLsizei,
+    ) {
         self.ffi_gl_.CopyImageSubData(
-            src_name,
-            src_target,
-            src_level,
-            src_x,
-            src_y,
-            src_z,
-            dst_name,
-            dst_target,
-            dst_level,
-            dst_x,
-            dst_y,
-            dst_z,
-            src_width,
-            src_height,
-            src_depth,
+            src_name, src_target, src_level, src_x, src_y, src_z, dst_name, dst_target, dst_level,
+            dst_x, dst_y, dst_z, src_width, src_height, src_depth,
         );
     }
 
-    fn invalidate_framebuffer(&self,
-                              target: GLenum,
-                              attachments: &[GLenum]) {
+    fn invalidate_framebuffer(&self, target: GLenum, attachments: &[GLenum]) {
         if self.ffi_gl_.InvalidateFramebuffer.is_loaded() {
             unsafe {
                 self.ffi_gl_.InvalidateFramebuffer(
                     target,
                     attachments.len() as GLsizei,
                     attachments.as_ptr(),
                 );
             }
         }
     }
 
-    fn invalidate_sub_framebuffer(&self,
-                                  target: GLenum,
-                                  attachments: &[GLenum],
-                                  xoffset: GLint,
-                                  yoffset: GLint,
-                                  width: GLsizei,
-                                  height: GLsizei) {
+    fn invalidate_sub_framebuffer(
+        &self,
+        target: GLenum,
+        attachments: &[GLenum],
+        xoffset: GLint,
+        yoffset: GLint,
+        width: GLsizei,
+        height: GLsizei,
+    ) {
         if self.ffi_gl_.InvalidateSubFramebuffer.is_loaded() {
             unsafe {
                 self.ffi_gl_.InvalidateSubFramebuffer(
                     target,
                     attachments.len() as GLsizei,
                     attachments.as_ptr(),
                     xoffset,
                     yoffset,
@@ -754,43 +898,55 @@ impl Gl for GlFns {
     unsafe fn get_integer_iv(&self, name: GLenum, index: GLuint, result: &mut [GLint]) {
         assert!(!result.is_empty());
         self.ffi_gl_.GetIntegeri_v(name, index, result.as_mut_ptr());
     }
 
     #[inline]
     unsafe fn get_integer_64iv(&self, name: GLenum, index: GLuint, result: &mut [GLint64]) {
         assert!(!result.is_empty());
-        self.ffi_gl_.GetInteger64i_v(name, index, result.as_mut_ptr());
+        self.ffi_gl_
+            .GetInteger64i_v(name, index, result.as_mut_ptr());
     }
 
     #[inline]
     unsafe fn get_boolean_v(&self, name: GLenum, result: &mut [GLboolean]) {
         assert!(!result.is_empty());
         self.ffi_gl_.GetBooleanv(name, result.as_mut_ptr());
     }
 
     #[inline]
     unsafe fn get_float_v(&self, name: GLenum, result: &mut [GLfloat]) {
         assert!(!result.is_empty());
         self.ffi_gl_.GetFloatv(name, result.as_mut_ptr());
     }
 
-    fn get_framebuffer_attachment_parameter_iv(&self, target: GLenum, attachment: GLenum, pname: GLenum) -> GLint {
+    fn get_framebuffer_attachment_parameter_iv(
+        &self,
+        target: GLenum,
+        attachment: GLenum,
+        pname: GLenum,
+    ) -> GLint {
         let mut result: GLint = 0;
         unsafe {
-            self.ffi_gl_.GetFramebufferAttachmentParameteriv(target, attachment, pname, &mut result);
+            self.ffi_gl_.GetFramebufferAttachmentParameteriv(
+                target,
+                attachment,
+                pname,
+                &mut result,
+            );
         }
         result
     }
 
     fn get_renderbuffer_parameter_iv(&self, target: GLenum, pname: GLenum) -> GLint {
         let mut result: GLint = 0;
         unsafe {
-            self.ffi_gl_.GetRenderbufferParameteriv(target, pname, &mut result);
+            self.ffi_gl_
+                .GetRenderbufferParameteriv(target, pname, &mut result);
         }
         result
     }
 
     fn get_tex_parameter_iv(&self, target: GLenum, pname: GLenum) -> GLint {
         let mut result: GLint = 0;
         unsafe {
             self.ffi_gl_.GetTexParameteriv(target, pname, &mut result);
@@ -813,126 +969,125 @@ impl Gl for GlFns {
     }
 
     fn tex_parameter_f(&self, target: GLenum, pname: GLenum, param: GLfloat) {
         unsafe {
             self.ffi_gl_.TexParameterf(target, pname, param);
         }
     }
 
-    fn framebuffer_texture_2d(&self,
-                              target: GLenum,
-                              attachment: GLenum,
-                              textarget: GLenum,
-                              texture: GLuint,
-                              level: GLint) {
+    fn framebuffer_texture_2d(
+        &self,
+        target: GLenum,
+        attachment: GLenum,
+        textarget: GLenum,
+        texture: GLuint,
+        level: GLint,
+    ) {
         unsafe {
-            self.ffi_gl_.FramebufferTexture2D(target, attachment, textarget, texture, level);
-        }
-    }
-
-    fn framebuffer_texture_layer(&self,
-                                 target: GLenum,
-                                 attachment: GLenum,
-                                 texture: GLuint,
-                                 level: GLint,
-                                 layer: GLint) {
-        unsafe {
-            self.ffi_gl_.FramebufferTextureLayer(target, attachment, texture, level, layer);
+            self.ffi_gl_
+                .FramebufferTexture2D(target, attachment, textarget, texture, level);
         }
     }
 
-    fn blit_framebuffer(&self,
-                        src_x0: GLint,
-                        src_y0: GLint,
-                        src_x1: GLint,
-                        src_y1: GLint,
-                        dst_x0: GLint,
-                        dst_y0: GLint,
-                        dst_x1: GLint,
-                        dst_y1: GLint,
-                        mask: GLbitfield,
-                        filter: GLenum) {
+    fn framebuffer_texture_layer(
+        &self,
+        target: GLenum,
+        attachment: GLenum,
+        texture: GLuint,
+        level: GLint,
+        layer: GLint,
+    ) {
         unsafe {
-            self.ffi_gl_.BlitFramebuffer(src_x0,
-                                         src_y0,
-                                         src_x1,
-                                         src_y1,
-                                         dst_x0,
-                                         dst_y0,
-                                         dst_x1,
-                                         dst_y1,
-                                         mask,
-                                         filter);
+            self.ffi_gl_
+                .FramebufferTextureLayer(target, attachment, texture, level, layer);
+        }
+    }
+
+    fn blit_framebuffer(
+        &self,
+        src_x0: GLint,
+        src_y0: GLint,
+        src_x1: GLint,
+        src_y1: GLint,
+        dst_x0: GLint,
+        dst_y0: GLint,
+        dst_x1: GLint,
+        dst_y1: GLint,
+        mask: GLbitfield,
+        filter: GLenum,
+    ) {
+        unsafe {
+            self.ffi_gl_.BlitFramebuffer(
+                src_x0, src_y0, src_x1, src_y1, dst_x0, dst_y0, dst_x1, dst_y1, mask, filter,
+            );
         }
     }
 
-    fn vertex_attrib_4f(&self,
-                        index: GLuint,
-                        x: GLfloat,
-                        y: GLfloat,
-                        z: GLfloat,
-                        w: GLfloat) {
-        unsafe {
-            self.ffi_gl_.VertexAttrib4f(index, x, y, z, w)
-        }
+    fn vertex_attrib_4f(&self, index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat) {
+        unsafe { self.ffi_gl_.VertexAttrib4f(index, x, y, z, w) }
     }
 
-    fn vertex_attrib_pointer_f32(&self,
-                                 index: GLuint,
-                                 size: GLint,
-                                 normalized: bool,
-                                 stride: GLsizei,
-                                 offset: GLuint) {
+    fn vertex_attrib_pointer_f32(
+        &self,
+        index: GLuint,
+        size: GLint,
+        normalized: bool,
+        stride: GLsizei,
+        offset: GLuint,
+    ) {
         unsafe {
-            self.ffi_gl_.VertexAttribPointer(index,
-                                             size,
-                                             ffi::FLOAT,
-                                             normalized as GLboolean,
-                                             stride,
-                                             offset as *const GLvoid)
+            self.ffi_gl_.VertexAttribPointer(
+                index,
+                size,
+                ffi::FLOAT,
+                normalized as GLboolean,
+                stride,
+                offset as *const GLvoid,
+            )
         }
     }
 
-    fn vertex_attrib_pointer(&self,
-                                 index: GLuint,
-                                 size: GLint,
-                                 type_: GLenum,
-                                 normalized: bool,
-                                 stride: GLsizei,
-                                 offset: GLuint) {
+    fn vertex_attrib_pointer(
+        &self,
+        index: GLuint,
+        size: GLint,
+        type_: GLenum,
+        normalized: bool,
+        stride: GLsizei,
+        offset: GLuint,
+    ) {
         unsafe {
-            self.ffi_gl_.VertexAttribPointer(index,
-                                             size,
-                                             type_,
-                                             normalized as GLboolean,
-                                             stride,
-                                             offset as *const GLvoid)
+            self.ffi_gl_.VertexAttribPointer(
+                index,
+                size,
+                type_,
+                normalized as GLboolean,
+                stride,
+                offset as *const GLvoid,
+            )
         }
     }
 
-    fn vertex_attrib_i_pointer(&self,
-                               index: GLuint,
-                               size: GLint,
-                               type_: GLenum,
-                               stride: GLsizei,
-                               offset: GLuint) {
+    fn vertex_attrib_i_pointer(
+        &self,
+        index: GLuint,
+        size: GLint,
+        type_: GLenum,
+        stride: GLsizei,
+        offset: GLuint,
+    ) {
         unsafe {
-            self.ffi_gl_.VertexAttribIPointer(index,
-                                              size,
-                                              type_,
-                                              stride,
-                                              offset as *const GLvoid)
+            self.ffi_gl_
+                .VertexAttribIPointer(index, size, type_, stride, offset as *const GLvoid)
         }
     }
 
     fn vertex_attrib_divisor(&self, index: GLuint, divisor: GLuint) {
-        unsafe {
-            self.ffi_gl_.VertexAttribDivisor(index, divisor)
-        }
+        unsafe { self.ffi_gl_.VertexAttribDivisor(index, divisor) }
     }
 
     fn viewport(&self, x: GLint, y: GLint, width: GLsizei, height: GLsizei) {
         unsafe {
             self.ffi_gl_.Viewport(x, y, width, height);
         }
     }
 
@@ -961,58 +1116,88 @@ impl Gl for GlFns {
     }
 
     fn draw_arrays(&self, mode: GLenum, first: GLint, count: GLsizei) {
         unsafe {
             return self.ffi_gl_.DrawArrays(mode, first, count);
         }
     }
 
-    fn draw_arrays_instanced(&self, mode: GLenum, first: GLint, count: GLsizei, primcount: GLsizei) {
+    fn draw_arrays_instanced(
+        &self,
+        mode: GLenum,
+        first: GLint,
+        count: GLsizei,
+        primcount: GLsizei,
+    ) {
         unsafe {
-            return self.ffi_gl_.DrawArraysInstanced(mode, first, count, primcount);
-        }
-    }
-
-    fn draw_elements(&self, mode: GLenum, count: GLsizei, element_type: GLenum, indices_offset: GLuint) {
-        unsafe {
-            return self.ffi_gl_.DrawElements(mode, count, element_type, indices_offset as *const c_void)
+            return self
+                .ffi_gl_
+                .DrawArraysInstanced(mode, first, count, primcount);
         }
     }
 
-    fn draw_elements_instanced(&self,
-                                   mode: GLenum,
-                                   count: GLsizei,
-                                   element_type: GLenum,
-                                   indices_offset: GLuint,
-                                   primcount: GLsizei) {
+    fn draw_elements(
+        &self,
+        mode: GLenum,
+        count: GLsizei,
+        element_type: GLenum,
+        indices_offset: GLuint,
+    ) {
         unsafe {
-            return self.ffi_gl_.DrawElementsInstanced(mode,
-                                                      count,
-                                                      element_type,
-                                                      indices_offset as *const c_void,
-                                                      primcount)
+            return self.ffi_gl_.DrawElements(
+                mode,
+                count,
+                element_type,
+                indices_offset as *const c_void,
+            );
+        }
+    }
+
+    fn draw_elements_instanced(
+        &self,
+        mode: GLenum,
+        count: GLsizei,
+        element_type: GLenum,
+        indices_offset: GLuint,
+        primcount: GLsizei,
+    ) {
+        unsafe {
+            return self.ffi_gl_.DrawElementsInstanced(
+                mode,
+                count,
+                element_type,
+                indices_offset as *const c_void,
+                primcount,
+            );
         }
     }
 
     fn blend_color(&self, r: f32, g: f32, b: f32, a: f32) {
         unsafe {
             self.ffi_gl_.BlendColor(r, g, b, a);
         }
     }
 
     fn blend_func(&self, sfactor: GLenum, dfactor: GLenum) {
         unsafe {
             self.ffi_gl_.BlendFunc(sfactor, dfactor);
         }
     }
 
-    fn blend_func_separate(&self, src_rgb: GLenum, dest_rgb: GLenum, src_alpha: GLenum, dest_alpha: GLenum) {
+    fn blend_func_separate(
+        &self,
+        src_rgb: GLenum,
+        dest_rgb: GLenum,
+        src_alpha: GLenum,
+        dest_alpha: GLenum,
+    ) {
         unsafe {
-            self.ffi_gl_.BlendFuncSeparate(src_rgb, dest_rgb, src_alpha, dest_alpha);
+            self.ffi_gl_
+                .BlendFuncSeparate(src_rgb, dest_rgb, src_alpha, dest_alpha);
         }
     }
 
     fn blend_equation(&self, mode: GLenum) {
         unsafe {
             self.ffi_gl_.BlendEquation(mode);
         }
     }
@@ -1020,17 +1205,22 @@ impl Gl for GlFns {
     fn blend_equation_separate(&self, mode_rgb: GLenum, mode_alpha: GLenum) {
         unsafe {
             self.ffi_gl_.BlendEquationSeparate(mode_rgb, mode_alpha);
         }
     }
 
     fn color_mask(&self, r: bool, g: bool, b: bool, a: bool) {
         unsafe {
-            self.ffi_gl_.ColorMask(r as GLboolean, g as GLboolean, b as GLboolean, a as GLboolean);
+            self.ffi_gl_.ColorMask(
+                r as GLboolean,
+                g as GLboolean,
+                b as GLboolean,
+                a as GLboolean,
+            );
         }
     }
 
     fn cull_face(&self, mode: GLenum) {
         unsafe {
             self.ffi_gl_.CullFace(mode);
         }
     }
@@ -1055,49 +1245,37 @@ impl Gl for GlFns {
 
     fn hint(&self, param_name: GLenum, param_val: GLenum) {
         unsafe {
             self.ffi_gl_.Hint(param_name, param_val);
         }
     }
 
     fn is_enabled(&self, cap: GLenum) -> GLboolean {
-        unsafe {
-            self.ffi_gl_.IsEnabled(cap)
-        }
+        unsafe { self.ffi_gl_.IsEnabled(cap) }
     }
 
     fn is_shader(&self, shader: GLuint) -> GLboolean {
-        unsafe {
-            self.ffi_gl_.IsShader(shader)
-        }
+        unsafe { self.ffi_gl_.IsShader(shader) }
     }
 
     fn is_texture(&self, texture: GLenum) -> GLboolean {
-        unsafe {
-            self.ffi_gl_.IsTexture(texture)
-        }
+        unsafe { self.ffi_gl_.IsTexture(texture) }
     }
 
     fn is_framebuffer(&self, framebuffer: GLenum) -> GLboolean {
-        unsafe {
-            self.ffi_gl_.IsFramebuffer(framebuffer)
-        }
+        unsafe { self.ffi_gl_.IsFramebuffer(framebuffer) }
     }
 
     fn is_renderbuffer(&self, renderbuffer: GLenum) -> GLboolean {
-        unsafe {
-            self.ffi_gl_.IsRenderbuffer(renderbuffer)
-        }
+        unsafe { self.ffi_gl_.IsRenderbuffer(renderbuffer) }
     }
 
     fn check_frame_buffer_status(&self, target: GLenum) -> GLenum {
-        unsafe {
-            self.ffi_gl_.CheckFramebufferStatus(target)
-        }
+        unsafe { self.ffi_gl_.CheckFramebufferStatus(target) }
     }
 
     fn enable_vertex_attrib_array(&self, index: GLuint) {
         unsafe {
             self.ffi_gl_.EnableVertexAttribArray(index);
         }
     }
 
@@ -1110,33 +1288,31 @@ impl Gl for GlFns {
     fn uniform_1f(&self, location: GLint, v0: GLfloat) {
         unsafe {
             self.ffi_gl_.Uniform1f(location, v0);
         }
     }
 
     fn uniform_1fv(&self, location: GLint, values: &[f32]) {
         unsafe {
-            self.ffi_gl_.Uniform1fv(location,
-                                    values.len() as GLsizei,
-                                    values.as_ptr());
+            self.ffi_gl_
+                .Uniform1fv(location, values.len() as GLsizei, values.as_ptr());
         }
     }
 
     fn uniform_1i(&self, location: GLint, v0: GLint) {
         unsafe {
             self.ffi_gl_.Uniform1i(location, v0);
         }
     }
 
     fn uniform_1iv(&self, location: GLint, values: &[i32]) {
         unsafe {
-            self.ffi_gl_.Uniform1iv(location,
-                                    values.len() as GLsizei,
-                                    values.as_ptr());
+            self.ffi_gl_
+                .Uniform1iv(location, values.len() as GLsizei, values.as_ptr());
         }
     }
 
     fn uniform_1ui(&self, location: GLint, v0: GLuint) {
         unsafe {
             self.ffi_gl_.Uniform1ui(location, v0);
         }
     }
@@ -1144,33 +1320,31 @@ impl Gl for GlFns {
     fn uniform_2f(&self, location: GLint, v0: GLfloat, v1: GLfloat) {
         unsafe {
             self.ffi_gl_.Uniform2f(location, v0, v1);
         }
     }
 
     fn uniform_2fv(&self, location: GLint, values: &[f32]) {
         unsafe {
-            self.ffi_gl_.Uniform2fv(location,
-                                    (values.len() / 2) as GLsizei,
-                                    values.as_ptr());
+            self.ffi_gl_
+                .Uniform2fv(location, (values.len() / 2) as GLsizei, values.as_ptr());
         }
     }
 
     fn uniform_2i(&self, location: GLint, v0: GLint, v1: GLint) {
         unsafe {
             self.ffi_gl_.Uniform2i(location, v0, v1);
         }
     }
 
     fn uniform_2iv(&self, location: GLint, values: &[i32]) {
         unsafe {
-            self.ffi_gl_.Uniform2iv(location,
-                                    (values.len() / 2) as GLsizei,
-                                    values.as_ptr());
+            self.ffi_gl_
+                .Uniform2iv(location, (values.len() / 2) as GLsizei, values.as_ptr());
         }
     }
 
     fn uniform_2ui(&self, location: GLint, v0: GLuint, v1: GLuint) {
         unsafe {
             self.ffi_gl_.Uniform2ui(location, v0, v1);
         }
     }
@@ -1178,33 +1352,31 @@ impl Gl for GlFns {
     fn uniform_3f(&self, location: GLint, v0: GLfloat, v1: GLfloat, v2: GLfloat) {
         unsafe {
             self.ffi_gl_.Uniform3f(location, v0, v1, v2);
         }
     }
 
     fn uniform_3fv(&self, location: GLint, values: &[f32]) {
         unsafe {
-            self.ffi_gl_.Uniform3fv(location,
-                                    (values.len() / 3) as GLsizei,
-                                    values.as_ptr());
+            self.ffi_gl_
+                .Uniform3fv(location, (values.len() / 3) as GLsizei, values.as_ptr());
         }
     }
 
     fn uniform_3i(&self, location: GLint, v0: GLint, v1: GLint, v2: GLint) {
         unsafe {
             self.ffi_gl_.Uniform3i(location, v0, v1, v2);
         }
     }
 
     fn uniform_3iv(&self, location: GLint, values: &[i32]) {
         unsafe {
-            self.ffi_gl_.Uniform3iv(location,
-                                    (values.len() / 3) as GLsizei,
-                                    values.as_ptr());
+            self.ffi_gl_
+                .Uniform3iv(location, (values.len() / 3) as GLsizei, values.as_ptr());
         }
     }
 
     fn uniform_3ui(&self, location: GLint, v0: GLuint, v1: GLuint, v2: GLuint) {
         unsafe {
             self.ffi_gl_.Uniform3ui(location, v0, v1, v2);
         }
     }
@@ -1218,60 +1390,64 @@ impl Gl for GlFns {
     fn uniform_4i(&self, location: GLint, x: GLint, y: GLint, z: GLint, w: GLint) {
         unsafe {
             self.ffi_gl_.Uniform4i(location, x, y, z, w);
         }
     }
 
     fn uniform_4iv(&self, location: GLint, values: &[i32]) {
         unsafe {
-            self.ffi_gl_.Uniform4iv(location,
-                                    (values.len() / 4) as GLsizei,
-                                    values.as_ptr());
+            self.ffi_gl_
+                .Uniform4iv(location, (values.len() / 4) as GLsizei, values.as_ptr());
         }
     }
 
     fn uniform_4ui(&self, location: GLint, x: GLuint, y: GLuint, z: GLuint, w: GLuint) {
         unsafe {
             self.ffi_gl_.Uniform4ui(location, x, y, z, w);
         }
     }
 
     fn uniform_4fv(&self, location: GLint, values: &[f32]) {
         unsafe {
-            self.ffi_gl_.Uniform4fv(location,
-                                    (values.len() / 4) as GLsizei,
-                                    values.as_ptr());
+            self.ffi_gl_
+                .Uniform4fv(location, (values.len() / 4) as GLsizei, values.as_ptr());
         }
     }
 
     fn uniform_matrix_2fv(&self, location: GLint, transpose: bool, value: &[f32]) {
         unsafe {
-            self.ffi_gl_.UniformMatrix2fv(location,
-                                          (value.len() / 4) as GLsizei,
-                                          transpose as GLboolean,
-                                          value.as_ptr());
+            self.ffi_gl_.UniformMatrix2fv(
+                location,
+                (value.len() / 4) as GLsizei,
+                transpose as GLboolean,
+                value.as_ptr(),
+            );
         }
     }
 
     fn uniform_matrix_3fv(&self, location: GLint, transpose: bool, value: &[f32]) {
         unsafe {
-            self.ffi_gl_.UniformMatrix3fv(location,
-                                          (value.len() / 9) as GLsizei,
-                                          transpose as GLboolean,
-                                          value.as_ptr());
+            self.ffi_gl_.UniformMatrix3fv(
+                location,
+                (value.len() / 9) as GLsizei,
+                transpose as GLboolean,
+                value.as_ptr(),
+            );
         }
     }
 
     fn uniform_matrix_4fv(&self, location: GLint, transpose: bool, value: &[f32]) {
         unsafe {
-            self.ffi_gl_.UniformMatrix4fv(location,
-                                          (value.len() / 16) as GLsizei,
-                                          transpose as GLboolean,
-                                          value.as_ptr());
+            self.ffi_gl_.UniformMatrix4fv(
+                location,
+                (value.len() / 16) as GLsizei,
+                transpose as GLboolean,
+                value.as_ptr(),
+            );
         }
     }
 
     fn depth_mask(&self, flag: bool) {
         unsafe {
             self.ffi_gl_.DepthMask(flag as GLboolean);
         }
     }
@@ -1297,17 +1473,17 @@ impl Gl for GlFns {
                 index,
                 buf_size[0],
                 &mut length,
                 &mut size,
                 &mut type_,
                 name.as_mut_ptr() as *mut GLchar,
             );
         }
-        name.truncate(if length > 0 {length as usize} else {0});
+        name.truncate(if length > 0 { length as usize } else { 0 });
         (size, type_, String::from_utf8(name).unwrap())
     }
 
     fn get_active_uniform(&self, program: GLuint, index: GLuint) -> (i32, u32, String) {
         let mut buf_size = [0];
         unsafe {
             self.get_program_iv(program, ffi::ACTIVE_UNIFORM_MAX_LENGTH, &mut buf_size);
         }
@@ -1328,82 +1504,94 @@ impl Gl for GlFns {
             );
         }
 
         name.truncate(if length > 0 { length as usize } else { 0 });
 
         (size, type_, String::from_utf8(name).unwrap())
     }
 
-    fn get_active_uniforms_iv(&self, program: GLuint, indices: Vec<GLuint>, pname: GLenum) -> Vec<GLint> {
+    fn get_active_uniforms_iv(
+        &self,
+        program: GLuint,
+        indices: Vec<GLuint>,
+        pname: GLenum,
+    ) -> Vec<GLint> {
         let mut result = Vec::with_capacity(indices.len());
         unsafe {
             result.set_len(indices.len());
-            self.ffi_gl_.GetActiveUniformsiv(program,
-                                             indices.len() as GLsizei,
-                                             indices.as_ptr(),
-                                             pname,
-                                             result.as_mut_ptr());
+            self.ffi_gl_.GetActiveUniformsiv(
+                program,
+                indices.len() as GLsizei,
+                indices.as_ptr(),
+                pname,
+                result.as_mut_ptr(),
+            );
         }
         result
     }
 
     fn get_active_uniform_block_i(&self, program: GLuint, index: GLuint, pname: GLenum) -> GLint {
         let mut result = 0;
         unsafe {
-            self.ffi_gl_.GetActiveUniformBlockiv(program, index, pname, &mut result);
+            self.ffi_gl_
+                .GetActiveUniformBlockiv(program, index, pname, &mut result);
         }
         result
     }
 
-    fn get_active_uniform_block_iv(&self, program: GLuint, index: GLuint, pname: GLenum) -> Vec<GLint> {
-        let count = self.get_active_uniform_block_i(program, index, ffi::UNIFORM_BLOCK_ACTIVE_UNIFORMS);
+    fn get_active_uniform_block_iv(
+        &self,
+        program: GLuint,
+        index: GLuint,
+        pname: GLenum,
+    ) -> Vec<GLint> {
+        let count =
+            self.get_active_uniform_block_i(program, index, ffi::UNIFORM_BLOCK_ACTIVE_UNIFORMS);
         let mut result = Vec::with_capacity(count as usize);
         unsafe {
             result.set_len(count as usize);
-            self.ffi_gl_.GetActiveUniformBlockiv(program, index, pname, result.as_mut_ptr());
+            self.ffi_gl_
+                .GetActiveUniformBlockiv(program, index, pname, result.as_mut_ptr());
         }
         result
     }
 
     fn get_active_uniform_block_name(&self, program: GLuint, index: GLuint) -> String {
-        let buf_size = self.get_active_uniform_block_i(program, index, ffi::UNIFORM_BLOCK_NAME_LENGTH);
+        let buf_size =
+            self.get_active_uniform_block_i(program, index, ffi::UNIFORM_BLOCK_NAME_LENGTH);
         let mut name = vec![0 as u8; buf_size as usize];
         let mut length: GLsizei = 0;
         unsafe {
-            self.ffi_gl_.GetActiveUniformBlockName(program,
-                                                   index,
-                                                   buf_size,
-                                                   &mut length,
-                                                   name.as_mut_ptr() as *mut GLchar);
+            self.ffi_gl_.GetActiveUniformBlockName(
+                program,
+                index,
+                buf_size,
+                &mut length,
+                name.as_mut_ptr() as *mut GLchar,
+            );
         }
         name.truncate(if length > 0 { length as usize } else { 0 });
 
         String::from_utf8(name).unwrap()
     }
 
     fn get_attrib_location(&self, program: GLuint, name: &str) -> c_int {
         let name = CString::new(name).unwrap();
-        unsafe {
-            self.ffi_gl_.GetAttribLocation(program, name.as_ptr())
-        }
+        unsafe { self.ffi_gl_.GetAttribLocation(program, name.as_ptr()) }
     }
 
     fn get_frag_data_location(&self, program: GLuint, name: &str) -> c_int {
         let name = CString::new(name).unwrap();
-        unsafe {
-            self.ffi_gl_.GetFragDataLocation(program, name.as_ptr())
-        }
+        unsafe { self.ffi_gl_.GetFragDataLocation(program, name.as_ptr()) }
     }
 
     fn get_uniform_location(&self, program: GLuint, name: &str) -> c_int {
         let name = CString::new(name).unwrap();
-        unsafe {
-            self.ffi_gl_.GetUniformLocation(program, name.as_ptr())
-        }
+        unsafe { self.ffi_gl_.GetUniformLocation(program, name.as_ptr()) }
     }
 
     fn get_program_info_log(&self, program: GLuint) -> String {
         let mut max_len = [0];
         unsafe {
             self.get_program_iv(program, ffi::INFO_LOG_LENGTH, &mut max_len);
         }
         let mut result = vec![0u8; max_len[0] as usize];
@@ -1411,24 +1599,29 @@ impl Gl for GlFns {
         unsafe {
             self.ffi_gl_.GetProgramInfoLog(
                 program,
                 max_len[0] as GLsizei,
                 &mut result_len,
                 result.as_mut_ptr() as *mut GLchar,
             );
         }
-        result.truncate(if result_len > 0 {result_len as usize} else {0});
+        result.truncate(if result_len > 0 {
+            result_len as usize
+        } else {
+            0
+        });
         String::from_utf8(result).unwrap()
     }
 
     #[inline]
     unsafe fn get_program_iv(&self, program: GLuint, pname: GLenum, result: &mut [GLint]) {
         assert!(!result.is_empty());
-        self.ffi_gl_.GetProgramiv(program, pname, result.as_mut_ptr());
+        self.ffi_gl_
+            .GetProgramiv(program, pname, result.as_mut_ptr());
     }
 
     fn get_program_binary(&self, program: GLuint) -> (Vec<u8>, GLenum) {
         if !self.ffi_gl_.GetProgramBinary.is_loaded() {
             return (Vec::new(), NONE);
         }
         let mut len = [0];
         unsafe {
@@ -1457,56 +1650,62 @@ impl Gl for GlFns {
         (binary, format)
     }
 
     fn program_binary(&self, program: GLuint, format: GLenum, binary: &[u8]) {
         if !self.ffi_gl_.ProgramBinary.is_loaded() {
             return;
         }
         unsafe {
-            self.ffi_gl_.ProgramBinary(program,
-                                       format,
-                                       binary.as_ptr() as *const c_void,
-                                       binary.len() as GLsizei);
+            self.ffi_gl_.ProgramBinary(
+                program,
+                format,
+                binary.as_ptr() as *const c_void,
+                binary.len() as GLsizei,
+            );
         }
     }
 
     fn program_parameter_i(&self, program: GLuint, pname: GLenum, value: GLint) {
         if !self.ffi_gl_.ProgramParameteri.is_loaded() {
             return;
         }
         unsafe {
             self.ffi_gl_.ProgramParameteri(program, pname, value);
         }
     }
 
     #[inline]
     unsafe fn get_vertex_attrib_iv(&self, index: GLuint, pname: GLenum, result: &mut [GLint]) {
         assert!(!result.is_empty());
-        self.ffi_gl_.GetVertexAttribiv(index, pname, result.as_mut_ptr());
+        self.ffi_gl_
+            .GetVertexAttribiv(index, pname, result.as_mut_ptr());
     }
 
     #[inline]
     unsafe fn get_vertex_attrib_fv(&self, index: GLuint, pname: GLenum, result: &mut [GLfloat]) {
         assert!(!result.is_empty());
-        self.ffi_gl_.GetVertexAttribfv(index, pname, result.as_mut_ptr());
+        self.ffi_gl_
+            .GetVertexAttribfv(index, pname, result.as_mut_ptr());
     }
 
     fn get_vertex_attrib_pointer_v(&self, index: GLuint, pname: GLenum) -> GLsizeiptr {
         let mut result = 0 as *mut GLvoid;
         unsafe {
-            self.ffi_gl_.GetVertexAttribPointerv(index, pname, &mut result)
+            self.ffi_gl_
+                .GetVertexAttribPointerv(index, pname, &mut result)
         }
         result as GLsizeiptr
     }
 
     fn get_buffer_parameter_iv(&self, target: GLuint, pname: GLenum) -> GLint {
         let mut result = 0 as GLint;
         unsafe {
-            self.ffi_gl_.GetBufferParameteriv(target, pname, &mut result);
+            self.ffi_gl_
+                .GetBufferParameteriv(target, pname, &mut result);
         }
         result
     }
 
     fn get_shader_info_log(&self, shader: GLuint) -> String {
         let mut max_len = [0];
         unsafe {
             self.get_shader_iv(shader, ffi::INFO_LOG_LENGTH, &mut max_len);
@@ -1516,66 +1715,74 @@ impl Gl for GlFns {
         unsafe {
             self.ffi_gl_.GetShaderInfoLog(
                 shader,
                 max_len[0] as GLsizei,
                 &mut result_len,
                 result.as_mut_ptr() as *mut GLchar,
             );
         }
-        result.truncate(if result_len > 0 {result_len as usize} else {0});
+        result.truncate(if result_len > 0 {
+            result_len as usize
+        } else {
+            0
+        });
         String::from_utf8(result).unwrap()
     }
 
     fn get_string(&self, which: GLenum) -> String {
         unsafe {
             let llstr = self.ffi_gl_.GetString(which);
             if !llstr.is_null() {
-                return str::from_utf8_unchecked(CStr::from_ptr(llstr as *const c_char).to_bytes()).to_string();
+                return str::from_utf8_unchecked(CStr::from_ptr(llstr as *const c_char).to_bytes())
+                    .to_string();
             } else {
                 return "".to_string();
             }
         }
     }
 
     fn get_string_i(&self, which: GLenum, index: GLuint) -> String {
         unsafe {
             let llstr = self.ffi_gl_.GetStringi(which, index);
             if !llstr.is_null() {
-                str::from_utf8_unchecked(CStr::from_ptr(llstr as *const c_char).to_bytes()).to_string()
+                str::from_utf8_unchecked(CStr::from_ptr(llstr as *const c_char).to_bytes())
+                    .to_string()
             } else {
                 "".to_string()
             }
         }
     }
 
     unsafe fn get_shader_iv(&self, shader: GLuint, pname: GLenum, result: &mut [GLint]) {
         assert!(!result.is_empty());
         self.ffi_gl_.GetShaderiv(shader, pname, result.as_mut_ptr());
     }
 
-    fn get_shader_precision_format(&self, _shader_type: GLuint, precision_type: GLuint) -> (GLint, GLint, GLint) {
+    fn get_shader_precision_format(
+        &self,
+        _shader_type: GLuint,
+        precision_type: GLuint,
+    ) -> (GLint, GLint, GLint) {
         // gl.GetShaderPrecisionFormat is not available until OpenGL 4.1.
         // Fallback to OpenGL standard precissions that most desktop hardware support.
         match precision_type {
             ffi::LOW_FLOAT | ffi::MEDIUM_FLOAT | ffi::HIGH_FLOAT => {
                 // Fallback to IEEE 754 single precision
                 // Range: from -2^127 to 2^127
                 // Significand precision: 23 bits
                 (127, 127, 23)
-            },
+            }
             ffi::LOW_INT | ffi::MEDIUM_INT | ffi::HIGH_INT => {
                 // Fallback to single precision integer
                 // Range: from -2^24 to 2^24
                 // Precision: For integer formats this value is always 0
                 (24, 24, 0)
-            },
-            _ => {
-                (0, 0, 0)
             }
+            _ => (0, 0, 0),
         }
     }
 
     fn compile_shader(&self, shader: GLuint) {
         unsafe {
             self.ffi_gl_.CompileShader(shader);
         }
     }
@@ -1648,127 +1855,102 @@ impl Gl for GlFns {
 
     fn finish(&self) {
         unsafe {
             self.ffi_gl_.Finish();
         }
     }
 
     fn get_error(&self) -> GLenum {
-        unsafe {
-            self.ffi_gl_.GetError()
-        }
+        unsafe { self.ffi_gl_.GetError() }
     }
 
     fn stencil_mask(&self, mask: GLuint) {
-        unsafe {
-            self.ffi_gl_.StencilMask(mask)
-        }
+        unsafe { self.ffi_gl_.StencilMask(mask) }
     }
 
     fn stencil_mask_separate(&self, face: GLenum, mask: GLuint) {
-        unsafe {
-            self.ffi_gl_.StencilMaskSeparate(face, mask)
-        }
+        unsafe { self.ffi_gl_.StencilMaskSeparate(face, mask) }
     }
 
-    fn stencil_func(&self,
-                    func: GLenum,
-                    ref_: GLint,
-                    mask: GLuint) {
-        unsafe {
-            self.ffi_gl_.StencilFunc(func, ref_, mask)
-        }
+    fn stencil_func(&self, func: GLenum, ref_: GLint, mask: GLuint) {
+        unsafe { self.ffi_gl_.StencilFunc(func, ref_, mask) }
     }
 
-    fn stencil_func_separate(&self,
-                             face: GLenum,
-                             func: GLenum,
-                             ref_: GLint,
-                             mask: GLuint) {
-        unsafe {
-            self.ffi_gl_.StencilFuncSeparate(face, func, ref_, mask)
-        }
+    fn stencil_func_separate(&self, face: GLenum, func: GLenum, ref_: GLint, mask: GLuint) {
+        unsafe { self.ffi_gl_.StencilFuncSeparate(face, func, ref_, mask) }
     }
 
-    fn stencil_op(&self,
-                  sfail: GLenum,
-                  dpfail: GLenum,
-                  dppass: GLenum) {
-        unsafe {
-            self.ffi_gl_.StencilOp(sfail, dpfail, dppass)
-        }
+    fn stencil_op(&self, sfail: GLenum, dpfail: GLenum, dppass: GLenum) {
+        unsafe { self.ffi_gl_.StencilOp(sfail, dpfail, dppass) }
     }
 
-    fn stencil_op_separate(&self,
-                           face: GLenum,
-                           sfail: GLenum,
-                           dpfail: GLenum,
-                           dppass: GLenum) {
-        unsafe {
-            self.ffi_gl_.StencilOpSeparate(face, sfail, dpfail, dppass)
-        }
+    fn stencil_op_separate(&self, face: GLenum, sfail: GLenum, dpfail: GLenum, dppass: GLenum) {
+        unsafe { self.ffi_gl_.StencilOpSeparate(face, sfail, dpfail, dppass) }
     }
 
     #[allow(unused_variables)]
     fn egl_image_target_texture2d_oes(&self, target: GLenum, image: GLeglImageOES) {
         panic!("not supported")
     }
 
     fn generate_mipmap(&self, target: GLenum) {
-        unsafe {
-            self.ffi_gl_.GenerateMipmap(target)
-        }
+        unsafe { self.ffi_gl_.GenerateMipmap(target) }
     }
 
     fn insert_event_marker_ext(&self, message: &str) {
         if self.ffi_gl_.InsertEventMarkerEXT.is_loaded() {
             unsafe {
-                self.ffi_gl_.InsertEventMarkerEXT(message.len() as GLsizei, message.as_ptr() as *const _);
+                self.ffi_gl_
+                    .InsertEventMarkerEXT(message.len() as GLsizei, message.as_ptr() as *const _);
             }
         }
     }
 
     fn push_group_marker_ext(&self, message: &str) {
         if self.ffi_gl_.PushGroupMarkerEXT.is_loaded() {
             unsafe {
-                self.ffi_gl_.PushGroupMarkerEXT(message.len() as GLsizei, message.as_ptr() as *const _);
+                self.ffi_gl_
+                    .PushGroupMarkerEXT(message.len() as GLsizei, message.as_ptr() as *const _);
             }
         }
     }
 
     fn pop_group_marker_ext(&self) {
         if self.ffi_gl_.PopGroupMarkerEXT.is_loaded() {
             unsafe {
                 self.ffi_gl_.PopGroupMarkerEXT();
             }
         }
     }
 
     fn fence_sync(&self, condition: GLenum, flags: GLbitfield) -> GLsync {
-        unsafe {
-           self.ffi_gl_.FenceSync(condition, flags) as *const _
-        }
+        unsafe { self.ffi_gl_.FenceSync(condition, flags) as *const _ }
     }
 
     fn client_wait_sync(&self, sync: GLsync, flags: GLbitfield, timeout: GLuint64) {
         unsafe {
-            self.ffi_gl_.ClientWaitSync(sync as *const _, flags, timeout);
+            self.ffi_gl_
+                .ClientWaitSync(sync as *const _, flags, timeout);
         }
     }
 
     fn wait_sync(&self, sync: GLsync, flags: GLbitfield, timeout: GLuint64) {
         unsafe {
             self.ffi_gl_.WaitSync(sync as *const _, flags, timeout);
         }
     }
 
     fn texture_range_apple(&self, target: GLenum, data: &[u8]) {
         unsafe {
-            self.ffi_gl_.TextureRangeAPPLE(target, data.len() as GLsizei, data.as_ptr() as *const c_void);
+            self.ffi_gl_.TextureRangeAPPLE(
+                target,
+                data.len() as GLsizei,
+                data.as_ptr() as *const c_void,
+            );
         }
     }
 
     fn delete_sync(&self, sync: GLsync) {
         unsafe {
             self.ffi_gl_.DeleteSync(sync as *const _);
         }
     }
@@ -1778,17 +1960,18 @@ impl Gl for GlFns {
         unsafe {
             self.ffi_gl_.GenFencesAPPLE(n, result.as_mut_ptr());
         }
         result
     }
 
     fn delete_fences_apple(&self, fences: &[GLuint]) {
         unsafe {
-            self.ffi_gl_.DeleteFencesAPPLE(fences.len() as GLsizei, fences.as_ptr());
+            self.ffi_gl_
+                .DeleteFencesAPPLE(fences.len() as GLsizei, fences.as_ptr());
         }
     }
 
     fn set_fence_apple(&self, fence: GLuint) {
         unsafe {
             self.ffi_gl_.SetFenceAPPLE(fence);
         }
     }
@@ -1824,47 +2007,36 @@ impl Gl for GlFns {
                 program,
                 color_number,
                 index,
                 c_string.as_ptr(),
             )
         }
     }
 
-    fn get_frag_data_index(
-        &self,
-        program: GLuint,
-        name: &str,
-    ) -> GLint {
+    fn get_frag_data_index(&self, program: GLuint, name: &str) -> GLint {
         if !self.ffi_gl_.GetFragDataIndex.is_loaded() {
             return -1;
         }
 
         let c_string = CString::new(name).unwrap();
 
-        unsafe {
-            self.ffi_gl_.GetFragDataIndex(
-                program,
-                c_string.as_ptr(),
-            )
-        }
+        unsafe { self.ffi_gl_.GetFragDataIndex(program, c_string.as_ptr()) }
     }
 
     // GL_KHR_debug
     fn get_debug_messages(&self) -> Vec<DebugMessage> {
         if !self.ffi_gl_.GetDebugMessageLog.is_loaded() {
             return Vec::new();
         }
 
         let mut max_message_len = 0;
         unsafe {
-            self.ffi_gl_.GetIntegerv(
-                ffi::MAX_DEBUG_MESSAGE_LENGTH,
-                &mut max_message_len
-            )
+            self.ffi_gl_
+                .GetIntegerv(ffi::MAX_DEBUG_MESSAGE_LENGTH, &mut max_message_len)
         }
 
         let mut output = Vec::new();
         const CAPACITY: usize = 4;
 
         let mut msg_data = vec![0u8; CAPACITY * max_message_len as usize];
         let mut sources = [0 as GLenum; CAPACITY];
         let mut types = [0 as GLenum; CAPACITY];
@@ -1882,28 +2054,27 @@ impl Gl for GlFns {
                     ids.as_mut_ptr(),
                     severities.as_mut_ptr(),
                     lengths.as_mut_ptr(),
                     msg_data.as_mut_ptr() as *mut _,
                 )
             };
 
             let mut offset = 0;
-            output.extend((0 .. count as usize).map(|i| {
+            output.extend((0..count as usize).map(|i| {
                 let len = lengths[i] as usize;
-                let slice = &msg_data[offset .. offset + len];
+                let slice = &msg_data[offset..offset + len];
                 offset += len;
                 DebugMessage {
                     message: String::from_utf8_lossy(slice).to_string(),
                     source: sources[i],
                     ty: types[i],
                     id: ids[i],
                     severity: severities[i],
                 }
             }));
 
             if (count as usize) < CAPACITY {
-                return output
+                return output;
             }
         }
     }
 }
-
--- a/third_party/rust/gleam/src/gles_fns.rs
+++ b/third_party/rust/gleam/src/gles_fns.rs
@@ -6,88 +6,148 @@
 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
 pub struct GlesFns {
     ffi_gl_: GlesFfi,
 }
 
-impl GlesFns
-{
-    pub unsafe fn load_with<'a, F>(loadfn: F) -> Rc<Gl> where F: FnMut(&str) -> *const c_void {
+impl GlesFns {
+    pub unsafe fn load_with<'a, F>(loadfn: F) -> Rc<Gl>
+    where
+        F: FnMut(&str) -> *const c_void,
+    {
         let ffi_gl_ = GlesFfi::load_with(loadfn);
-        Rc::new(GlesFns {
-            ffi_gl_: ffi_gl_,
-        }) as Rc<Gl>
+        Rc::new(GlesFns { ffi_gl_: ffi_gl_ }) as Rc<Gl>
     }
 }
 
 impl Gl for GlesFns {
     fn get_type(&self) -> GlType {
         GlType::Gles
     }
 
-    fn buffer_data_untyped(&self, target: GLenum, size: GLsizeiptr, data: *const GLvoid, usage: GLenum) {
+    fn buffer_data_untyped(
+        &self,
+        target: GLenum,
+        size: GLsizeiptr,
+        data: *const GLvoid,
+        usage: GLenum,
+    ) {
         unsafe {
-            self.ffi_gl_.BufferData(target,
-                                    size,
-                                    data,
-                                    usage);
+            self.ffi_gl_.BufferData(target, size, data, usage);
         }
     }
 
     fn tex_buffer(&self, _target: GLenum, _internal_format: GLenum, _buffer: GLuint) {
         panic!("not supported")
     }
 
-    fn buffer_sub_data_untyped(&self, target: GLenum, offset: isize, size: GLsizeiptr, data: *const GLvoid) {
+    fn buffer_sub_data_untyped(
+        &self,
+        target: GLenum,
+        offset: isize,
+        size: GLsizeiptr,
+        data: *const GLvoid,
+    ) {
         unsafe {
-            self.ffi_gl_.BufferSubData(target,
-                                       offset,
-                                       size,
-                                       data);
+            self.ffi_gl_.BufferSubData(target, offset, size, data);
+        }
+    }
+
+    fn map_buffer_range(&self,
+                        target: GLenum,
+                        offset: GLintptr,
+                        length: GLsizeiptr,
+                        access: GLbitfield) -> *mut c_void {
+        unsafe {
+            return self.ffi_gl_.MapBufferRange(target, offset, length, access);
+        }
+    }
+
+    fn unmap_buffer(&self, target: GLenum) -> GLboolean {
+        unsafe {
+            return self.ffi_gl_.UnmapBuffer(target);
         }
     }
 
     fn shader_source(&self, shader: GLuint, strings: &[&[u8]]) {
         let pointers: Vec<*const u8> = strings.iter().map(|string| (*string).as_ptr()).collect();
         let lengths: Vec<GLint> = strings.iter().map(|string| string.len() as GLint).collect();
         unsafe {
-            self.ffi_gl_.ShaderSource(shader, pointers.len() as GLsizei,
-                                      pointers.as_ptr() as *const *const GLchar, lengths.as_ptr());
+            self.ffi_gl_.ShaderSource(
+                shader,
+                pointers.len() as GLsizei,
+                pointers.as_ptr() as *const *const GLchar,
+                lengths.as_ptr(),
+            );
         }
         drop(lengths);
         drop(pointers);
     }
 
     #[allow(unused_variables)]
     fn read_buffer(&self, mode: GLenum) {
         panic!("not supported")
     }
 
-    fn read_pixels_into_buffer(&self, x: GLint, y: GLint, width: GLsizei, height: GLsizei,
-                               format: GLenum, pixel_type: GLenum, dst_buffer: &mut [u8]) {
+    fn read_pixels_into_buffer(
+        &self,
+        x: GLint,
+        y: GLint,
+        width: GLsizei,
+        height: GLsizei,
+        format: GLenum,
+        pixel_type: GLenum,
+        dst_buffer: &mut [u8],
+    ) {
         // Assumes that the user properly allocated the size for dst_buffer.
         assert!(calculate_length(width, height, format, pixel_type) == dst_buffer.len());
 
         unsafe {
             // We don't want any alignment padding on pixel rows.
             self.ffi_gl_.PixelStorei(ffi::PACK_ALIGNMENT, 1);
-            self.ffi_gl_.ReadPixels(x, y, width, height, format, pixel_type, dst_buffer.as_mut_ptr() as *mut c_void);
+            self.ffi_gl_.ReadPixels(
+                x,
+                y,
+                width,
+                height,
+                format,
+                pixel_type,
+                dst_buffer.as_mut_ptr() as *mut c_void,
+            );
         }
     }
 
-    fn read_pixels(&self, x: GLint, y: GLint, width: GLsizei, height: GLsizei, format: GLenum, pixel_type: GLenum) -> Vec<u8> {
+    fn read_pixels(
+        &self,
+        x: GLint,
+        y: GLint,
+        width: GLsizei,
+        height: GLsizei,
+        format: GLenum,
+        pixel_type: GLenum,
+    ) -> Vec<u8> {
         let len = calculate_length(width, height, format, pixel_type);
         let mut pixels: Vec<u8> = Vec::new();
         pixels.reserve(len);
-        unsafe { pixels.set_len(len); }
+        unsafe {
+            pixels.set_len(len);
+        }
 
-        self.read_pixels_into_buffer(x, y, width, height, format, pixel_type, pixels.as_mut_slice());
+        self.read_pixels_into_buffer(
+            x,
+            y,
+            width,
+            height,
+            format,
+            pixel_type,
+            pixels.as_mut_slice(),
+        );
 
         pixels
     }
 
     fn sample_coverage(&self, value: GLclampf, invert: bool) {
         unsafe {
             self.ffi_gl_.SampleCoverage(value, invert as GLboolean);
         }
@@ -227,73 +287,83 @@ impl Gl for GlesFns {
         result
     }
 
     fn delete_queries(&self, queries: &[GLuint]) {
         if !self.ffi_gl_.DeleteQueriesEXT.is_loaded() {
             return;
         }
         unsafe {
-            self.ffi_gl_.DeleteQueriesEXT(queries.len() as GLsizei, queries.as_ptr());
+            self.ffi_gl_
+                .DeleteQueriesEXT(queries.len() as GLsizei, queries.as_ptr());
         }
     }
 
     fn delete_vertex_arrays(&self, vertex_arrays: &[GLuint]) {
         unsafe {
-            self.ffi_gl_.DeleteVertexArrays(vertex_arrays.len() as GLsizei, vertex_arrays.as_ptr());
+            self.ffi_gl_
+                .DeleteVertexArrays(vertex_arrays.len() as GLsizei, vertex_arrays.as_ptr());
         }
     }
 
     fn delete_buffers(&self, buffers: &[GLuint]) {
         unsafe {
-            self.ffi_gl_.DeleteBuffers(buffers.len() as GLsizei, buffers.as_ptr());
+            self.ffi_gl_
+                .DeleteBuffers(buffers.len() as GLsizei, buffers.as_ptr());
         }
     }
 
     fn delete_renderbuffers(&self, renderbuffers: &[GLuint]) {
         unsafe {
-            self.ffi_gl_.DeleteRenderbuffers(renderbuffers.len() as GLsizei, renderbuffers.as_ptr());
+            self.ffi_gl_
+                .DeleteRenderbuffers(renderbuffers.len() as GLsizei, renderbuffers.as_ptr());
         }
     }
 
     fn delete_framebuffers(&self, framebuffers: &[GLuint]) {
         unsafe {
-            self.ffi_gl_.DeleteFramebuffers(framebuffers.len() as GLsizei, framebuffers.as_ptr());
+            self.ffi_gl_
+                .DeleteFramebuffers(framebuffers.len() as GLsizei, framebuffers.as_ptr());
         }
     }
 
     fn delete_textures(&self, textures: &[GLuint]) {
         unsafe {
-            self.ffi_gl_.DeleteTextures(textures.len() as GLsizei, textures.as_ptr());
+            self.ffi_gl_
+                .DeleteTextures(textures.len() as GLsizei, textures.as_ptr());
         }
     }
 
-    fn framebuffer_renderbuffer(&self,
-                                target: GLenum,
-                                attachment: GLenum,
-                                renderbuffertarget: GLenum,
-                                renderbuffer: GLuint) {
+    fn framebuffer_renderbuffer(
+        &self,
+        target: GLenum,
+        attachment: GLenum,
+        renderbuffertarget: GLenum,
+        renderbuffer: GLuint,
+    ) {
         unsafe {
-            self.ffi_gl_.FramebufferRenderbuffer(target,
-                                                 attachment,
-                                                 renderbuffertarget,
-                                                 renderbuffer);
+            self.ffi_gl_.FramebufferRenderbuffer(
+                target,
+                attachment,
+                renderbuffertarget,
+                renderbuffer,
+            );
         }
     }
 
-    fn renderbuffer_storage(&self,
-                                target: GLenum,
-                                internalformat: GLenum,
-                                width: GLsizei,
-                                height: GLsizei) {
+    fn renderbuffer_storage(
+        &self,
+        target: GLenum,
+        internalformat: GLenum,
+        width: GLsizei,
+        height: GLsizei,
+    ) {
         unsafe {
-            self.ffi_gl_.RenderbufferStorage(target,
-                                             internalformat,
-                                             width,
-                                             height);
+            self.ffi_gl_
+                .RenderbufferStorage(target, internalformat, width, height);
         }
     }
 
     fn depth_func(&self, func: GLenum) {
         unsafe {
             self.ffi_gl_.DepthFunc(func);
         }
     }
@@ -308,68 +378,88 @@ impl Gl for GlesFns {
         unsafe {
             self.ffi_gl_.AttachShader(program, shader);
         }
     }
 
     fn bind_attrib_location(&self, program: GLuint, index: GLuint, name: &str) {
         let c_string = CString::new(name).unwrap();
         unsafe {
-            self.ffi_gl_.BindAttribLocation(program, index, c_string.as_ptr())
+            self.ffi_gl_
+                .BindAttribLocation(program, index, c_string.as_ptr())
         }
     }
 
     // https://www.khronos.org/registry/OpenGL-Refpages/es2.0/xhtml/glGetUniform.xml
     unsafe fn get_uniform_iv(&self, program: GLuint, location: GLint, result: &mut [GLint]) {
         assert!(!result.is_empty());
-        self.ffi_gl_.GetUniformiv(program, location, result.as_mut_ptr());
+        self.ffi_gl_
+            .GetUniformiv(program, location, result.as_mut_ptr());
     }
 
     // https://www.khronos.org/registry/OpenGL-Refpages/es2.0/xhtml/glGetUniform.xml
     unsafe fn get_uniform_fv(&self, program: GLuint, location: GLint, result: &mut [GLfloat]) {
         assert!(!result.is_empty());
-        self.ffi_gl_.GetUniformfv(program, location, result.as_mut_ptr());
+        self.ffi_gl_
+            .GetUniformfv(program, location, result.as_mut_ptr());
     }
 
     fn get_uniform_block_index(&self, program: GLuint, name: &str) -> GLuint {
         let c_string = CString::new(name).unwrap();
         unsafe {
-            self.ffi_gl_.GetUniformBlockIndex(program, c_string.as_ptr())
+            self.ffi_gl_
+                .GetUniformBlockIndex(program, c_string.as_ptr())
         }
     }
 
-    fn get_uniform_indices(&self,  program: GLuint, names: &[&str]) -> Vec<GLuint> {
+    fn get_uniform_indices(&self, program: GLuint, names: &[&str]) -> Vec<GLuint> {
         let c_strings: Vec<CString> = names.iter().map(|n| CString::new(*n).unwrap()).collect();
         let pointers: Vec<*const GLchar> = c_strings.iter().map(|string| string.as_ptr()).collect();
         let mut result = Vec::with_capacity(c_strings.len());
         unsafe {
             result.set_len(c_strings.len());
-            self.ffi_gl_.GetUniformIndices(program,
-                                           pointers.len() as GLsizei,
-                                           pointers.as_ptr(),
-                                           result.as_mut_ptr());
+            self.ffi_gl_.GetUniformIndices(
+                program,
+                pointers.len() as GLsizei,
+                pointers.as_ptr(),
+                result.as_mut_ptr(),
+            );
         }
         result
     }
 
     fn bind_buffer_base(&self, target: GLenum, index: GLuint, buffer: GLuint) {
         unsafe {
             self.ffi_gl_.BindBufferBase(target, index, buffer);
         }
     }
 
-    fn bind_buffer_range(&self, target: GLenum, index: GLuint, buffer: GLuint, offset: GLintptr, size: GLsizeiptr) {
+    fn bind_buffer_range(
+        &self,
+        target: GLenum,
+        index: GLuint,
+        buffer: GLuint,
+        offset: GLintptr,
+        size: GLsizeiptr,
+    ) {
         unsafe {
-            self.ffi_gl_.BindBufferRange(target, index, buffer, offset, size);
+            self.ffi_gl_
+                .BindBufferRange(target, index, buffer, offset, size);
         }
     }
 
-    fn uniform_block_binding(&self, program: GLuint, uniform_block_index: GLuint, uniform_block_binding: GLuint) {
+    fn uniform_block_binding(
+        &self,
+        program: GLuint,
+        uniform_block_index: GLuint,
+        uniform_block_binding: GLuint,
+    ) {
         unsafe {
-            self.ffi_gl_.UniformBlockBinding(program, uniform_block_index, uniform_block_binding);
+            self.ffi_gl_
+                .UniformBlockBinding(program, uniform_block_index, uniform_block_binding);
         }
     }
 
     fn bind_buffer(&self, target: GLenum, buffer: GLuint) {
         unsafe {
             self.ffi_gl_.BindBuffer(target, buffer);
         }
     }
@@ -395,351 +485,409 @@ impl Gl for GlesFns {
     fn bind_texture(&self, target: GLenum, texture: GLuint) {
         unsafe {
             self.ffi_gl_.BindTexture(target, texture);
         }
     }
 
     fn draw_buffers(&self, bufs: &[GLenum]) {
         unsafe {
-            self.ffi_gl_.DrawBuffers(bufs.len() as GLsizei, bufs.as_ptr());
+            self.ffi_gl_
+                .DrawBuffers(bufs.len() as GLsizei, bufs.as_ptr());
         }
     }
 
     // FIXME: Does not verify buffer size -- unsafe!
-    fn tex_image_2d(&self,
-                    target: GLenum,
-                    level: GLint,
-                    internal_format: GLint,
-                    width: GLsizei,
-                    height: GLsizei,
-                    border: GLint,
-                    format: GLenum,
-                    ty: GLenum,
-                    opt_data: Option<&[u8]>) {
+    fn tex_image_2d(
+        &self,
+        target: GLenum,
+        level: GLint,
+        internal_format: GLint,
+        width: GLsizei,
+        height: GLsizei,
+        border: GLint,
+        format: GLenum,
+        ty: GLenum,
+        opt_data: Option<&[u8]>,
+    ) {
         match opt_data {
-            Some(data) => {
-                unsafe {
-                    self.ffi_gl_.TexImage2D(target, level, internal_format, width, height, border, format, ty,
-                                            data.as_ptr() as *const GLvoid);
-                }
-            }
-            None => {
-                unsafe {
-                    self.ffi_gl_.TexImage2D(target, level, internal_format, width, height, border, format, ty,
-                                            ptr::null());
-                }
-            }
+            Some(data) => unsafe {
+                self.ffi_gl_.TexImage2D(
+                    target,
+                    level,
+                    internal_format,
+                    width,
+                    height,
+                    border,
+                    format,
+                    ty,
+                    data.as_ptr() as *const GLvoid,
+                );
+            },
+            None => unsafe {
+                self.ffi_gl_.TexImage2D(
+                    target,
+                    level,
+                    internal_format,
+                    width,
+                    height,
+                    border,
+                    format,
+                    ty,
+                    ptr::null(),
+                );
+            },
         }
     }
 
-    fn compressed_tex_image_2d(&self,
-                               target: GLenum,
-                               level: GLint,
-                               internal_format: GLenum,
-                               width: GLsizei,
-                               height: GLsizei,
-                               border: GLint,
-                               data: &[u8]) {
+    fn compressed_tex_image_2d(
+        &self,
+        target: GLenum,
+        level: GLint,
+        internal_format: GLenum,
+        width: GLsizei,
+        height: GLsizei,
+        border: GLint,
+        data: &[u8],
+    ) {
         unsafe {
-            self.ffi_gl_.CompressedTexImage2D(target, level, internal_format, width, height, border,
-                                              data.len() as GLsizei, data.as_ptr() as *const GLvoid);
+            self.ffi_gl_.CompressedTexImage2D(
+                target,
+                level,
+                internal_format,
+                width,
+                height,
+                border,
+                data.len() as GLsizei,
+                data.as_ptr() as *const GLvoid,
+            );
         }
     }
 
-    fn compressed_tex_sub_image_2d(&self,
-                                   target: GLenum,
-                                   level: GLint,
-                                   xoffset: GLint,
-                                   yoffset: GLint,
-                                   width: GLsizei,
-                                   height: GLsizei,
-                                   format: GLenum,
-                                   data: &[u8]) {
+    fn compressed_tex_sub_image_2d(
+        &self,
+        target: GLenum,
+        level: GLint,
+        xoffset: GLint,
+        yoffset: GLint,
+        width: GLsizei,
+        height: GLsizei,
+        format: GLenum,
+        data: &[u8],
+    ) {
         unsafe {
-            self.ffi_gl_.CompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format,
-                                                 data.len() as GLsizei, data.as_ptr() as *const GLvoid);
+            self.ffi_gl_.CompressedTexSubImage2D(
+                target,
+                level,
+                xoffset,
+                yoffset,
+                width,
+                height,
+                format,
+                data.len() as GLsizei,
+                data.as_ptr() as *const GLvoid,
+            );
         }
     }
 
     // FIXME: Does not verify buffer size -- unsafe!
-    fn tex_image_3d(&self,
-                    target: GLenum,
-                    level: GLint,
-                    internal_format: GLint,
-                    width: GLsizei,
-                    height: GLsizei,
-                    depth: GLsizei,
-                    border: GLint,
-                    format: GLenum,
-                    ty: GLenum,
-                    opt_data: Option<&[u8]>) {
+    fn tex_image_3d(
+        &self,
+        target: GLenum,
+        level: GLint,
+        internal_format: GLint,
+        width: GLsizei,
+        height: GLsizei,
+        depth: GLsizei,
+        border: GLint,
+        format: GLenum,
+        ty: GLenum,
+        opt_data: Option<&[u8]>,
+    ) {
         unsafe {
             let pdata = match opt_data {
                 Some(data) => mem::transmute(data.as_ptr()),
                 None => ptr::null(),
             };
-            self.ffi_gl_.TexImage3D(target,
-                                    level,
-                                    internal_format,
-                                    width,
-                                    height,
-                                    depth,
-                                    border,
-                                    format,
-                                    ty,
-                                    pdata);
+            self.ffi_gl_.TexImage3D(
+                target,
+                level,
+                internal_format,
+                width,
+                height,
+                depth,
+                border,
+                format,
+                ty,
+                pdata,
+            );
         }
     }
 
-    fn copy_tex_image_2d(&self,
-                         target: GLenum,
-                         level: GLint,
-                         internal_format: GLenum,
-                         x: GLint,
-                         y: GLint,
-                         width: GLsizei,
-                         height: GLsizei,
-                         border: GLint) {
+    fn copy_tex_image_2d(
+        &self,
+        target: GLenum,
+        level: GLint,
+        internal_format: GLenum,
+        x: GLint,
+        y: GLint,
+        width: GLsizei,
+        height: GLsizei,
+        border: GLint,
+    ) {
         unsafe {
-            self.ffi_gl_.CopyTexImage2D(target,
-                                        level,
-                                        internal_format,
-                                        x,
-                                        y,
-                                        width,
-                                        height,
-                                        border);
+            self.ffi_gl_.CopyTexImage2D(
+                target,
+                level,
+                internal_format,
+                x,
+                y,
+                width,
+                height,
+                border,
+            );
         }
     }
 
-    fn copy_tex_sub_image_2d(&self,
-                             target: GLenum,
-                             level: GLint,
-                             xoffset: GLint,
-                             yoffset: GLint,
-                             x: GLint,
-                             y: GLint,
-                             width: GLsizei,
-                             height: GLsizei) {
+    fn copy_tex_sub_image_2d(
+        &self,
+        target: GLenum,
+        level: GLint,
+        xoffset: GLint,
+        yoffset: GLint,
+        x: GLint,
+        y: GLint,
+        width: GLsizei,
+        height: GLsizei,
+    ) {
         unsafe {
-            self.ffi_gl_.CopyTexSubImage2D(target,
-                                           level,
-                                           xoffset,
-                                           yoffset,
-                                           x,
-                                           y,
-                                           width,
-                                           height);
+            self.ffi_gl_
+                .CopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
         }
     }
 
-    fn copy_tex_sub_image_3d(&self,
-                             target: GLenum,
-                             level: GLint,
-                             xoffset: GLint,
-                             yoffset: GLint,
-                             zoffset: GLint,
-                             x: GLint,
-                             y: GLint,
-                             width: GLsizei,
-                             height: GLsizei) {
+    fn copy_tex_sub_image_3d(
+        &self,
+        target: GLenum,
+        level: GLint,
+        xoffset: GLint,
+        yoffset: GLint,
+        zoffset: GLint,
+        x: GLint,
+        y: GLint,
+        width: GLsizei,
+        height: GLsizei,
+    ) {
         unsafe {
-            self.ffi_gl_.CopyTexSubImage3D(target,
-                                           level,
-                                           xoffset,
-                                           yoffset,
-                                           zoffset,
-                                           x,
-                                           y,
-                                           width,
-                                           height);
+            self.ffi_gl_.CopyTexSubImage3D(
+                target, level, xoffset, yoffset, zoffset, x, y, width, height,
+            );
         }
     }
 
-    fn tex_sub_image_2d(&self,
-                        target: GLenum,
-                        level: GLint,
-                        xoffset: GLint,
-                        yoffset: GLint,
-                        width: GLsizei,
-                        height: GLsizei,
-                        format: GLenum,
-                        ty: GLenum,
-                        data: &[u8]) {
+    fn tex_sub_image_2d(
+        &self,
+        target: GLenum,
+        level: GLint,
+        xoffset: GLint,
+        yoffset: GLint,
+        width: GLsizei,
+        height: GLsizei,
+        format: GLenum,
+        ty: GLenum,
+        data: &[u8],
+    ) {
         unsafe {
-            self.ffi_gl_.TexSubImage2D(target, level, xoffset, yoffset, width, height, format, ty, data.as_ptr() as *const c_void);
+            self.ffi_gl_.TexSubImage2D(
+                target,
+                level,
+                xoffset,
+                yoffset,
+                width,
+                height,
+                format,
+                ty,
+                data.as_ptr() as *const c_void,
+            );
         }
     }
 
-    fn tex_sub_image_2d_pbo(&self,
-                            target: GLenum,
-                            level: GLint,
-                            xoffset: GLint,
-                            yoffset: GLint,
-                            width: GLsizei,
-                            height: GLsizei,
-                            format: GLenum,
-                            ty: GLenum,
-                            offset: usize) {
+    fn tex_sub_image_2d_pbo(
+        &self,
+        target: GLenum,
+        level: GLint,
+        xoffset: GLint,
+        yoffset: GLint,
+        width: GLsizei,
+        height: GLsizei,
+        format: GLenum,
+        ty: GLenum,
+        offset: usize,
+    ) {
         unsafe {
-            self.ffi_gl_.TexSubImage2D(target, level, xoffset, yoffset, width, height, format, ty, offset as *const c_void);
+            self.ffi_gl_.TexSubImage2D(
+                target,
+                level,
+                xoffset,
+                yoffset,
+                width,
+                height,
+                format,
+                ty,
+                offset as *const c_void,
+            );
         }
     }
 
-    fn tex_sub_image_3d(&self,
-                        target: GLenum,
-                        level: GLint,
-                        xoffset: GLint,
-                        yoffset: GLint,
-                        zoffset: GLint,
-                        width: GLsizei,
-                        height: GLsizei,
-                        depth: GLsizei,
-                        format: GLenum,
-                        ty: GLenum,
-                        data: &[u8]) {
+    fn tex_sub_image_3d(
+        &self,
+        target: GLenum,
+        level: GLint,
+        xoffset: GLint,
+        yoffset: GLint,
+        zoffset: GLint,
+        width: GLsizei,
+        height: GLsizei,
+        depth: GLsizei,
+        format: GLenum,
+        ty: GLenum,
+        data: &[u8],
+    ) {
         unsafe {
-            self.ffi_gl_.TexSubImage3D(target,
-                                       level,
-                                       xoffset,
-                                       yoffset,
-                                       zoffset,
-                                       width,
-                                       height,
-                                       depth,
-                                       format,
-                                       ty,
-                                       data.as_ptr() as *const c_void);
+            self.ffi_gl_.TexSubImage3D(
+                target,
+                level,
+                xoffset,
+                yoffset,
+                zoffset,
+                width,
+                height,
+                depth,
+                format,
+                ty,
+                data.as_ptr() as *const c_void,
+            );
         }
     }
 
-    fn tex_sub_image_3d_pbo(&self,
-                            target: GLenum,
-                            level: GLint,
-                            xoffset: GLint,
-                            yoffset: GLint,
-                            zoffset: GLint,
-                            width: GLsizei,
-                            height: GLsizei,
-                            depth: GLsizei,
-                            format: GLenum,
-                            ty: GLenum,
-                            offset: usize) {
+    fn tex_sub_image_3d_pbo(
+        &self,
+        target: GLenum,
+        level: GLint,
+        xoffset: GLint,
+        yoffset: GLint,
+        zoffset: GLint,
+        width: GLsizei,
+        height: GLsizei,
+        depth: GLsizei,
+        format: GLenum,
+        ty: GLenum,
+        offset: usize,
+    ) {
         unsafe {
-            self.ffi_gl_.TexSubImage3D(target,
-                                       level,
-                                       xoffset,
-                                       yoffset,
-                                       zoffset,
-                                       width,
-                                       height,
-                                       depth,
-                                       format,
-                                       ty,
-                                       offset as *const c_void);
+            self.ffi_gl_.TexSubImage3D(
+                target,
+                level,
+                xoffset,
+                yoffset,
+                zoffset,
+                width,
+                height,
+                depth,
+                format,
+                ty,
+                offset as *const c_void,
+            );
         }
     }
 
-    fn tex_storage_2d(&self,
-                      target: GLenum,
-                      levels: GLint,
-                      internal_format: GLenum,
-                      width: GLsizei,
-                      height: GLsizei) {
+    fn tex_storage_2d(
+        &self,
+        target: GLenum,
+        levels: GLint,
+        internal_format: GLenum,
+        width: GLsizei,
+        height: GLsizei,
+    ) {
         unsafe {
-            self.ffi_gl_.TexStorage2D(target,
-                                      levels,
-                                      internal_format,
-                                      width,
-                                      height);
+            self.ffi_gl_
+                .TexStorage2D(target, levels, internal_format, width, height);
         }
     }
 
-    fn tex_storage_3d(&self,
-                      target: GLenum,
-                      levels: GLint,
-                      internal_format: GLenum,
-                      width: GLsizei,
-                      height: GLsizei,
-                      depth: GLsizei) {
+    fn tex_storage_3d(
+        &self,
+        target: GLenum,
+        levels: GLint,
+        internal_format: GLenum,
+        width: GLsizei,
+        height: GLsizei,
+        depth: GLsizei,
+    ) {
         unsafe {
-            self.ffi_gl_.TexStorage3D(target,
-                                      levels,
-                                      internal_format,
-                                      width,
-                                      height,
-                                      depth);
+            self.ffi_gl_
+                .TexStorage3D(target, levels, internal_format, width, height, depth);
         }
     }
 
     #[allow(unused_variables)]
-    fn get_tex_image_into_buffer(&self,
-                                 target: GLenum,
-                                 level: GLint,
-                                 format: GLenum,
-                                 ty: GLenum,
-                                 output: &mut [u8]) {
+    fn get_tex_image_into_buffer(
+        &self,
+        target: GLenum,
+        level: GLint,
+        format: GLenum,
+        ty: GLenum,
+        output: &mut [u8],
+    ) {
         panic!("not supported");
     }
 
-    unsafe fn copy_image_sub_data(&self,
-                                  src_name: GLuint,
-                                  src_target: GLenum,
-                                  src_level: GLint,
-                                  src_x: GLint,
-                                  src_y: GLint,
-                                  src_z: GLint,
-                                  dst_name: GLuint,
-                                  dst_target: GLenum,
-                                  dst_level: GLint,
-                                  dst_x: GLint,
-                                  dst_y: GLint,
-                                  dst_z: GLint,
-                                  src_width: GLsizei,
-                                  src_height: GLsizei,
-                                  src_depth: GLsizei) {
+    unsafe fn copy_image_sub_data(
+        &self,
+        src_name: GLuint,
+        src_target: GLenum,
+        src_level: GLint,
+        src_x: GLint,
+        src_y: GLint,
+        src_z: GLint,
+        dst_name: GLuint,
+        dst_target: GLenum,
+        dst_level: GLint,
+        dst_x: GLint,
+        dst_y: GLint,
+        dst_z: GLint,
+        src_width: GLsizei,
+        src_height: GLsizei,
+        src_depth: GLsizei,
+    ) {
         self.ffi_gl_.CopyImageSubDataEXT(
-            src_name,
-            src_target,
-            src_level,
-            src_x,
-            src_y,
-            src_z,
-            dst_name,
-            dst_target,
-            dst_level,
-            dst_x,
-            dst_y,
-            dst_z,
-            src_width,
-            src_height,
-            src_depth,
+            src_name, src_target, src_level, src_x, src_y, src_z, dst_name, dst_target, dst_level,
+            dst_x, dst_y, dst_z, src_width, src_height, src_depth,
         );
     }
 
-    fn invalidate_framebuffer(&self,
-                              target: GLenum,
-                              attachments: &[GLenum]) {
+    fn invalidate_framebuffer(&self, target: GLenum, attachments: &[GLenum]) {
         unsafe {
             self.ffi_gl_.InvalidateFramebuffer(
                 target,
                 attachments.len() as GLsizei,
                 attachments.as_ptr(),
             );
         }
     }
 
-    fn invalidate_sub_framebuffer(&self,
-                                  target: GLenum,
-                                  attachments: &[GLenum],
-                                  xoffset: GLint,
-                                  yoffset: GLint,
-                                  width: GLsizei,
-                                  height: GLsizei) {
+    fn invalidate_sub_framebuffer(
+        &self,
+        target: GLenum,
+        attachments: &[GLenum],
+        xoffset: GLint,
+        yoffset: GLint,
+        width: GLsizei,
+        height: GLsizei,
+    ) {
         unsafe {
             self.ffi_gl_.InvalidateSubFramebuffer(
                 target,
                 attachments.len() as GLsizei,
                 attachments.as_ptr(),
                 xoffset,
                 yoffset,
                 width,
@@ -764,17 +912,18 @@ impl Gl for GlesFns {
     unsafe fn get_integer_iv(&self, name: GLenum, index: GLuint, result: &mut [GLint]) {
         assert!(!result.is_empty());
         self.ffi_gl_.GetIntegeri_v(name, index, result.as_mut_ptr());
     }
 
     #[inline]
     unsafe fn get_integer_64iv(&self, name: GLenum, index: GLuint, result: &mut [GLint64]) {
         assert!(!result.is_empty());
-        self.ffi_gl_.GetInteger64i_v(name, index, result.as_mut_ptr());
+        self.ffi_gl_
+            .GetInteger64i_v(name, index, result.as_mut_ptr());
     }
 
     #[inline]
     unsafe fn get_boolean_v(&self, name: GLenum, result: &mut [GLboolean]) {
         assert!(!result.is_empty());
         self.ffi_gl_.GetBooleanv(name, result.as_mut_ptr());
     }
 
@@ -782,25 +931,36 @@ impl Gl for GlesFns {
     unsafe fn get_float_v(&self, name: GLenum, result: &mut [GLfloat]) {
         assert!(!result.is_empty());
         self.ffi_gl_.GetFloatv(name, result.as_mut_ptr());
     }
 
     fn get_renderbuffer_parameter_iv(&self, target: GLenum, pname: GLenum) -> GLint {
         let mut result: GLint = 0;
         unsafe {
-            self.ffi_gl_.GetRenderbufferParameteriv(target, pname, &mut result);
+            self.ffi_gl_
+                .GetRenderbufferParameteriv(target, pname, &mut result);
         }
         result
     }
 
-    fn get_framebuffer_attachment_parameter_iv(&self, target: GLenum, attachment: GLenum, pname: GLenum) -> GLint {
+    fn get_framebuffer_attachment_parameter_iv(
+        &self,
+        target: GLenum,
+        attachment: GLenum,
+        pname: GLenum,
+    ) -> GLint {
         let mut result: GLint = 0;
         unsafe {
-            self.ffi_gl_.GetFramebufferAttachmentParameteriv(target, attachment, pname, &mut result);
+            self.ffi_gl_.GetFramebufferAttachmentParameteriv(
+                target,
+                attachment,
+                pname,
+                &mut result,
+            );
         }
         result
     }
 
     fn get_tex_parameter_iv(&self, target: GLenum, pname: GLenum) -> GLint {
         let mut result: GLint = 0;
         unsafe {
             self.ffi_gl_.GetTexParameteriv(target, pname, &mut result);
@@ -823,126 +983,125 @@ impl Gl for GlesFns {
     }
 
     fn tex_parameter_f(&self, target: GLenum, pname: GLenum, param: GLfloat) {
         unsafe {
             self.ffi_gl_.TexParameterf(target, pname, param);
         }
     }
 
-    fn framebuffer_texture_2d(&self,
-                              target: GLenum,
-                              attachment: GLenum,
-                              textarget: GLenum,
-                              texture: GLuint,
-                              level: GLint) {
+    fn framebuffer_texture_2d(
+        &self,
+        target: GLenum,
+        attachment: GLenum,
+        textarget: GLenum,
+        texture: GLuint,
+        level: GLint,
+    ) {
         unsafe {
-            self.ffi_gl_.FramebufferTexture2D(target, attachment, textarget, texture, level);
-        }
-    }
-
-    fn framebuffer_texture_layer(&self,
-                                 target: GLenum,
-                                 attachment: GLenum,
-                                 texture: GLuint,
-                                 level: GLint,
-                                 layer: GLint) {
-        unsafe {
-            self.ffi_gl_.FramebufferTextureLayer(target, attachment, texture, level, layer);
+            self.ffi_gl_
+                .FramebufferTexture2D(target, attachment, textarget, texture, level);
         }
     }
 
-    fn blit_framebuffer(&self,
-                        src_x0: GLint,
-                        src_y0: GLint,
-                        src_x1: GLint,
-                        src_y1: GLint,
-                        dst_x0: GLint,
-                        dst_y0: GLint,
-                        dst_x1: GLint,
-                        dst_y1: GLint,
-                        mask: GLbitfield,
-                        filter: GLenum) {
+    fn framebuffer_texture_layer(
+        &self,
+        target: GLenum,
+        attachment: GLenum,
+        texture: GLuint,
+        level: GLint,
+        layer: GLint,
+    ) {
         unsafe {
-            self.ffi_gl_.BlitFramebuffer(src_x0,
-                                         src_y0,
-                                         src_x1,
-                                         src_y1,
-                                         dst_x0,
-                                         dst_y0,
-                                         dst_x1,
-                                         dst_y1,
-                                         mask,
-                                         filter);
+            self.ffi_gl_
+                .FramebufferTextureLayer(target, attachment, texture, level, layer);
+        }
+    }
+
+    fn blit_framebuffer(
+        &self,
+        src_x0: GLint,
+        src_y0: GLint,
+        src_x1: GLint,
+        src_y1: GLint,
+        dst_x0: GLint,
+        dst_y0: GLint,
+        dst_x1: GLint,
+        dst_y1: GLint,
+        mask: GLbitfield,
+        filter: GLenum,
+    ) {
+        unsafe {
+            self.ffi_gl_.BlitFramebuffer(
+                src_x0, src_y0, src_x1, src_y1, dst_x0, dst_y0, dst_x1, dst_y1, mask, filter,
+            );
         }
     }
 
-    fn vertex_attrib_4f(&self,
-                        index: GLuint,
-                        x: GLfloat,
-                        y: GLfloat,
-                        z: GLfloat,
-                        w: GLfloat) {
-        unsafe {
-            self.ffi_gl_.VertexAttrib4f(index, x, y, z, w)
-        }
+    fn vertex_attrib_4f(&self, index: GLuint, x: GLfloat, y: GLfloat, z: GLfloat, w: GLfloat) {
+        unsafe { self.ffi_gl_.VertexAttrib4f(index, x, y, z, w) }
     }
 
-    fn vertex_attrib_pointer_f32(&self,
-                                 index: GLuint,
-                                 size: GLint,
-                                 normalized: bool,
-                                 stride: GLsizei,
-                                 offset: GLuint) {
+    fn vertex_attrib_pointer_f32(
+        &self,
+        index: GLuint,
+        size: GLint,
+        normalized: bool,
+        stride: GLsizei,
+        offset: GLuint,
+    ) {
         unsafe {
-            self.ffi_gl_.VertexAttribPointer(index,
-                                             size,
-                                             ffi::FLOAT,
-                                             normalized as GLboolean,
-                                             stride,
-                                             offset as *const GLvoid)
+            self.ffi_gl_.VertexAttribPointer(
+                index,
+                size,
+                ffi::FLOAT,
+                normalized as GLboolean,
+                stride,
+                offset as *const GLvoid,
+            )
         }
     }
 
-    fn vertex_attrib_pointer(&self,
-                                 index: GLuint,
-                                 size: GLint,
-                                 type_: GLenum,
-                                 normalized: bool,
-                                 stride: GLsizei,
-                                 offset: GLuint) {
+    fn vertex_attrib_pointer(
+        &self,
+        index: GLuint,
+        size: GLint,
+        type_: GLenum,
+        normalized: bool,
+        stride: GLsizei,
+        offset: GLuint,
+    ) {
         unsafe {
-            self.ffi_gl_.VertexAttribPointer(index,
-                                             size,
-                                             type_,
-                                             normalized as GLboolean,
-                                             stride,
-                                             offset as *const GLvoid)
+            self.ffi_gl_.VertexAttribPointer(
+                index,
+                size,
+                type_,
+                normalized as GLboolean,
+                stride,
+                offset as *const GLvoid,
+            )
         }
     }
 
-    fn vertex_attrib_i_pointer(&self,
-                               index: GLuint,
-                               size: GLint,
-                               type_: GLenum,
-                               stride: GLsizei,
-                               offset: GLuint) {
+    fn vertex_attrib_i_pointer(
+        &self,
+        index: GLuint,
+        size: GLint,
+        type_: GLenum,
+        stride: GLsizei,
+        offset: GLuint,
+    ) {
         unsafe {
-            self.ffi_gl_.VertexAttribIPointer(index,
-                                              size,
-                                              type_,
-                                              stride,
-                                              offset as *const GLvoid)
+            self.ffi_gl_
+                .VertexAttribIPointer(index, size, type_, stride, offset as *const GLvoid)
         }
     }
 
     fn vertex_attrib_divisor(&self, index: GLuint, divisor: GLuint) {
-        unsafe {
-            self.ffi_gl_.VertexAttribDivisor(index, divisor)
-        }
+        unsafe { self.ffi_gl_.VertexAttribDivisor(index, divisor) }
     }
 
     fn viewport(&self, x: GLint, y: GLint, width: GLsizei, height: GLsizei) {
         unsafe {
             self.ffi_gl_.Viewport(x, y, width, height);
         }
     }
 
@@ -971,58 +1130,88 @@ impl Gl for GlesFns {
     }
 
     fn draw_arrays(&self, mode: GLenum, first: GLint, count: GLsizei) {
         unsafe {
             return self.ffi_gl_.DrawArrays(mode, first, count);
         }
     }
 
-    fn draw_arrays_instanced(&self, mode: GLenum, first: GLint, count: GLsizei, primcount: GLsizei) {
+    fn draw_arrays_instanced(
+        &self,
+        mode: GLenum,
+        first: GLint,
+        count: GLsizei,
+        primcount: GLsizei,
+    ) {
         unsafe {
-            return self.ffi_gl_.DrawArraysInstanced(mode, first, count, primcount);
-        }
-    }
-
-    fn draw_elements(&self, mode: GLenum, count: GLsizei, element_type: GLenum, indices_offset: GLuint) {
-        unsafe {
-            return self.ffi_gl_.DrawElements(mode, count, element_type, indices_offset as *const c_void)
+            return self
+                .ffi_gl_
+                .DrawArraysInstanced(mode, first, count, primcount);
         }
     }
 
-    fn draw_elements_instanced(&self,
-                                   mode: GLenum,
-                                   count: GLsizei,
-                                   element_type: GLenum,
-                                   indices_offset: GLuint,
-                                   primcount: GLsizei) {
+    fn draw_elements(
+        &self,
+        mode: GLenum,
+        count: GLsizei,
+        element_type: GLenum,
+        indices_offset: GLuint,
+    ) {
         unsafe {
-            return self.ffi_gl_.DrawElementsInstanced(mode,
-                                                      count,
-                                                      element_type,
-                                                      indices_offset as *const c_void,
-                                                      primcount)
+            return self.ffi_gl_.DrawElements(
+                mode,
+                count,
+                element_type,
+                indices_offset as *const c_void,
+            );
+        }
+    }
+
+    fn draw_elements_instanced(
+        &self,
+        mode: GLenum,
+        count: GLsizei,
+        element_type: GLenum,
+        indices_offset: GLuint,
+        primcount: GLsizei,
+    ) {
+        unsafe {
+            return self.ffi_gl_.DrawElementsInstanced(
+                mode,
+                count,
+                element_type,
+                indices_offset as *const c_void,
+                primcount,
+            );
         }
     }
 
     fn blend_color(&self, r: f32, g: f32, b: f32, a: f32) {
         unsafe {
             self.ffi_gl_.BlendColor(r, g, b, a);
         }
     }
 
     fn blend_func(&self, sfactor: GLenum, dfactor: GLenum) {
         unsafe {
             self.ffi_gl_.BlendFunc(sfactor, dfactor);
         }
     }
 
-    fn blend_func_separate(&self, src_rgb: GLenum, dest_rgb: GLenum, src_alpha: GLenum, dest_alpha: GLenum) {
+    fn blend_func_separate(
+        &self,
+        src_rgb: GLenum,
+        dest_rgb: GLenum,
+        src_alpha: GLenum,
+        dest_alpha: GLenum,
+    ) {
         unsafe {
-            self.ffi_gl_.BlendFuncSeparate(src_rgb, dest_rgb, src_alpha, dest_alpha);
+            self.ffi_gl_
+                .BlendFuncSeparate(src_rgb, dest_rgb, src_alpha, dest_alpha);
         }
     }
 
     fn blend_equation(&self, mode: GLenum) {
         unsafe {
             self.ffi_gl_.BlendEquation(mode);
         }
     }
@@ -1030,17 +1219,22 @@ impl Gl for GlesFns {
     fn blend_equation_separate(&self, mode_rgb: GLenum, mode_alpha: GLenum) {
         unsafe {
             self.ffi_gl_.BlendEquationSeparate(mode_rgb, mode_alpha);
         }
     }
 
     fn color_mask(&self, r: bool, g: bool, b: bool, a: bool) {
         unsafe {
-            self.ffi_gl_.ColorMask(r as GLboolean, g as GLboolean, b as GLboolean, a as GLboolean);
+            self.ffi_gl_.ColorMask(
+                r as GLboolean,
+                g as GLboolean,
+                b as GLboolean,
+                a as GLboolean,
+            );
         }
     }
 
     fn cull_face(&self, mode: GLenum) {
         unsafe {
             self.ffi_gl_.CullFace(mode);
         }
     }
@@ -1065,49 +1259,37 @@ impl Gl for GlesFns {
 
     fn hint(&self, param_name: GLenum, param_val: GLenum) {
         unsafe {
             self.ffi_gl_.Hint(param_name, param_val);
         }
     }
 
     fn is_enabled(&self, cap: GLenum) -> GLboolean {
-        unsafe {
-            self.ffi_gl_.IsEnabled(cap)
-        }
+        unsafe { self.ffi_gl_.IsEnabled(cap) }
     }
 
     fn is_shader(&self, shader: GLuint) -> GLboolean {
-        unsafe {
-            self.ffi_gl_.IsShader(shader)
-        }
+        unsafe { self.ffi_gl_.IsShader(shader) }
     }
 
     fn is_texture(&self, texture: GLenum) -> GLboolean {
-        unsafe {
-            self.ffi_gl_.IsTexture(texture)
-        }
+        unsafe { self.ffi_gl_.IsTexture(texture) }
     }
 
     fn is_framebuffer(&self, framebuffer: GLenum) -> GLboolean {
-        unsafe {
-            self.ffi_gl_.IsFramebuffer(framebuffer)
-        }
+        unsafe { self.ffi_gl_.IsFramebuffer(framebuffer) }
     }
 
     fn is_renderbuffer(&self, renderbuffer: GLenum) -> GLboolean {
-        unsafe {
-            self.ffi_gl_.IsRenderbuffer(renderbuffer)
-        }
+        unsafe { self.ffi_gl_.IsRenderbuffer(renderbuffer) }
     }
 
     fn check_frame_buffer_status(&self, target: GLenum) -> GLenum {
-        unsafe {
-            self.ffi_gl_.CheckFramebufferStatus(target)
-        }
+        unsafe { self.ffi_gl_.CheckFramebufferStatus(target) }
     }
 
     fn enable_vertex_attrib_array(&self, index: GLuint) {
         unsafe {
             self.ffi_gl_.EnableVertexAttribArray(index);
         }
     }
 
@@ -1120,99 +1302,93 @@ impl Gl for GlesFns {
     fn uniform_1f(&self, location: GLint, v0: GLfloat) {
         unsafe {
             self.ffi_gl_.Uniform1f(location, v0);
         }
     }
 
     fn uniform_1fv(&self, location: GLint, values: &[f32]) {
         unsafe {
-            self.ffi_gl_.Uniform1fv(location,
-                                    values.len() as GLsizei,
-                                    values.as_ptr());
+            self.ffi_gl_
+                .Uniform1fv(location, values.len() as GLsizei, values.as_ptr());
         }
     }
 
     fn uniform_1i(&self, location: GLint, v0: GLint) {
         unsafe {
             self.ffi_gl_.Uniform1i(location, v0);
         }
     }
 
     fn uniform_1iv(&self, location: GLint, values: &[i32]) {
         unsafe {
-            self.ffi_gl_.Uniform1iv(location,
-                                    values.len() as GLsizei,
-                                    values.as_ptr());
+            self.ffi_gl_
+                .Uniform1iv(location, values.len() as GLsizei, values.as_ptr());
         }
     }
 
     #[allow(unused_variables)]
     fn uniform_1ui(&self, location: GLint, v0: GLuint) {
         panic!("not supported")
     }
 
     fn uniform_2f(&self, location: GLint, v0: GLfloat, v1: GLfloat) {
         unsafe {
             self.ffi_gl_.Uniform2f(location, v0, v1);
         }
     }
 
     fn uniform_2fv(&self, location: GLint, values: &[f32]) {
         unsafe {
-            self.ffi_gl_.Uniform2fv(location,
-                                    (values.len() / 2) as GLsizei,
-                                    values.as_ptr());
+            self.ffi_gl_
+                .Uniform2fv(location, (values.len() / 2) as GLsizei, values.as_ptr());
         }
     }
 
     fn uniform_2i(&self, location: GLint, v0: GLint, v1: GLint) {
         unsafe {
             self.ffi_gl_.Uniform2i(location, v0, v1);
         }
     }
 
     fn uniform_2iv(&self, location: GLint, values: &[i32]) {
         unsafe {
-            self.ffi_gl_.Uniform2iv(location,
-                                    (values.len() / 2) as GLsizei,
-                                    values.as_ptr());
+            self.ffi_gl_
+                .Uniform2iv(location, (values.len() / 2) as GLsizei, values.as_ptr());
         }
     }
 
     #[allow(unused_variables)]
     fn uniform_2ui(&self, location: GLint, v0: GLuint, v1: GLuint) {
         panic!("not supported")
     }
 
     fn uniform_3f(&self, location: GLint, v0: GLfloat, v1: GLfloat, v2: GLfloat) {
         unsafe {
             self.ffi_gl_.Uniform3f(location, v0, v1, v2);
         }
     }
 
     fn uniform_3fv(&self, location: GLint, values: &[f32]) {
         unsafe {
-            self.ffi_gl_.Uniform3fv(location,
-                                    (values.len() / 3) as GLsizei,
-                                    values.as_ptr());
+            self.ffi_gl_
+                .Uniform3fv(location, (values.len() / 3) as GLsizei, values.as_ptr());
         }
     }
 
     fn uniform_3i(&self, location: GLint, v0: GLint, v1: GLint, v2: GLint) {
         unsafe {
             self.ffi_gl_.Uniform3i(location, v0, v1, v2);
         }
     }
 
     fn uniform_3iv(&self, location: GLint, values: &[i32]) {
         unsafe {
-            self.ffi_gl_.Uniform3iv(location,
-                                    (values.len() / 3) as GLsizei,
-                                    values.as_ptr());
+            self.ffi_gl_
+                .Uniform3iv(location, (values.len() / 3) as GLsizei, values.as_ptr());
         }
     }
 
     #[allow(unused_variables)]
     fn uniform_3ui(&self, location: GLint, v0: GLuint, v1: GLuint, v2: GLuint) {
         panic!("not supported")
     }
 
@@ -1225,59 +1401,63 @@ impl Gl for GlesFns {
     fn uniform_4i(&self, location: GLint, x: GLint, y: GLint, z: GLint, w: GLint) {
         unsafe {
             self.ffi_gl_.Uniform4i(location, x, y, z, w);
         }
     }
 
     fn uniform_4iv(&self, location: GLint, values: &[i32]) {
         unsafe {
-            self.ffi_gl_.Uniform4iv(location,
-                                    (values.len() / 4) as GLsizei,
-                                    values.as_ptr());
+            self.ffi_gl_
+                .Uniform4iv(location, (values.len() / 4) as GLsizei, values.as_ptr());
         }
     }
 
     #[allow(unused_variables)]
     fn uniform_4ui(&self, location: GLint, x: GLuint, y: GLuint, z: GLuint, w: GLuint) {
         panic!("not supported")
     }
 
     fn uniform_4fv(&self, location: GLint, values: &[f32]) {
         unsafe {
-            self.ffi_gl_.Uniform4fv(location,
-                                    (values.len() / 4) as GLsizei,
-                                    values.as_ptr());
+            self.ffi_gl_
+                .Uniform4fv(location, (values.len() / 4) as GLsizei, values.as_ptr());
         }
     }
 
     fn uniform_matrix_2fv(&self, location: GLint, transpose: bool, value: &[f32]) {
         unsafe {
-            self.ffi_gl_.UniformMatrix2fv(location,
-                                          (value.len() / 4) as GLsizei,
-                                          transpose as GLboolean,
-                                          value.as_ptr());
+            self.ffi_gl_.UniformMatrix2fv(
+                location,
+                (value.len() / 4) as GLsizei,
+                transpose as GLboolean,
+                value.as_ptr(),
+            );
         }
     }
 
     fn uniform_matrix_3fv(&self, location: GLint, transpose: bool, value: &[f32]) {
         unsafe {
-            self.ffi_gl_.UniformMatrix3fv(location,
-                                          (value.len() / 9) as GLsizei,
-                                          transpose as GLboolean,
-                                          value.as_ptr());
+            self.ffi_gl_.UniformMatrix3fv(
+                location,
+                (value.len() / 9) as GLsizei,
+                transpose as GLboolean,
+                value.as_ptr(),
+            );
         }
     }
 
     fn uniform_matrix_4fv(&self, location: GLint, transpose: bool, value: &[f32]) {
         unsafe {
-            self.ffi_gl_.UniformMatrix4fv(location,
-                                          (value.len() / 16) as GLsizei,
-                                          transpose as GLboolean,
-                                          value.as_ptr());
+            self.ffi_gl_.UniformMatrix4fv(
+                location,
+                (value.len() / 16) as GLsizei,
+                transpose as GLboolean,
+                value.as_ptr(),
+            );
         }
     }
 
     fn depth_mask(&self, flag: bool) {
         unsafe {
             self.ffi_gl_.DepthMask(flag as GLboolean);
         }
     }
@@ -1303,17 +1483,17 @@ impl Gl for GlesFns {
                 index,
                 buf_size[0],
                 &mut length,
                 &mut size,
                 &mut type_,
                 name.as_mut_ptr() as *mut GLchar,
             );
         }
-        name.truncate(if length > 0 {length as usize} else {0});
+        name.truncate(if length > 0 { length as usize } else { 0 });
         (size, type_, String::from_utf8(name).unwrap())
     }
 
     fn get_active_uniform(&self, program: GLuint, index: GLuint) -> (i32, u32, String) {
         let mut buf_size = [0];
         unsafe {
             self.get_program_iv(program, ffi::ACTIVE_UNIFORM_MAX_LENGTH, &mut buf_size);
         }
@@ -1334,80 +1514,94 @@ impl Gl for GlesFns {
             );
         }
 
         name.truncate(if length > 0 { length as usize } else { 0 });
 
         (size, type_, String::from_utf8(name).unwrap())
     }
 
-    fn get_active_uniforms_iv(&self, program: GLuint, indices: Vec<GLuint>, pname: GLenum) -> Vec<GLint> {
+    fn get_active_uniforms_iv(
+        &self,
+        program: GLuint,
+        indices: Vec<GLuint>,
+        pname: GLenum,
+    ) -> Vec<GLint> {
         let mut result = Vec::with_capacity(indices.len());
         unsafe {
             result.set_len(indices.len());
-            self.ffi_gl_.GetActiveUniformsiv(program,
-                                             indices.len() as GLsizei,
-                                             indices.as_ptr(),
-                                             pname,
-                                             result.as_mut_ptr());
+            self.ffi_gl_.GetActiveUniformsiv(
+                program,
+                indices.len() as GLsizei,
+                indices.as_ptr(),
+                pname,
+                result.as_mut_ptr(),
+            );
         }
         result
     }
 
     fn get_active_uniform_block_i(&self, program: GLuint, index: GLuint, pname: GLenum) -> GLint {
         let mut result = 0 as GLint;
         unsafe {
-            self.ffi_gl_.GetActiveUniformBlockiv(program, index, pname, &mut result);
+            self.ffi_gl_
+                .GetActiveUniformBlockiv(program, index, pname, &mut result);
         }
         result
     }
 
-    fn get_active_uniform_block_iv(&self, program: GLuint, index: GLuint, pname: GLenum) -> Vec<GLint> {
-        let count = self.get_active_uniform_block_i(program, index, ffi::UNIFORM_BLOCK_ACTIVE_UNIFORMS);
+    fn get_active_uniform_block_iv(
+        &self,
+        program: GLuint,
+        index: GLuint,
+        pname: GLenum,
+    ) -> Vec<GLint> {
+        let count =
+            self.get_active_uniform_block_i(program, index, ffi::UNIFORM_BLOCK_ACTIVE_UNIFORMS);
         let mut result = Vec::with_capacity(count as usize);
         unsafe {
             result.set_len(count as usize);
-            self.ffi_gl_.GetActiveUniformBlockiv(program, index, pname, result.as_mut_ptr());
+            self.ffi_gl_
+                .GetActiveUniformBlockiv(program, index, pname, result.as_mut_ptr());
         }
         result
     }
 
     fn get_active_uniform_block_name(&self, program: GLuint, index: GLuint) -> String {
-        let buf_size = self.get_active_uniform_block_i(program, index, ffi::UNIFORM_BLOCK_NAME_LENGTH);
+        let buf_size =
+            self.get_active_uniform_block_i(program, index, ffi::UNIFORM_BLOCK_NAME_LENGTH);
         let mut name = vec![0 as u8; buf_size as usize];
         let mut length: GLsizei = 0;
         unsafe {
-            self.ffi_gl_.GetActiveUniformBlockName(program,
-                                                   index,
-                                                   buf_size,
-                                                   &mut length,
-                                                   name.as_mut_ptr() as *mut GLchar);
+            self.ffi_gl_.GetActiveUniformBlockName(
+                program,
+                index,
+                buf_size,
+                &mut length,
+                name.as_mut_ptr() as *mut GLchar,
+            );
         }
         name.truncate(if length > 0 { length as usize } else { 0 });
 
         String::from_utf8(name).unwrap()
     }
 
     fn get_attrib_location(&self, program: GLuint, name: &str) -> c_int {
         let name = CString::new(name).unwrap();
-        unsafe {
-            self.ffi_gl_.GetAttribLocation(program, name.as_ptr())
-        }
+        unsafe { self.ffi_gl_.GetAttribLocation(program, name.as_ptr()) }
     }
 
     #[allow(unused_variables)]
     fn get_frag_data_location(&self, program: GLuint, name: &str) -> c_int {
         panic!("not supported")
     }
 
     fn get_uniform_location(&self, program: GLuint, name: &str) -> c_int {
         let name = CString::new(name).unwrap();
-        unsafe {
-            self.ffi_gl_.GetUniformLocation(program, name.as_ptr())
-        }
+        unsafe { self.ffi_gl_.GetUniformLocation(program, name.as_ptr()) }
     }
 
     fn get_program_info_log(&self, program: GLuint) -> String {
         let mut max_len = [0];
         unsafe {
             self.get_program_iv(program, ffi::INFO_LOG_LENGTH, &mut max_len);
         }
         let mut result = vec![0u8; max_len[0] as usize];
@@ -1415,24 +1609,29 @@ impl Gl for GlesFns {
         unsafe {
             self.ffi_gl_.GetProgramInfoLog(
                 program,
                 max_len[0] as GLsizei,
                 &mut result_len,
                 result.as_mut_ptr() as *mut GLchar,
             );
         }
-        result.truncate(if result_len > 0 {result_len as usize} else {0});
+        result.truncate(if result_len > 0 {
+            result_len as usize
+        } else {
+            0
+        });
         String::from_utf8(result).unwrap()
     }
 
     #[inline]
     unsafe fn get_program_iv(&self, program: GLuint, pname: GLenum, result: &mut [GLint]) {
         assert!(!result.is_empty());
-        self.ffi_gl_.GetProgramiv(program, pname, result.as_mut_ptr());
+        self.ffi_gl_
+            .GetProgramiv(program, pname, result.as_mut_ptr());
     }
 
     fn get_program_binary(&self, program: GLuint) -> (Vec<u8>, GLenum) {
         let mut len = [0];
         unsafe {
             self.get_program_iv(program, ffi::PROGRAM_BINARY_LENGTH, &mut len);
         }
         if len[0] <= 0 {
@@ -1455,53 +1654,59 @@ impl Gl for GlesFns {
             return (Vec::new(), NONE);
         }
 
         (binary, format)
     }
 
     fn program_binary(&self, program: GLuint, format: GLenum, binary: &[u8]) {
         unsafe {
-            self.ffi_gl_.ProgramBinary(program,
-                                       format,
-                                       binary.as_ptr() as *const c_void,
-                                       binary.len() as GLsizei);
+            self.ffi_gl_.ProgramBinary(
+                program,
+                format,
+                binary.as_ptr() as *const c_void,
+                binary.len() as GLsizei,
+            );
         }
     }
 
     fn program_parameter_i(&self, program: GLuint, pname: GLenum, value: GLint) {
         unsafe {
             self.ffi_gl_.ProgramParameteri(program, pname, value);
         }
     }
 
     #[inline]
     unsafe fn get_vertex_attrib_iv(&self, index: GLuint, pname: GLenum, result: &mut [GLint]) {
         assert!(!result.is_empty());
-        self.ffi_gl_.GetVertexAttribiv(index, pname, result.as_mut_ptr());
+        self.ffi_gl_
+            .GetVertexAttribiv(index, pname, result.as_mut_ptr());
     }
 
     #[inline]
     unsafe fn get_vertex_attrib_fv(&self, index: GLuint, pname: GLenum, result: &mut [GLfloat]) {
         assert!(!result.is_empty());
-        self.ffi_gl_.GetVertexAttribfv(index, pname, result.as_mut_ptr());
+        self.ffi_gl_
+            .GetVertexAttribfv(index, pname, result.as_mut_ptr());
     }
 
     fn get_vertex_attrib_pointer_v(&self, index: GLuint, pname: GLenum) -> GLsizeiptr {
         let mut result = 0 as *mut GLvoid;
         unsafe {
-            self.ffi_gl_.GetVertexAttribPointerv(index, pname, &mut result)
+            self.ffi_gl_
+                .GetVertexAttribPointerv(index, pname, &mut result)
         }
         result as GLsizeiptr
     }
 
     fn get_buffer_parameter_iv(&self, target: GLuint, pname: GLenum) -> GLint {
         let mut result = 0 as GLint;
         unsafe {
-            self.ffi_gl_.GetBufferParameteriv(target, pname, &mut result);
+            self.ffi_gl_
+                .GetBufferParameteriv(target, pname, &mut result);
         }
         result
     }
 
     fn get_shader_info_log(&self, shader: GLuint) -> String {
         let mut max_len = [0];
         unsafe {
             self.get_shader_iv(shader, ffi::INFO_LOG_LENGTH, &mut max_len);
@@ -1511,72 +1716,77 @@ impl Gl for GlesFns {
         unsafe {
             self.ffi_gl_.GetShaderInfoLog(
                 shader,
                 max_len[0] as GLsizei,
                 &mut result_len,
                 result.as_mut_ptr() as *mut GLchar,
             );
         }
-        result.truncate(if result_len > 0 {result_len as usize} else {0});
+        result.truncate(if result_len > 0 {
+            result_len as usize
+        } else {
+            0
+        });
         String::from_utf8(result).unwrap()
     }
 
     fn get_string(&self, which: GLenum) -> String {
         unsafe {
             let llstr = self.ffi_gl_.GetString(which);
             if !llstr.is_null() {
-                return str::from_utf8_unchecked(CStr::from_ptr(llstr as *const c_char).to_bytes()).to_string();
+                return str::from_utf8_unchecked(CStr::from_ptr(llstr as *const c_char).to_bytes())
+                    .to_string();
             } else {
                 return "".to_string();
             }
         }
     }
 
     fn get_string_i(&self, which: GLenum, index: GLuint) -> String {
         unsafe {
             let llstr = self.ffi_gl_.GetStringi(which, index);
             if !llstr.is_null() {
-                str::from_utf8_unchecked(CStr::from_ptr(llstr as *const c_char).to_bytes()).to_string()
+                str::from_utf8_unchecked(CStr::from_ptr(llstr as *const c_char).to_bytes())
+                    .to_string()
             } else {
                 "".to_string()
             }
         }
     }
 
     unsafe fn get_shader_iv(&self, shader: GLuint, pname: GLenum, result: &mut [GLint]) {
         assert!(!result.is_empty());
         self.ffi_gl_.GetShaderiv(shader, pname, result.as_mut_ptr());
     }
 
-    fn get_shader_precision_format(&self,
-                                   shader_type: GLuint,
-                                   precision_type: GLuint)
-                                   -> (GLint, GLint, GLint) {
+    fn get_shader_precision_format(
+        &self,
+        shader_type: GLuint,
+        precision_type: GLuint,
+    ) -> (GLint, GLint, GLint) {
         let (mut range, mut precision) = match precision_type {
             // These values are for a 32-bit twos-complement integer format.
-            ffi::LOW_INT |
-            ffi::MEDIUM_INT |
-            ffi::HIGH_INT => ([31, 30], 0),
+            ffi::LOW_INT | ffi::MEDIUM_INT | ffi::HIGH_INT => ([31, 30], 0),
 
             // These values are for an IEEE single-precision floating-point format.
-            ffi::LOW_FLOAT |
-            ffi::MEDIUM_FLOAT |
-            ffi::HIGH_FLOAT => ([127, 127], 23),
+            ffi::LOW_FLOAT | ffi::MEDIUM_FLOAT | ffi::HIGH_FLOAT => ([127, 127], 23),
 
             _ => unreachable!("invalid precision"),
         };
         // This function is sometimes defined even though it's really just
         // a stub, so we need to set range and precision as if it weren't
         // defined before calling it. Suppress any error that might occur.
         unsafe {
-            self.ffi_gl_.GetShaderPrecisionFormat(shader_type,
-                                                  precision_type,
-                                                  range.as_mut_ptr(),
-                                                  &mut precision);
+            self.ffi_gl_.GetShaderPrecisionFormat(
+                shader_type,
+                precision_type,
+                range.as_mut_ptr(),
+                &mut precision,
+            );
             let _ = self.ffi_gl_.GetError();
         }
 
         (range[0], range[1], precision)
     }
 
     fn compile_shader(&self, shader: GLuint) {
         unsafe {
@@ -1652,116 +1862,87 @@ impl Gl for GlesFns {
 
     fn finish(&self) {
         unsafe {
             self.ffi_gl_.Finish();
         }
     }
 
     fn get_error(&self) -> GLenum {
-        unsafe {
-            self.ffi_gl_.GetError()
-        }
+        unsafe { self.ffi_gl_.GetError() }
     }
 
     fn stencil_mask(&self, mask: GLuint) {
-        unsafe {
-            self.ffi_gl_.StencilMask(mask)
-        }
+        unsafe { self.ffi_gl_.StencilMask(mask) }
     }
 
     fn stencil_mask_separate(&self, face: GLenum, mask: GLuint) {
-        unsafe {
-            self.ffi_gl_.StencilMaskSeparate(face, mask)
-        }
+        unsafe { self.ffi_gl_.StencilMaskSeparate(face, mask) }
     }
 
-    fn stencil_func(&self,
-                    func: GLenum,
-                    ref_: GLint,
-                    mask: GLuint) {
-        unsafe {
-            self.ffi_gl_.StencilFunc(func, ref_, mask)
-        }
+    fn stencil_func(&self, func: GLenum, ref_: GLint, mask: GLuint) {
+        unsafe { self.ffi_gl_.StencilFunc(func, ref_, mask) }
     }
 
-    fn stencil_func_separate(&self,
-                             face: GLenum,
-                             func: GLenum,
-                             ref_: GLint,
-                             mask: GLuint) {
-        unsafe {
-            self.ffi_gl_.StencilFuncSeparate(face, func, ref_, mask)
-        }
+    fn stencil_func_separate(&self, face: GLenum, func: GLenum, ref_: GLint, mask: GLuint) {
+        unsafe { self.ffi_gl_.StencilFuncSeparate(face, func, ref_, mask) }
     }
 
-    fn stencil_op(&self,
-                  sfail: GLenum,
-                  dpfail: GLenum,
-                  dppass: GLenum) {
-        unsafe {
-            self.ffi_gl_.StencilOp(sfail, dpfail, dppass)
-        }
+    fn stencil_op(&self, sfail: GLenum, dpfail: GLenum, dppass: GLenum) {
+        unsafe { self.ffi_gl_.StencilOp(sfail, dpfail, dppass) }
     }
 
-    fn stencil_op_separate(&self,
-                           face: GLenum,
-                           sfail: GLenum,
-                           dpfail: GLenum,
-                           dppass: GLenum) {
-        unsafe {
-            self.ffi_gl_.StencilOpSeparate(face, sfail, dpfail, dppass)
-        }
+    fn stencil_op_separate(&self, face: GLenum, sfail: GLenum, dpfail: GLenum, dppass: GLenum) {
+        unsafe { self.ffi_gl_.StencilOpSeparate(face, sfail, dpfail, dppass) }
     }
 
     fn egl_image_target_texture2d_oes(&self, target: GLenum, image: GLeglImageOES) {
         unsafe {
             self.ffi_gl_.EGLImageTargetTexture2DOES(target, image);
         }
     }
 
     fn generate_mipmap(&self, target: GLenum) {
-        unsafe {
-            self.ffi_gl_.GenerateMipmap(target)
-        }
+        unsafe { self.ffi_gl_.GenerateMipmap(target) }
     }
 
     fn insert_event_marker_ext(&self, message: &str) {
         if self.ffi_gl_.InsertEventMarkerEXT.is_loaded() {
             unsafe {
-                self.ffi_gl_.InsertEventMarkerEXT(message.len() as GLsizei, message.as_ptr() as *const _);
+                self.ffi_gl_
+                    .InsertEventMarkerEXT(message.len() as GLsizei, message.as_ptr() as *const _);
             }
         }
     }
 
     fn push_group_marker_ext(&self, message: &str) {
         if self.ffi_gl_.PushGroupMarkerEXT.is_loaded() {
             unsafe {
-                self.ffi_gl_.PushGroupMarkerEXT(message.len() as GLsizei, message.as_ptr() as *const _);
+                self.ffi_gl_
+                    .PushGroupMarkerEXT(message.len() as GLsizei, message.as_ptr() as *const _);
             }
         }
     }
 
     fn pop_group_marker_ext(&self) {
         if self.ffi_gl_.PopGroupMarkerEXT.is_loaded() {
             unsafe {
                 self.ffi_gl_.PopGroupMarkerEXT();
             }
         }
     }
 
     fn fence_sync(&self, condition: GLenum, flags: GLbitfield) -> GLsync {
-        unsafe {
-           self.ffi_gl_.FenceSync(condition, flags) as *const _
-        }
+        unsafe { self.ffi_gl_.FenceSync(condition, flags) as *const _ }
     }
 
     fn client_wait_sync(&self, sync: GLsync, flags: GLbitfield, timeout: GLuint64) {
         unsafe {
-            self.ffi_gl_.ClientWaitSync(sync as *const _, flags, timeout);
+            self.ffi_gl_
+                .ClientWaitSync(sync as *const _, flags, timeout);
         }
     }
 
     fn wait_sync(&self, sync: GLsync, flags: GLbitfield, timeout: GLuint64) {
         unsafe {
             self.ffi_gl_.WaitSync(sync as *const _, flags, timeout);
         }
     }
@@ -1802,36 +1983,30 @@ impl Gl for GlesFns {
         _program: GLuint,
         _color_number: GLuint,
         _index: GLuint,
         _name: &str,
     ) {
         panic!("not supported");
     }
 
-    fn get_frag_data_index(
-        &self,
-        _program: GLuint,
-        _name: &str,
-    ) -> GLint {
+    fn get_frag_data_index(&self, _program: GLuint, _name: &str) -> GLint {
         panic!("not supported");
     }
 
     // GL_KHR_debug
     fn get_debug_messages(&self) -> Vec<DebugMessage> {
         if !self.ffi_gl_.GetDebugMessageLog.is_loaded() {
             return Vec::new();
         }
 
         let mut max_message_len = 0;
         unsafe {
-            self.ffi_gl_.GetIntegerv(
-                ffi::MAX_DEBUG_MESSAGE_LENGTH,
-                &mut max_message_len
-            )
+            self.ffi_gl_
+                .GetIntegerv(ffi::MAX_DEBUG_MESSAGE_LENGTH, &mut max_message_len)
         }
 
         let mut output = Vec::new();
         const CAPACITY: usize = 4;
 
         let mut msg_data = vec![0u8; CAPACITY * max_message_len as usize];
         let mut sources = [0 as GLenum; CAPACITY];
         let mut types = [0 as GLenum; CAPACITY];
@@ -1849,28 +2024,27 @@ impl Gl for GlesFns {
                     ids.as_mut_ptr(),
                     severities.as_mut_ptr(),
                     lengths.as_mut_ptr(),
                     msg_data.as_mut_ptr() as *mut _,
                 )
             };
 
             let mut offset = 0;
-            output.extend((0 .. count as usize).map(|i| {
+            output.extend((0..count as usize).map(|i| {
                 let len = lengths[i] as usize;
-                let slice = &msg_data[offset .. offset + len];
+                let slice = &msg_data[offset..offset + len];
                 offset += len;
                 DebugMessage {
                     message: String::from_utf8_lossy(slice).to_string(),
                     source: sources[i],
                     ty: types[i],
                     id: ids[i],
                     severity: severities[i],
                 }
             }));
 
             if (count as usize) < CAPACITY {
-                return output
+                return output;
             }
         }
     }
 }
-