mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Fix some more WebGL methods
This commit is contained in:
parent
eaf59ca9b9
commit
8061d8c3d2
4 changed files with 14 additions and 151 deletions
|
@ -185,18 +185,17 @@ impl WebGL2RenderingContextMethods for WebGL2RenderingContext {
|
|||
}
|
||||
|
||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
|
||||
fn AttachShader(&self, program: Option<&WebGLProgram>, shader: Option<&WebGLShader>) {
|
||||
fn AttachShader(&self, program: &WebGLProgram, shader: &WebGLShader) {
|
||||
self.base.AttachShader(program, shader)
|
||||
}
|
||||
|
||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
|
||||
fn DetachShader(&self, program: Option<&WebGLProgram>, shader: Option<&WebGLShader>) {
|
||||
fn DetachShader(&self, program: &WebGLProgram, shader: &WebGLShader) {
|
||||
self.base.DetachShader(program, shader)
|
||||
}
|
||||
|
||||
/// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
|
||||
fn BindAttribLocation(&self, program: Option<&WebGLProgram>,
|
||||
index: u32, name: DOMString) {
|
||||
fn BindAttribLocation(&self, program: &WebGLProgram, index: u32, name: DOMString) {
|
||||
self.base.BindAttribLocation(program, index, name)
|
||||
}
|
||||
|
||||
|
|
|
@ -1514,29 +1514,18 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
|
|||
}
|
||||
|
||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
|
||||
fn AttachShader(&self, program: Option<&WebGLProgram>, shader: Option<&WebGLShader>) {
|
||||
if let Some(program) = program {
|
||||
if let Some(shader) = shader {
|
||||
handle_potential_webgl_error!(self, program.attach_shader(shader));
|
||||
}
|
||||
}
|
||||
fn AttachShader(&self, program: &WebGLProgram, shader: &WebGLShader) {
|
||||
handle_potential_webgl_error!(self, program.attach_shader(shader));
|
||||
}
|
||||
|
||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
|
||||
fn DetachShader(&self, program: Option<&WebGLProgram>, shader: Option<&WebGLShader>) {
|
||||
if let Some(program) = program {
|
||||
if let Some(shader) = shader {
|
||||
handle_potential_webgl_error!(self, program.detach_shader(shader));
|
||||
}
|
||||
}
|
||||
fn DetachShader(&self, program: &WebGLProgram, shader: &WebGLShader) {
|
||||
handle_potential_webgl_error!(self, program.detach_shader(shader));
|
||||
}
|
||||
|
||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9
|
||||
fn BindAttribLocation(&self, program: Option<&WebGLProgram>,
|
||||
index: u32, name: DOMString) {
|
||||
if let Some(program) = program {
|
||||
handle_potential_webgl_error!(self, program.bind_attrib_location(index, name));
|
||||
}
|
||||
fn BindAttribLocation(&self, program: &WebGLProgram, index: u32, name: DOMString) {
|
||||
handle_potential_webgl_error!(self, program.bind_attrib_location(index, name));
|
||||
}
|
||||
|
||||
// https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.5
|
||||
|
|
|
@ -475,8 +475,8 @@ interface WebGLRenderingContextBase
|
|||
object? getExtension(DOMString name);
|
||||
|
||||
void activeTexture(GLenum texture);
|
||||
void attachShader(WebGLProgram? program, WebGLShader? shader);
|
||||
void bindAttribLocation(WebGLProgram? program, GLuint index, DOMString name);
|
||||
void attachShader(WebGLProgram program, WebGLShader shader);
|
||||
void bindAttribLocation(WebGLProgram program, GLuint index, DOMString name);
|
||||
void bindBuffer(GLenum target, WebGLBuffer? buffer);
|
||||
void bindFramebuffer(GLenum target, WebGLFramebuffer? framebuffer);
|
||||
void bindRenderbuffer(GLenum target, WebGLRenderbuffer? renderbuffer);
|
||||
|
@ -559,7 +559,7 @@ interface WebGLRenderingContextBase
|
|||
void depthFunc(GLenum func);
|
||||
void depthMask(GLboolean flag);
|
||||
void depthRange(GLclampf zNear, GLclampf zFar);
|
||||
void detachShader(WebGLProgram? program, WebGLShader? shader);
|
||||
void detachShader(WebGLProgram program, WebGLShader shader);
|
||||
void disable(GLenum cap);
|
||||
void disableVertexAttribArray(GLuint index);
|
||||
void drawArrays(GLenum mode, GLint first, GLsizei count);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue