diff options
Diffstat (limited to 'components/script/dom')
-rw-r--r-- | components/script/dom/macros.rs | 15 | ||||
-rw-r--r-- | components/script/dom/webglrenderingcontext.rs | 15 |
2 files changed, 15 insertions, 15 deletions
diff --git a/components/script/dom/macros.rs b/components/script/dom/macros.rs index 2fd7368525b..b2963305aa6 100644 --- a/components/script/dom/macros.rs +++ b/components/script/dom/macros.rs @@ -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, ()); + }; +} diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs index 1181231e27a..31dcc7b647f 100644 --- a/components/script/dom/webglrenderingcontext.rs +++ b/components/script/dom/webglrenderingcontext.rs @@ -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 |