mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Make GL/GLES decisions based on the API in use.
This commit is contained in:
parent
812bf8d816
commit
dbaed5ed92
13 changed files with 83 additions and 52 deletions
|
@ -18,7 +18,7 @@ use crate::dom::oestexturehalffloat::OESTextureHalfFloat;
|
|||
use crate::dom::webglcolorbufferfloat::WEBGLColorBufferFloat;
|
||||
use crate::dom::webglrenderingcontext::WebGLRenderingContext;
|
||||
use crate::dom::webgltexture::TexCompression;
|
||||
use canvas_traits::webgl::WebGLVersion;
|
||||
use canvas_traits::webgl::{GlType, WebGLVersion};
|
||||
use fnv::{FnvHashMap, FnvHashSet};
|
||||
use gleam::gl::{self, GLenum};
|
||||
use js::jsapi::JSObject;
|
||||
|
@ -146,14 +146,16 @@ pub struct WebGLExtensions {
|
|||
extensions: DomRefCell<HashMap<String, Box<dyn WebGLExtensionWrapper>>>,
|
||||
features: DomRefCell<WebGLExtensionFeatures>,
|
||||
webgl_version: WebGLVersion,
|
||||
api_type: GlType,
|
||||
}
|
||||
|
||||
impl WebGLExtensions {
|
||||
pub fn new(webgl_version: WebGLVersion) -> WebGLExtensions {
|
||||
pub fn new(webgl_version: WebGLVersion, api_type: GlType) -> WebGLExtensions {
|
||||
Self {
|
||||
extensions: DomRefCell::new(HashMap::new()),
|
||||
features: DomRefCell::new(WebGLExtensionFeatures::new(webgl_version)),
|
||||
webgl_version,
|
||||
api_type,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -425,6 +427,10 @@ impl WebGLExtensions {
|
|||
}
|
||||
type_
|
||||
}
|
||||
|
||||
pub fn is_gles(&self) -> bool {
|
||||
self.api_type == GlType::Gles
|
||||
}
|
||||
}
|
||||
|
||||
// Helper structs
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue