Add trait DomObjectWrap to provide WRAP function

This commit is contained in:
YUAN LYU 2020-03-20 22:14:18 -04:00
parent ca29399bab
commit 3ea6d87bcc
No known key found for this signature in database
GPG key ID: 63A93E6A451DD166
353 changed files with 327 additions and 1236 deletions

View file

@ -3,7 +3,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use super::{WebGLExtension, WebGLExtensionSpec, WebGLExtensions};
use crate::dom::bindings::codegen::Bindings::ANGLEInstancedArraysBinding;
use crate::dom::bindings::codegen::Bindings::ANGLEInstancedArraysBinding::ANGLEInstancedArraysConstants;
use crate::dom::bindings::codegen::Bindings::ANGLEInstancedArraysBinding::ANGLEInstancedArraysMethods;
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
@ -34,7 +33,6 @@ impl WebGLExtension for ANGLEInstancedArrays {
reflect_dom_object(
Box::new(ANGLEInstancedArrays::new_inherited(ctx)),
&*ctx.global(),
ANGLEInstancedArraysBinding::Wrap,
)
}

View file

@ -3,7 +3,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use super::{WebGLExtension, WebGLExtensionSpec, WebGLExtensions};
use crate::dom::bindings::codegen::Bindings::EXTBlendMinmaxBinding;
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
use crate::dom::bindings::root::DomRoot;
use crate::dom::webglrenderingcontext::WebGLRenderingContext;
@ -27,11 +26,7 @@ impl WebGLExtension for EXTBlendMinmax {
type Extension = Self;
fn new(ctx: &WebGLRenderingContext) -> DomRoot<Self> {
reflect_dom_object(
Box::new(Self::new_inherited()),
&*ctx.global(),
EXTBlendMinmaxBinding::Wrap,
)
reflect_dom_object(Box::new(Self::new_inherited()), &*ctx.global())
}
fn spec() -> WebGLExtensionSpec {

View file

@ -3,7 +3,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use super::{WebGLExtension, WebGLExtensionSpec, WebGLExtensions};
use crate::dom::bindings::codegen::Bindings::EXTColorBufferHalfFloatBinding;
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
use crate::dom::bindings::root::DomRoot;
use crate::dom::webgl_extensions::ext::oestexturehalffloat::OESTextureHalfFloat;
@ -30,7 +29,6 @@ impl WebGLExtension for EXTColorBufferHalfFloat {
reflect_dom_object(
Box::new(EXTColorBufferHalfFloat::new_inherited()),
&*ctx.global(),
EXTColorBufferHalfFloatBinding::Wrap,
)
}

View file

@ -3,7 +3,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use super::{WebGLExtension, WebGLExtensionSpec, WebGLExtensions};
use crate::dom::bindings::codegen::Bindings::EXTShaderTextureLodBinding;
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
use crate::dom::bindings::root::DomRoot;
use crate::dom::webglrenderingcontext::WebGLRenderingContext;
@ -27,11 +26,7 @@ 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,
)
reflect_dom_object(Box::new(Self::new_inherited()), &*ctx.global())
}
fn spec() -> WebGLExtensionSpec {

View file

@ -3,7 +3,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use super::{WebGLExtension, WebGLExtensionSpec, WebGLExtensions};
use crate::dom::bindings::codegen::Bindings::EXTTextureFilterAnisotropicBinding;
use crate::dom::bindings::codegen::Bindings::EXTTextureFilterAnisotropicBinding::EXTTextureFilterAnisotropicConstants;
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
use crate::dom::bindings::root::DomRoot;
@ -28,11 +27,7 @@ impl WebGLExtension for EXTTextureFilterAnisotropic {
type Extension = EXTTextureFilterAnisotropic;
fn new(ctx: &WebGLRenderingContext) -> DomRoot<Self> {
reflect_dom_object(
Box::new(Self::new_inherited()),
&*ctx.global(),
EXTTextureFilterAnisotropicBinding::Wrap,
)
reflect_dom_object(Box::new(Self::new_inherited()), &*ctx.global())
}
fn spec() -> WebGLExtensionSpec {

View file

@ -3,7 +3,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use super::{WebGLExtension, WebGLExtensionSpec, WebGLExtensions};
use crate::dom::bindings::codegen::Bindings::OESElementIndexUintBinding;
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
use crate::dom::bindings::root::DomRoot;
use crate::dom::webglrenderingcontext::WebGLRenderingContext;
@ -30,7 +29,6 @@ impl WebGLExtension for OESElementIndexUint {
reflect_dom_object(
Box::new(OESElementIndexUint::new_inherited()),
&*ctx.global(),
OESElementIndexUintBinding::Wrap,
)
}

View file

@ -3,7 +3,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use super::{WebGLExtension, WebGLExtensionSpec, WebGLExtensions};
use crate::dom::bindings::codegen::Bindings::OESStandardDerivativesBinding;
use crate::dom::bindings::codegen::Bindings::OESStandardDerivativesBinding::OESStandardDerivativesConstants;
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
use crate::dom::bindings::root::DomRoot;
@ -30,7 +29,6 @@ impl WebGLExtension for OESStandardDerivatives {
reflect_dom_object(
Box::new(OESStandardDerivatives::new_inherited()),
&*ctx.global(),
OESStandardDerivativesBinding::Wrap,
)
}

View file

@ -5,7 +5,6 @@
use super::{
constants as webgl, ext_constants as gl, WebGLExtension, WebGLExtensionSpec, WebGLExtensions,
};
use crate::dom::bindings::codegen::Bindings::OESTextureFloatBinding;
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
use crate::dom::bindings::root::DomRoot;
use crate::dom::webglrenderingcontext::WebGLRenderingContext;
@ -28,11 +27,7 @@ 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())
}
fn spec() -> WebGLExtensionSpec {

View file

@ -3,7 +3,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use super::{constants as webgl, WebGLExtension, WebGLExtensionSpec, WebGLExtensions};
use crate::dom::bindings::codegen::Bindings::OESTextureFloatLinearBinding;
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
use crate::dom::bindings::root::DomRoot;
use crate::dom::webglrenderingcontext::WebGLRenderingContext;
@ -28,7 +27,6 @@ impl WebGLExtension for OESTextureFloatLinear {
reflect_dom_object(
Box::new(OESTextureFloatLinear::new_inherited()),
&*ctx.global(),
OESTextureFloatLinearBinding::Wrap,
)
}

View file

@ -5,9 +5,7 @@
use super::{
constants as webgl, ext_constants as gl, WebGLExtension, WebGLExtensionSpec, WebGLExtensions,
};
use crate::dom::bindings::codegen::Bindings::OESTextureHalfFloatBinding::{
self, OESTextureHalfFloatConstants,
};
use crate::dom::bindings::codegen::Bindings::OESTextureHalfFloatBinding::OESTextureHalfFloatConstants;
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
use crate::dom::bindings::root::DomRoot;
use crate::dom::webglrenderingcontext::WebGLRenderingContext;
@ -33,7 +31,6 @@ impl WebGLExtension for OESTextureHalfFloat {
reflect_dom_object(
Box::new(OESTextureHalfFloat::new_inherited()),
&*ctx.global(),
OESTextureHalfFloatBinding::Wrap,
)
}

View file

@ -4,7 +4,6 @@
use super::{WebGLExtension, WebGLExtensionSpec, WebGLExtensions};
use crate::dom::bindings::codegen::Bindings::OESTextureHalfFloatBinding::OESTextureHalfFloatConstants;
use crate::dom::bindings::codegen::Bindings::OESTextureHalfFloatLinearBinding;
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
use crate::dom::bindings::root::DomRoot;
use crate::dom::webglrenderingcontext::WebGLRenderingContext;
@ -29,7 +28,6 @@ impl WebGLExtension for OESTextureHalfFloatLinear {
reflect_dom_object(
Box::new(OESTextureHalfFloatLinear::new_inherited()),
&*ctx.global(),
OESTextureHalfFloatLinearBinding::Wrap,
)
}

View file

@ -4,9 +4,7 @@
use super::{WebGLExtension, WebGLExtensionSpec, WebGLExtensions};
use crate::dom::bindings::codegen::Bindings::OESVertexArrayObjectBinding::OESVertexArrayObjectConstants;
use crate::dom::bindings::codegen::Bindings::OESVertexArrayObjectBinding::{
self, OESVertexArrayObjectMethods,
};
use crate::dom::bindings::codegen::Bindings::OESVertexArrayObjectBinding::OESVertexArrayObjectMethods;
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
use crate::dom::bindings::root::{Dom, DomRoot};
use crate::dom::webglrenderingcontext::WebGLRenderingContext;
@ -57,7 +55,6 @@ impl WebGLExtension for OESVertexArrayObject {
reflect_dom_object(
Box::new(OESVertexArrayObject::new_inherited(ctx)),
&*ctx.global(),
OESVertexArrayObjectBinding::Wrap,
)
}

View file

@ -3,7 +3,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use super::{WebGLExtension, WebGLExtensionSpec, WebGLExtensions};
use crate::dom::bindings::codegen::Bindings::WEBGLColorBufferFloatBinding;
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
use crate::dom::bindings::root::DomRoot;
use crate::dom::webgl_extensions::ext::oestexturefloat::OESTextureFloat;
@ -30,7 +29,6 @@ impl WebGLExtension for WEBGLColorBufferFloat {
reflect_dom_object(
Box::new(WEBGLColorBufferFloat::new_inherited()),
&*ctx.global(),
WEBGLColorBufferFloatBinding::Wrap,
)
}

View file

@ -3,7 +3,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use super::{WebGLExtension, WebGLExtensionSpec, WebGLExtensions};
use crate::dom::bindings::codegen::Bindings::WEBGLCompressedTextureETC1Binding;
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
use crate::dom::bindings::root::DomRoot;
use crate::dom::webglrenderingcontext::WebGLRenderingContext;
@ -30,7 +29,6 @@ impl WebGLExtension for WEBGLCompressedTextureETC1 {
reflect_dom_object(
Box::new(WEBGLCompressedTextureETC1::new_inherited()),
&*ctx.global(),
WEBGLCompressedTextureETC1Binding::Wrap,
)
}

View file

@ -3,7 +3,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use super::{WebGLExtension, WebGLExtensionSpec, WebGLExtensions};
use crate::dom::bindings::codegen::Bindings::WEBGLCompressedTextureS3TCBinding;
use crate::dom::bindings::reflector::{reflect_dom_object, DomObject, Reflector};
use crate::dom::bindings::root::DomRoot;
use crate::dom::webglrenderingcontext::WebGLRenderingContext;
@ -30,7 +29,6 @@ impl WebGLExtension for WEBGLCompressedTextureS3TC {
reflect_dom_object(
Box::new(WEBGLCompressedTextureS3TC::new_inherited()),
&*ctx.global(),
WEBGLCompressedTextureS3TCBinding::Wrap,
)
}