mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
script: Limit public exports. (#34915)
* script: Restrict reexport visibility of DOM types. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Mass pub->pub(crate) conversion. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * script: Hide existing dead code warnings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix clippy warnings. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix unit tests. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * Fix clippy. Signed-off-by: Josh Matthews <josh@joshmatthews.net> * More formatting. Signed-off-by: Josh Matthews <josh@joshmatthews.net> --------- Signed-off-by: Josh Matthews <josh@joshmatthews.net>
This commit is contained in:
parent
f220d6d3a5
commit
c94d909a86
585 changed files with 5411 additions and 5013 deletions
|
@ -15,7 +15,7 @@ use crate::dom::webglrenderingcontext::WebGLRenderingContext;
|
|||
use crate::script_runtime::CanGc;
|
||||
|
||||
#[dom_struct]
|
||||
pub struct ANGLEInstancedArrays {
|
||||
pub(crate) struct ANGLEInstancedArrays {
|
||||
reflector_: Reflector,
|
||||
ctx: Dom<WebGLRenderingContext>,
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@ use crate::dom::webglrenderingcontext::WebGLRenderingContext;
|
|||
use crate::script_runtime::CanGc;
|
||||
|
||||
#[dom_struct]
|
||||
pub struct EXTBlendMinmax {
|
||||
pub(crate) struct EXTBlendMinmax {
|
||||
reflector_: Reflector,
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ use crate::dom::webglrenderingcontext::WebGLRenderingContext;
|
|||
use crate::script_runtime::CanGc;
|
||||
|
||||
#[dom_struct]
|
||||
pub struct EXTColorBufferHalfFloat {
|
||||
pub(crate) struct EXTColorBufferHalfFloat {
|
||||
reflector_: Reflector,
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ use crate::dom::webglrenderingcontext::WebGLRenderingContext;
|
|||
use crate::script_runtime::CanGc;
|
||||
|
||||
#[dom_struct]
|
||||
pub struct EXTFragDepth {
|
||||
pub(crate) struct EXTFragDepth {
|
||||
reflector_: Reflector,
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ use crate::dom::webglrenderingcontext::WebGLRenderingContext;
|
|||
use crate::script_runtime::CanGc;
|
||||
|
||||
#[dom_struct]
|
||||
pub struct EXTShaderTextureLod {
|
||||
pub(crate) struct EXTShaderTextureLod {
|
||||
reflector_: Reflector,
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ use crate::dom::webglrenderingcontext::WebGLRenderingContext;
|
|||
use crate::script_runtime::CanGc;
|
||||
|
||||
#[dom_struct]
|
||||
pub struct EXTTextureFilterAnisotropic {
|
||||
pub(crate) struct EXTTextureFilterAnisotropic {
|
||||
reflector_: Reflector,
|
||||
}
|
||||
|
||||
|
|
|
@ -5,19 +5,19 @@
|
|||
use super::{WebGLExtension, WebGLExtensionSpec, WebGLExtensions};
|
||||
use crate::dom::bindings::codegen::Bindings::WebGLRenderingContextBinding::WebGLRenderingContextConstants as constants;
|
||||
|
||||
pub mod angleinstancedarrays;
|
||||
pub mod extblendminmax;
|
||||
pub mod extcolorbufferhalffloat;
|
||||
pub mod extfragdepth;
|
||||
pub mod extshadertexturelod;
|
||||
pub mod exttexturefilteranisotropic;
|
||||
pub mod oeselementindexuint;
|
||||
pub mod oesstandardderivatives;
|
||||
pub mod oestexturefloat;
|
||||
pub mod oestexturefloatlinear;
|
||||
pub mod oestexturehalffloat;
|
||||
pub mod oestexturehalffloatlinear;
|
||||
pub mod oesvertexarrayobject;
|
||||
pub mod webglcolorbufferfloat;
|
||||
pub mod webglcompressedtextureetc1;
|
||||
pub mod webglcompressedtextures3tc;
|
||||
pub(crate) mod angleinstancedarrays;
|
||||
pub(crate) mod extblendminmax;
|
||||
pub(crate) mod extcolorbufferhalffloat;
|
||||
pub(crate) mod extfragdepth;
|
||||
pub(crate) mod extshadertexturelod;
|
||||
pub(crate) mod exttexturefilteranisotropic;
|
||||
pub(crate) mod oeselementindexuint;
|
||||
pub(crate) mod oesstandardderivatives;
|
||||
pub(crate) mod oestexturefloat;
|
||||
pub(crate) mod oestexturefloatlinear;
|
||||
pub(crate) mod oestexturehalffloat;
|
||||
pub(crate) mod oestexturehalffloatlinear;
|
||||
pub(crate) mod oesvertexarrayobject;
|
||||
pub(crate) mod webglcolorbufferfloat;
|
||||
pub(crate) mod webglcompressedtextureetc1;
|
||||
pub(crate) mod webglcompressedtextures3tc;
|
||||
|
|
|
@ -12,7 +12,7 @@ use crate::dom::webglrenderingcontext::WebGLRenderingContext;
|
|||
use crate::script_runtime::CanGc;
|
||||
|
||||
#[dom_struct]
|
||||
pub struct OESElementIndexUint {
|
||||
pub(crate) struct OESElementIndexUint {
|
||||
reflector_: Reflector,
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ use crate::dom::webglrenderingcontext::WebGLRenderingContext;
|
|||
use crate::script_runtime::CanGc;
|
||||
|
||||
#[dom_struct]
|
||||
pub struct OESStandardDerivatives {
|
||||
pub(crate) struct OESStandardDerivatives {
|
||||
reflector_: Reflector,
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ use crate::dom::webglrenderingcontext::WebGLRenderingContext;
|
|||
use crate::script_runtime::CanGc;
|
||||
|
||||
#[dom_struct]
|
||||
pub struct OESTextureFloat {
|
||||
pub(crate) struct OESTextureFloat {
|
||||
reflector_: Reflector,
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ use crate::dom::webglrenderingcontext::WebGLRenderingContext;
|
|||
use crate::script_runtime::CanGc;
|
||||
|
||||
#[dom_struct]
|
||||
pub struct OESTextureFloatLinear {
|
||||
pub(crate) struct OESTextureFloatLinear {
|
||||
reflector_: Reflector,
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ use crate::dom::webglrenderingcontext::WebGLRenderingContext;
|
|||
use crate::script_runtime::CanGc;
|
||||
|
||||
#[dom_struct]
|
||||
pub struct OESTextureHalfFloat {
|
||||
pub(crate) struct OESTextureHalfFloat {
|
||||
reflector_: Reflector,
|
||||
}
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ use crate::dom::webglrenderingcontext::WebGLRenderingContext;
|
|||
use crate::script_runtime::CanGc;
|
||||
|
||||
#[dom_struct]
|
||||
pub struct OESTextureHalfFloatLinear {
|
||||
pub(crate) struct OESTextureHalfFloatLinear {
|
||||
reflector_: Reflector,
|
||||
}
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ use crate::dom::webglvertexarrayobjectoes::WebGLVertexArrayObjectOES;
|
|||
use crate::script_runtime::CanGc;
|
||||
|
||||
#[dom_struct]
|
||||
pub struct OESVertexArrayObject {
|
||||
pub(crate) struct OESVertexArrayObject {
|
||||
reflector_: Reflector,
|
||||
ctx: Dom<WebGLRenderingContext>,
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ use crate::dom::webglrenderingcontext::WebGLRenderingContext;
|
|||
use crate::script_runtime::CanGc;
|
||||
|
||||
#[dom_struct]
|
||||
pub struct WEBGLColorBufferFloat {
|
||||
pub(crate) struct WEBGLColorBufferFloat {
|
||||
reflector_: Reflector,
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ use crate::dom::webgltexture::{TexCompression, TexCompressionValidation};
|
|||
use crate::script_runtime::CanGc;
|
||||
|
||||
#[dom_struct]
|
||||
pub struct WEBGLCompressedTextureETC1 {
|
||||
pub(crate) struct WEBGLCompressedTextureETC1 {
|
||||
reflector_: Reflector,
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ use crate::dom::webgltexture::{TexCompression, TexCompressionValidation};
|
|||
use crate::script_runtime::CanGc;
|
||||
|
||||
#[dom_struct]
|
||||
pub struct WEBGLCompressedTextureS3TC {
|
||||
pub(crate) struct WEBGLCompressedTextureS3TC {
|
||||
reflector_: Reflector,
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ use crate::dom::bindings::trace::JSTraceable;
|
|||
use crate::dom::webglrenderingcontext::WebGLRenderingContext;
|
||||
|
||||
/// Trait implemented by WebGL extensions.
|
||||
pub trait WebGLExtension: Sized
|
||||
pub(crate) trait WebGLExtension: Sized
|
||||
where
|
||||
Self::Extension: DomObject + JSTraceable,
|
||||
{
|
||||
|
@ -34,7 +34,7 @@ where
|
|||
fn name() -> &'static str;
|
||||
}
|
||||
|
||||
pub enum WebGLExtensionSpec {
|
||||
pub(crate) enum WebGLExtensionSpec {
|
||||
/// Extensions written against both WebGL and WebGL2 specs.
|
||||
All,
|
||||
/// Extensions writen against a specific WebGL version spec.
|
||||
|
|
|
@ -166,7 +166,7 @@ impl WebGLExtensionFeatures {
|
|||
/// Handles the list of implemented, supported and enabled WebGL extensions.
|
||||
#[crown::unrooted_must_root_lint::must_root]
|
||||
#[derive(JSTraceable, MallocSizeOf)]
|
||||
pub struct WebGLExtensions {
|
||||
pub(crate) struct WebGLExtensions {
|
||||
extensions: DomRefCell<HashMap<String, Box<dyn WebGLExtensionWrapper>>>,
|
||||
features: DomRefCell<WebGLExtensionFeatures>,
|
||||
#[no_trace]
|
||||
|
@ -178,7 +178,7 @@ pub struct WebGLExtensions {
|
|||
}
|
||||
|
||||
impl WebGLExtensions {
|
||||
pub fn new(
|
||||
pub(crate) fn new(
|
||||
webgl_version: WebGLVersion,
|
||||
api_type: GlType,
|
||||
glsl_version: WebGLSLVersion,
|
||||
|
@ -192,7 +192,7 @@ impl WebGLExtensions {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn init_once<F>(&self, cb: F)
|
||||
pub(crate) fn init_once<F>(&self, cb: F)
|
||||
where
|
||||
F: FnOnce() -> String,
|
||||
{
|
||||
|
@ -204,14 +204,14 @@ impl WebGLExtensions {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn register<T: 'static + WebGLExtension + JSTraceable + MallocSizeOf>(&self) {
|
||||
pub(crate) fn register<T: 'static + WebGLExtension + JSTraceable + MallocSizeOf>(&self) {
|
||||
let name = T::name().to_uppercase();
|
||||
self.extensions
|
||||
.borrow_mut()
|
||||
.insert(name, Box::new(TypedWebGLExtensionWrapper::<T>::new()));
|
||||
}
|
||||
|
||||
pub fn get_supported_extensions(&self) -> Vec<&'static str> {
|
||||
pub(crate) fn get_supported_extensions(&self) -> Vec<&'static str> {
|
||||
self.extensions
|
||||
.borrow()
|
||||
.iter()
|
||||
|
@ -227,7 +227,7 @@ impl WebGLExtensions {
|
|||
.collect()
|
||||
}
|
||||
|
||||
pub fn get_or_init_extension(
|
||||
pub(crate) fn get_or_init_extension(
|
||||
&self,
|
||||
name: &str,
|
||||
ctx: &WebGLRenderingContext,
|
||||
|
@ -242,7 +242,7 @@ impl WebGLExtensions {
|
|||
})
|
||||
}
|
||||
|
||||
pub fn is_enabled<T>(&self) -> bool
|
||||
pub(crate) fn is_enabled<T>(&self) -> bool
|
||||
where
|
||||
T: 'static + WebGLExtension + JSTraceable + MallocSizeOf,
|
||||
{
|
||||
|
@ -253,32 +253,32 @@ impl WebGLExtensions {
|
|||
.is_some_and(|ext| ext.is_enabled())
|
||||
}
|
||||
|
||||
pub fn supports_gl_extension(&self, name: &str) -> bool {
|
||||
pub(crate) fn supports_gl_extension(&self, name: &str) -> bool {
|
||||
self.features.borrow().gl_extensions.contains(name)
|
||||
}
|
||||
|
||||
pub fn supports_any_gl_extension(&self, names: &[&str]) -> bool {
|
||||
pub(crate) fn supports_any_gl_extension(&self, names: &[&str]) -> bool {
|
||||
let features = self.features.borrow();
|
||||
names
|
||||
.iter()
|
||||
.any(|name| features.gl_extensions.contains(*name))
|
||||
}
|
||||
|
||||
pub fn supports_all_gl_extension(&self, names: &[&str]) -> bool {
|
||||
pub(crate) fn supports_all_gl_extension(&self, names: &[&str]) -> bool {
|
||||
let features = self.features.borrow();
|
||||
names
|
||||
.iter()
|
||||
.all(|name| features.gl_extensions.contains(*name))
|
||||
}
|
||||
|
||||
pub fn enable_tex_type(&self, data_type: GLenum) {
|
||||
pub(crate) fn enable_tex_type(&self, data_type: GLenum) {
|
||||
self.features
|
||||
.borrow_mut()
|
||||
.disabled_tex_types
|
||||
.remove(&data_type);
|
||||
}
|
||||
|
||||
pub fn is_tex_type_enabled(&self, data_type: GLenum) -> bool {
|
||||
pub(crate) fn is_tex_type_enabled(&self, data_type: GLenum) -> bool {
|
||||
!self
|
||||
.features
|
||||
.borrow()
|
||||
|
@ -286,7 +286,7 @@ impl WebGLExtensions {
|
|||
.contains(&data_type)
|
||||
}
|
||||
|
||||
pub fn add_effective_tex_internal_format(
|
||||
pub(crate) fn add_effective_tex_internal_format(
|
||||
&self,
|
||||
source_internal_format: TexFormat,
|
||||
source_data_type: u32,
|
||||
|
@ -299,7 +299,7 @@ impl WebGLExtensions {
|
|||
.insert(format, effective_internal_format);
|
||||
}
|
||||
|
||||
pub fn get_effective_tex_internal_format(
|
||||
pub(crate) fn get_effective_tex_internal_format(
|
||||
&self,
|
||||
source_internal_format: TexFormat,
|
||||
source_data_type: u32,
|
||||
|
@ -313,14 +313,14 @@ impl WebGLExtensions {
|
|||
.unwrap_or(&source_internal_format))
|
||||
}
|
||||
|
||||
pub fn enable_filterable_tex_type(&self, text_data_type: GLenum) {
|
||||
pub(crate) fn enable_filterable_tex_type(&self, text_data_type: GLenum) {
|
||||
self.features
|
||||
.borrow_mut()
|
||||
.not_filterable_tex_types
|
||||
.remove(&text_data_type);
|
||||
}
|
||||
|
||||
pub fn is_filterable(&self, text_data_type: u32) -> bool {
|
||||
pub(crate) fn is_filterable(&self, text_data_type: u32) -> bool {
|
||||
!self
|
||||
.features
|
||||
.borrow()
|
||||
|
@ -328,22 +328,22 @@ impl WebGLExtensions {
|
|||
.contains(&text_data_type)
|
||||
}
|
||||
|
||||
pub fn enable_hint_target(&self, name: GLenum) {
|
||||
pub(crate) fn enable_hint_target(&self, name: GLenum) {
|
||||
self.features.borrow_mut().hint_targets.insert(name);
|
||||
}
|
||||
|
||||
pub fn is_hint_target_enabled(&self, name: GLenum) -> bool {
|
||||
pub(crate) fn is_hint_target_enabled(&self, name: GLenum) -> bool {
|
||||
self.features.borrow().hint_targets.contains(&name)
|
||||
}
|
||||
|
||||
pub fn enable_get_parameter_name(&self, name: GLenum) {
|
||||
pub(crate) fn enable_get_parameter_name(&self, name: GLenum) {
|
||||
self.features
|
||||
.borrow_mut()
|
||||
.disabled_get_parameter_names
|
||||
.remove(&name);
|
||||
}
|
||||
|
||||
pub fn is_get_parameter_name_enabled(&self, name: GLenum) -> bool {
|
||||
pub(crate) fn is_get_parameter_name_enabled(&self, name: GLenum) -> bool {
|
||||
!self
|
||||
.features
|
||||
.borrow()
|
||||
|
@ -351,14 +351,14 @@ impl WebGLExtensions {
|
|||
.contains(&name)
|
||||
}
|
||||
|
||||
pub fn enable_get_tex_parameter_name(&self, name: GLenum) {
|
||||
pub(crate) fn enable_get_tex_parameter_name(&self, name: GLenum) {
|
||||
self.features
|
||||
.borrow_mut()
|
||||
.disabled_get_tex_parameter_names
|
||||
.remove(&name);
|
||||
}
|
||||
|
||||
pub fn is_get_tex_parameter_name_enabled(&self, name: GLenum) -> bool {
|
||||
pub(crate) fn is_get_tex_parameter_name_enabled(&self, name: GLenum) -> bool {
|
||||
!self
|
||||
.features
|
||||
.borrow()
|
||||
|
@ -366,14 +366,14 @@ impl WebGLExtensions {
|
|||
.contains(&name)
|
||||
}
|
||||
|
||||
pub fn enable_get_vertex_attrib_name(&self, name: GLenum) {
|
||||
pub(crate) fn enable_get_vertex_attrib_name(&self, name: GLenum) {
|
||||
self.features
|
||||
.borrow_mut()
|
||||
.disabled_get_vertex_attrib_names
|
||||
.remove(&name);
|
||||
}
|
||||
|
||||
pub fn is_get_vertex_attrib_name_enabled(&self, name: GLenum) -> bool {
|
||||
pub(crate) fn is_get_vertex_attrib_name_enabled(&self, name: GLenum) -> bool {
|
||||
!self
|
||||
.features
|
||||
.borrow()
|
||||
|
@ -381,7 +381,7 @@ impl WebGLExtensions {
|
|||
.contains(&name)
|
||||
}
|
||||
|
||||
pub fn add_tex_compression_formats(&self, formats: &[TexCompression]) {
|
||||
pub(crate) fn add_tex_compression_formats(&self, formats: &[TexCompression]) {
|
||||
let formats: FnvHashMap<GLenum, TexCompression> = formats
|
||||
.iter()
|
||||
.map(|&compression| (compression.format.as_gl_constant(), compression))
|
||||
|
@ -393,7 +393,7 @@ impl WebGLExtensions {
|
|||
.extend(formats.iter());
|
||||
}
|
||||
|
||||
pub fn get_tex_compression_format(&self, format_id: GLenum) -> Option<TexCompression> {
|
||||
pub(crate) fn get_tex_compression_format(&self, format_id: GLenum) -> Option<TexCompression> {
|
||||
self.features
|
||||
.borrow()
|
||||
.tex_compression_formats
|
||||
|
@ -401,7 +401,7 @@ impl WebGLExtensions {
|
|||
.cloned()
|
||||
}
|
||||
|
||||
pub fn get_tex_compression_ids(&self) -> Vec<GLenum> {
|
||||
pub(crate) fn get_tex_compression_ids(&self) -> Vec<GLenum> {
|
||||
self.features
|
||||
.borrow()
|
||||
.tex_compression_formats
|
||||
|
@ -429,35 +429,35 @@ impl WebGLExtensions {
|
|||
self.register::<ext::webglcompressedtextures3tc::WEBGLCompressedTextureS3TC>();
|
||||
}
|
||||
|
||||
pub fn enable_element_index_uint(&self) {
|
||||
pub(crate) fn enable_element_index_uint(&self) {
|
||||
self.features.borrow_mut().element_index_uint_enabled = true;
|
||||
}
|
||||
|
||||
pub fn is_element_index_uint_enabled(&self) -> bool {
|
||||
pub(crate) fn is_element_index_uint_enabled(&self) -> bool {
|
||||
self.features.borrow().element_index_uint_enabled
|
||||
}
|
||||
|
||||
pub fn enable_blend_minmax(&self) {
|
||||
pub(crate) fn enable_blend_minmax(&self) {
|
||||
self.features.borrow_mut().blend_minmax_enabled = true;
|
||||
}
|
||||
|
||||
pub fn is_blend_minmax_enabled(&self) -> bool {
|
||||
pub(crate) fn is_blend_minmax_enabled(&self) -> bool {
|
||||
self.features.borrow().blend_minmax_enabled
|
||||
}
|
||||
|
||||
pub fn is_float_buffer_renderable(&self) -> bool {
|
||||
pub(crate) fn is_float_buffer_renderable(&self) -> bool {
|
||||
self.is_enabled::<WEBGLColorBufferFloat>() || self.is_enabled::<OESTextureFloat>()
|
||||
}
|
||||
|
||||
pub fn is_min_glsl_version_satisfied(&self, min_glsl_version: WebGLSLVersion) -> bool {
|
||||
pub(crate) fn is_min_glsl_version_satisfied(&self, min_glsl_version: WebGLSLVersion) -> bool {
|
||||
self.glsl_version >= min_glsl_version
|
||||
}
|
||||
|
||||
pub fn is_half_float_buffer_renderable(&self) -> bool {
|
||||
pub(crate) fn is_half_float_buffer_renderable(&self) -> bool {
|
||||
self.is_enabled::<EXTColorBufferHalfFloat>() || self.is_enabled::<OESTextureHalfFloat>()
|
||||
}
|
||||
|
||||
pub fn effective_type(&self, type_: u32) -> u32 {
|
||||
pub(crate) fn effective_type(&self, type_: u32) -> u32 {
|
||||
if type_ == OESTextureHalfFloatConstants::HALF_FLOAT_OES &&
|
||||
!self.supports_gl_extension("GL_OES_texture_half_float")
|
||||
{
|
||||
|
@ -466,7 +466,7 @@ impl WebGLExtensions {
|
|||
type_
|
||||
}
|
||||
|
||||
pub fn is_gles(&self) -> bool {
|
||||
pub(crate) fn is_gles(&self) -> bool {
|
||||
self.api_type == GlType::Gles
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
|
||||
|
||||
pub mod ext;
|
||||
pub(crate) mod ext;
|
||||
mod extension;
|
||||
mod extensions;
|
||||
mod wrapper;
|
||||
|
||||
pub use self::extension::{WebGLExtension, WebGLExtensionSpec};
|
||||
pub use self::extensions::WebGLExtensions;
|
||||
pub(crate) use self::extension::{WebGLExtension, WebGLExtensionSpec};
|
||||
pub(crate) use self::extensions::WebGLExtensions;
|
||||
|
|
|
@ -15,7 +15,7 @@ use crate::dom::webglrenderingcontext::WebGLRenderingContext;
|
|||
|
||||
/// Trait used internally by WebGLExtensions to store and
|
||||
/// handle the different WebGL extensions in a common list.
|
||||
pub trait WebGLExtensionWrapper: JSTraceable + MallocSizeOf {
|
||||
pub(crate) trait WebGLExtensionWrapper: JSTraceable + MallocSizeOf {
|
||||
fn instance_or_init(
|
||||
&self,
|
||||
ctx: &WebGLRenderingContext,
|
||||
|
@ -30,14 +30,14 @@ pub trait WebGLExtensionWrapper: JSTraceable + MallocSizeOf {
|
|||
|
||||
#[crown::unrooted_must_root_lint::must_root]
|
||||
#[derive(JSTraceable, MallocSizeOf)]
|
||||
pub struct TypedWebGLExtensionWrapper<T: WebGLExtension> {
|
||||
pub(crate) struct TypedWebGLExtensionWrapper<T: WebGLExtension> {
|
||||
extension: MutNullableDom<T::Extension>,
|
||||
}
|
||||
|
||||
/// Typed WebGL Extension implementation.
|
||||
/// Exposes the exact `MutNullableDom<DOMObject>` type defined by the extension.
|
||||
impl<T: WebGLExtension> TypedWebGLExtensionWrapper<T> {
|
||||
pub fn new() -> TypedWebGLExtensionWrapper<T> {
|
||||
pub(crate) fn new() -> TypedWebGLExtensionWrapper<T> {
|
||||
TypedWebGLExtensionWrapper {
|
||||
extension: MutNullableDom::new(None),
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue