mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Add support for filtering WebGL extensions based on WebGL version
This commit is contained in:
parent
d21657a9e5
commit
f2f5817f56
13 changed files with 87 additions and 25 deletions
|
@ -9,7 +9,7 @@ use dom::bindings::trace::JSTraceable;
|
|||
use dom::webglrenderingcontext::WebGLRenderingContext;
|
||||
use malloc_size_of::MallocSizeOf;
|
||||
use std::any::Any;
|
||||
use super::{WebGLExtension, WebGLExtensions};
|
||||
use super::{WebGLExtension, WebGLExtensions, WebGLExtensionSpec};
|
||||
|
||||
/// Trait used internally by WebGLExtensions to store and
|
||||
/// handle the different WebGL extensions in a common list.
|
||||
|
@ -18,6 +18,7 @@ pub trait WebGLExtensionWrapper: JSTraceable + MallocSizeOf {
|
|||
ctx: &WebGLRenderingContext,
|
||||
ext: &WebGLExtensions)
|
||||
-> NonNullJSObjectPtr;
|
||||
fn spec(&self) -> WebGLExtensionSpec;
|
||||
fn is_supported(&self, &WebGLExtensions) -> bool;
|
||||
fn is_enabled(&self) -> bool;
|
||||
fn enable(&self, ext: &WebGLExtensions);
|
||||
|
@ -61,6 +62,10 @@ impl<T> WebGLExtensionWrapper for TypedWebGLExtensionWrapper<T>
|
|||
}
|
||||
}
|
||||
|
||||
fn spec(&self) -> WebGLExtensionSpec {
|
||||
T::spec()
|
||||
}
|
||||
|
||||
fn is_supported(&self, ext: &WebGLExtensions) -> bool {
|
||||
self.is_enabled() || T::is_supported(ext)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue