aboutsummaryrefslogtreecommitdiffstats
path: root/components/script
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2020-01-16 23:47:07 -0500
committerGitHub <noreply@github.com>2020-01-16 23:47:07 -0500
commitd3b37ead0a969b6c8e90676d37057e7b53ee8dd9 (patch)
tree1a9ebc1093d0586adaca073d092a1d6c5dd45eba /components/script
parent0e9d89cecc3983422eb28831155bbc354c03fe16 (diff)
parent0650fc319905ecd018ee0f6e059f9f40589e10b6 (diff)
downloadservo-d3b37ead0a969b6c8e90676d37057e7b53ee8dd9.tar.gz
servo-d3b37ead0a969b6c8e90676d37057e7b53ee8dd9.zip
Auto merge of #25538 - szeged:mmatyas__webgl_fns_uniforms_p2, r=jdm
Add support for WebGL2 uniform array operations Adds support for the WebGL2 overloads of `uniform[1234][if]v`. <!-- Please describe your changes on the following line: --> WebGL2 adds two optional parameters for the `uniform[1234][if]v` functions to allow specifying input data ranges. However, because they have the same name and overlapping parameters, the Codegen cannot make a difference between their GL1 and 2 variants. As a workaround, I've added the new parameters to the WebGL1 side, which which isn't strictly what the spec says, but shouldn't break things either. (Note: Firefox devs also run into this issue: [[1](https://searchfox.org/mozilla-central/source/dom/webidl/WebGLRenderingContext.webidl#794), [2](https://bugzilla.mozilla.org/show_bug.cgi?id=1324543)]). cc @jdm @zakorgy @imiklos --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors - [x] There are tests for these changes <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
Diffstat (limited to 'components/script')
-rw-r--r--components/script/dom/webgl2renderingcontext.rs97
-rw-r--r--components/script/dom/webglrenderingcontext.rs198
-rw-r--r--components/script/dom/webidls/WebGL2RenderingContext.webidl18
-rw-r--r--components/script/dom/webidls/WebGLRenderingContext.webidl26
4 files changed, 182 insertions, 157 deletions
diff --git a/components/script/dom/webgl2renderingcontext.rs b/components/script/dom/webgl2renderingcontext.rs
index 86ca17c12d8..2f847cebd3f 100644
--- a/components/script/dom/webgl2renderingcontext.rs
+++ b/components/script/dom/webgl2renderingcontext.rs
@@ -391,7 +391,7 @@ impl WebGL2RenderingContext {
}
}
- fn uniform_vec_section(
+ fn uniform_vec_section_uint(
&self,
vec: Uint32ArrayOrUnsignedLongSequence,
offset: u32,
@@ -403,35 +403,8 @@ impl WebGL2RenderingContext {
Uint32ArrayOrUnsignedLongSequence::Uint32Array(v) => v.to_vec(),
Uint32ArrayOrUnsignedLongSequence::UnsignedLongSequence(v) => v,
};
-
- let offset = offset as usize;
- if offset > vec.len() {
- return Err(InvalidValue);
- }
-
- let length = if length > 0 {
- length as usize
- } else {
- vec.len() - offset
- };
- if offset + length > vec.len() {
- return Err(InvalidValue);
- }
-
- let vec = if offset == 0 && length == vec.len() {
- vec
- } else {
- vec[offset..offset + length].to_vec()
- };
-
- if vec.len() < uniform_size || vec.len() % uniform_size != 0 {
- return Err(InvalidValue);
- }
- if uniform_location.size().is_none() && vec.len() != uniform_size {
- return Err(InvalidOperation);
- }
-
- Ok(vec)
+ self.base
+ .uniform_vec_section::<u32>(vec, offset, length, uniform_size, uniform_location)
}
}
@@ -1515,8 +1488,14 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn Uniform1iv(&self, location: Option<&WebGLUniformLocation>, v: Int32ArrayOrLongSequence) {
- self.base.Uniform1iv(location, v)
+ fn Uniform1iv(
+ &self,
+ location: Option<&WebGLUniformLocation>,
+ v: Int32ArrayOrLongSequence,
+ src_offset: u32,
+ src_length: u32,
+ ) {
+ self.base.Uniform1iv(location, v, src_offset, src_length)
}
// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.8
@@ -1549,7 +1528,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
_ => return Err(InvalidOperation),
}
- let val = self.uniform_vec_section(val, src_offset, src_length, 1, location)?;
+ let val = self.uniform_vec_section_uint(val, src_offset, src_length, 1, location)?;
match location.type_() {
constants::SAMPLER_2D | constants::SAMPLER_CUBE => {
@@ -1575,8 +1554,10 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
&self,
location: Option<&WebGLUniformLocation>,
v: Float32ArrayOrUnrestrictedFloatSequence,
+ src_offset: u32,
+ src_length: u32,
) {
- self.base.Uniform1fv(location, v);
+ self.base.Uniform1fv(location, v, src_offset, src_length);
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
@@ -1589,8 +1570,10 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
&self,
location: Option<&WebGLUniformLocation>,
v: Float32ArrayOrUnrestrictedFloatSequence,
+ src_offset: u32,
+ src_length: u32,
) {
- self.base.Uniform2fv(location, v);
+ self.base.Uniform2fv(location, v, src_offset, src_length);
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
@@ -1599,8 +1582,14 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn Uniform2iv(&self, location: Option<&WebGLUniformLocation>, v: Int32ArrayOrLongSequence) {
- self.base.Uniform2iv(location, v)
+ fn Uniform2iv(
+ &self,
+ location: Option<&WebGLUniformLocation>,
+ v: Int32ArrayOrLongSequence,
+ src_offset: u32,
+ src_length: u32,
+ ) {
+ self.base.Uniform2iv(location, v, src_offset, src_length)
}
// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.8
@@ -1629,7 +1618,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
constants::BOOL_VEC2 | constants::UNSIGNED_INT_VEC2 => {},
_ => return Err(InvalidOperation),
}
- let val = self.uniform_vec_section(val, src_offset, src_length, 2, location)?;
+ let val = self.uniform_vec_section_uint(val, src_offset, src_length, 2, location)?;
self.base
.send_command(WebGLCommand::Uniform2uiv(location.id(), val));
Ok(())
@@ -1646,8 +1635,10 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
&self,
location: Option<&WebGLUniformLocation>,
v: Float32ArrayOrUnrestrictedFloatSequence,
+ src_offset: u32,
+ src_length: u32,
) {
- self.base.Uniform3fv(location, v);
+ self.base.Uniform3fv(location, v, src_offset, src_length);
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
@@ -1656,8 +1647,14 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn Uniform3iv(&self, location: Option<&WebGLUniformLocation>, v: Int32ArrayOrLongSequence) {
- self.base.Uniform3iv(location, v)
+ fn Uniform3iv(
+ &self,
+ location: Option<&WebGLUniformLocation>,
+ v: Int32ArrayOrLongSequence,
+ src_offset: u32,
+ src_length: u32,
+ ) {
+ self.base.Uniform3iv(location, v, src_offset, src_length)
}
// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.8
@@ -1686,7 +1683,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
constants::BOOL_VEC3 | constants::UNSIGNED_INT_VEC3 => {},
_ => return Err(InvalidOperation),
}
- let val = self.uniform_vec_section(val, src_offset, src_length, 3, location)?;
+ let val = self.uniform_vec_section_uint(val, src_offset, src_length, 3, location)?;
self.base
.send_command(WebGLCommand::Uniform3uiv(location.id(), val));
Ok(())
@@ -1699,8 +1696,14 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn Uniform4iv(&self, location: Option<&WebGLUniformLocation>, v: Int32ArrayOrLongSequence) {
- self.base.Uniform4iv(location, v)
+ fn Uniform4iv(
+ &self,
+ location: Option<&WebGLUniformLocation>,
+ v: Int32ArrayOrLongSequence,
+ src_offset: u32,
+ src_length: u32,
+ ) {
+ self.base.Uniform4iv(location, v, src_offset, src_length)
}
// https://www.khronos.org/registry/webgl/specs/latest/2.0/#3.7.8
@@ -1729,7 +1732,7 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
constants::BOOL_VEC4 | constants::UNSIGNED_INT_VEC4 => {},
_ => return Err(InvalidOperation),
}
- let val = self.uniform_vec_section(val, src_offset, src_length, 4, location)?;
+ let val = self.uniform_vec_section_uint(val, src_offset, src_length, 4, location)?;
self.base
.send_command(WebGLCommand::Uniform4uiv(location.id(), val));
Ok(())
@@ -1746,8 +1749,10 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
&self,
location: Option<&WebGLUniformLocation>,
v: Float32ArrayOrUnrestrictedFloatSequence,
+ src_offset: u32,
+ src_length: u32,
) {
- self.base.Uniform4fv(location, v);
+ self.base.Uniform4fv(location, v, src_offset, src_length);
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs
index cf01a53e0f3..fdd04297446 100644
--- a/components/script/dom/webglrenderingcontext.rs
+++ b/components/script/dom/webglrenderingcontext.rs
@@ -1254,6 +1254,74 @@ impl WebGLRenderingContext {
Ok(())
}
+
+ fn uniform_vec_section_int(
+ &self,
+ vec: Int32ArrayOrLongSequence,
+ offset: u32,
+ length: u32,
+ uniform_size: usize,
+ uniform_location: &WebGLUniformLocation,
+ ) -> WebGLResult<Vec<i32>> {
+ let vec = match vec {
+ Int32ArrayOrLongSequence::Int32Array(v) => v.to_vec(),
+ Int32ArrayOrLongSequence::LongSequence(v) => v,
+ };
+ self.uniform_vec_section::<i32>(vec, offset, length, uniform_size, uniform_location)
+ }
+
+ fn uniform_vec_section_float(
+ &self,
+ vec: Float32ArrayOrUnrestrictedFloatSequence,
+ offset: u32,
+ length: u32,
+ uniform_size: usize,
+ uniform_location: &WebGLUniformLocation,
+ ) -> WebGLResult<Vec<f32>> {
+ let vec = match vec {
+ Float32ArrayOrUnrestrictedFloatSequence::Float32Array(v) => v.to_vec(),
+ Float32ArrayOrUnrestrictedFloatSequence::UnrestrictedFloatSequence(v) => v,
+ };
+ self.uniform_vec_section::<f32>(vec, offset, length, uniform_size, uniform_location)
+ }
+
+ pub fn uniform_vec_section<T: Clone>(
+ &self,
+ vec: Vec<T>,
+ offset: u32,
+ length: u32,
+ uniform_size: usize,
+ uniform_location: &WebGLUniformLocation,
+ ) -> WebGLResult<Vec<T>> {
+ let offset = offset as usize;
+ if offset > vec.len() {
+ return Err(InvalidValue);
+ }
+
+ let length = if length > 0 {
+ length as usize
+ } else {
+ vec.len() - offset
+ };
+ if offset + length > vec.len() {
+ return Err(InvalidValue);
+ }
+
+ let vec = if offset == 0 && length == vec.len() {
+ vec
+ } else {
+ vec[offset..offset + length].to_vec()
+ };
+
+ if vec.len() < uniform_size || vec.len() % uniform_size != 0 {
+ return Err(InvalidValue);
+ }
+ if uniform_location.size().is_none() && vec.len() != uniform_size {
+ return Err(InvalidOperation);
+ }
+
+ Ok(vec)
+ }
}
#[cfg(not(feature = "webgl_backtrace"))]
@@ -3211,7 +3279,13 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn Uniform1iv(&self, location: Option<&WebGLUniformLocation>, val: Int32ArrayOrLongSequence) {
+ fn Uniform1iv(
+ &self,
+ location: Option<&WebGLUniformLocation>,
+ val: Int32ArrayOrLongSequence,
+ src_offset: u32,
+ src_length: u32,
+ ) {
self.with_location(location, |location| {
match location.type_() {
constants::BOOL |
@@ -3220,16 +3294,9 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
constants::SAMPLER_CUBE => {},
_ => return Err(InvalidOperation),
}
- let val = match val {
- Int32ArrayOrLongSequence::Int32Array(v) => v.to_vec(),
- Int32ArrayOrLongSequence::LongSequence(v) => v,
- };
- if val.is_empty() {
- return Err(InvalidValue);
- }
- if location.size().is_none() && val.len() != 1 {
- return Err(InvalidOperation);
- }
+
+ let val = self.uniform_vec_section_int(val, src_offset, src_length, 1, location)?;
+
match location.type_() {
constants::SAMPLER_2D | constants::SAMPLER_CUBE => {
for &v in val
@@ -3253,22 +3320,15 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
&self,
location: Option<&WebGLUniformLocation>,
val: Float32ArrayOrUnrestrictedFloatSequence,
+ src_offset: u32,
+ src_length: u32,
) {
self.with_location(location, |location| {
match location.type_() {
constants::BOOL | constants::FLOAT => {},
_ => return Err(InvalidOperation),
}
- let val = match val {
- Float32ArrayOrUnrestrictedFloatSequence::Float32Array(v) => v.to_vec(),
- Float32ArrayOrUnrestrictedFloatSequence::UnrestrictedFloatSequence(v) => v,
- };
- if val.is_empty() {
- return Err(InvalidValue);
- }
- if location.size().is_none() && val.len() != 1 {
- return Err(InvalidOperation);
- }
+ let val = self.uniform_vec_section_float(val, src_offset, src_length, 1, location)?;
self.send_command(WebGLCommand::Uniform1fv(location.id(), val));
Ok(())
});
@@ -3291,22 +3351,15 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
&self,
location: Option<&WebGLUniformLocation>,
val: Float32ArrayOrUnrestrictedFloatSequence,
+ src_offset: u32,
+ src_length: u32,
) {
self.with_location(location, |location| {
match location.type_() {
constants::BOOL_VEC2 | constants::FLOAT_VEC2 => {},
_ => return Err(InvalidOperation),
}
- let val = match val {
- Float32ArrayOrUnrestrictedFloatSequence::Float32Array(v) => v.to_vec(),
- Float32ArrayOrUnrestrictedFloatSequence::UnrestrictedFloatSequence(v) => v,
- };
- if val.len() < 2 || val.len() % 2 != 0 {
- return Err(InvalidValue);
- }
- if location.size().is_none() && val.len() != 2 {
- return Err(InvalidOperation);
- }
+ let val = self.uniform_vec_section_float(val, src_offset, src_length, 2, location)?;
self.send_command(WebGLCommand::Uniform2fv(location.id(), val));
Ok(())
});
@@ -3325,22 +3378,19 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn Uniform2iv(&self, location: Option<&WebGLUniformLocation>, val: Int32ArrayOrLongSequence) {
+ fn Uniform2iv(
+ &self,
+ location: Option<&WebGLUniformLocation>,
+ val: Int32ArrayOrLongSequence,
+ src_offset: u32,
+ src_length: u32,
+ ) {
self.with_location(location, |location| {
match location.type_() {
constants::BOOL_VEC2 | constants::INT_VEC2 => {},
_ => return Err(InvalidOperation),
}
- let val = match val {
- Int32ArrayOrLongSequence::Int32Array(v) => v.to_vec(),
- Int32ArrayOrLongSequence::LongSequence(v) => v,
- };
- if val.len() < 2 || val.len() % 2 != 0 {
- return Err(InvalidValue);
- }
- if location.size().is_none() && val.len() != 2 {
- return Err(InvalidOperation);
- }
+ let val = self.uniform_vec_section_int(val, src_offset, src_length, 2, location)?;
self.send_command(WebGLCommand::Uniform2iv(location.id(), val));
Ok(())
});
@@ -3363,22 +3413,15 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
&self,
location: Option<&WebGLUniformLocation>,
val: Float32ArrayOrUnrestrictedFloatSequence,
+ src_offset: u32,
+ src_length: u32,
) {
self.with_location(location, |location| {
match location.type_() {
constants::BOOL_VEC3 | constants::FLOAT_VEC3 => {},
_ => return Err(InvalidOperation),
}
- let val = match val {
- Float32ArrayOrUnrestrictedFloatSequence::Float32Array(v) => v.to_vec(),
- Float32ArrayOrUnrestrictedFloatSequence::UnrestrictedFloatSequence(v) => v,
- };
- if val.len() < 3 || val.len() % 3 != 0 {
- return Err(InvalidValue);
- }
- if location.size().is_none() && val.len() != 3 {
- return Err(InvalidOperation);
- }
+ let val = self.uniform_vec_section_float(val, src_offset, src_length, 3, location)?;
self.send_command(WebGLCommand::Uniform3fv(location.id(), val));
Ok(())
});
@@ -3397,22 +3440,19 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn Uniform3iv(&self, location: Option<&WebGLUniformLocation>, val: Int32ArrayOrLongSequence) {
+ fn Uniform3iv(
+ &self,
+ location: Option<&WebGLUniformLocation>,
+ val: Int32ArrayOrLongSequence,
+ src_offset: u32,
+ src_length: u32,
+ ) {
self.with_location(location, |location| {
match location.type_() {
constants::BOOL_VEC3 | constants::INT_VEC3 => {},
_ => return Err(InvalidOperation),
}
- let val = match val {
- Int32ArrayOrLongSequence::Int32Array(v) => v.to_vec(),
- Int32ArrayOrLongSequence::LongSequence(v) => v,
- };
- if val.len() < 3 || val.len() % 3 != 0 {
- return Err(InvalidValue);
- }
- if location.size().is_none() && val.len() != 3 {
- return Err(InvalidOperation);
- }
+ let val = self.uniform_vec_section_int(val, src_offset, src_length, 3, location)?;
self.send_command(WebGLCommand::Uniform3iv(location.id(), val));
Ok(())
});
@@ -3431,22 +3471,19 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
}
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- fn Uniform4iv(&self, location: Option<&WebGLUniformLocation>, val: Int32ArrayOrLongSequence) {
+ fn Uniform4iv(
+ &self,
+ location: Option<&WebGLUniformLocation>,
+ val: Int32ArrayOrLongSequence,
+ src_offset: u32,
+ src_length: u32,
+ ) {
self.with_location(location, |location| {
match location.type_() {
constants::BOOL_VEC4 | constants::INT_VEC4 => {},
_ => return Err(InvalidOperation),
}
- let val = match val {
- Int32ArrayOrLongSequence::Int32Array(v) => v.to_vec(),
- Int32ArrayOrLongSequence::LongSequence(v) => v,
- };
- if val.len() < 4 || val.len() % 4 != 0 {
- return Err(InvalidValue);
- }
- if location.size().is_none() && val.len() != 4 {
- return Err(InvalidOperation);
- }
+ let val = self.uniform_vec_section_int(val, src_offset, src_length, 4, location)?;
self.send_command(WebGLCommand::Uniform4iv(location.id(), val));
Ok(())
});
@@ -3469,22 +3506,15 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
&self,
location: Option<&WebGLUniformLocation>,
val: Float32ArrayOrUnrestrictedFloatSequence,
+ src_offset: u32,
+ src_length: u32,
) {
self.with_location(location, |location| {
match location.type_() {
constants::BOOL_VEC4 | constants::FLOAT_VEC4 => {},
_ => return Err(InvalidOperation),
}
- let val = match val {
- Float32ArrayOrUnrestrictedFloatSequence::Float32Array(v) => v.to_vec(),
- Float32ArrayOrUnrestrictedFloatSequence::UnrestrictedFloatSequence(v) => v,
- };
- if val.len() < 4 || val.len() % 4 != 0 {
- return Err(InvalidValue);
- }
- if location.size().is_none() && val.len() != 4 {
- return Err(InvalidOperation);
- }
+ let val = self.uniform_vec_section_float(val, src_offset, src_length, 4, location)?;
self.send_command(WebGLCommand::Uniform4fv(location.id(), val));
Ok(())
});
diff --git a/components/script/dom/webidls/WebGL2RenderingContext.webidl b/components/script/dom/webidls/WebGL2RenderingContext.webidl
index 33e8d1bf99b..68ee72db8b6 100644
--- a/components/script/dom/webidls/WebGL2RenderingContext.webidl
+++ b/components/script/dom/webidls/WebGL2RenderingContext.webidl
@@ -430,24 +430,6 @@ interface mixin WebGL2RenderingContextBase
void uniform3ui(WebGLUniformLocation? location, GLuint v0, GLuint v1, GLuint v2);
void uniform4ui(WebGLUniformLocation? location, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
- // void uniform1fv(WebGLUniformLocation? location, Float32List data, optional GLuint srcOffset = 0,
- // optional GLuint srcLength = 0);
- // void uniform2fv(WebGLUniformLocation? location, Float32List data, optional GLuint srcOffset = 0,
- // optional GLuint srcLength = 0);
- // void uniform3fv(WebGLUniformLocation? location, Float32List data, optional GLuint srcOffset = 0,
- // optional GLuint srcLength = 0);
- // void uniform4fv(WebGLUniformLocation? location, Float32List data, optional GLuint srcOffset = 0,
- // optional GLuint srcLength = 0);
-
- // void uniform1iv(WebGLUniformLocation? location, Int32List data, optional GLuint srcOffset = 0,
- // optional GLuint srcLength = 0);
- // void uniform2iv(WebGLUniformLocation? location, Int32List data, optional GLuint srcOffset = 0,
- // optional GLuint srcLength = 0);
- // void uniform3iv(WebGLUniformLocation? location, Int32List data, optional GLuint srcOffset = 0,
- // optional GLuint srcLength = 0);
- // void uniform4iv(WebGLUniformLocation? location, Int32List data, optional GLuint srcOffset = 0,
- // optional GLuint srcLength = 0);
-
void uniform1uiv(WebGLUniformLocation? location, Uint32List data, optional GLuint srcOffset = 0,
optional GLuint srcLength = 0);
void uniform2uiv(WebGLUniformLocation? location, Uint32List data, optional GLuint srcOffset = 0,
diff --git a/components/script/dom/webidls/WebGLRenderingContext.webidl b/components/script/dom/webidls/WebGLRenderingContext.webidl
index 0d3504c53f0..e56f08ccacf 100644
--- a/components/script/dom/webidls/WebGLRenderingContext.webidl
+++ b/components/script/dom/webidls/WebGLRenderingContext.webidl
@@ -650,15 +650,23 @@ interface mixin WebGLRenderingContextBase
void uniform3i(WebGLUniformLocation? location, GLint x, GLint y, GLint z);
void uniform4i(WebGLUniformLocation? location, GLint x, GLint y, GLint z, GLint w);
- void uniform1fv(WebGLUniformLocation? location, Float32List v);
- void uniform2fv(WebGLUniformLocation? location, Float32List v);
- void uniform3fv(WebGLUniformLocation? location, Float32List v);
- void uniform4fv(WebGLUniformLocation? location, Float32List v);
-
- void uniform1iv(WebGLUniformLocation? location, Int32List v);
- void uniform2iv(WebGLUniformLocation? location, Int32List v);
- void uniform3iv(WebGLUniformLocation? location, Int32List v);
- void uniform4iv(WebGLUniformLocation? location, Int32List v);
+ void uniform1fv(WebGLUniformLocation? location, Float32List data, optional GLuint srcOffset = 0,
+ optional GLuint srcLength = 0);
+ void uniform2fv(WebGLUniformLocation? location, Float32List data, optional GLuint srcOffset = 0,
+ optional GLuint srcLength = 0);
+ void uniform3fv(WebGLUniformLocation? location, Float32List data, optional GLuint srcOffset = 0,
+ optional GLuint srcLength = 0);
+ void uniform4fv(WebGLUniformLocation? location, Float32List data, optional GLuint srcOffset = 0,
+ optional GLuint srcLength = 0);
+
+ void uniform1iv(WebGLUniformLocation? location, Int32List data, optional GLuint srcOffset = 0,
+ optional GLuint srcLength = 0);
+ void uniform2iv(WebGLUniformLocation? location, Int32List data, optional GLuint srcOffset = 0,
+ optional GLuint srcLength = 0);
+ void uniform3iv(WebGLUniformLocation? location, Int32List data, optional GLuint srcOffset = 0,
+ optional GLuint srcLength = 0);
+ void uniform4iv(WebGLUniformLocation? location, Int32List data, optional GLuint srcOffset = 0,
+ optional GLuint srcLength = 0);
void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, Float32List value);
void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose, Float32List value);