Move handle_potential_webgl_error to the dom macros module

This commit is contained in:
Anthony Ramine 2018-04-04 12:47:06 +02:00
parent e7f716de12
commit 3c56d2f5a7
2 changed files with 15 additions and 15 deletions

View file

@ -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, ());
};
}

View file

@ -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