Make GL/GLES decisions based on the API in use.

This commit is contained in:
Josh Matthews 2019-07-10 17:34:16 -04:00
parent 812bf8d816
commit dbaed5ed92
13 changed files with 83 additions and 52 deletions

View file

@ -8,7 +8,7 @@ use crate::dom::bindings::codegen::Bindings::OESStandardDerivativesBinding::OESS
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
use crate::dom::bindings::root::DomRoot;
use crate::dom::webglrenderingcontext::WebGLRenderingContext;
use canvas_traits::webgl::{is_gles, WebGLVersion};
use canvas_traits::webgl::WebGLVersion;
use dom_struct::dom_struct;
#[dom_struct]
@ -40,7 +40,7 @@ impl WebGLExtension for OESStandardDerivatives {
fn is_supported(ext: &WebGLExtensions) -> bool {
// The standard derivatives are always available in desktop OpenGL.
!is_gles() || ext.supports_any_gl_extension(&["GL_OES_standard_derivatives"])
!ext.is_gles() || ext.supports_any_gl_extension(&["GL_OES_standard_derivatives"])
}
fn enable(ext: &WebGLExtensions) {