Skip to content

Commit

Permalink
Move handle_potential_webgl_error to the dom macros module
Browse files Browse the repository at this point in the history
  • Loading branch information
nox committed Apr 4, 2018
1 parent e7f716d commit 3c56d2f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
15 changes: 15 additions & 0 deletions components/script/dom/macros.rs
Expand Up @@ -614,3 +614,18 @@ macro_rules! impl_performance_entry_struct(
}
);
);

macro_rules! handle_potential_webgl_error {
($context:expr, $call:expr, $return_on_error:expr) => {
match $call {
Ok(ret) => ret,
Err(error) => {
$context.webgl_error(error);
$return_on_error
}
}
};
($context:expr, $call:expr) => {
handle_potential_webgl_error!($context, $call, ());
};
}
15 changes: 0 additions & 15 deletions components/script/dom/webglrenderingcontext.rs
Expand Up @@ -68,21 +68,6 @@ use webrender_api;
type ImagePixelResult = Result<(Vec<u8>, Size2D<i32>, bool), ()>;
pub const MAX_UNIFORM_AND_ATTRIBUTE_LEN: usize = 256;

macro_rules! handle_potential_webgl_error {
($context:ident, $call:expr, $return_on_error:expr) => {
match $call {
Ok(ret) => ret,
Err(error) => {
$context.webgl_error(error);
$return_on_error
}
}
};
($context:ident, $call:expr) => {
handle_potential_webgl_error!($context, $call, ());
};
}

// From the GLES 2.0.25 spec, page 85:
//
// "If a texture that is currently bound to one of the targets
Expand Down

0 comments on commit 3c56d2f

Please sign in to comment.