mirror of
https://github.com/servo/servo
synced 2026-04-30 19:37:43 +02:00
Replaced failible boolean with an enum
This commit is contained in:
@@ -11,7 +11,7 @@ use crate::dom::bindings::reflector::{reflect_dom_object, DomObject};
|
||||
use crate::dom::bindings::root::{Dom, DomRoot, MutNullableDom};
|
||||
use crate::dom::webglobject::WebGLObject;
|
||||
use crate::dom::webglrenderbuffer::WebGLRenderbuffer;
|
||||
use crate::dom::webglrenderingcontext::WebGLRenderingContext;
|
||||
use crate::dom::webglrenderingcontext::{Operation, WebGLRenderingContext};
|
||||
use crate::dom::webgltexture::WebGLTexture;
|
||||
use crate::dom::xrsession::XRSession;
|
||||
use canvas_traits::webgl::{webgl_channel, WebGLError, WebGLResult, WebGLVersion};
|
||||
@@ -207,15 +207,14 @@ impl WebGLFramebuffer {
|
||||
));
|
||||
}
|
||||
|
||||
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();
|
||||
let cmd = WebGLCommand::DeleteFramebuffer(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),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -977,7 +976,7 @@ impl WebGLFramebuffer {
|
||||
|
||||
impl Drop for WebGLFramebuffer {
|
||||
fn drop(&mut self) {
|
||||
let _ = self.delete(true);
|
||||
let _ = self.delete(Operation::Fallible);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user