mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Update to gleam 0.5
This commit is contained in:
parent
696084863c
commit
0f91712800
18 changed files with 473 additions and 399 deletions
71
Cargo.lock
generated
71
Cargo.lock
generated
|
@ -81,14 +81,14 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "azure"
|
name = "azure"
|
||||||
version = "0.28.0"
|
version = "0.29.0"
|
||||||
source = "git+https://github.com/servo/rust-azure#29f0c063ad366b5364e06af26d3e9d1ee588e3b2"
|
source = "git+https://github.com/servo/rust-azure#1ca68f302f5e914e2c63b0ec5b72af8f761f977d"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cmake 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)",
|
"cmake 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"servo-freetype-sys 4.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"servo-freetype-sys 4.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"servo-skia 0.30000013.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"servo-skia 0.30000014.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -265,17 +265,17 @@ dependencies = [
|
||||||
name = "canvas"
|
name = "canvas"
|
||||||
version = "0.0.1"
|
version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"azure 0.28.0 (git+https://github.com/servo/rust-azure)",
|
"azure 0.29.0 (git+https://github.com/servo/rust-azure)",
|
||||||
"canvas_traits 0.0.1",
|
"canvas_traits 0.0.1",
|
||||||
"compositing 0.0.1",
|
"compositing 0.0.1",
|
||||||
"cssparser 0.23.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"cssparser 0.23.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"gleam 0.4.34 (registry+https://github.com/rust-lang/crates.io-index)",
|
"gleam 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"ipc-channel 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"ipc-channel 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
|
"num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"offscreen_gl_context 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"offscreen_gl_context 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_bytes 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_bytes 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"servo_config 0.0.1",
|
"servo_config 0.0.1",
|
||||||
"webrender 0.57.2 (git+https://github.com/servo/webrender)",
|
"webrender 0.57.2 (git+https://github.com/servo/webrender)",
|
||||||
|
@ -288,12 +288,13 @@ version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cssparser 0.23.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"cssparser 0.23.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"gleam 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"ipc-channel 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"ipc-channel 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"malloc_size_of 0.0.1",
|
"malloc_size_of 0.0.1",
|
||||||
"malloc_size_of_derive 0.0.1",
|
"malloc_size_of_derive 0.0.1",
|
||||||
"nonzero 0.0.1",
|
"nonzero 0.0.1",
|
||||||
"offscreen_gl_context 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"offscreen_gl_context 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde 1.0.37 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"serde_bytes 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"serde_bytes 0.10.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"servo_config 0.0.1",
|
"servo_config 0.0.1",
|
||||||
|
@ -329,10 +330,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cgl"
|
name = "cgl"
|
||||||
version = "0.2.1"
|
version = "0.2.2"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"gleam 0.4.34 (registry+https://github.com/rust-lang/crates.io-index)",
|
"gleam 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -420,7 +421,7 @@ version = "0.0.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"gfx_traits 0.0.1",
|
"gfx_traits 0.0.1",
|
||||||
"gleam 0.4.34 (registry+https://github.com/rust-lang/crates.io-index)",
|
"gleam 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"image 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"image 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"ipc-channel 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"ipc-channel 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -1088,7 +1089,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "gleam"
|
name = "gleam"
|
||||||
version = "0.4.34"
|
version = "0.5.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"gl_generator 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"gl_generator 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -1105,7 +1106,7 @@ version = "0.13.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"android_glue 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"android_glue 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"cgl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"cgl 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"cocoa 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"cocoa 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"core-graphics 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"core-graphics 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -1309,12 +1310,12 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "io-surface"
|
name = "io-surface"
|
||||||
version = "0.9.0"
|
version = "0.9.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cgl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"cgl 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"gleam 0.4.34 (registry+https://github.com/rust-lang/crates.io-index)",
|
"gleam 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"leaky-cow 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"leaky-cow 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
]
|
]
|
||||||
|
@ -1573,7 +1574,7 @@ dependencies = [
|
||||||
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"gaol 0.0.1 (git+https://github.com/servo/gaol)",
|
"gaol 0.0.1 (git+https://github.com/servo/gaol)",
|
||||||
"gfx 0.0.1",
|
"gfx 0.0.1",
|
||||||
"gleam 0.4.34 (registry+https://github.com/rust-lang/crates.io-index)",
|
"gleam 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"ipc-channel 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"ipc-channel 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"layout_thread 0.0.1",
|
"layout_thread 0.0.1",
|
||||||
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -2067,14 +2068,14 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "offscreen_gl_context"
|
name = "offscreen_gl_context"
|
||||||
version = "0.15.1"
|
version = "0.16.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cgl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"cgl 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"gl_generator 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"gl_generator 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"gleam 0.4.34 (registry+https://github.com/rust-lang/crates.io-index)",
|
"gleam 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libloading 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libloading 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -2521,7 +2522,7 @@ dependencies = [
|
||||||
"encoding_rs 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"encoding_rs 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"gleam 0.4.34 (registry+https://github.com/rust-lang/crates.io-index)",
|
"gleam 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"half 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"half 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"html5ever 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"html5ever 0.22.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"hyper 0.10.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
"hyper 0.10.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -2544,7 +2545,7 @@ dependencies = [
|
||||||
"msg 0.0.1",
|
"msg 0.0.1",
|
||||||
"net_traits 0.0.1",
|
"net_traits 0.0.1",
|
||||||
"num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
|
"num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"offscreen_gl_context 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"offscreen_gl_context 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"parking_lot 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"parking_lot 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
|
"phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"phf_codegen 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
|
"phf_codegen 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -2742,7 +2743,7 @@ dependencies = [
|
||||||
"bitflags 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"bitflags 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"gdi32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"gleam 0.4.34 (registry+https://github.com/rust-lang/crates.io-index)",
|
"gleam 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"glutin 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"glutin 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libservo 0.0.1",
|
"libservo 0.0.1",
|
||||||
|
@ -2797,17 +2798,17 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "servo-skia"
|
name = "servo-skia"
|
||||||
version = "0.30000013.1"
|
version = "0.30000014.0"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"cgl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"cgl 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"cmake 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)",
|
"cmake 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"expat-sys 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
"expat-sys 2.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"gleam 0.4.34 (registry+https://github.com/rust-lang/crates.io-index)",
|
"gleam 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"glutin 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"glutin 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"glx 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
"glx 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"io-surface 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"io-surface 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
"libc 0.2.39 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"servo-egl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"servo-egl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"servo-fontconfig-sys 4.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
"servo-fontconfig-sys 4.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -3563,7 +3564,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "webrender"
|
name = "webrender"
|
||||||
version = "0.57.2"
|
version = "0.57.2"
|
||||||
source = "git+https://github.com/servo/webrender#81920df73bdf4f129cfc732a2bd6d2587088e838"
|
source = "git+https://github.com/servo/webrender#f94683560dc4b2a8092d218600da4fc380131d6a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"app_units 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"app_units 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -3578,7 +3579,7 @@ dependencies = [
|
||||||
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
"euclid 0.17.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"freetype 0.4.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)",
|
"fxhash 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"gleam 0.4.34 (registry+https://github.com/rust-lang/crates.io-index)",
|
"gleam 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"image 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"image 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"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)",
|
"log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -3598,7 +3599,7 @@ dependencies = [
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "webrender_api"
|
name = "webrender_api"
|
||||||
version = "0.57.2"
|
version = "0.57.2"
|
||||||
source = "git+https://github.com/servo/webrender#81920df73bdf4f129cfc732a2bd6d2587088e838"
|
source = "git+https://github.com/servo/webrender#f94683560dc4b2a8092d218600da4fc380131d6a"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"app_units 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
"app_units 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
"bincode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
"bincode 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
@ -3818,7 +3819,7 @@ dependencies = [
|
||||||
"checksum atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fb2dcb6e6d35f20276943cc04bb98e538b348d525a04ac79c10021561d202f21"
|
"checksum atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fb2dcb6e6d35f20276943cc04bb98e538b348d525a04ac79c10021561d202f21"
|
||||||
"checksum atty 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "21e50800ec991574876040fff8ee46b136a53e985286fbe6a3bdfe6421b78860"
|
"checksum atty 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "21e50800ec991574876040fff8ee46b136a53e985286fbe6a3bdfe6421b78860"
|
||||||
"checksum audio-video-metadata 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "71536082079f5ba92c274fba7c2dcd4e2f9d5c13ce6d7f8fe9acbbb258916d18"
|
"checksum audio-video-metadata 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "71536082079f5ba92c274fba7c2dcd4e2f9d5c13ce6d7f8fe9acbbb258916d18"
|
||||||
"checksum azure 0.28.0 (git+https://github.com/servo/rust-azure)" = "<none>"
|
"checksum azure 0.29.0 (git+https://github.com/servo/rust-azure)" = "<none>"
|
||||||
"checksum backtrace 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "72f9b4182546f4b04ebc4ab7f84948953a118bd6021a1b6a6c909e3e94f6be76"
|
"checksum backtrace 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "72f9b4182546f4b04ebc4ab7f84948953a118bd6021a1b6a6c909e3e94f6be76"
|
||||||
"checksum backtrace-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "44585761d6161b0f57afc49482ab6bd067e4edef48c12a152c237eb0203f7661"
|
"checksum backtrace-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "44585761d6161b0f57afc49482ab6bd067e4edef48c12a152c237eb0203f7661"
|
||||||
"checksum base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96434f987501f0ed4eb336a411e0631ecd1afa11574fe148587adc4ff96143c9"
|
"checksum base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96434f987501f0ed4eb336a411e0631ecd1afa11574fe148587adc4ff96143c9"
|
||||||
|
@ -3841,7 +3842,7 @@ dependencies = [
|
||||||
"checksum cc 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "9be26b24e988625409b19736d130f0c7d224f01d06454b5f81d8d23d6c1a618f"
|
"checksum cc 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "9be26b24e988625409b19736d130f0c7d224f01d06454b5f81d8d23d6c1a618f"
|
||||||
"checksum cexpr 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "393a5f0088efbe41f9d1fcd062f24e83c278608420e62109feb2c8abee07de7d"
|
"checksum cexpr 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "393a5f0088efbe41f9d1fcd062f24e83c278608420e62109feb2c8abee07de7d"
|
||||||
"checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de"
|
"checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de"
|
||||||
"checksum cgl 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "86765cb42c2a2c497e142af72517c1b4d7ae5bb2f25dfa77a5c69642f2342d89"
|
"checksum cgl 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "80f05e25f9631fdee56693110feda284a49308ca1e768857a0ad3906cfc1502a"
|
||||||
"checksum chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7c20ebe0b2b08b0aeddba49c609fe7957ba2e33449882cb186a180bc60682fa9"
|
"checksum chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7c20ebe0b2b08b0aeddba49c609fe7957ba2e33449882cb186a180bc60682fa9"
|
||||||
"checksum clang-sys 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)" = "939a1a34310b120d26eba35c29475933128b0ec58e24b43327f8dbe6036fc538"
|
"checksum clang-sys 0.22.0 (registry+https://github.com/rust-lang/crates.io-index)" = "939a1a34310b120d26eba35c29475933128b0ec58e24b43327f8dbe6036fc538"
|
||||||
"checksum clap 2.28.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dc34bf7d5d66268b466b9852bca925ec1d2650654dab4da081e63fd230145c2e"
|
"checksum clap 2.28.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dc34bf7d5d66268b466b9852bca925ec1d2650654dab4da081e63fd230145c2e"
|
||||||
|
@ -3901,7 +3902,7 @@ dependencies = [
|
||||||
"checksum getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9047cfbd08a437050b363d35ef160452c5fe8ea5187ae0a624708c91581d685"
|
"checksum getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9047cfbd08a437050b363d35ef160452c5fe8ea5187ae0a624708c91581d685"
|
||||||
"checksum gif 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8a80d6fe9e52f637df9afd4779449a7be17c39cc9c35b01589bb833f956ba596"
|
"checksum gif 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8a80d6fe9e52f637df9afd4779449a7be17c39cc9c35b01589bb833f956ba596"
|
||||||
"checksum gl_generator 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a795170cbd85b5a7baa58d6d7525cae6a03e486859860c220f7ebbbdd379d0a"
|
"checksum gl_generator 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a795170cbd85b5a7baa58d6d7525cae6a03e486859860c220f7ebbbdd379d0a"
|
||||||
"checksum gleam 0.4.34 (registry+https://github.com/rust-lang/crates.io-index)" = "b4e5e2cdcadecdf3886e7808b6a38eae0a48dfe98c5c12b776fc861b80edf4a2"
|
"checksum gleam 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e47b39459e47b76be4d2c82702932cdc66df09dcb8f813424167991adb8b3380"
|
||||||
"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb"
|
"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb"
|
||||||
"checksum glutin 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90de8e0391e57098acfbfe693b23065e9186255d370ebae12c933b7d77df8424"
|
"checksum glutin 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "90de8e0391e57098acfbfe693b23065e9186255d370ebae12c933b7d77df8424"
|
||||||
"checksum glx 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "63a6e7c2846e12626455f45ebaff9d92161436dd0fa703d9d198012e528ca7b9"
|
"checksum glx 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "63a6e7c2846e12626455f45ebaff9d92161436dd0fa703d9d198012e528ca7b9"
|
||||||
|
@ -3923,7 +3924,7 @@ dependencies = [
|
||||||
"checksum immeta 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "1aaaa557fbc7323c857871ce15f2b2c08d90548cba4aabda4251fac1b4778337"
|
"checksum immeta 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "1aaaa557fbc7323c857871ce15f2b2c08d90548cba4aabda4251fac1b4778337"
|
||||||
"checksum inflate 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "10ec05638adf7c5c788bc0cfa608cd479a13572beda20feb4898fe1d85d2c64b"
|
"checksum inflate 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "10ec05638adf7c5c788bc0cfa608cd479a13572beda20feb4898fe1d85d2c64b"
|
||||||
"checksum influent 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a22b311b83431be3ab9af96ca9ea41554bb4a8551ea871ae44c3ce0c57e55f2c"
|
"checksum influent 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a22b311b83431be3ab9af96ca9ea41554bb4a8551ea871ae44c3ce0c57e55f2c"
|
||||||
"checksum io-surface 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "623ace1e5f7de3512ec45302572a72349fdadcbef650c3dfc5d8244209be7653"
|
"checksum io-surface 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6b506cf08070106ec8d802dd7c3b4290bf1f844e4cf6b0aaff68ede2a58b5922"
|
||||||
"checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08"
|
"checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08"
|
||||||
"checksum ipc-channel 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "db9daf099728ac5390c73f54e6e3708f0c514d2b51f24373830f568702eadfca"
|
"checksum ipc-channel 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "db9daf099728ac5390c73f54e6e3708f0c514d2b51f24373830f568702eadfca"
|
||||||
"checksum itertools 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "b07332223953b5051bceb67e8c4700aa65291535568e1f12408c43c4a42c0394"
|
"checksum itertools 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "b07332223953b5051bceb67e8c4700aa65291535568e1f12408c43c4a42c0394"
|
||||||
|
@ -3976,7 +3977,7 @@ dependencies = [
|
||||||
"checksum objc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "877f30f37acef6749b1841cceab289707f211aecfc756553cd63976190e6cc2e"
|
"checksum objc 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "877f30f37acef6749b1841cceab289707f211aecfc756553cd63976190e6cc2e"
|
||||||
"checksum objc-foundation 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9"
|
"checksum objc-foundation 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9"
|
||||||
"checksum objc_id 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e4730aa1c64d722db45f7ccc4113a3e2c465d018de6db4d3e7dfe031e8c8a297"
|
"checksum objc_id 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e4730aa1c64d722db45f7ccc4113a3e2c465d018de6db4d3e7dfe031e8c8a297"
|
||||||
"checksum offscreen_gl_context 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b0daacb4e8c5760ab0addb80938f6bde4cd23b71b39a84d90080ae0c7215716a"
|
"checksum offscreen_gl_context 0.16.0 (registry+https://github.com/rust-lang/crates.io-index)" = "84e4be9374dd9e7caf6771b68b5e9e9a458c34ea2677b57993edada51abb0544"
|
||||||
"checksum ogg 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7137bf02687385302f4c0aecd77cfce052b69f5b4ee937be778e125c62f67e30"
|
"checksum ogg 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7137bf02687385302f4c0aecd77cfce052b69f5b4ee937be778e125c62f67e30"
|
||||||
"checksum ogg_metadata 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fc665717454399cba557c55ad226148996e9266ee291f8a37a98bb2cded0a490"
|
"checksum ogg_metadata 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "fc665717454399cba557c55ad226148996e9266ee291f8a37a98bb2cded0a490"
|
||||||
"checksum openssl 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)" = "a3605c298474a3aa69de92d21139fb5e2a81688d308262359d85cdd0d12a7985"
|
"checksum openssl 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)" = "a3605c298474a3aa69de92d21139fb5e2a81688d308262359d85cdd0d12a7985"
|
||||||
|
@ -4033,7 +4034,7 @@ dependencies = [
|
||||||
"checksum servo-fontconfig 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "93f799b649b4a2bf362398910eca35240704c7e765e780349b2bb1070d892262"
|
"checksum servo-fontconfig 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "93f799b649b4a2bf362398910eca35240704c7e765e780349b2bb1070d892262"
|
||||||
"checksum servo-fontconfig-sys 4.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "38b494f03009ee81914b0e7d387ad7c145cafcd69747c2ec89b0e17bb94f303a"
|
"checksum servo-fontconfig-sys 4.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "38b494f03009ee81914b0e7d387ad7c145cafcd69747c2ec89b0e17bb94f303a"
|
||||||
"checksum servo-freetype-sys 4.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9232032c2e85118c0282c6562c84cab12316e655491ba0a5d1905b2320060d1b"
|
"checksum servo-freetype-sys 4.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9232032c2e85118c0282c6562c84cab12316e655491ba0a5d1905b2320060d1b"
|
||||||
"checksum servo-skia 0.30000013.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3fb707c7dc3d8a053b8c9d48ed9eb7f2a0c0751616dfbe3598f526948408bc33"
|
"checksum servo-skia 0.30000014.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5fb39ffad573e5696b37bf4fad0b1a33ef3d3b8c92dcbdc04b550023ea97c4c8"
|
||||||
"checksum servo-websocket 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6bac1e2295e72f0525147d993c626761811acf0441dac1cee8707f12dc7f3363"
|
"checksum servo-websocket 0.21.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6bac1e2295e72f0525147d993c626761811acf0441dac1cee8707f12dc7f3363"
|
||||||
"checksum sha1 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cc30b1e1e8c40c121ca33b86c23308a090d19974ef001b4bf6e61fd1a0fb095c"
|
"checksum sha1 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cc30b1e1e8c40c121ca33b86c23308a090d19974ef001b4bf6e61fd1a0fb095c"
|
||||||
"checksum shared_library 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8254bf098ce4d8d7cc7cc6de438c5488adc5297e5b7ffef88816c0a91bd289c1"
|
"checksum shared_library 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8254bf098ce4d8d7cc7cc6de438c5488adc5297e5b7ffef88816c0a91bd289c1"
|
||||||
|
|
|
@ -16,11 +16,11 @@ compositing = {path = "../compositing"}
|
||||||
cssparser = "0.23.0"
|
cssparser = "0.23.0"
|
||||||
euclid = "0.17"
|
euclid = "0.17"
|
||||||
fnv = "1.0"
|
fnv = "1.0"
|
||||||
gleam = "0.4.34"
|
gleam = "0.5"
|
||||||
ipc-channel = "0.10"
|
ipc-channel = "0.10"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
num-traits = "0.1.32"
|
num-traits = "0.1.32"
|
||||||
offscreen_gl_context = { version = "0.15", features = ["serde", "osmesa"] }
|
offscreen_gl_context = {version = "0.16", features = ["serde", "osmesa"]}
|
||||||
serde_bytes = "0.10"
|
serde_bytes = "0.10"
|
||||||
servo_config = {path = "../config"}
|
servo_config = {path = "../config"}
|
||||||
webrender = {git = "https://github.com/servo/webrender"}
|
webrender = {git = "https://github.com/servo/webrender"}
|
||||||
|
|
|
@ -648,6 +648,7 @@ struct DOMToTextureData {
|
||||||
pub struct WebGLImpl;
|
pub struct WebGLImpl;
|
||||||
|
|
||||||
impl WebGLImpl {
|
impl WebGLImpl {
|
||||||
|
#[allow(unsafe_code)]
|
||||||
pub fn apply<Native: NativeGLContextMethods>(ctx: &GLContext<Native>, command: WebGLCommand) {
|
pub fn apply<Native: NativeGLContextMethods>(ctx: &GLContext<Native>, command: WebGLCommand) {
|
||||||
match command {
|
match command {
|
||||||
WebGLCommand::GetContextAttributes(sender) =>
|
WebGLCommand::GetContextAttributes(sender) =>
|
||||||
|
@ -758,18 +759,11 @@ impl WebGLImpl {
|
||||||
Self::get_renderbuffer_parameter(ctx.gl(), target, pname, chan),
|
Self::get_renderbuffer_parameter(ctx.gl(), target, pname, chan),
|
||||||
WebGLCommand::GetFramebufferAttachmentParameter(target, attachment, pname, chan) =>
|
WebGLCommand::GetFramebufferAttachmentParameter(target, attachment, pname, chan) =>
|
||||||
Self::get_framebuffer_attachment_parameter(ctx.gl(), target, attachment, pname, chan),
|
Self::get_framebuffer_attachment_parameter(ctx.gl(), target, attachment, pname, chan),
|
||||||
WebGLCommand::GetVertexAttrib(index, pname, chan) =>
|
|
||||||
Self::vertex_attrib(ctx.gl(), index, pname, chan),
|
|
||||||
WebGLCommand::GetVertexAttribOffset(index, pname, chan) =>
|
WebGLCommand::GetVertexAttribOffset(index, pname, chan) =>
|
||||||
Self::vertex_attrib_offset(ctx.gl(), index, pname, chan),
|
Self::vertex_attrib_offset(ctx.gl(), index, pname, chan),
|
||||||
WebGLCommand::GetParameter(param_id, chan) =>
|
WebGLCommand::GetTexParameter(target, pname, chan) => {
|
||||||
Self::parameter(ctx.gl(), param_id, chan),
|
chan.send(ctx.gl().get_tex_parameter_iv(target, pname)).unwrap();
|
||||||
WebGLCommand::GetTexParameter(target, pname, chan) =>
|
}
|
||||||
Self::get_tex_parameter(ctx.gl(), target, pname, chan),
|
|
||||||
WebGLCommand::GetProgramParameter(program_id, param_id, chan) =>
|
|
||||||
Self::program_parameter(ctx.gl(), program_id, param_id, chan),
|
|
||||||
WebGLCommand::GetShaderParameter(shader_id, param_id, chan) =>
|
|
||||||
Self::shader_parameter(ctx.gl(), shader_id, param_id, chan),
|
|
||||||
WebGLCommand::GetShaderPrecisionFormat(shader_type, precision_type, chan) =>
|
WebGLCommand::GetShaderPrecisionFormat(shader_type, precision_type, chan) =>
|
||||||
Self::shader_precision_format(ctx.gl(), shader_type, precision_type, chan),
|
Self::shader_precision_format(ctx.gl(), shader_type, precision_type, chan),
|
||||||
WebGLCommand::GetExtensions(chan) =>
|
WebGLCommand::GetExtensions(chan) =>
|
||||||
|
@ -864,9 +858,6 @@ impl WebGLImpl {
|
||||||
ctx.gl().vertex_attrib_pointer_f32(attrib_id, size, normalized, stride, offset),
|
ctx.gl().vertex_attrib_pointer_f32(attrib_id, size, normalized, stride, offset),
|
||||||
WebGLCommand::VertexAttribPointer(attrib_id, size, data_type, normalized, stride, offset) =>
|
WebGLCommand::VertexAttribPointer(attrib_id, size, data_type, normalized, stride, offset) =>
|
||||||
ctx.gl().vertex_attrib_pointer(attrib_id, size, data_type, normalized, stride, offset),
|
ctx.gl().vertex_attrib_pointer(attrib_id, size, data_type, normalized, stride, offset),
|
||||||
WebGLCommand::GetViewport(sender) => {
|
|
||||||
sender.send(ctx.gl().get_viewport()).unwrap();
|
|
||||||
}
|
|
||||||
WebGLCommand::SetViewport(x, y, width, height) => {
|
WebGLCommand::SetViewport(x, y, width, height) => {
|
||||||
ctx.gl().viewport(x, y, width, height);
|
ctx.gl().viewport(x, y, width, height);
|
||||||
}
|
}
|
||||||
|
@ -895,10 +886,119 @@ impl WebGLImpl {
|
||||||
ctx.gl().delete_vertex_arrays(&[id.get()]),
|
ctx.gl().delete_vertex_arrays(&[id.get()]),
|
||||||
WebGLCommand::BindVertexArray(id) =>
|
WebGLCommand::BindVertexArray(id) =>
|
||||||
ctx.gl().bind_vertex_array(id.map_or(0, WebGLVertexArrayId::get)),
|
ctx.gl().bind_vertex_array(id.map_or(0, WebGLVertexArrayId::get)),
|
||||||
WebGLCommand::AliasedPointSizeRange(sender) =>
|
WebGLCommand::GetParameterBool(param, sender) => {
|
||||||
sender.send(ctx.gl().alias_point_size_range()).unwrap(),
|
let mut value = [0];
|
||||||
WebGLCommand::AliasedLineWidthRange(sender) => {
|
unsafe {
|
||||||
sender.send(ctx.gl().alias_line_width_range()).unwrap()
|
ctx.gl().get_boolean_v(param as u32, &mut value);
|
||||||
|
}
|
||||||
|
sender.send(value[0] != 0).unwrap()
|
||||||
|
}
|
||||||
|
WebGLCommand::GetParameterInt(param, sender) => {
|
||||||
|
let mut value = [0];
|
||||||
|
unsafe {
|
||||||
|
ctx.gl().get_integer_v(param as u32, &mut value);
|
||||||
|
}
|
||||||
|
sender.send(value[0]).unwrap()
|
||||||
|
}
|
||||||
|
WebGLCommand::GetParameterInt4(param, sender) => {
|
||||||
|
let mut value = [0; 4];
|
||||||
|
unsafe {
|
||||||
|
ctx.gl().get_integer_v(param as u32, &mut value);
|
||||||
|
}
|
||||||
|
sender.send(value).unwrap()
|
||||||
|
}
|
||||||
|
WebGLCommand::GetParameterFloat(param, sender) => {
|
||||||
|
let mut value = [0.];
|
||||||
|
unsafe {
|
||||||
|
ctx.gl().get_float_v(param as u32, &mut value);
|
||||||
|
}
|
||||||
|
sender.send(value[0]).unwrap()
|
||||||
|
}
|
||||||
|
WebGLCommand::GetParameterFloat2(param, sender) => {
|
||||||
|
let mut value = [0.; 2];
|
||||||
|
unsafe {
|
||||||
|
ctx.gl().get_float_v(param as u32, &mut value);
|
||||||
|
}
|
||||||
|
sender.send(value).unwrap()
|
||||||
|
}
|
||||||
|
WebGLCommand::GetProgramParameterBool(program, param, sender) => {
|
||||||
|
let mut value = [0];
|
||||||
|
unsafe {
|
||||||
|
ctx.gl().get_program_iv(program.get(), param as u32, &mut value);
|
||||||
|
}
|
||||||
|
sender.send(value[0] != 0).unwrap()
|
||||||
|
}
|
||||||
|
WebGLCommand::GetProgramParameterInt(program, param, sender) => {
|
||||||
|
let mut value = [0];
|
||||||
|
unsafe {
|
||||||
|
ctx.gl().get_program_iv(program.get(), param as u32, &mut value);
|
||||||
|
}
|
||||||
|
sender.send(value[0]).unwrap()
|
||||||
|
}
|
||||||
|
WebGLCommand::GetShaderParameterBool(shader, param, sender) => {
|
||||||
|
let mut value = [0];
|
||||||
|
unsafe {
|
||||||
|
ctx.gl().get_shader_iv(shader.get(), param as u32, &mut value);
|
||||||
|
}
|
||||||
|
sender.send(value[0] != 0).unwrap()
|
||||||
|
}
|
||||||
|
WebGLCommand::GetShaderParameterInt(shader, param, sender) => {
|
||||||
|
let mut value = [0];
|
||||||
|
unsafe {
|
||||||
|
ctx.gl().get_shader_iv(shader.get(), param as u32, &mut value);
|
||||||
|
}
|
||||||
|
sender.send(value[0]).unwrap()
|
||||||
|
}
|
||||||
|
WebGLCommand::GetVertexAttribBool(index, param, sender) => {
|
||||||
|
// FIXME(nox): https://github.com/servo/servo/issues/20608
|
||||||
|
let mut max = [0];
|
||||||
|
unsafe {
|
||||||
|
ctx.gl().get_integer_v(gl::MAX_VERTEX_ATTRIBS, &mut max);
|
||||||
|
}
|
||||||
|
let result = if index >= max[0] as u32 {
|
||||||
|
Err(WebGLError::InvalidValue)
|
||||||
|
} else {
|
||||||
|
let mut value = [0];
|
||||||
|
unsafe {
|
||||||
|
ctx.gl().get_vertex_attrib_iv(index, param as u32, &mut value);
|
||||||
|
}
|
||||||
|
Ok(value[0] != 0)
|
||||||
|
};
|
||||||
|
sender.send(result).unwrap();
|
||||||
|
}
|
||||||
|
WebGLCommand::GetVertexAttribInt(index, param, sender) => {
|
||||||
|
// FIXME(nox): https://github.com/servo/servo/issues/20608
|
||||||
|
let mut max = [0];
|
||||||
|
unsafe {
|
||||||
|
ctx.gl().get_integer_v(gl::MAX_VERTEX_ATTRIBS, &mut max);
|
||||||
|
}
|
||||||
|
let result = if index >= max[0] as u32 {
|
||||||
|
Err(WebGLError::InvalidValue)
|
||||||
|
} else {
|
||||||
|
let mut value = [0];
|
||||||
|
unsafe {
|
||||||
|
ctx.gl().get_vertex_attrib_iv(index, param as u32, &mut value);
|
||||||
|
}
|
||||||
|
Ok(value[0])
|
||||||
|
};
|
||||||
|
sender.send(result).unwrap();
|
||||||
|
}
|
||||||
|
WebGLCommand::GetVertexAttribFloat4(index, param, sender) => {
|
||||||
|
// FIXME(nox): https://github.com/servo/servo/issues/20608
|
||||||
|
let mut max = [0];
|
||||||
|
unsafe {
|
||||||
|
ctx.gl().get_integer_v(gl::MAX_VERTEX_ATTRIBS, &mut max);
|
||||||
|
}
|
||||||
|
let result = if index >= max[0] as u32 {
|
||||||
|
Err(WebGLError::InvalidValue)
|
||||||
|
} else {
|
||||||
|
let mut value = [0.; 4];
|
||||||
|
unsafe {
|
||||||
|
ctx.gl().get_vertex_attrib_fv(index, param as u32, &mut value);
|
||||||
|
}
|
||||||
|
Ok(value)
|
||||||
|
};
|
||||||
|
sender.send(result).unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -923,11 +1023,18 @@ impl WebGLImpl {
|
||||||
chan.send(result.into()).unwrap()
|
chan.send(result.into()).unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn active_attrib(gl: &gl::Gl,
|
#[allow(unsafe_code)]
|
||||||
program_id: WebGLProgramId,
|
fn active_attrib(
|
||||||
index: u32,
|
gl: &gl::Gl,
|
||||||
chan: WebGLSender<WebGLResult<(i32, u32, String)>>) {
|
program_id: WebGLProgramId,
|
||||||
let result = if index >= gl.get_program_iv(program_id.get(), gl::ACTIVE_ATTRIBUTES) as u32 {
|
index: u32,
|
||||||
|
chan: WebGLSender<WebGLResult<(i32, u32, String)>>,
|
||||||
|
) {
|
||||||
|
let mut max = [0];
|
||||||
|
unsafe {
|
||||||
|
gl.get_program_iv(program_id.get(), gl::ACTIVE_ATTRIBUTES, &mut max);
|
||||||
|
}
|
||||||
|
let result = if index >= max[0] as u32 {
|
||||||
Err(WebGLError::InvalidValue)
|
Err(WebGLError::InvalidValue)
|
||||||
} else {
|
} else {
|
||||||
Ok(gl.get_active_attrib(program_id.get(), index))
|
Ok(gl.get_active_attrib(program_id.get(), index))
|
||||||
|
@ -935,11 +1042,16 @@ impl WebGLImpl {
|
||||||
chan.send(result).unwrap();
|
chan.send(result).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[allow(unsafe_code)]
|
||||||
fn active_uniform(gl: &gl::Gl,
|
fn active_uniform(gl: &gl::Gl,
|
||||||
program_id: WebGLProgramId,
|
program_id: WebGLProgramId,
|
||||||
index: u32,
|
index: u32,
|
||||||
chan: WebGLSender<WebGLResult<(i32, u32, String)>>) {
|
chan: WebGLSender<WebGLResult<(i32, u32, String)>>) {
|
||||||
let result = if index >= gl.get_program_iv(program_id.get(), gl::ACTIVE_UNIFORMS) as u32 {
|
let mut max = [0];
|
||||||
|
unsafe {
|
||||||
|
gl.get_program_iv(program_id.get(), gl::ACTIVE_UNIFORMS, &mut max);
|
||||||
|
}
|
||||||
|
let result = if index >= max[0] as u32 {
|
||||||
Err(WebGLError::InvalidValue)
|
Err(WebGLError::InvalidValue)
|
||||||
} else {
|
} else {
|
||||||
Ok(gl.get_active_uniform(program_id.get(), index))
|
Ok(gl.get_active_uniform(program_id.get(), index))
|
||||||
|
@ -962,167 +1074,11 @@ impl WebGLImpl {
|
||||||
chan.send(attrib_location).unwrap();
|
chan.send(attrib_location).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn parameter(gl: &gl::Gl,
|
|
||||||
param_id: u32,
|
|
||||||
chan: WebGLSender<WebGLResult<WebGLParameter>>) {
|
|
||||||
let result = match param_id {
|
|
||||||
gl::ACTIVE_TEXTURE |
|
|
||||||
gl::ALPHA_BITS |
|
|
||||||
gl::BLEND_DST_ALPHA |
|
|
||||||
gl::BLEND_DST_RGB |
|
|
||||||
gl::BLEND_EQUATION_ALPHA |
|
|
||||||
gl::BLEND_EQUATION_RGB |
|
|
||||||
gl::BLEND_SRC_ALPHA |
|
|
||||||
gl::BLEND_SRC_RGB |
|
|
||||||
gl::BLUE_BITS |
|
|
||||||
gl::CULL_FACE_MODE |
|
|
||||||
gl::DEPTH_BITS |
|
|
||||||
gl::DEPTH_FUNC |
|
|
||||||
gl::FRONT_FACE |
|
|
||||||
//gl::GENERATE_MIPMAP_HINT |
|
|
||||||
gl::GREEN_BITS |
|
|
||||||
//gl::IMPLEMENTATION_COLOR_READ_FORMAT |
|
|
||||||
//gl::IMPLEMENTATION_COLOR_READ_TYPE |
|
|
||||||
gl::MAX_COMBINED_TEXTURE_IMAGE_UNITS |
|
|
||||||
gl::MAX_CUBE_MAP_TEXTURE_SIZE |
|
|
||||||
//gl::MAX_FRAGMENT_UNIFORM_VECTORS |
|
|
||||||
gl::MAX_RENDERBUFFER_SIZE |
|
|
||||||
gl::MAX_TEXTURE_IMAGE_UNITS |
|
|
||||||
gl::MAX_TEXTURE_SIZE |
|
|
||||||
//gl::MAX_VARYING_VECTORS |
|
|
||||||
gl::MAX_VERTEX_ATTRIBS |
|
|
||||||
gl::MAX_VERTEX_TEXTURE_IMAGE_UNITS |
|
|
||||||
//gl::MAX_VERTEX_UNIFORM_VECTORS |
|
|
||||||
gl::PACK_ALIGNMENT |
|
|
||||||
gl::RED_BITS |
|
|
||||||
gl::SAMPLE_BUFFERS |
|
|
||||||
gl::SAMPLES |
|
|
||||||
gl::STENCIL_BACK_FAIL |
|
|
||||||
gl::STENCIL_BACK_FUNC |
|
|
||||||
gl::STENCIL_BACK_PASS_DEPTH_FAIL |
|
|
||||||
gl::STENCIL_BACK_PASS_DEPTH_PASS |
|
|
||||||
gl::STENCIL_BACK_REF |
|
|
||||||
gl::STENCIL_BACK_VALUE_MASK |
|
|
||||||
gl::STENCIL_BACK_WRITEMASK |
|
|
||||||
gl::STENCIL_BITS |
|
|
||||||
gl::STENCIL_CLEAR_VALUE |
|
|
||||||
gl::STENCIL_FAIL |
|
|
||||||
gl::STENCIL_FUNC |
|
|
||||||
gl::STENCIL_PASS_DEPTH_FAIL |
|
|
||||||
gl::STENCIL_PASS_DEPTH_PASS |
|
|
||||||
gl::STENCIL_REF |
|
|
||||||
gl::STENCIL_VALUE_MASK |
|
|
||||||
gl::STENCIL_WRITEMASK |
|
|
||||||
gl::SUBPIXEL_BITS |
|
|
||||||
gl::UNPACK_ALIGNMENT |
|
|
||||||
gl::FRAGMENT_SHADER_DERIVATIVE_HINT =>
|
|
||||||
//gl::UNPACK_COLORSPACE_CONVERSION_WEBGL =>
|
|
||||||
Ok(WebGLParameter::Int(gl.get_integer_v(param_id))),
|
|
||||||
|
|
||||||
gl::BLEND |
|
|
||||||
gl::CULL_FACE |
|
|
||||||
gl::DEPTH_TEST |
|
|
||||||
gl::DEPTH_WRITEMASK |
|
|
||||||
gl::DITHER |
|
|
||||||
gl::POLYGON_OFFSET_FILL |
|
|
||||||
gl::SAMPLE_COVERAGE_INVERT |
|
|
||||||
gl::STENCIL_TEST =>
|
|
||||||
//gl::UNPACK_FLIP_Y_WEBGL |
|
|
||||||
//gl::UNPACK_PREMULTIPLY_ALPHA_WEBGL =>
|
|
||||||
Ok(WebGLParameter::Bool(gl.get_boolean_v(param_id) != 0)),
|
|
||||||
|
|
||||||
gl::DEPTH_CLEAR_VALUE |
|
|
||||||
gl::LINE_WIDTH |
|
|
||||||
gl::POLYGON_OFFSET_FACTOR |
|
|
||||||
gl::POLYGON_OFFSET_UNITS |
|
|
||||||
gl::SAMPLE_COVERAGE_VALUE =>
|
|
||||||
Ok(WebGLParameter::Float(gl.get_float_v(param_id))),
|
|
||||||
|
|
||||||
gl::VERSION => Ok(WebGLParameter::String("WebGL 1.0".to_owned())),
|
|
||||||
gl::RENDERER |
|
|
||||||
gl::VENDOR => Ok(WebGLParameter::String("Mozilla/Servo".to_owned())),
|
|
||||||
gl::SHADING_LANGUAGE_VERSION => Ok(WebGLParameter::String("WebGL GLSL ES 1.0".to_owned())),
|
|
||||||
|
|
||||||
// TODO(zbarsky, emilio): Implement support for the following valid parameters
|
|
||||||
// Float32Array
|
|
||||||
gl::ALIASED_LINE_WIDTH_RANGE |
|
|
||||||
//gl::ALIASED_POINT_SIZE_RANGE |
|
|
||||||
//gl::BLEND_COLOR |
|
|
||||||
gl::COLOR_CLEAR_VALUE |
|
|
||||||
gl::DEPTH_RANGE |
|
|
||||||
|
|
||||||
// WebGLBuffer
|
|
||||||
gl::ARRAY_BUFFER_BINDING |
|
|
||||||
gl::ELEMENT_ARRAY_BUFFER_BINDING |
|
|
||||||
|
|
||||||
// WebGLFrameBuffer
|
|
||||||
gl::FRAMEBUFFER_BINDING |
|
|
||||||
|
|
||||||
// WebGLRenderBuffer
|
|
||||||
gl::RENDERBUFFER_BINDING |
|
|
||||||
|
|
||||||
// WebGLProgram
|
|
||||||
gl::CURRENT_PROGRAM |
|
|
||||||
|
|
||||||
// WebGLTexture
|
|
||||||
gl::TEXTURE_BINDING_2D |
|
|
||||||
gl::TEXTURE_BINDING_CUBE_MAP |
|
|
||||||
|
|
||||||
// sequence<GlBoolean>
|
|
||||||
gl::COLOR_WRITEMASK |
|
|
||||||
|
|
||||||
// Uint32Array
|
|
||||||
gl::COMPRESSED_TEXTURE_FORMATS |
|
|
||||||
|
|
||||||
// Int32Array
|
|
||||||
gl::MAX_VIEWPORT_DIMS |
|
|
||||||
gl::SCISSOR_BOX => Err(WebGLError::InvalidEnum),
|
|
||||||
|
|
||||||
// Invalid parameters
|
|
||||||
_ => Err(WebGLError::InvalidEnum)
|
|
||||||
};
|
|
||||||
|
|
||||||
chan.send(result).unwrap();
|
|
||||||
}
|
|
||||||
|
|
||||||
fn get_tex_parameter(gl: &gl::Gl,
|
|
||||||
target: u32,
|
|
||||||
pname: u32,
|
|
||||||
chan: WebGLSender<i32> ) {
|
|
||||||
let result = gl.get_tex_parameter_iv(target, pname);
|
|
||||||
chan.send(result).unwrap();
|
|
||||||
}
|
|
||||||
|
|
||||||
fn finish(gl: &gl::Gl, chan: WebGLSender<()>) {
|
fn finish(gl: &gl::Gl, chan: WebGLSender<()>) {
|
||||||
gl.finish();
|
gl.finish();
|
||||||
chan.send(()).unwrap();
|
chan.send(()).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn vertex_attrib(gl: &gl::Gl,
|
|
||||||
index: u32,
|
|
||||||
pname: u32,
|
|
||||||
chan: WebGLSender<WebGLResult<WebGLParameter>>) {
|
|
||||||
let result = if index >= gl.get_integer_v(gl::MAX_VERTEX_ATTRIBS) as u32 {
|
|
||||||
Err(WebGLError::InvalidValue)
|
|
||||||
} else {
|
|
||||||
match pname {
|
|
||||||
gl::VERTEX_ATTRIB_ARRAY_ENABLED |
|
|
||||||
gl::VERTEX_ATTRIB_ARRAY_NORMALIZED =>
|
|
||||||
Ok(WebGLParameter::Bool(gl.get_vertex_attrib_iv(index, pname) != 0)),
|
|
||||||
gl::VERTEX_ATTRIB_ARRAY_SIZE |
|
|
||||||
gl::VERTEX_ATTRIB_ARRAY_STRIDE |
|
|
||||||
gl::VERTEX_ATTRIB_ARRAY_TYPE =>
|
|
||||||
Ok(WebGLParameter::Int(gl.get_vertex_attrib_iv(index, pname))),
|
|
||||||
gl::CURRENT_VERTEX_ATTRIB =>
|
|
||||||
Ok(WebGLParameter::FloatArray(gl.get_vertex_attrib_fv(index, pname))),
|
|
||||||
// gl::VERTEX_ATTRIB_ARRAY_BUFFER_BINDING should return WebGLBuffer
|
|
||||||
_ => Err(WebGLError::InvalidEnum),
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
chan.send(result).unwrap();
|
|
||||||
}
|
|
||||||
|
|
||||||
fn vertex_attrib_offset(gl: &gl::Gl,
|
fn vertex_attrib_offset(gl: &gl::Gl,
|
||||||
index: u32,
|
index: u32,
|
||||||
pname: u32,
|
pname: u32,
|
||||||
|
@ -1131,41 +1087,6 @@ impl WebGLImpl {
|
||||||
chan.send(result).unwrap();
|
chan.send(result).unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
fn program_parameter(gl: &gl::Gl,
|
|
||||||
program_id: WebGLProgramId,
|
|
||||||
param_id: u32,
|
|
||||||
chan: WebGLSender<WebGLResult<WebGLParameter>>) {
|
|
||||||
let result = match param_id {
|
|
||||||
gl::DELETE_STATUS |
|
|
||||||
gl::LINK_STATUS |
|
|
||||||
gl::VALIDATE_STATUS =>
|
|
||||||
Ok(WebGLParameter::Bool(gl.get_program_iv(program_id.get(), param_id) != 0)),
|
|
||||||
gl::ATTACHED_SHADERS |
|
|
||||||
gl::ACTIVE_ATTRIBUTES |
|
|
||||||
gl::ACTIVE_UNIFORMS =>
|
|
||||||
Ok(WebGLParameter::Int(gl.get_program_iv(program_id.get(), param_id))),
|
|
||||||
_ => Err(WebGLError::InvalidEnum),
|
|
||||||
};
|
|
||||||
|
|
||||||
chan.send(result).unwrap();
|
|
||||||
}
|
|
||||||
|
|
||||||
fn shader_parameter(gl: &gl::Gl,
|
|
||||||
shader_id: WebGLShaderId,
|
|
||||||
param_id: u32,
|
|
||||||
chan: WebGLSender<WebGLResult<WebGLParameter>>) {
|
|
||||||
let result = match param_id {
|
|
||||||
gl::SHADER_TYPE =>
|
|
||||||
Ok(WebGLParameter::Int(gl.get_shader_iv(shader_id.get(), param_id))),
|
|
||||||
gl::DELETE_STATUS |
|
|
||||||
gl::COMPILE_STATUS =>
|
|
||||||
Ok(WebGLParameter::Bool(gl.get_shader_iv(shader_id.get(), param_id) != 0)),
|
|
||||||
_ => Err(WebGLError::InvalidEnum),
|
|
||||||
};
|
|
||||||
|
|
||||||
chan.send(result).unwrap();
|
|
||||||
}
|
|
||||||
|
|
||||||
fn shader_precision_format(gl: &gl::Gl,
|
fn shader_precision_format(gl: &gl::Gl,
|
||||||
shader_type: u32,
|
shader_type: u32,
|
||||||
precision_type: u32,
|
precision_type: u32,
|
||||||
|
|
|
@ -13,11 +13,12 @@ path = "lib.rs"
|
||||||
cssparser = "0.23.0"
|
cssparser = "0.23.0"
|
||||||
euclid = "0.17"
|
euclid = "0.17"
|
||||||
ipc-channel = "0.10"
|
ipc-channel = "0.10"
|
||||||
|
gleam = "0.5"
|
||||||
lazy_static = "1"
|
lazy_static = "1"
|
||||||
malloc_size_of = { path = "../malloc_size_of" }
|
malloc_size_of = { path = "../malloc_size_of" }
|
||||||
malloc_size_of_derive = { path = "../malloc_size_of_derive" }
|
malloc_size_of_derive = { path = "../malloc_size_of_derive" }
|
||||||
nonzero = {path = "../nonzero"}
|
nonzero = {path = "../nonzero"}
|
||||||
offscreen_gl_context = { version = "0.15", features = ["serde"] }
|
offscreen_gl_context = {version = "0.16", features = ["serde"]}
|
||||||
serde = "1.0"
|
serde = "1.0"
|
||||||
serde_bytes = "0.10"
|
serde_bytes = "0.10"
|
||||||
servo_config = {path = "../config"}
|
servo_config = {path = "../config"}
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
extern crate cssparser;
|
extern crate cssparser;
|
||||||
extern crate euclid;
|
extern crate euclid;
|
||||||
|
extern crate gleam;
|
||||||
extern crate ipc_channel;
|
extern crate ipc_channel;
|
||||||
#[macro_use] extern crate lazy_static;
|
#[macro_use] extern crate lazy_static;
|
||||||
extern crate malloc_size_of;
|
extern crate malloc_size_of;
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
use euclid::Size2D;
|
use euclid::Size2D;
|
||||||
|
use gleam::gl;
|
||||||
use nonzero::NonZeroU32;
|
use nonzero::NonZeroU32;
|
||||||
use offscreen_gl_context::{GLContextAttributes, GLLimits};
|
use offscreen_gl_context::{GLContextAttributes, GLLimits};
|
||||||
use serde_bytes::ByteBuf;
|
use serde_bytes::ByteBuf;
|
||||||
|
@ -206,16 +207,12 @@ pub enum WebGLCommand {
|
||||||
FramebufferRenderbuffer(u32, u32, u32, Option<WebGLRenderbufferId>),
|
FramebufferRenderbuffer(u32, u32, u32, Option<WebGLRenderbufferId>),
|
||||||
FramebufferTexture2D(u32, u32, u32, Option<WebGLTextureId>, i32),
|
FramebufferTexture2D(u32, u32, u32, Option<WebGLTextureId>, i32),
|
||||||
GetExtensions(WebGLSender<String>),
|
GetExtensions(WebGLSender<String>),
|
||||||
GetParameter(u32, WebGLSender<WebGLResult<WebGLParameter>>),
|
|
||||||
GetTexParameter(u32, u32, WebGLSender<i32>),
|
GetTexParameter(u32, u32, WebGLSender<i32>),
|
||||||
GetProgramParameter(WebGLProgramId, u32, WebGLSender<WebGLResult<WebGLParameter>>),
|
|
||||||
GetShaderParameter(WebGLShaderId, u32, WebGLSender<WebGLResult<WebGLParameter>>),
|
|
||||||
GetShaderPrecisionFormat(u32, u32, WebGLSender<(i32, i32, i32)>),
|
GetShaderPrecisionFormat(u32, u32, WebGLSender<(i32, i32, i32)>),
|
||||||
GetActiveAttrib(WebGLProgramId, u32, WebGLSender<WebGLResult<(i32, u32, String)>>),
|
GetActiveAttrib(WebGLProgramId, u32, WebGLSender<WebGLResult<(i32, u32, String)>>),
|
||||||
GetActiveUniform(WebGLProgramId, u32, WebGLSender<WebGLResult<(i32, u32, String)>>),
|
GetActiveUniform(WebGLProgramId, u32, WebGLSender<WebGLResult<(i32, u32, String)>>),
|
||||||
GetAttribLocation(WebGLProgramId, String, WebGLSender<Option<i32>>),
|
GetAttribLocation(WebGLProgramId, String, WebGLSender<Option<i32>>),
|
||||||
GetUniformLocation(WebGLProgramId, String, WebGLSender<Option<i32>>),
|
GetUniformLocation(WebGLProgramId, String, WebGLSender<Option<i32>>),
|
||||||
GetVertexAttrib(u32, u32, WebGLSender<WebGLResult<WebGLParameter>>),
|
|
||||||
GetVertexAttribOffset(u32, u32, WebGLSender<isize>),
|
GetVertexAttribOffset(u32, u32, WebGLSender<isize>),
|
||||||
GetShaderInfoLog(WebGLShaderId, WebGLSender<String>),
|
GetShaderInfoLog(WebGLShaderId, WebGLSender<String>),
|
||||||
GetProgramInfoLog(WebGLProgramId, WebGLSender<String>),
|
GetProgramInfoLog(WebGLProgramId, WebGLSender<String>),
|
||||||
|
@ -261,7 +258,6 @@ pub enum WebGLCommand {
|
||||||
VertexAttrib(u32, f32, f32, f32, f32),
|
VertexAttrib(u32, f32, f32, f32, f32),
|
||||||
VertexAttribPointer(u32, i32, u32, bool, i32, u32),
|
VertexAttribPointer(u32, i32, u32, bool, i32, u32),
|
||||||
VertexAttribPointer2f(u32, i32, bool, i32, u32),
|
VertexAttribPointer2f(u32, i32, bool, i32, u32),
|
||||||
GetViewport(WebGLSender<(i32, i32, i32, i32)>),
|
|
||||||
SetViewport(i32, i32, i32, i32),
|
SetViewport(i32, i32, i32, i32),
|
||||||
TexImage2D(u32, i32, i32, i32, i32, u32, u32, ByteBuf),
|
TexImage2D(u32, i32, i32, i32, i32, u32, u32, ByteBuf),
|
||||||
TexParameteri(u32, u32, i32),
|
TexParameteri(u32, u32, i32),
|
||||||
|
@ -275,8 +271,18 @@ pub enum WebGLCommand {
|
||||||
CreateVertexArray(WebGLSender<Option<WebGLVertexArrayId>>),
|
CreateVertexArray(WebGLSender<Option<WebGLVertexArrayId>>),
|
||||||
DeleteVertexArray(WebGLVertexArrayId),
|
DeleteVertexArray(WebGLVertexArrayId),
|
||||||
BindVertexArray(Option<WebGLVertexArrayId>),
|
BindVertexArray(Option<WebGLVertexArrayId>),
|
||||||
AliasedPointSizeRange(WebGLSender<(f32, f32)>),
|
GetParameterBool(ParameterBool, WebGLSender<bool>),
|
||||||
AliasedLineWidthRange(WebGLSender<(f32, f32)>),
|
GetParameterInt(ParameterInt, WebGLSender<i32>),
|
||||||
|
GetParameterInt4(ParameterInt4, WebGLSender<[i32; 4]>),
|
||||||
|
GetParameterFloat(ParameterFloat, WebGLSender<f32>),
|
||||||
|
GetParameterFloat2(ParameterFloat2, WebGLSender<[f32; 2]>),
|
||||||
|
GetProgramParameterBool(WebGLProgramId, ProgramParameterBool, WebGLSender<bool>),
|
||||||
|
GetProgramParameterInt(WebGLProgramId, ProgramParameterInt, WebGLSender<i32>),
|
||||||
|
GetShaderParameterBool(WebGLShaderId, ShaderParameterBool, WebGLSender<bool>),
|
||||||
|
GetShaderParameterInt(WebGLShaderId, ShaderParameterInt, WebGLSender<i32>),
|
||||||
|
GetVertexAttribBool(u32, VertexAttribBool, WebGLSender<WebGLResult<bool>>),
|
||||||
|
GetVertexAttribInt(u32, VertexAttribInt, WebGLSender<WebGLResult<i32>>),
|
||||||
|
GetVertexAttribFloat4(u32, VertexAttribFloat4, WebGLSender<WebGLResult<[f32; 4]>>),
|
||||||
}
|
}
|
||||||
|
|
||||||
macro_rules! define_resource_id_struct {
|
macro_rules! define_resource_id_struct {
|
||||||
|
@ -376,25 +382,8 @@ pub enum WebGLFramebufferBindingRequest {
|
||||||
Default,
|
Default,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
|
||||||
pub enum WebGLParameter {
|
|
||||||
Int(i32),
|
|
||||||
Bool(bool),
|
|
||||||
String(String),
|
|
||||||
Float(f32),
|
|
||||||
FloatArray(Vec<f32>),
|
|
||||||
Invalid,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub type WebGLResult<T> = Result<T, WebGLError>;
|
pub type WebGLResult<T> = Result<T, WebGLError>;
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
|
||||||
pub enum WebGLShaderParameter {
|
|
||||||
Int(i32),
|
|
||||||
Bool(bool),
|
|
||||||
Invalid,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub type WebVRDeviceId = u32;
|
pub type WebVRDeviceId = u32;
|
||||||
|
|
||||||
// WebVR commands that must be called in the WebGL render thread.
|
// WebVR commands that must be called in the WebGL render thread.
|
||||||
|
@ -481,10 +470,7 @@ impl fmt::Debug for WebGLCommand {
|
||||||
FramebufferRenderbuffer(..) => "FramebufferRenderbuffer",
|
FramebufferRenderbuffer(..) => "FramebufferRenderbuffer",
|
||||||
FramebufferTexture2D(..) => "FramebufferTexture2D",
|
FramebufferTexture2D(..) => "FramebufferTexture2D",
|
||||||
GetExtensions(..) => "GetExtensions",
|
GetExtensions(..) => "GetExtensions",
|
||||||
GetParameter(..) => "GetParameter",
|
|
||||||
GetTexParameter(..) => "GetTexParameter",
|
GetTexParameter(..) => "GetTexParameter",
|
||||||
GetProgramParameter(..) => "GetProgramParameter",
|
|
||||||
GetShaderParameter(..) => "GetShaderParameter",
|
|
||||||
GetShaderPrecisionFormat(..) => "GetShaderPrecisionFormat",
|
GetShaderPrecisionFormat(..) => "GetShaderPrecisionFormat",
|
||||||
GetActiveAttrib(..) => "GetActiveAttrib",
|
GetActiveAttrib(..) => "GetActiveAttrib",
|
||||||
GetActiveUniform(..) => "GetActiveUniform",
|
GetActiveUniform(..) => "GetActiveUniform",
|
||||||
|
@ -492,7 +478,6 @@ impl fmt::Debug for WebGLCommand {
|
||||||
GetUniformLocation(..) => "GetUniformLocation",
|
GetUniformLocation(..) => "GetUniformLocation",
|
||||||
GetShaderInfoLog(..) => "GetShaderInfoLog",
|
GetShaderInfoLog(..) => "GetShaderInfoLog",
|
||||||
GetProgramInfoLog(..) => "GetProgramInfoLog",
|
GetProgramInfoLog(..) => "GetProgramInfoLog",
|
||||||
GetVertexAttrib(..) => "GetVertexAttrib",
|
|
||||||
GetVertexAttribOffset(..) => "GetVertexAttribOffset",
|
GetVertexAttribOffset(..) => "GetVertexAttribOffset",
|
||||||
GetFramebufferAttachmentParameter(..) => "GetFramebufferAttachmentParameter",
|
GetFramebufferAttachmentParameter(..) => "GetFramebufferAttachmentParameter",
|
||||||
GetRenderbufferParameter(..) => "GetRenderbufferParameter",
|
GetRenderbufferParameter(..) => "GetRenderbufferParameter",
|
||||||
|
@ -536,7 +521,6 @@ impl fmt::Debug for WebGLCommand {
|
||||||
VertexAttrib(..) => "VertexAttrib",
|
VertexAttrib(..) => "VertexAttrib",
|
||||||
VertexAttribPointer2f(..) => "VertexAttribPointer2f",
|
VertexAttribPointer2f(..) => "VertexAttribPointer2f",
|
||||||
VertexAttribPointer(..) => "VertexAttribPointer",
|
VertexAttribPointer(..) => "VertexAttribPointer",
|
||||||
GetViewport(..) => "GetViewport",
|
|
||||||
SetViewport(..) => "SetViewport",
|
SetViewport(..) => "SetViewport",
|
||||||
TexImage2D(..) => "TexImage2D",
|
TexImage2D(..) => "TexImage2D",
|
||||||
TexParameteri(..) => "TexParameteri",
|
TexParameteri(..) => "TexParameteri",
|
||||||
|
@ -550,10 +534,169 @@ impl fmt::Debug for WebGLCommand {
|
||||||
CreateVertexArray(..) => "CreateVertexArray",
|
CreateVertexArray(..) => "CreateVertexArray",
|
||||||
DeleteVertexArray(..) => "DeleteVertexArray",
|
DeleteVertexArray(..) => "DeleteVertexArray",
|
||||||
BindVertexArray(..) => "BindVertexArray",
|
BindVertexArray(..) => "BindVertexArray",
|
||||||
AliasedPointSizeRange(..) => "AliasedPointSizeRange",
|
GetParameterBool(..) => "GetParameterBool",
|
||||||
AliasedLineWidthRange(..) => "AliasedLineWidthRange",
|
GetParameterInt(..) => "GetParameterInt",
|
||||||
|
GetParameterInt4(..) => "GetParameterInt4",
|
||||||
|
GetParameterFloat(..) => "GetParameterFloat",
|
||||||
|
GetParameterFloat2(..) => "GetParameterFloat2",
|
||||||
|
GetProgramParameterBool(..) => "GetProgramParameterBool",
|
||||||
|
GetProgramParameterInt(..) => "GetProgramParameterInt",
|
||||||
|
GetShaderParameterBool(..) => "GetShaderParameterBool",
|
||||||
|
GetShaderParameterInt(..) => "GetShaderParameterInt",
|
||||||
|
GetVertexAttribBool(..) => "GetVertexAttribBool",
|
||||||
|
GetVertexAttribInt(..) => "GetVertexAttribInt",
|
||||||
|
GetVertexAttribFloat4(..) => "GetVertexAttribFloat4",
|
||||||
};
|
};
|
||||||
|
|
||||||
write!(f, "CanvasWebGLMsg::{}(..)", name)
|
write!(f, "CanvasWebGLMsg::{}(..)", name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
macro_rules! parameters {
|
||||||
|
($name:ident { $(
|
||||||
|
$variant:ident($kind:ident { $(
|
||||||
|
$param:ident = gl::$value:ident,
|
||||||
|
)+ }),
|
||||||
|
)+ }) => {
|
||||||
|
#[derive(Clone, Deserialize, Serialize)]
|
||||||
|
pub enum $name { $(
|
||||||
|
$variant($kind),
|
||||||
|
)+}
|
||||||
|
|
||||||
|
$(
|
||||||
|
#[derive(Clone, Deserialize, Serialize)]
|
||||||
|
#[repr(u32)]
|
||||||
|
pub enum $kind { $(
|
||||||
|
$param = gl::$value,
|
||||||
|
)+}
|
||||||
|
)+
|
||||||
|
|
||||||
|
impl $name {
|
||||||
|
pub fn from_u32(value: u32) -> WebGLResult<Self> {
|
||||||
|
match value {
|
||||||
|
$($(gl::$value => Ok($name::$variant($kind::$param)),)+)+
|
||||||
|
_ => Err(WebGLError::InvalidEnum)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
parameters! {
|
||||||
|
Parameter {
|
||||||
|
Bool(ParameterBool {
|
||||||
|
Blend = gl::BLEND,
|
||||||
|
CullFace = gl::CULL_FACE,
|
||||||
|
DepthTest = gl::DEPTH_TEST,
|
||||||
|
DepthWritemask = gl::DEPTH_WRITEMASK,
|
||||||
|
Dither = gl::DITHER,
|
||||||
|
PolygonOffsetFill = gl::POLYGON_OFFSET_FILL,
|
||||||
|
SampleCoverageInvert = gl::SAMPLE_COVERAGE_INVERT,
|
||||||
|
StencilTest = gl::STENCIL_TEST,
|
||||||
|
}),
|
||||||
|
Int(ParameterInt {
|
||||||
|
ActiveTexture = gl::ACTIVE_TEXTURE,
|
||||||
|
AlphaBits = gl::ALPHA_BITS,
|
||||||
|
BlendDstAlpha = gl::BLEND_DST_ALPHA,
|
||||||
|
BlendDstRgb = gl::BLEND_DST_RGB,
|
||||||
|
BlendEquationAlpha = gl::BLEND_EQUATION_ALPHA,
|
||||||
|
BlendEquationRgb = gl::BLEND_EQUATION_RGB,
|
||||||
|
BlendSrcAlpha = gl::BLEND_SRC_ALPHA,
|
||||||
|
BlendSrcRgb = gl::BLEND_SRC_RGB,
|
||||||
|
BlueBits = gl::BLUE_BITS,
|
||||||
|
CullFaceMode = gl::CULL_FACE_MODE,
|
||||||
|
DepthBits = gl::DEPTH_BITS,
|
||||||
|
DepthFunc = gl::DEPTH_FUNC,
|
||||||
|
FrontFace = gl::FRONT_FACE,
|
||||||
|
GreenBits = gl::GREEN_BITS,
|
||||||
|
MaxCombinedTextureImageUnits = gl::MAX_COMBINED_TEXTURE_IMAGE_UNITS,
|
||||||
|
MaxCubeMapTextureSize = gl::MAX_CUBE_MAP_TEXTURE_SIZE,
|
||||||
|
MaxRenderbufferSize = gl::MAX_RENDERBUFFER_SIZE,
|
||||||
|
MaxTextureImageUnits = gl::MAX_TEXTURE_IMAGE_UNITS,
|
||||||
|
MaxTextureSize = gl::MAX_TEXTURE_SIZE,
|
||||||
|
MaxVertexAttribs = gl::MAX_VERTEX_ATTRIBS,
|
||||||
|
MaxVertexTextureImageUnits = gl::MAX_VERTEX_TEXTURE_IMAGE_UNITS,
|
||||||
|
PackAlignment = gl::PACK_ALIGNMENT,
|
||||||
|
RedBits = gl::RED_BITS,
|
||||||
|
SampleBuffers = gl::SAMPLE_BUFFERS,
|
||||||
|
Samples = gl::SAMPLES,
|
||||||
|
StencilBackFail = gl::STENCIL_BACK_FAIL,
|
||||||
|
StencilBackFunc = gl::STENCIL_BACK_FUNC,
|
||||||
|
StencilBackPassDepthFail = gl::STENCIL_BACK_PASS_DEPTH_FAIL,
|
||||||
|
StencilBackPassDepthPass = gl::STENCIL_BACK_PASS_DEPTH_PASS,
|
||||||
|
StencilBackRef = gl::STENCIL_BACK_REF,
|
||||||
|
StencilBackValueMask = gl::STENCIL_BACK_VALUE_MASK,
|
||||||
|
StencilBackWritemask = gl::STENCIL_BACK_WRITEMASK,
|
||||||
|
StencilBits = gl::STENCIL_BITS,
|
||||||
|
StencilClearValue = gl::STENCIL_CLEAR_VALUE,
|
||||||
|
StencilFail = gl::STENCIL_FAIL,
|
||||||
|
StencilFunc = gl::STENCIL_FUNC,
|
||||||
|
StencilPassDepthFail = gl::STENCIL_PASS_DEPTH_FAIL,
|
||||||
|
StencilPassDepthPass = gl::STENCIL_PASS_DEPTH_PASS,
|
||||||
|
StencilRef = gl::STENCIL_REF,
|
||||||
|
StencilValueMask = gl::STENCIL_VALUE_MASK,
|
||||||
|
StencilWritemask = gl::STENCIL_WRITEMASK,
|
||||||
|
SubpixelBits = gl::SUBPIXEL_BITS,
|
||||||
|
UnpackAlignment = gl::UNPACK_ALIGNMENT,
|
||||||
|
FragmentShaderDerivativeHint = gl::FRAGMENT_SHADER_DERIVATIVE_HINT,
|
||||||
|
}),
|
||||||
|
Int4(ParameterInt4 {
|
||||||
|
Viewport = gl::VIEWPORT,
|
||||||
|
}),
|
||||||
|
Float(ParameterFloat {
|
||||||
|
DepthClearValue = gl::DEPTH_CLEAR_VALUE,
|
||||||
|
LineWidth = gl::LINE_WIDTH,
|
||||||
|
PolygonOffsetFactor = gl::POLYGON_OFFSET_FACTOR,
|
||||||
|
PolygonOffsetUnits = gl::POLYGON_OFFSET_UNITS,
|
||||||
|
SampleCoverageValue = gl::SAMPLE_COVERAGE_VALUE,
|
||||||
|
}),
|
||||||
|
Float2(ParameterFloat2 {
|
||||||
|
AliasedPointSizeRange = gl::ALIASED_POINT_SIZE_RANGE,
|
||||||
|
AliasedLineWidthRange = gl::ALIASED_LINE_WIDTH_RANGE,
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
parameters! {
|
||||||
|
ProgramParameter {
|
||||||
|
Bool(ProgramParameterBool {
|
||||||
|
DeleteStatus = gl::DELETE_STATUS,
|
||||||
|
LinkStatus = gl::LINK_STATUS,
|
||||||
|
ValidateStatus = gl::VALIDATE_STATUS,
|
||||||
|
}),
|
||||||
|
Int(ProgramParameterInt {
|
||||||
|
AttachedShaders = gl::ATTACHED_SHADERS,
|
||||||
|
ActiveAttributes = gl::ACTIVE_ATTRIBUTES,
|
||||||
|
ActiveUniforms = gl::ACTIVE_UNIFORMS,
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
parameters! {
|
||||||
|
ShaderParameter {
|
||||||
|
Bool(ShaderParameterBool {
|
||||||
|
DeleteStatus = gl::DELETE_STATUS,
|
||||||
|
CompileStatus = gl::COMPILE_STATUS,
|
||||||
|
}),
|
||||||
|
Int(ShaderParameterInt {
|
||||||
|
ShaderType = gl::SHADER_TYPE,
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
parameters! {
|
||||||
|
VertexAttrib {
|
||||||
|
Bool(VertexAttribBool {
|
||||||
|
VertexAttribArrayEnabled = gl::VERTEX_ATTRIB_ARRAY_ENABLED,
|
||||||
|
VertexAttribArrayNormalized = gl::VERTEX_ATTRIB_ARRAY_NORMALIZED,
|
||||||
|
}),
|
||||||
|
Int(VertexAttribInt {
|
||||||
|
VertexAttribArraySize = gl::VERTEX_ATTRIB_ARRAY_SIZE,
|
||||||
|
VertexAttribArrayStride = gl::VERTEX_ATTRIB_ARRAY_STRIDE,
|
||||||
|
VertexAttribArrayType = gl::VERTEX_ATTRIB_ARRAY_TYPE,
|
||||||
|
}),
|
||||||
|
Float4(VertexAttribFloat4 {
|
||||||
|
CurrentVertexAttrib = gl::CURRENT_VERTEX_ATTRIB,
|
||||||
|
}),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -16,7 +16,7 @@ default = []
|
||||||
[dependencies]
|
[dependencies]
|
||||||
euclid = "0.17"
|
euclid = "0.17"
|
||||||
gfx_traits = {path = "../gfx_traits"}
|
gfx_traits = {path = "../gfx_traits"}
|
||||||
gleam = { version = "0.4.34", optional = true }
|
gleam = {version = "0.5", optional = true}
|
||||||
image = "0.18"
|
image = "0.18"
|
||||||
ipc-channel = "0.10"
|
ipc-channel = "0.10"
|
||||||
libc = "0.2"
|
libc = "0.2"
|
||||||
|
|
|
@ -276,7 +276,7 @@ impl webrender_api::RenderNotifier for RenderNotifier {
|
||||||
self.compositor_proxy.recomposite(CompositingReason::NewWebRenderFrame);
|
self.compositor_proxy.recomposite(CompositingReason::NewWebRenderFrame);
|
||||||
}
|
}
|
||||||
|
|
||||||
fn new_document_ready(
|
fn new_frame_ready(
|
||||||
&self,
|
&self,
|
||||||
_document_id: webrender_api::DocumentId,
|
_document_id: webrender_api::DocumentId,
|
||||||
scrolled: bool,
|
scrolled: bool,
|
||||||
|
|
|
@ -32,8 +32,8 @@ use style::values::generics::image::EndingShape as GenericEndingShape;
|
||||||
use style::values::generics::image::GradientItem as GenericGradientItem;
|
use style::values::generics::image::GradientItem as GenericGradientItem;
|
||||||
use style::values::specified::background::BackgroundRepeatKeyword;
|
use style::values::specified::background::BackgroundRepeatKeyword;
|
||||||
use style::values::specified::position::{X, Y};
|
use style::values::specified::position::{X, Y};
|
||||||
use webrender_api::{BorderRadius, BorderSide, BorderStyle, ColorF, ExtendMode, ImageBorder};
|
use webrender_api::{BorderRadius, BorderSide, BorderStyle, ColorF, ExtendMode, GradientStop};
|
||||||
use webrender_api::{GradientStop, LayoutSize, NinePatchDescriptor, NormalBorder};
|
use webrender_api::{LayoutSize, NinePatchBorder, NinePatchBorderSource, NormalBorder};
|
||||||
|
|
||||||
/// A helper data structure for gradients.
|
/// A helper data structure for gradients.
|
||||||
#[derive(Clone, Copy)]
|
#[derive(Clone, Copy)]
|
||||||
|
@ -791,22 +791,20 @@ pub fn build_image_border_details(
|
||||||
let corners = &border_style_struct.border_image_slice.offsets;
|
let corners = &border_style_struct.border_image_slice.offsets;
|
||||||
let border_image_repeat = &border_style_struct.border_image_repeat;
|
let border_image_repeat = &border_style_struct.border_image_repeat;
|
||||||
if let Some(image_key) = webrender_image.key {
|
if let Some(image_key) = webrender_image.key {
|
||||||
Some(BorderDetails::Image(ImageBorder {
|
Some(BorderDetails::Image(NinePatchBorder {
|
||||||
image_key: image_key,
|
source: NinePatchBorderSource::Image(image_key),
|
||||||
patch: NinePatchDescriptor {
|
width: webrender_image.width,
|
||||||
width: webrender_image.width,
|
height: webrender_image.height,
|
||||||
height: webrender_image.height,
|
slice: SideOffsets2D::new(
|
||||||
slice: SideOffsets2D::new(
|
corners.0.resolve(webrender_image.height),
|
||||||
corners.0.resolve(webrender_image.height),
|
corners.1.resolve(webrender_image.width),
|
||||||
corners.1.resolve(webrender_image.width),
|
corners.2.resolve(webrender_image.height),
|
||||||
corners.2.resolve(webrender_image.height),
|
corners.3.resolve(webrender_image.width),
|
||||||
corners.3.resolve(webrender_image.width),
|
),
|
||||||
),
|
|
||||||
},
|
|
||||||
fill: border_style_struct.border_image_slice.fill,
|
fill: border_style_struct.border_image_slice.fill,
|
||||||
outset: outset,
|
|
||||||
repeat_horizontal: border_image_repeat.0.to_layout(),
|
repeat_horizontal: border_image_repeat.0.to_layout(),
|
||||||
repeat_vertical: border_image_repeat.1.to_layout(),
|
repeat_vertical: border_image_repeat.1.to_layout(),
|
||||||
|
outset: outset,
|
||||||
}))
|
}))
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
|
|
|
@ -24,10 +24,10 @@ use std::f32;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use webrender_api::{BorderRadius, BorderWidths, BoxShadowClipMode, ClipMode, ColorF};
|
use webrender_api::{BorderRadius, BorderWidths, BoxShadowClipMode, ClipMode, ColorF};
|
||||||
use webrender_api::{ComplexClipRegion, ExtendMode, ExternalScrollId, FilterOp, FontInstanceKey};
|
use webrender_api::{ComplexClipRegion, ExtendMode, ExternalScrollId, FilterOp, FontInstanceKey};
|
||||||
use webrender_api::{GlyphInstance, GradientStop, ImageBorder, ImageKey, ImageRendering};
|
use webrender_api::{GlyphInstance, GradientStop, ImageKey, ImageRendering, LayoutPoint};
|
||||||
use webrender_api::{LayoutPoint, LayoutRect, LayoutSize, LayoutTransform, LayoutVector2D};
|
use webrender_api::{LayoutRect, LayoutSize, LayoutTransform, LayoutVector2D, LineStyle};
|
||||||
use webrender_api::{LineStyle, MixBlendMode, NormalBorder, ScrollPolicy, ScrollSensitivity, Shadow};
|
use webrender_api::{MixBlendMode, NinePatchBorder, NormalBorder, ScrollPolicy, ScrollSensitivity};
|
||||||
use webrender_api::{StickyOffsetBounds, TransformStyle};
|
use webrender_api::{Shadow, StickyOffsetBounds, TransformStyle};
|
||||||
|
|
||||||
pub use style::dom::OpaqueNode;
|
pub use style::dom::OpaqueNode;
|
||||||
|
|
||||||
|
@ -775,7 +775,7 @@ pub struct RadialGradientBorder {
|
||||||
#[derive(Clone, Serialize)]
|
#[derive(Clone, Serialize)]
|
||||||
pub enum BorderDetails {
|
pub enum BorderDetails {
|
||||||
Normal(NormalBorder),
|
Normal(NormalBorder),
|
||||||
Image(ImageBorder),
|
Image(NinePatchBorder),
|
||||||
Gradient(GradientBorder),
|
Gradient(GradientBorder),
|
||||||
RadialGradient(RadialGradientBorder),
|
RadialGradient(RadialGradientBorder),
|
||||||
}
|
}
|
||||||
|
|
|
@ -127,7 +127,7 @@ impl WebRenderDisplayItemConverter for DisplayItem {
|
||||||
BorderDetails::Normal(ref border) => {
|
BorderDetails::Normal(ref border) => {
|
||||||
webrender_api::BorderDetails::Normal(*border)
|
webrender_api::BorderDetails::Normal(*border)
|
||||||
},
|
},
|
||||||
BorderDetails::Image(ref image) => webrender_api::BorderDetails::Image(*image),
|
BorderDetails::Image(ref image) => webrender_api::BorderDetails::NinePatch(*image),
|
||||||
BorderDetails::Gradient(ref gradient) => {
|
BorderDetails::Gradient(ref gradient) => {
|
||||||
webrender_api::BorderDetails::Gradient(webrender_api::GradientBorder {
|
webrender_api::BorderDetails::Gradient(webrender_api::GradientBorder {
|
||||||
gradient: builder.create_gradient(
|
gradient: builder.create_gradient(
|
||||||
|
|
|
@ -793,7 +793,7 @@ malloc_size_of_is_0!(webrender_api::GradientStop);
|
||||||
#[cfg(feature = "webrender_api")]
|
#[cfg(feature = "webrender_api")]
|
||||||
malloc_size_of_is_0!(webrender_api::GlyphInstance);
|
malloc_size_of_is_0!(webrender_api::GlyphInstance);
|
||||||
#[cfg(feature = "webrender_api")]
|
#[cfg(feature = "webrender_api")]
|
||||||
malloc_size_of_is_0!(webrender_api::ImageBorder);
|
malloc_size_of_is_0!(webrender_api::NinePatchBorder);
|
||||||
#[cfg(feature = "webrender_api")]
|
#[cfg(feature = "webrender_api")]
|
||||||
malloc_size_of_is_0!(webrender_api::ImageKey);
|
malloc_size_of_is_0!(webrender_api::ImageKey);
|
||||||
#[cfg(feature = "webrender_api")]
|
#[cfg(feature = "webrender_api")]
|
||||||
|
|
|
@ -46,7 +46,7 @@ embedder_traits = {path = "../embedder_traits"}
|
||||||
encoding_rs = "0.7"
|
encoding_rs = "0.7"
|
||||||
euclid = "0.17"
|
euclid = "0.17"
|
||||||
fnv = "1.0"
|
fnv = "1.0"
|
||||||
gleam = "0.4.34"
|
gleam = "0.5"
|
||||||
half = "1.0"
|
half = "1.0"
|
||||||
html5ever = "0.22"
|
html5ever = "0.22"
|
||||||
hyper = "0.10"
|
hyper = "0.10"
|
||||||
|
@ -68,7 +68,7 @@ mozjs = { version = "0.6", features = ["promises"]}
|
||||||
msg = {path = "../msg"}
|
msg = {path = "../msg"}
|
||||||
net_traits = {path = "../net_traits"}
|
net_traits = {path = "../net_traits"}
|
||||||
num-traits = "0.1.32"
|
num-traits = "0.1.32"
|
||||||
offscreen_gl_context = { version = "0.15", features = ["serde"] }
|
offscreen_gl_context = {version = "0.16", features = ["serde"]}
|
||||||
parking_lot = "0.5"
|
parking_lot = "0.5"
|
||||||
phf = "0.7.18"
|
phf = "0.7.18"
|
||||||
profile_traits = {path = "../profile_traits"}
|
profile_traits = {path = "../profile_traits"}
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl
|
// https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl
|
||||||
use canvas_traits::webgl::{WebGLCommand, WebGLError, WebGLMsgSender, WebGLParameter, WebGLProgramId, WebGLResult};
|
use canvas_traits::webgl::{WebGLCommand, WebGLError, WebGLMsgSender, WebGLProgramId, WebGLResult};
|
||||||
use canvas_traits::webgl::webgl_channel;
|
use canvas_traits::webgl::webgl_channel;
|
||||||
use dom::bindings::codegen::Bindings::WebGLProgramBinding;
|
use dom::bindings::codegen::Bindings::WebGLProgramBinding;
|
||||||
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants;
|
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants;
|
||||||
|
@ -362,13 +362,6 @@ impl WebGLProgram {
|
||||||
Ok(receiver.recv().unwrap())
|
Ok(receiver.recv().unwrap())
|
||||||
}
|
}
|
||||||
|
|
||||||
/// glGetProgramParameter
|
|
||||||
pub fn parameter(&self, param_id: u32) -> WebGLResult<WebGLParameter> {
|
|
||||||
let (sender, receiver) = webgl_channel().unwrap();
|
|
||||||
self.renderer.send(WebGLCommand::GetProgramParameter(self.id, param_id, sender)).unwrap();
|
|
||||||
receiver.recv().unwrap()
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn attached_shaders(&self) -> WebGLResult<Vec<DomRoot<WebGLShader>>> {
|
pub fn attached_shaders(&self) -> WebGLResult<Vec<DomRoot<WebGLShader>>> {
|
||||||
if self.is_deleted.get() {
|
if self.is_deleted.get() {
|
||||||
return Err(WebGLError::InvalidValue);
|
return Err(WebGLError::InvalidValue);
|
||||||
|
|
|
@ -4,12 +4,13 @@
|
||||||
|
|
||||||
use byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt};
|
use byteorder::{NativeEndian, ReadBytesExt, WriteBytesExt};
|
||||||
use canvas_traits::canvas::{byte_swap, multiply_u8_pixel};
|
use canvas_traits::canvas::{byte_swap, multiply_u8_pixel};
|
||||||
use canvas_traits::webgl::{WebGLCommand, WebGLContextShareMode, WebGLError};
|
use canvas_traits::webgl::{DOMToTextureCommand, Parameter, ProgramParameter};
|
||||||
|
use canvas_traits::webgl::{ShaderParameter, VertexAttrib, WebGLCommand};
|
||||||
|
use canvas_traits::webgl::{WebGLContextShareMode, WebGLError};
|
||||||
use canvas_traits::webgl::{WebGLFramebufferBindingRequest, WebGLMsg, WebGLMsgSender};
|
use canvas_traits::webgl::{WebGLFramebufferBindingRequest, WebGLMsg, WebGLMsgSender};
|
||||||
use canvas_traits::webgl::{WebGLParameter, WebGLResult, WebGLSLVersion, WebGLVersion, WebVRCommand};
|
use canvas_traits::webgl::{WebGLResult, WebGLSLVersion, WebGLVersion};
|
||||||
use canvas_traits::webgl::DOMToTextureCommand;
|
use canvas_traits::webgl::{WebVRCommand, webgl_channel};
|
||||||
use canvas_traits::webgl::WebGLError::*;
|
use canvas_traits::webgl::WebGLError::*;
|
||||||
use canvas_traits::webgl::webgl_channel;
|
|
||||||
use dom::bindings::cell::DomRefCell;
|
use dom::bindings::cell::DomRefCell;
|
||||||
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::{self, WebGLContextAttributes};
|
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::{self, WebGLContextAttributes};
|
||||||
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants;
|
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants;
|
||||||
|
@ -1310,36 +1311,27 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
return Int32Value(constants::UNSIGNED_BYTE as i32);
|
return Int32Value(constants::UNSIGNED_BYTE as i32);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
constants::VIEWPORT => {
|
constants::VERSION => {
|
||||||
let (sender, receiver) = webgl_channel().unwrap();
|
|
||||||
self.send_command(WebGLCommand::GetViewport(sender));
|
|
||||||
let (x, y, width, height) = receiver.recv().unwrap();
|
|
||||||
rooted!(in(cx) let mut rval = UndefinedValue());
|
rooted!(in(cx) let mut rval = UndefinedValue());
|
||||||
[x, y, width, height].to_jsval(cx, rval.handle_mut());
|
"WebGL 1.0".to_jsval(cx, rval.handle_mut());
|
||||||
return rval.get();
|
return rval.get();
|
||||||
}
|
}
|
||||||
constants::ALIASED_POINT_SIZE_RANGE => {
|
constants::RENDERER | constants::VENDOR => {
|
||||||
let (sender, receiver) = webgl_channel().unwrap();
|
|
||||||
self.send_command(WebGLCommand::AliasedPointSizeRange(sender));
|
|
||||||
let (width, height) = receiver.recv().unwrap();
|
|
||||||
rooted!(in(cx) let mut rval = UndefinedValue());
|
rooted!(in(cx) let mut rval = UndefinedValue());
|
||||||
[width, height].to_jsval(cx, rval.handle_mut());
|
"Mozilla/Servo".to_jsval(cx, rval.handle_mut());
|
||||||
return rval.get();
|
return rval.get();
|
||||||
}
|
}
|
||||||
constants::ALIASED_LINE_WIDTH_RANGE => {
|
constants::SHADING_LANGUAGE_VERSION => {
|
||||||
let (sender, receiver) = webgl_channel().unwrap();
|
|
||||||
self.send_command(WebGLCommand::AliasedLineWidthRange(sender));
|
|
||||||
let (width, height) = receiver.recv().unwrap();
|
|
||||||
rooted!(in(cx) let mut rval = UndefinedValue());
|
rooted!(in(cx) let mut rval = UndefinedValue());
|
||||||
[width, height].to_jsval(cx, rval.handle_mut());
|
"WebGL GLSL ES 1.0".to_jsval(cx, rval.handle_mut());
|
||||||
return rval.get();
|
return rval.get();
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {}
|
||||||
if !self.extension_manager.is_get_parameter_name_enabled(parameter) {
|
}
|
||||||
self.webgl_error(WebGLError::InvalidEnum);
|
|
||||||
return NullValue();
|
if !self.extension_manager.is_get_parameter_name_enabled(parameter) {
|
||||||
}
|
self.webgl_error(WebGLError::InvalidEnum);
|
||||||
}
|
return NullValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle GetParameter getters injected via WebGL extensions
|
// Handle GetParameter getters injected via WebGL extensions
|
||||||
|
@ -1355,20 +1347,38 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let (sender, receiver) = webgl_channel().unwrap();
|
match handle_potential_webgl_error!(self, Parameter::from_u32(parameter), return NullValue()) {
|
||||||
self.send_command(WebGLCommand::GetParameter(parameter, sender));
|
Parameter::Bool(param) => {
|
||||||
|
let (sender, receiver) = webgl_channel().unwrap();
|
||||||
match handle_potential_webgl_error!(self, receiver.recv().unwrap(), WebGLParameter::Invalid) {
|
self.send_command(WebGLCommand::GetParameterBool(param, sender));
|
||||||
WebGLParameter::Int(val) => Int32Value(val),
|
BooleanValue(receiver.recv().unwrap())
|
||||||
WebGLParameter::Bool(val) => BooleanValue(val),
|
}
|
||||||
WebGLParameter::Float(val) => DoubleValue(val as f64),
|
Parameter::Int(param) => {
|
||||||
WebGLParameter::FloatArray(_) => panic!("Parameter should not be float array"),
|
let (sender, receiver) = webgl_channel().unwrap();
|
||||||
WebGLParameter::String(val) => {
|
self.send_command(WebGLCommand::GetParameterInt(param, sender));
|
||||||
|
Int32Value(receiver.recv().unwrap())
|
||||||
|
}
|
||||||
|
Parameter::Int4(param) => {
|
||||||
|
let (sender, receiver) = webgl_channel().unwrap();
|
||||||
|
self.send_command(WebGLCommand::GetParameterInt4(param, sender));
|
||||||
|
// FIXME(nox): https://github.com/servo/servo/issues/20655
|
||||||
rooted!(in(cx) let mut rval = UndefinedValue());
|
rooted!(in(cx) let mut rval = UndefinedValue());
|
||||||
val.to_jsval(cx, rval.handle_mut());
|
receiver.recv().unwrap().to_jsval(cx, rval.handle_mut());
|
||||||
|
rval.get()
|
||||||
|
}
|
||||||
|
Parameter::Float(param) => {
|
||||||
|
let (sender, receiver) = webgl_channel().unwrap();
|
||||||
|
self.send_command(WebGLCommand::GetParameterFloat(param, sender));
|
||||||
|
DoubleValue(receiver.recv().unwrap() as f64)
|
||||||
|
}
|
||||||
|
Parameter::Float2(param) => {
|
||||||
|
let (sender, receiver) = webgl_channel().unwrap();
|
||||||
|
self.send_command(WebGLCommand::GetParameterFloat2(param, sender));
|
||||||
|
// FIXME(nox): https://github.com/servo/servo/issues/20655
|
||||||
|
rooted!(in(cx) let mut rval = UndefinedValue());
|
||||||
|
receiver.recv().unwrap().to_jsval(cx, rval.handle_mut());
|
||||||
rval.get()
|
rval.get()
|
||||||
}
|
}
|
||||||
WebGLParameter::Invalid => NullValue(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2400,16 +2410,18 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
|
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
|
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
|
||||||
unsafe fn GetProgramParameter(&self, _: *mut JSContext, program: &WebGLProgram, param_id: u32) -> JSVal {
|
unsafe fn GetProgramParameter(&self, _: *mut JSContext, program: &WebGLProgram, param: u32) -> JSVal {
|
||||||
match handle_potential_webgl_error!(self, program.parameter(param_id), WebGLParameter::Invalid) {
|
match handle_potential_webgl_error!(self, ProgramParameter::from_u32(param), return NullValue()) {
|
||||||
WebGLParameter::Int(val) => Int32Value(val),
|
ProgramParameter::Bool(param) => {
|
||||||
WebGLParameter::Bool(val) => BooleanValue(val),
|
let (sender, receiver) = webgl_channel().unwrap();
|
||||||
WebGLParameter::String(_) => panic!("Program parameter should not be string"),
|
self.send_command(WebGLCommand::GetProgramParameterBool(program.id(), param, sender));
|
||||||
WebGLParameter::Float(_) => panic!("Program parameter should not be float"),
|
BooleanValue(receiver.recv().unwrap())
|
||||||
WebGLParameter::FloatArray(_) => {
|
}
|
||||||
panic!("Program paramenter should not be float array")
|
ProgramParameter::Int(param) => {
|
||||||
|
let (sender, receiver) = webgl_channel().unwrap();
|
||||||
|
self.send_command(WebGLCommand::GetProgramParameterInt(program.id(), param, sender));
|
||||||
|
Int32Value(receiver.recv().unwrap())
|
||||||
}
|
}
|
||||||
WebGLParameter::Invalid => NullValue(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2420,16 +2432,22 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
|
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
|
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
|
||||||
unsafe fn GetShaderParameter(&self, _: *mut JSContext, shader: &WebGLShader, param_id: u32) -> JSVal {
|
unsafe fn GetShaderParameter(&self, _: *mut JSContext, shader: &WebGLShader, param: u32) -> JSVal {
|
||||||
match handle_potential_webgl_error!(self, shader.parameter(param_id), WebGLParameter::Invalid) {
|
if shader.is_deleted() && !shader.is_attached() {
|
||||||
WebGLParameter::Int(val) => Int32Value(val),
|
self.webgl_error(InvalidValue);
|
||||||
WebGLParameter::Bool(val) => BooleanValue(val),
|
return NullValue();
|
||||||
WebGLParameter::String(_) => panic!("Shader parameter should not be string"),
|
}
|
||||||
WebGLParameter::Float(_) => panic!("Shader parameter should not be float"),
|
match handle_potential_webgl_error!(self, ShaderParameter::from_u32(param), return NullValue()) {
|
||||||
WebGLParameter::FloatArray(_) => {
|
ShaderParameter::Bool(param) => {
|
||||||
panic!("Shader paramenter should not be float array")
|
let (sender, receiver) = webgl_channel().unwrap();
|
||||||
|
self.send_command(WebGLCommand::GetShaderParameterBool(shader.id(), param, sender));
|
||||||
|
BooleanValue(receiver.recv().unwrap())
|
||||||
|
}
|
||||||
|
ShaderParameter::Int(param) => {
|
||||||
|
let (sender, receiver) = webgl_channel().unwrap();
|
||||||
|
self.send_command(WebGLCommand::GetShaderParameterInt(shader.id(), param, sender));
|
||||||
|
Int32Value(receiver.recv().unwrap())
|
||||||
}
|
}
|
||||||
WebGLParameter::Invalid => NullValue(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2474,8 +2492,8 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
|
|
||||||
#[allow(unsafe_code)]
|
#[allow(unsafe_code)]
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
|
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
|
||||||
unsafe fn GetVertexAttrib(&self, cx: *mut JSContext, index: u32, pname: u32) -> JSVal {
|
unsafe fn GetVertexAttrib(&self, cx: *mut JSContext, index: u32, param: u32) -> JSVal {
|
||||||
if index == 0 && pname == constants::CURRENT_VERTEX_ATTRIB {
|
if index == 0 && param == constants::CURRENT_VERTEX_ATTRIB {
|
||||||
rooted!(in(cx) let mut result = UndefinedValue());
|
rooted!(in(cx) let mut result = UndefinedValue());
|
||||||
let (x, y, z, w) = self.current_vertex_attrib_0.get();
|
let (x, y, z, w) = self.current_vertex_attrib_0.get();
|
||||||
let attrib = vec![x, y, z, w];
|
let attrib = vec![x, y, z, w];
|
||||||
|
@ -2483,7 +2501,7 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
return result.get()
|
return result.get()
|
||||||
}
|
}
|
||||||
|
|
||||||
if pname == constants::VERTEX_ATTRIB_ARRAY_BUFFER_BINDING {
|
if param == constants::VERTEX_ATTRIB_ARRAY_BUFFER_BINDING {
|
||||||
rooted!(in(cx) let mut jsval = NullValue());
|
rooted!(in(cx) let mut jsval = NullValue());
|
||||||
if let Some(buffer) = self.bound_attrib_buffers.borrow().get(&index) {
|
if let Some(buffer) = self.bound_attrib_buffers.borrow().get(&index) {
|
||||||
buffer.to_jsval(cx, jsval.handle_mut());
|
buffer.to_jsval(cx, jsval.handle_mut());
|
||||||
|
@ -2491,20 +2509,28 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
||||||
return jsval.get();
|
return jsval.get();
|
||||||
}
|
}
|
||||||
|
|
||||||
let (sender, receiver) = webgl_channel().unwrap();
|
match handle_potential_webgl_error!(self, VertexAttrib::from_u32(param), return NullValue()) {
|
||||||
self.send_command(WebGLCommand::GetVertexAttrib(index, pname, sender));
|
VertexAttrib::Bool(param) => {
|
||||||
|
let (sender, receiver) = webgl_channel().unwrap();
|
||||||
match handle_potential_webgl_error!(self, receiver.recv().unwrap(), WebGLParameter::Invalid) {
|
self.send_command(WebGLCommand::GetVertexAttribBool(index, param, sender));
|
||||||
WebGLParameter::Int(val) => Int32Value(val),
|
let value = handle_potential_webgl_error!(self, receiver.recv().unwrap(), return NullValue());
|
||||||
WebGLParameter::Bool(val) => BooleanValue(val),
|
BooleanValue(value)
|
||||||
WebGLParameter::String(_) => panic!("Vertex attrib should not be string"),
|
}
|
||||||
WebGLParameter::Float(_) => panic!("Vertex attrib should not be float"),
|
VertexAttrib::Int(param) => {
|
||||||
WebGLParameter::FloatArray(val) => {
|
let (sender, receiver) = webgl_channel().unwrap();
|
||||||
|
self.send_command(WebGLCommand::GetVertexAttribInt(index, param, sender));
|
||||||
|
let value = handle_potential_webgl_error!(self, receiver.recv().unwrap(), return NullValue());
|
||||||
|
Int32Value(value)
|
||||||
|
}
|
||||||
|
VertexAttrib::Float4(param) => {
|
||||||
|
let (sender, receiver) = webgl_channel().unwrap();
|
||||||
|
self.send_command(WebGLCommand::GetVertexAttribFloat4(index, param, sender));
|
||||||
|
let value = handle_potential_webgl_error!(self, receiver.recv().unwrap(), return NullValue());
|
||||||
|
// FIXME(nox): https://github.com/servo/servo/issues/20655
|
||||||
rooted!(in(cx) let mut result = UndefinedValue());
|
rooted!(in(cx) let mut result = UndefinedValue());
|
||||||
val.to_jsval(cx, result.handle_mut());
|
value.to_jsval(cx, result.handle_mut());
|
||||||
result.get()
|
result.get()
|
||||||
}
|
}
|
||||||
WebGLParameter::Invalid => NullValue(),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
|
|
||||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl
|
// https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl
|
||||||
use canvas_traits::webgl::{WebGLCommand, WebGLError, WebGLMsgSender};
|
use canvas_traits::webgl::{WebGLCommand, WebGLError, WebGLMsgSender};
|
||||||
use canvas_traits::webgl::{WebGLParameter, WebGLResult, WebGLSLVersion};
|
use canvas_traits::webgl::{WebGLResult, WebGLSLVersion, WebGLShaderId};
|
||||||
use canvas_traits::webgl::{WebGLShaderId, WebGLVersion, webgl_channel};
|
use canvas_traits::webgl::{WebGLVersion, webgl_channel};
|
||||||
use dom::bindings::cell::DomRefCell;
|
use dom::bindings::cell::DomRefCell;
|
||||||
use dom::bindings::codegen::Bindings::WebGLShaderBinding;
|
use dom::bindings::codegen::Bindings::WebGLShaderBinding;
|
||||||
use dom::bindings::reflector::reflect_dom_object;
|
use dom::bindings::reflector::reflect_dom_object;
|
||||||
|
@ -210,16 +210,6 @@ impl WebGLShader {
|
||||||
self.info_log.borrow().clone()
|
self.info_log.borrow().clone()
|
||||||
}
|
}
|
||||||
|
|
||||||
/// glGetParameter
|
|
||||||
pub fn parameter(&self, param_id: u32) -> WebGLResult<WebGLParameter> {
|
|
||||||
if self.is_deleted.get() && !self.is_attached() {
|
|
||||||
return Err(WebGLError::InvalidValue);
|
|
||||||
}
|
|
||||||
let (sender, receiver) = webgl_channel().unwrap();
|
|
||||||
self.renderer.send(WebGLCommand::GetShaderParameter(self.id, param_id, sender)).unwrap();
|
|
||||||
receiver.recv().unwrap()
|
|
||||||
}
|
|
||||||
|
|
||||||
/// Get the shader source
|
/// Get the shader source
|
||||||
pub fn source(&self) -> Option<DOMString> {
|
pub fn source(&self) -> Option<DOMString> {
|
||||||
self.source.borrow().clone()
|
self.source.borrow().clone()
|
||||||
|
|
|
@ -41,7 +41,7 @@ embedder_traits = {path = "../embedder_traits"}
|
||||||
env_logger = "0.5"
|
env_logger = "0.5"
|
||||||
euclid = "0.17"
|
euclid = "0.17"
|
||||||
gfx = {path = "../gfx"}
|
gfx = {path = "../gfx"}
|
||||||
gleam = "0.4.34"
|
gleam = "0.5"
|
||||||
ipc-channel = "0.10"
|
ipc-channel = "0.10"
|
||||||
layout_thread = {path = "../layout_thread"}
|
layout_thread = {path = "../layout_thread"}
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
|
|
|
@ -37,7 +37,7 @@ unstable = ["libservo/unstable"]
|
||||||
backtrace = "0.3"
|
backtrace = "0.3"
|
||||||
bitflags = "1.0"
|
bitflags = "1.0"
|
||||||
euclid = "0.17"
|
euclid = "0.17"
|
||||||
gleam = "0.4.34"
|
gleam = "0.5"
|
||||||
glutin = "0.13"
|
glutin = "0.13"
|
||||||
lazy_static = "1"
|
lazy_static = "1"
|
||||||
libservo = {path = "../../components/servo"}
|
libservo = {path = "../../components/servo"}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue