Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make handle_potential_webgl_error more ergonomic #7360

Merged
merged 1 commit into from Aug 26, 2015
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -59,7 +59,10 @@ macro_rules! handle_potential_webgl_error {
$return_on_error
}
}
}
};
($context:ident, $call:expr) => {
handle_potential_webgl_error!($context, $call, ());
};
}

/// Set of bitflags for texture unpacking (texImage2d, etc...)
@@ -269,7 +272,7 @@ impl<'a> WebGLRenderingContextMethods for &'a WebGLRenderingContext {
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), ());
handle_potential_webgl_error!(self, program.attach_shader(shader));
}
}
}
@@ -284,7 +287,7 @@ impl<'a> WebGLRenderingContextMethods for &'a WebGLRenderingContext {
}

if let Some(buffer) = buffer {
handle_potential_webgl_error!(self, buffer.bind(target), ())
handle_potential_webgl_error!(self, buffer.bind(target))
} else {
// Unbind the current buffer
self.ipc_renderer
@@ -876,7 +879,7 @@ impl<'a> WebGLRenderingContextMethods for &'a WebGLRenderingContext {
if let Some(texture) = self.bound_texture_for(target) {
let texture = texture.root();
let result = texture.r().tex_parameter(target, name, TexParameterValue::Float(value));
handle_potential_webgl_error!(self, result, ());
handle_potential_webgl_error!(self, result);
} else {
return self.webgl_error(InvalidOperation);
}
@@ -894,7 +897,7 @@ impl<'a> WebGLRenderingContextMethods for &'a WebGLRenderingContext {
if let Some(texture) = self.bound_texture_for(target) {
let texture = texture.root();
let result = texture.r().tex_parameter(target, name, TexParameterValue::Int(value));
handle_potential_webgl_error!(self, result, ());
handle_potential_webgl_error!(self, result);
} else {
return self.webgl_error(InvalidOperation);
}
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.