aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/webgl2renderingcontext.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2018-03-23 15:15:38 -0400
committerGitHub <noreply@github.com>2018-03-23 15:15:38 -0400
commite8fdc677f440919507209ed42d0ea042c700042c (patch)
treefab6934483c93cf67273458bd193c75e3f3a7d64 /components/script/dom/webgl2renderingcontext.rs
parent18ef5874dd3e11551e2f9503746540847eeb974c (diff)
parent80c6891f339c52778ee7133b3b3f8ae9c8c350e5 (diff)
downloadservo-e8fdc677f440919507209ed42d0ea042c700042c.tar.gz
servo-e8fdc677f440919507209ed42d0ea042c700042c.zip
Auto merge of #20396 - Xanewok:webgl-typed-arrays, r=jdm
Replace `object` function arguments in WebGL with typed arrays <!-- Please describe your changes on the following line: --> Could use a https://github.com/servo/rust-mozjs/pull/402 in some places, as this should simplify a little bit and remove unnecessary `#[allow(unsafe_code)]` attributes. I sort of hacked my way through for https://github.com/servo/servo/issues/20394 since I encountered this issue as well. I agree that the comment above makes me feel uneasy about this and feels like I'm missing something and this shouldn't be the way we eventually resolve the overloads with auto rootable types (talking about this: https://github.com/servo/servo/pull/20396/files#diff-60d01595cff328c165842fea9e4ccbc2R428). r? @jdm --- <!-- 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] These changes fix #20342 (github issue number if applicable). <!-- Either: --> - [ ] There are tests for these changes OR - [X] These changes do not require tests because if the bindings compile now, it works! <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20396) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/webgl2renderingcontext.rs')
-rw-r--r--components/script/dom/webgl2renderingcontext.rs321
1 files changed, 185 insertions, 136 deletions
diff --git a/components/script/dom/webgl2renderingcontext.rs b/components/script/dom/webgl2renderingcontext.rs
index 71ec9388d87..dd0701ace99 100644
--- a/components/script/dom/webgl2renderingcontext.rs
+++ b/components/script/dom/webgl2renderingcontext.rs
@@ -8,6 +8,7 @@ use dom::bindings::codegen::Bindings::WebGL2RenderingContextBinding;
use dom::bindings::codegen::Bindings::WebGL2RenderingContextBinding::WebGL2RenderingContextMethods;
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLContextAttributes;
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextMethods;
+use dom::bindings::codegen::UnionTypes::ArrayBufferOrArrayBufferView;
use dom::bindings::codegen::UnionTypes::ImageDataOrHTMLImageElementOrHTMLCanvasElementOrHTMLVideoElement;
use dom::bindings::error::{ErrorResult, Fallible};
use dom::bindings::reflector::{reflect_dom_object, Reflector};
@@ -30,6 +31,8 @@ use dom_struct::dom_struct;
use euclid::Size2D;
use js::jsapi::{JSContext, JSObject};
use js::jsval::JSVal;
+use js::rust::CustomAutoRooterGuard;
+use js::typedarray::{ArrayBufferView, Float32Array, Int32Array};
use offscreen_gl_context::GLContextAttributes;
use script_layout_interface::HTMLCanvasDataSource;
use std::ptr::NonNull;
@@ -235,25 +238,23 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
self.base.BufferData_(target, size, usage)
}
- #[allow(unsafe_code)]
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.5
- unsafe fn BufferSubData(&self, cx: *mut JSContext, target: u32, offset: i64, data: *mut JSObject) -> Fallible<()> {
- self.base.BufferSubData(cx, target, offset, data)
+ fn BufferSubData(&self, target: u32, offset: i64, data: Option<ArrayBufferOrArrayBufferView>) {
+ self.base.BufferSubData(target, offset, data)
}
- #[allow(unsafe_code)]
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8
- unsafe fn CompressedTexImage2D(&self, cx: *mut JSContext, target: u32, level: i32, internal_format: u32,
- width: i32, height: i32, border: i32, pixels: *mut JSObject) -> Fallible<()> {
- self.base.CompressedTexImage2D(cx, target, level, internal_format, width, height, border, pixels)
+ fn CompressedTexImage2D(&self, target: u32, level: i32, internal_format: u32,
+ width: i32, height: i32, border: i32,
+ pixels: CustomAutoRooterGuard<ArrayBufferView>) {
+ self.base.CompressedTexImage2D(target, level, internal_format, width, height, border, pixels)
}
- #[allow(unsafe_code)]
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8
- unsafe fn CompressedTexSubImage2D(&self, cx: *mut JSContext, target: u32, level: i32,
- xoffset: i32, yoffset: i32, width: i32, height: i32,
- format: u32, pixels: *mut JSObject) -> Fallible<()> {
- self.base.CompressedTexSubImage2D(cx, target, level, xoffset, yoffset, width, height, format, pixels)
+ fn CompressedTexSubImage2D(&self, target: u32, level: i32, xoffset: i32,
+ yoffset: i32, width: i32, height: i32, format: u32,
+ pixels: CustomAutoRooterGuard<ArrayBufferView>) {
+ self.base.CompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, pixels)
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8
@@ -533,11 +534,10 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
self.base.PolygonOffset(factor, units)
}
- #[allow(unsafe_code)]
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.12
- unsafe fn ReadPixels(&self, cx: *mut JSContext, x: i32, y: i32, width: i32, height: i32,
- format: u32, pixel_type: u32, pixels: *mut JSObject) -> Fallible<()> {
- self.base.ReadPixels(cx, x, y, width, height, format, pixel_type, pixels)
+ fn ReadPixels(&self, x: i32, y: i32, width: i32, height: i32, format: u32, pixel_type: u32,
+ pixels: CustomAutoRooterGuard<Option<ArrayBufferView>>) {
+ self.base.ReadPixels(x, y, width, height, format, pixel_type, pixels)
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.3
@@ -597,161 +597,198 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
fn Uniform1f(&self,
- uniform: Option<&WebGLUniformLocation>,
+ location: Option<&WebGLUniformLocation>,
val: f32) {
- self.base.Uniform1f(uniform, val)
+ self.base.Uniform1f(location, val)
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
fn Uniform1i(&self,
- uniform: Option<&WebGLUniformLocation>,
+ location: Option<&WebGLUniformLocation>,
val: i32) {
- self.base.Uniform1i(uniform, val)
+ self.base.Uniform1i(location, val)
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- #[allow(unsafe_code)]
- unsafe fn Uniform1iv(&self,
- cx: *mut JSContext,
- uniform: Option<&WebGLUniformLocation>,
- data: *mut JSObject) -> Fallible<()> {
- self.base.Uniform1iv(cx, uniform, data)
+ fn Uniform1iv(&self,
+ location: Option<&WebGLUniformLocation>,
+ v: CustomAutoRooterGuard<Int32Array>) {
+ self.base.Uniform1iv(location, v)
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- #[allow(unsafe_code)]
- unsafe fn Uniform1fv(&self,
- cx: *mut JSContext,
- uniform: Option<&WebGLUniformLocation>,
- data: *mut JSObject) -> Fallible<()> {
- self.base.Uniform1fv(cx, uniform, data)
+ fn Uniform1iv_(&self, location: Option<&WebGLUniformLocation>, v: Vec<i32>) {
+ self.base.Uniform1iv_(location, v);
+ }
+
+ /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
+ fn Uniform1fv(&self,
+ location: Option<&WebGLUniformLocation>,
+ v: CustomAutoRooterGuard<Float32Array>) {
+ self.base.Uniform1fv(location, v);
+ }
+
+ // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
+ fn Uniform1fv_(&self, location: Option<&WebGLUniformLocation>, v: Vec<f32>) {
+ self.base.Uniform1fv_(location, v);
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
fn Uniform2f(&self,
- uniform: Option<&WebGLUniformLocation>,
+ location: Option<&WebGLUniformLocation>,
x: f32, y: f32) {
- self.base.Uniform2f(uniform, x, y)
+ self.base.Uniform2f(location, x, y)
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- #[allow(unsafe_code)]
- unsafe fn Uniform2fv(&self,
- cx: *mut JSContext,
- uniform: Option<&WebGLUniformLocation>,
- data: *mut JSObject) -> Fallible<()> {
- self.base.Uniform2fv(cx, uniform, data)
+ fn Uniform2fv(&self,
+ location: Option<&WebGLUniformLocation>,
+ v: CustomAutoRooterGuard<Float32Array>) {
+ self.base.Uniform2fv(location, v)
+ }
+
+ // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
+ fn Uniform2fv_(&self, location: Option<&WebGLUniformLocation>, v: Vec<f32>) {
+ self.base.Uniform2fv_(location, v);
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
fn Uniform2i(&self,
- uniform: Option<&WebGLUniformLocation>,
+ location: Option<&WebGLUniformLocation>,
x: i32, y: i32) {
- self.base.Uniform2i(uniform, x, y)
+ self.base.Uniform2i(location, x, y)
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- #[allow(unsafe_code)]
- unsafe fn Uniform2iv(&self,
- cx: *mut JSContext,
- uniform: Option<&WebGLUniformLocation>,
- data: *mut JSObject) -> Fallible<()> {
- self.base.Uniform2iv(cx, uniform, data)
+ fn Uniform2iv(&self,
+ location: Option<&WebGLUniformLocation>,
+ v: CustomAutoRooterGuard<Int32Array>) {
+ self.base.Uniform2iv(location, v)
+ }
+
+ /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
+ fn Uniform2iv_(&self, location: Option<&WebGLUniformLocation>, v: Vec<i32>) {
+ self.base.Uniform2iv_(location, v);
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
fn Uniform3f(&self,
- uniform: Option<&WebGLUniformLocation>,
+ location: Option<&WebGLUniformLocation>,
x: f32, y: f32, z: f32) {
- self.base.Uniform3f(uniform, x, y, z)
+ self.base.Uniform3f(location, x, y, z)
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- #[allow(unsafe_code)]
- unsafe fn Uniform3fv(&self,
- cx: *mut JSContext,
- uniform: Option<&WebGLUniformLocation>,
- data: *mut JSObject) -> Fallible<()> {
- self.base.Uniform3fv(cx, uniform, data)
+ fn Uniform3fv(&self,
+ location: Option<&WebGLUniformLocation>,
+ v: CustomAutoRooterGuard<Float32Array>) {
+ self.base.Uniform3fv(location, v)
+ }
+
+ // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
+ fn Uniform3fv_(&self, location: Option<&WebGLUniformLocation>, v: Vec<f32>) {
+ self.base.Uniform3fv_(location, v);
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
fn Uniform3i(&self,
- uniform: Option<&WebGLUniformLocation>,
+ location: Option<&WebGLUniformLocation>,
x: i32, y: i32, z: i32) {
- self.base.Uniform3i(uniform, x, y, z)
+ self.base.Uniform3i(location, x, y, z)
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- #[allow(unsafe_code)]
- unsafe fn Uniform3iv(&self,
- cx: *mut JSContext,
- uniform: Option<&WebGLUniformLocation>,
- data: *mut JSObject) -> Fallible<()> {
- self.base.Uniform3iv(cx, uniform, data)
+ fn Uniform3iv(&self,
+ location: Option<&WebGLUniformLocation>,
+ v: CustomAutoRooterGuard<Int32Array>) {
+ self.base.Uniform3iv(location, v)
+ }
+
+ /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
+ fn Uniform3iv_(&self,
+ location: Option<&WebGLUniformLocation>,
+ v: Vec<i32>) {
+ self.base.Uniform3iv_(location, v)
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
fn Uniform4i(&self,
- uniform: Option<&WebGLUniformLocation>,
+ location: Option<&WebGLUniformLocation>,
x: i32, y: i32, z: i32, w: i32) {
- self.base.Uniform4i(uniform, x, y, z, w)
+ self.base.Uniform4i(location, x, y, z, w)
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- #[allow(unsafe_code)]
- unsafe fn Uniform4iv(&self,
- cx: *mut JSContext,
- uniform: Option<&WebGLUniformLocation>,
- data: *mut JSObject) -> Fallible<()> {
- self.base.Uniform4iv(cx, uniform, data)
+ fn Uniform4iv(&self,
+ location: Option<&WebGLUniformLocation>,
+ v: CustomAutoRooterGuard<Int32Array>) {
+ self.base.Uniform4iv(location, v)
+ }
+
+ /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
+ fn Uniform4iv_(&self,
+ location: Option<&WebGLUniformLocation>,
+ v: Vec<i32>) {
+ self.base.Uniform4iv_(location, v)
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
fn Uniform4f(&self,
- uniform: Option<&WebGLUniformLocation>,
+ location: Option<&WebGLUniformLocation>,
x: f32, y: f32, z: f32, w: f32) {
- self.base.Uniform4f(uniform, x, y, z, w)
+ self.base.Uniform4f(location, x, y, z, w)
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- #[allow(unsafe_code)]
- unsafe fn Uniform4fv(&self,
- cx: *mut JSContext,
- uniform: Option<&WebGLUniformLocation>,
- data: *mut JSObject) -> Fallible<()> {
- self.base.Uniform4fv(cx, uniform, data)
+ fn Uniform4fv(&self,
+ location: Option<&WebGLUniformLocation>,
+ v: CustomAutoRooterGuard<Float32Array>) {
+ self.base.Uniform4fv(location, v)
+ }
+
+ // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
+ fn Uniform4fv_(&self, location: Option<&WebGLUniformLocation>, v: Vec<f32>) {
+ self.base.Uniform4fv_(location, v);
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- #[allow(unsafe_code)]
- unsafe fn UniformMatrix2fv(&self,
- cx: *mut JSContext,
- uniform: Option<&WebGLUniformLocation>,
+ fn UniformMatrix2fv(&self,
+ location: Option<&WebGLUniformLocation>,
transpose: bool,
- data: *mut JSObject) -> Fallible<()> {
- self.base.UniformMatrix2fv(cx, uniform, transpose, data)
+ v: CustomAutoRooterGuard<Float32Array>) {
+ self.base.UniformMatrix2fv(location, transpose, v)
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- #[allow(unsafe_code)]
- unsafe fn UniformMatrix3fv(&self,
- cx: *mut JSContext,
- uniform: Option<&WebGLUniformLocation>,
+ fn UniformMatrix2fv_(&self, location: Option<&WebGLUniformLocation>, transpose: bool, value: Vec<f32>) {
+ self.base.UniformMatrix2fv_(location, transpose, value);
+ }
+
+ /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
+ fn UniformMatrix3fv(&self,
+ location: Option<&WebGLUniformLocation>,
transpose: bool,
- data: *mut JSObject) -> Fallible<()> {
- self.base.UniformMatrix3fv(cx, uniform, transpose, data)
+ v: CustomAutoRooterGuard<Float32Array>) {
+ self.base.UniformMatrix3fv(location, transpose, v)
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- #[allow(unsafe_code)]
- unsafe fn UniformMatrix4fv(&self,
- cx: *mut JSContext,
- uniform: Option<&WebGLUniformLocation>,
+ fn UniformMatrix3fv_(&self, location: Option<&WebGLUniformLocation>, transpose: bool, value: Vec<f32>) {
+ self.base.UniformMatrix3fv_(location, transpose, value);
+ }
+
+ /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
+ fn UniformMatrix4fv(&self,
+ location: Option<&WebGLUniformLocation>,
transpose: bool,
- data: *mut JSObject) -> Fallible<()> {
- self.base.UniformMatrix4fv(cx, uniform, transpose, data)
+ v: CustomAutoRooterGuard<Float32Array>) {
+ self.base.UniformMatrix4fv(location, transpose, v)
+ }
+
+ /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
+ fn UniformMatrix4fv_(&self, location: Option<&WebGLUniformLocation>, transpose: bool, value: Vec<f32>) {
+ self.base.UniformMatrix4fv_(location, transpose, value);
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
@@ -770,9 +807,13 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- #[allow(unsafe_code)]
- unsafe fn VertexAttrib1fv(&self, cx: *mut JSContext, indx: u32, data: *mut JSObject) -> Fallible<()> {
- self.base.VertexAttrib1fv(cx, indx, data)
+ fn VertexAttrib1fv(&self, indx: u32, v: CustomAutoRooterGuard<Float32Array>) {
+ self.base.VertexAttrib1fv(indx, v)
+ }
+
+ /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
+ fn VertexAttrib1fv_(&self, indx: u32, v: Vec<f32>) {
+ self.base.VertexAttrib1fv_(indx, v)
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
@@ -781,9 +822,13 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- #[allow(unsafe_code)]
- unsafe fn VertexAttrib2fv(&self, cx: *mut JSContext, indx: u32, data: *mut JSObject) -> Fallible<()> {
- self.base.VertexAttrib2fv(cx, indx, data)
+ fn VertexAttrib2fv(&self, indx: u32, v: CustomAutoRooterGuard<Float32Array>) {
+ self.base.VertexAttrib2fv(indx, v)
+ }
+
+ /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
+ fn VertexAttrib2fv_(&self, indx: u32, v: Vec<f32>) {
+ self.base.VertexAttrib2fv_(indx, v)
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
@@ -792,9 +837,13 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- #[allow(unsafe_code)]
- unsafe fn VertexAttrib3fv(&self, cx: *mut JSContext, indx: u32, data: *mut JSObject) -> Fallible<()> {
- self.base.VertexAttrib3fv(cx, indx, data)
+ fn VertexAttrib3fv(&self, indx: u32, v: CustomAutoRooterGuard<Float32Array>) {
+ self.base.VertexAttrib3fv(indx, v)
+ }
+
+ /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
+ fn VertexAttrib3fv_(&self, indx: u32, v: Vec<f32>) {
+ self.base.VertexAttrib3fv_(indx, v)
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
@@ -803,9 +852,13 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
- #[allow(unsafe_code)]
- unsafe fn VertexAttrib4fv(&self, cx: *mut JSContext, indx: u32, data: *mut JSObject) -> Fallible<()> {
- self.base.VertexAttrib4fv(cx, indx, data)
+ fn VertexAttrib4fv(&self, indx: u32, v: CustomAutoRooterGuard<Float32Array>) {
+ self.base.VertexAttrib4fv(indx, v)
+ }
+
+ /// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
+ fn VertexAttrib4fv_(&self, indx: u32, v: Vec<f32>) {
+ self.base.VertexAttrib4fv_(indx, v)
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.10
@@ -820,19 +873,17 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8
- #[allow(unsafe_code)]
- unsafe fn TexImage2D(&self,
- cx: *mut JSContext,
- target: u32,
- level: i32,
- internal_format: u32,
- width: i32,
- height: i32,
- border: i32,
- format: u32,
- data_type: u32,
- data_ptr: *mut JSObject) -> Fallible<()> {
- self.base.TexImage2D(cx, target, level, internal_format, width, height, border, format, data_type, data_ptr)
+ fn TexImage2D(&self,
+ target: u32,
+ level: i32,
+ internal_format: u32,
+ width: i32,
+ height: i32,
+ border: i32,
+ format: u32,
+ data_type: u32,
+ pixels: CustomAutoRooterGuard<Option<ArrayBufferView>>) -> Fallible<()> {
+ self.base.TexImage2D(target, level, internal_format, width, height, border, format, data_type, pixels)
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8
@@ -862,19 +913,17 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8
- #[allow(unsafe_code)]
- unsafe fn TexSubImage2D(&self,
- cx: *mut JSContext,
- target: u32,
- level: i32,
- xoffset: i32,
- yoffset: i32,
- width: i32,
- height: i32,
- format: u32,
- data_type: u32,
- data_ptr: *mut JSObject) -> Fallible<()> {
- self.base.TexSubImage2D(cx, target, level, xoffset, yoffset, width, height, format, data_type, data_ptr)
+ fn TexSubImage2D(&self,
+ target: u32,
+ level: i32,
+ xoffset: i32,
+ yoffset: i32,
+ width: i32,
+ height: i32,
+ format: u32,
+ data_type: u32,
+ pixels: CustomAutoRooterGuard<Option<ArrayBufferView>>) -> Fallible<()> {
+ self.base.TexSubImage2D(target, level, xoffset, yoffset, width, height, format, data_type, pixels)
}
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.8