mirror of
https://github.com/servo/servo.git
synced 2025-07-05 22:43:40 +01:00
Move handle_potential_webgl_error to the dom macros module
This commit is contained in:
parent
e7f716de12
commit
3c56d2f5a7
2 changed files with 15 additions and 15 deletions
|
@ -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, ());
|
||||
};
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue