Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement EXT_shader_texture_lod #20915

Merged
merged 1 commit into from Jun 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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.