diff options
author | Eduard Burtescu <edy.burt@gmail.com> | 2016-07-04 20:59:01 +0300 |
---|---|---|
committer | Eduard Burtescu <edy.burt@gmail.com> | 2016-07-04 20:59:01 +0300 |
commit | 0db1faf87651c99223683faafc836353f016ffb3 (patch) | |
tree | dec7ee5366fdb60a47f495d32c11a9ed2b8a4eb2 /components/script/dom/webglrenderingcontext.rs | |
parent | a77cc9950fb13ccd674a10e46c2327bfa0735dab (diff) | |
download | servo-0db1faf87651c99223683faafc836353f016ffb3.tar.gz servo-0db1faf87651c99223683faafc836353f016ffb3.zip |
Switch to using the new rooted!/RootedGuard API for rooting.
Diffstat (limited to 'components/script/dom/webglrenderingcontext.rs')
-rw-r--r-- | components/script/dom/webglrenderingcontext.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs index 686bf43178f..cf814068b22 100644 --- a/components/script/dom/webglrenderingcontext.rs +++ b/components/script/dom/webglrenderingcontext.rs @@ -33,7 +33,7 @@ use dom::webgltexture::{TexParameterValue, WebGLTexture}; use dom::webgluniformlocation::WebGLUniformLocation; use euclid::size::Size2D; use ipc_channel::ipc::{self, IpcSender}; -use js::jsapi::{JSContext, JS_GetArrayBufferViewType, JSObject, RootedValue, Type}; +use js::jsapi::{JSContext, JS_GetArrayBufferViewType, JSObject, Type}; use js::jsval::{BooleanValue, DoubleValue, Int32Value, JSVal, NullValue, UndefinedValue}; use net_traits::image::base::PixelFormat; use net_traits::image_cache_thread::ImageResponse; @@ -522,11 +522,11 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext { WebGLParameter::Float(val) => DoubleValue(val as f64), WebGLParameter::FloatArray(_) => panic!("Parameter should not be float array"), WebGLParameter::String(val) => { - let mut rval = RootedValue::new(cx, UndefinedValue()); + rooted!(in(cx) let mut rval = UndefinedValue()); unsafe { val.to_jsval(cx, rval.handle_mut()); } - rval.ptr + rval.get() } WebGLParameter::Invalid => NullValue(), } @@ -1267,13 +1267,13 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext { // https://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14.9 fn GetVertexAttrib(&self, cx: *mut JSContext, index: u32, pname: u32) -> JSVal { if index == 0 && pname == constants::CURRENT_VERTEX_ATTRIB { - let mut result = RootedValue::new(cx, UndefinedValue()); + rooted!(in(cx) let mut result = UndefinedValue()); let (x, y, z, w) = self.current_vertex_attrib_0.get(); let attrib = vec![x, y, z, w]; unsafe { attrib.to_jsval(cx, result.handle_mut()); } - return result.ptr + return result.get() } let (sender, receiver) = ipc::channel().unwrap(); @@ -1285,11 +1285,11 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext { WebGLParameter::String(_) => panic!("Vertex attrib should not be string"), WebGLParameter::Float(_) => panic!("Vertex attrib should not be float"), WebGLParameter::FloatArray(val) => { - let mut result = RootedValue::new(cx, UndefinedValue()); + rooted!(in(cx) let mut result = UndefinedValue()); unsafe { val.to_jsval(cx, result.handle_mut()); } - result.ptr + result.get() } WebGLParameter::Invalid => NullValue(), } |