diff options
author | Tobias Tschinkowitz <tobias.tschinkowitz@icloud.com> | 2020-04-23 18:23:01 +0200 |
---|---|---|
committer | Tobias Tschinkowitz <tobias.tschinkowitz@icloud.com> | 2020-04-23 18:23:01 +0200 |
commit | 9c343fcc9600a1a2b768a4632793d0856d55ddce (patch) | |
tree | 468ae96e83fb1986e392d5b1c2bdece3bd17f67f /components/script/dom/webgltexture.rs | |
parent | 60e75314feaf0b5009f0cabfca6930ef1a584f27 (diff) | |
download | servo-9c343fcc9600a1a2b768a4632793d0856d55ddce.tar.gz servo-9c343fcc9600a1a2b768a4632793d0856d55ddce.zip |
Replaced failible boolean with an enum
Diffstat (limited to 'components/script/dom/webgltexture.rs')
-rw-r--r-- | components/script/dom/webgltexture.rs | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/components/script/dom/webgltexture.rs b/components/script/dom/webgltexture.rs index 682920df96e..3059dc7bf4e 100644 --- a/components/script/dom/webgltexture.rs +++ b/components/script/dom/webgltexture.rs @@ -13,7 +13,7 @@ use crate::dom::bindings::root::{DomRoot, MutNullableDom}; use crate::dom::webgl_validations::types::TexImageTarget; use crate::dom::webglframebuffer::WebGLFramebuffer; use crate::dom::webglobject::WebGLObject; -use crate::dom::webglrenderingcontext::WebGLRenderingContext; +use crate::dom::webglrenderingcontext::{Operation, WebGLRenderingContext}; use canvas_traits::webgl::{webgl_channel, TexDataType, TexFormat, WebGLResult, WebGLTextureId}; use canvas_traits::webgl::{DOMToTextureCommand, WebGLCommand, WebGLError}; use dom_struct::dom_struct; @@ -183,7 +183,7 @@ impl WebGLTexture { self.populate_mip_chain(self.base_mipmap_level, last_level) } - pub fn delete(&self, fallible: bool) { + pub fn delete(&self, operation_fallibility: Operation) { if !self.is_deleted.get() { self.is_deleted.set(true); let context = self.upcast::<WebGLObject>().context(); @@ -210,10 +210,9 @@ impl WebGLTexture { } let cmd = WebGLCommand::DeleteTexture(self.id); - if fallible { - context.send_command_ignored(cmd); - } else { - context.send_command(cmd); + match operation_fallibility { + Operation::Fallible => context.send_command_ignored(cmd), + Operation::Infallible => context.send_command(cmd), } } } @@ -420,7 +419,7 @@ impl WebGLTexture { impl Drop for WebGLTexture { fn drop(&mut self) { - self.delete(true); + self.delete(Operation::Fallible); } } |