mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
Implement EXT_shader_texture_lod
This commit is contained in:
parent
d23bc4f1a4
commit
4e5e1e6c33
4 changed files with 60 additions and 8 deletions
|
@ -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"
|
||||||
|
}
|
||||||
|
}
|
|
@ -5,6 +5,7 @@
|
||||||
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants;
|
use dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants;
|
||||||
use super::{ext_constants, WebGLExtension, WebGLExtensions, WebGLExtensionSpec};
|
use super::{ext_constants, WebGLExtension, WebGLExtensions, WebGLExtensionSpec};
|
||||||
|
|
||||||
|
pub mod extshadertexturelod;
|
||||||
pub mod oeselementindexuint;
|
pub mod oeselementindexuint;
|
||||||
pub mod oesstandardderivatives;
|
pub mod oesstandardderivatives;
|
||||||
pub mod oestexturefloat;
|
pub mod oestexturefloat;
|
||||||
|
|
11
components/script/dom/webidls/EXTShaderTextureLod.webidl
Normal file
11
components/script/dom/webidls/EXTShaderTextureLod.webidl
Normal file
|
@ -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 {
|
||||||
|
};
|
|
@ -1,8 +0,0 @@
|
||||||
[ext-shader-texture-lod.html]
|
|
||||||
type: testharness
|
|
||||||
[WebGL test #0: Unable to fetch WebGL rendering context for Canvas]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[WebGL test #1: WebGL context does not exist]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue