aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/webglrenderingcontext.rs
diff options
context:
space:
mode:
authorbors-servo <metajack+bors@gmail.com>2015-10-15 15:00:00 -0600
committerbors-servo <metajack+bors@gmail.com>2015-10-15 15:00:00 -0600
commit9d5f09e09c64d878e6c2bb273195c3c6ca9fe82c (patch)
treec027369e6a9df652db47366b6bb9da503849f0e5 /components/script/dom/webglrenderingcontext.rs
parent6f1db0fcd3ef861f61bed6b75aae63d738e575ba (diff)
parent8819f0d8b86a59acbad9b3127171fce4728b0cdd (diff)
downloadservo-9d5f09e09c64d878e6c2bb273195c3c6ca9fe82c.tar.gz
servo-9d5f09e09c64d878e6c2bb273195c3c6ca9fe82c.zip
Auto merge of #8030 - Manishearth:fix-lint-fn, r=frewsxcv
Fix unrooted_must_root lint to handle arguments/return types properly r? @jdm <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/8030) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/dom/webglrenderingcontext.rs')
-rw-r--r--components/script/dom/webglrenderingcontext.rs8
1 files changed, 3 insertions, 5 deletions
diff --git a/components/script/dom/webglrenderingcontext.rs b/components/script/dom/webglrenderingcontext.rs
index 2fd87cfd19d..f5a3569da13 100644
--- a/components/script/dom/webglrenderingcontext.rs
+++ b/components/script/dom/webglrenderingcontext.rs
@@ -147,10 +147,10 @@ impl WebGLRenderingContext {
}
}
- pub fn bound_texture_for(&self, target: u32) -> Option<JS<WebGLTexture>> {
+ pub fn bound_texture_for(&self, target: u32) -> Option<Root<WebGLTexture>> {
match target {
- constants::TEXTURE_2D => self.bound_texture_2d.get(),
- constants::TEXTURE_CUBE_MAP => self.bound_texture_cube_map.get(),
+ constants::TEXTURE_2D => self.bound_texture_2d.get().map(|t| t.root()),
+ constants::TEXTURE_CUBE_MAP => self.bound_texture_cube_map.get().map(|t| t.root()),
_ => unreachable!(),
}
@@ -906,7 +906,6 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
constants::TEXTURE_2D |
constants::TEXTURE_CUBE_MAP => {
if let Some(texture) = self.bound_texture_for(target) {
- let texture = texture.root();
let result = texture.r().tex_parameter(target, name, TexParameterValue::Float(value));
handle_potential_webgl_error!(self, result);
} else {
@@ -924,7 +923,6 @@ impl WebGLRenderingContextMethods for WebGLRenderingContext {
constants::TEXTURE_2D |
constants::TEXTURE_CUBE_MAP => {
if let Some(texture) = self.bound_texture_for(target) {
- let texture = texture.root();
let result = texture.r().tex_parameter(target, name, TexParameterValue::Int(value));
handle_potential_webgl_error!(self, result);
} else {