Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Implement EXT_shader_texture_lod
- Loading branch information
Showing
4 changed files
with
60 additions
and
8 deletions.
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
components/script/dom/webgl_extensions/ext/extshadertexturelod.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
||
use canvas_traits::webgl::WebGLVersion; | ||
use dom::bindings::codegen::Bindings::EXTShaderTextureLodBinding; | ||
use dom::bindings::reflector::{DomObject, Reflector, reflect_dom_object}; | ||
use dom::bindings::root::DomRoot; | ||
use dom::webglrenderingcontext::WebGLRenderingContext; | ||
use dom_struct::dom_struct; | ||
use super::{WebGLExtension, WebGLExtensions, WebGLExtensionSpec}; | ||
|
||
#[dom_struct] | ||
pub struct EXTShaderTextureLod { | ||
reflector_: Reflector, | ||
} | ||
|
||
impl EXTShaderTextureLod { | ||
fn new_inherited() -> Self { | ||
Self { reflector_: Reflector::new() } | ||
} | ||
} | ||
|
||
impl WebGLExtension for EXTShaderTextureLod { | ||
type Extension = Self; | ||
|
||
fn new(ctx: &WebGLRenderingContext) -> DomRoot<Self> { | ||
reflect_dom_object( | ||
Box::new(Self::new_inherited()), | ||
&*ctx.global(), | ||
EXTShaderTextureLodBinding::Wrap, | ||
) | ||
} | ||
|
||
fn spec() -> WebGLExtensionSpec { | ||
WebGLExtensionSpec::Specific(WebGLVersion::WebGL1) | ||
} | ||
|
||
fn is_supported(ext: &WebGLExtensions) -> bool { | ||
ext.supports_gl_extension("GL_EXT_shader_texture_lod") | ||
} | ||
|
||
fn enable(_ext: &WebGLExtensions) {} | ||
|
||
fn name() -> &'static str { | ||
"EXT_shader_texture_lod" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
/* | ||
* WebGL IDL definitions scraped from the Khronos specification: | ||
* https://www.khronos.org/registry/webgl/extensions/EXT_shader_texture_lod/ | ||
*/ | ||
|
||
[NoInterfaceObject] | ||
interface EXTShaderTextureLod { | ||
}; |
8 changes: 0 additions & 8 deletions
8
...zilla/meta/webgl/conformance-1.0.3/conformance/extensions/ext-shader-texture-lod.html.ini
This file was deleted.
Oops, something went wrong.