Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Implement EXT_shader_texture_lod
  • Loading branch information
nox committed Jun 4, 2018
1 parent d23bc4f commit 4e5e1e6
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 8 deletions.
48 changes: 48 additions & 0 deletions components/script/dom/webgl_extensions/ext/extshadertexturelod.rs
@@ -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"
}
}
1 change: 1 addition & 0 deletions components/script/dom/webgl_extensions/ext/mod.rs
Expand Up @@ -5,6 +5,7 @@
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants;
use super::{ext_constants, WebGLExtension, WebGLExtensions, WebGLExtensionSpec};

pub mod extshadertexturelod;
pub mod oeselementindexuint;
pub mod oesstandardderivatives;
pub mod oestexturefloat;
Expand Down
11 changes: 11 additions & 0 deletions components/script/dom/webidls/EXTShaderTextureLod.webidl
@@ -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 {
};

This file was deleted.

0 comments on commit 4e5e1e6

Please sign in to comment.