mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Format script component
This commit is contained in:
parent
2ca7a13473
commit
c37a345dc9
357 changed files with 25485 additions and 18076 deletions
|
@ -64,16 +64,11 @@ impl WebGLExtension for ANGLEInstancedArrays {
|
|||
|
||||
impl ANGLEInstancedArraysMethods for ANGLEInstancedArrays {
|
||||
// https://www.khronos.org/registry/webgl/extensions/ANGLE_instanced_arrays/
|
||||
fn DrawArraysInstancedANGLE(
|
||||
&self,
|
||||
mode: u32,
|
||||
first: i32,
|
||||
count: i32,
|
||||
primcount: i32,
|
||||
) {
|
||||
fn DrawArraysInstancedANGLE(&self, mode: u32, first: i32, count: i32, primcount: i32) {
|
||||
handle_potential_webgl_error!(
|
||||
self.ctx,
|
||||
self.ctx.draw_arrays_instanced(mode, first, count, primcount)
|
||||
self.ctx
|
||||
.draw_arrays_instanced(mode, first, count, primcount)
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -88,7 +83,8 @@ impl ANGLEInstancedArraysMethods for ANGLEInstancedArrays {
|
|||
) {
|
||||
handle_potential_webgl_error!(
|
||||
self.ctx,
|
||||
self.ctx.draw_elements_instanced(mode, count, type_, offset, primcount)
|
||||
self.ctx
|
||||
.draw_elements_instanced(mode, count, type_, offset, primcount)
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,9 @@ pub struct EXTBlendMinmax {
|
|||
|
||||
impl EXTBlendMinmax {
|
||||
fn new_inherited() -> Self {
|
||||
Self { reflector_: Reflector::new() }
|
||||
Self {
|
||||
reflector_: Reflector::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,9 @@ pub struct EXTShaderTextureLod {
|
|||
|
||||
impl EXTShaderTextureLod {
|
||||
fn new_inherited() -> Self {
|
||||
Self { reflector_: Reflector::new() }
|
||||
Self {
|
||||
reflector_: Reflector::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -44,8 +44,12 @@ impl WebGLExtension for EXTTextureFilterAnisotropic {
|
|||
}
|
||||
|
||||
fn enable(ext: &WebGLExtensions) {
|
||||
ext.enable_get_tex_parameter_name(EXTTextureFilterAnisotropicConstants::TEXTURE_MAX_ANISOTROPY_EXT);
|
||||
ext.enable_get_parameter_name(EXTTextureFilterAnisotropicConstants::MAX_TEXTURE_MAX_ANISOTROPY_EXT);
|
||||
ext.enable_get_tex_parameter_name(
|
||||
EXTTextureFilterAnisotropicConstants::TEXTURE_MAX_ANISOTROPY_EXT,
|
||||
);
|
||||
ext.enable_get_parameter_name(
|
||||
EXTTextureFilterAnisotropicConstants::MAX_TEXTURE_MAX_ANISOTROPY_EXT,
|
||||
);
|
||||
}
|
||||
|
||||
fn name() -> &'static str {
|
||||
|
|
|
@ -17,7 +17,9 @@ pub struct OESElementIndexUint {
|
|||
|
||||
impl OESElementIndexUint {
|
||||
fn new_inherited() -> Self {
|
||||
Self { reflector_: Reflector::new() }
|
||||
Self {
|
||||
reflector_: Reflector::new(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -27,9 +27,11 @@ impl OESStandardDerivatives {
|
|||
impl WebGLExtension for OESStandardDerivatives {
|
||||
type Extension = OESStandardDerivatives;
|
||||
fn new(ctx: &WebGLRenderingContext) -> DomRoot<OESStandardDerivatives> {
|
||||
reflect_dom_object(Box::new(OESStandardDerivatives::new_inherited()),
|
||||
&*ctx.global(),
|
||||
OESStandardDerivativesBinding::Wrap)
|
||||
reflect_dom_object(
|
||||
Box::new(OESStandardDerivatives::new_inherited()),
|
||||
&*ctx.global(),
|
||||
OESStandardDerivativesBinding::Wrap,
|
||||
)
|
||||
}
|
||||
|
||||
fn spec() -> WebGLExtensionSpec {
|
||||
|
@ -42,8 +44,12 @@ impl WebGLExtension for OESStandardDerivatives {
|
|||
}
|
||||
|
||||
fn enable(ext: &WebGLExtensions) {
|
||||
ext.enable_hint_target(OESStandardDerivativesConstants::FRAGMENT_SHADER_DERIVATIVE_HINT_OES);
|
||||
ext.enable_get_parameter_name(OESStandardDerivativesConstants::FRAGMENT_SHADER_DERIVATIVE_HINT_OES);
|
||||
ext.enable_hint_target(
|
||||
OESStandardDerivativesConstants::FRAGMENT_SHADER_DERIVATIVE_HINT_OES,
|
||||
);
|
||||
ext.enable_get_parameter_name(
|
||||
OESStandardDerivativesConstants::FRAGMENT_SHADER_DERIVATIVE_HINT_OES,
|
||||
);
|
||||
}
|
||||
|
||||
fn name() -> &'static str {
|
||||
|
|
|
@ -26,9 +26,11 @@ impl OESTextureFloat {
|
|||
impl WebGLExtension for OESTextureFloat {
|
||||
type Extension = OESTextureFloat;
|
||||
fn new(ctx: &WebGLRenderingContext) -> DomRoot<OESTextureFloat> {
|
||||
reflect_dom_object(Box::new(OESTextureFloat::new_inherited()),
|
||||
&*ctx.global(),
|
||||
OESTextureFloatBinding::Wrap)
|
||||
reflect_dom_object(
|
||||
Box::new(OESTextureFloat::new_inherited()),
|
||||
&*ctx.global(),
|
||||
OESTextureFloatBinding::Wrap,
|
||||
)
|
||||
}
|
||||
|
||||
fn spec() -> WebGLExtensionSpec {
|
||||
|
@ -36,9 +38,11 @@ impl WebGLExtension for OESTextureFloat {
|
|||
}
|
||||
|
||||
fn is_supported(ext: &WebGLExtensions) -> bool {
|
||||
ext.supports_any_gl_extension(&["GL_OES_texture_float",
|
||||
"GL_ARB_texture_float",
|
||||
"GL_EXT_color_buffer_float"])
|
||||
ext.supports_any_gl_extension(&[
|
||||
"GL_OES_texture_float",
|
||||
"GL_ARB_texture_float",
|
||||
"GL_EXT_color_buffer_float",
|
||||
])
|
||||
}
|
||||
|
||||
fn enable(ext: &WebGLExtensions) {
|
||||
|
@ -49,10 +53,17 @@ impl WebGLExtension for OESTextureFloat {
|
|||
// Special internal formats must be used to avoid clamped float values
|
||||
ext.add_effective_tex_internal_format(webgl::RGBA, webgl::FLOAT, gl::RGBA32F);
|
||||
ext.add_effective_tex_internal_format(webgl::RGB, webgl::FLOAT, gl::RGB32F);
|
||||
ext.add_effective_tex_internal_format(webgl::LUMINANCE, webgl::FLOAT, gl::LUMINANCE32F_ARB);
|
||||
ext.add_effective_tex_internal_format(
|
||||
webgl::LUMINANCE,
|
||||
webgl::FLOAT,
|
||||
gl::LUMINANCE32F_ARB,
|
||||
);
|
||||
ext.add_effective_tex_internal_format(webgl::ALPHA, webgl::FLOAT, gl::ALPHA32F_ARB);
|
||||
ext.add_effective_tex_internal_format(webgl::LUMINANCE_ALPHA, webgl::FLOAT,
|
||||
gl::LUMINANCE_ALPHA32F_ARB);
|
||||
ext.add_effective_tex_internal_format(
|
||||
webgl::LUMINANCE_ALPHA,
|
||||
webgl::FLOAT,
|
||||
gl::LUMINANCE_ALPHA32F_ARB,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -25,9 +25,11 @@ impl OESTextureFloatLinear {
|
|||
impl WebGLExtension for OESTextureFloatLinear {
|
||||
type Extension = OESTextureFloatLinear;
|
||||
fn new(ctx: &WebGLRenderingContext) -> DomRoot<OESTextureFloatLinear> {
|
||||
reflect_dom_object(Box::new(OESTextureFloatLinear::new_inherited()),
|
||||
&*ctx.global(),
|
||||
OESTextureFloatLinearBinding::Wrap)
|
||||
reflect_dom_object(
|
||||
Box::new(OESTextureFloatLinear::new_inherited()),
|
||||
&*ctx.global(),
|
||||
OESTextureFloatLinearBinding::Wrap,
|
||||
)
|
||||
}
|
||||
|
||||
fn spec() -> WebGLExtensionSpec {
|
||||
|
@ -35,8 +37,7 @@ impl WebGLExtension for OESTextureFloatLinear {
|
|||
}
|
||||
|
||||
fn is_supported(ext: &WebGLExtensions) -> bool {
|
||||
ext.supports_any_gl_extension(&["GL_OES_texture_float_linear",
|
||||
"GL_ARB_texture_float"])
|
||||
ext.supports_any_gl_extension(&["GL_OES_texture_float_linear", "GL_ARB_texture_float"])
|
||||
}
|
||||
|
||||
fn enable(ext: &WebGLExtensions) {
|
||||
|
|
|
@ -26,9 +26,11 @@ impl OESTextureHalfFloat {
|
|||
impl WebGLExtension for OESTextureHalfFloat {
|
||||
type Extension = OESTextureHalfFloat;
|
||||
fn new(ctx: &WebGLRenderingContext) -> DomRoot<OESTextureHalfFloat> {
|
||||
reflect_dom_object(Box::new(OESTextureHalfFloat::new_inherited()),
|
||||
&*ctx.global(),
|
||||
OESTextureHalfFloatBinding::Wrap)
|
||||
reflect_dom_object(
|
||||
Box::new(OESTextureHalfFloat::new_inherited()),
|
||||
&*ctx.global(),
|
||||
OESTextureHalfFloatBinding::Wrap,
|
||||
)
|
||||
}
|
||||
|
||||
fn spec() -> WebGLExtensionSpec {
|
||||
|
@ -36,10 +38,12 @@ impl WebGLExtension for OESTextureHalfFloat {
|
|||
}
|
||||
|
||||
fn is_supported(ext: &WebGLExtensions) -> bool {
|
||||
ext.supports_any_gl_extension(&["GL_OES_texture_half_float",
|
||||
"GL_ARB_half_float_pixel",
|
||||
"GL_NV_half_float",
|
||||
"GL_EXT_color_buffer_half_float"])
|
||||
ext.supports_any_gl_extension(&[
|
||||
"GL_OES_texture_half_float",
|
||||
"GL_ARB_half_float_pixel",
|
||||
"GL_NV_half_float",
|
||||
"GL_EXT_color_buffer_half_float",
|
||||
])
|
||||
}
|
||||
|
||||
fn enable(ext: &WebGLExtensions) {
|
||||
|
@ -53,7 +57,11 @@ impl WebGLExtension for OESTextureHalfFloat {
|
|||
ext.add_effective_tex_internal_format(webgl::RGB, hf, gl::RGB16F);
|
||||
ext.add_effective_tex_internal_format(webgl::LUMINANCE, hf, gl::LUMINANCE16F_ARB);
|
||||
ext.add_effective_tex_internal_format(webgl::ALPHA, hf, gl::ALPHA16F_ARB);
|
||||
ext.add_effective_tex_internal_format(webgl::LUMINANCE_ALPHA, hf, gl::LUMINANCE_ALPHA16F_ARB);
|
||||
ext.add_effective_tex_internal_format(
|
||||
webgl::LUMINANCE_ALPHA,
|
||||
hf,
|
||||
gl::LUMINANCE_ALPHA16F_ARB,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -26,9 +26,11 @@ impl OESTextureHalfFloatLinear {
|
|||
impl WebGLExtension for OESTextureHalfFloatLinear {
|
||||
type Extension = OESTextureHalfFloatLinear;
|
||||
fn new(ctx: &WebGLRenderingContext) -> DomRoot<OESTextureHalfFloatLinear> {
|
||||
reflect_dom_object(Box::new(OESTextureHalfFloatLinear::new_inherited()),
|
||||
&*ctx.global(),
|
||||
OESTextureHalfFloatLinearBinding::Wrap)
|
||||
reflect_dom_object(
|
||||
Box::new(OESTextureHalfFloatLinear::new_inherited()),
|
||||
&*ctx.global(),
|
||||
OESTextureHalfFloatLinearBinding::Wrap,
|
||||
)
|
||||
}
|
||||
|
||||
fn spec() -> WebGLExtensionSpec {
|
||||
|
@ -36,9 +38,11 @@ impl WebGLExtension for OESTextureHalfFloatLinear {
|
|||
}
|
||||
|
||||
fn is_supported(ext: &WebGLExtensions) -> bool {
|
||||
ext.supports_any_gl_extension(&["GL_OES_texture_float_linear",
|
||||
"GL_ARB_half_float_pixel",
|
||||
"GL_NV_half_float"])
|
||||
ext.supports_any_gl_extension(&[
|
||||
"GL_OES_texture_float_linear",
|
||||
"GL_ARB_half_float_pixel",
|
||||
"GL_NV_half_float",
|
||||
])
|
||||
}
|
||||
|
||||
fn enable(ext: &WebGLExtensions) {
|
||||
|
|
|
@ -52,9 +52,11 @@ impl OESVertexArrayObjectMethods for OESVertexArrayObject {
|
|||
impl WebGLExtension for OESVertexArrayObject {
|
||||
type Extension = OESVertexArrayObject;
|
||||
fn new(ctx: &WebGLRenderingContext) -> DomRoot<OESVertexArrayObject> {
|
||||
reflect_dom_object(Box::new(OESVertexArrayObject::new_inherited(ctx)),
|
||||
&*ctx.global(),
|
||||
OESVertexArrayObjectBinding::Wrap)
|
||||
reflect_dom_object(
|
||||
Box::new(OESVertexArrayObject::new_inherited(ctx)),
|
||||
&*ctx.global(),
|
||||
OESVertexArrayObjectBinding::Wrap,
|
||||
)
|
||||
}
|
||||
|
||||
fn spec() -> WebGLExtensionSpec {
|
||||
|
@ -62,9 +64,11 @@ impl WebGLExtension for OESVertexArrayObject {
|
|||
}
|
||||
|
||||
fn is_supported(ext: &WebGLExtensions) -> bool {
|
||||
ext.supports_any_gl_extension(&["GL_OES_vertex_array_object",
|
||||
"GL_ARB_vertex_array_object",
|
||||
"GL_APPLE_vertex_array_object"])
|
||||
ext.supports_any_gl_extension(&[
|
||||
"GL_OES_vertex_array_object",
|
||||
"GL_ARB_vertex_array_object",
|
||||
"GL_APPLE_vertex_array_object",
|
||||
])
|
||||
}
|
||||
|
||||
fn enable(ext: &WebGLExtensions) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue