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:
Josh Matthews 2025-01-10 03:19:19 -05:00 committed by GitHub
parent f220d6d3a5
commit c94d909a86
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
585 changed files with 5411 additions and 5013 deletions

View file

@ -15,7 +15,7 @@ use crate::dom::webglrenderingcontext::{Operation, WebGLRenderingContext};
use crate::script_runtime::CanGc;
#[dom_struct]
pub struct WebGLVertexArrayObject {
pub(crate) struct WebGLVertexArrayObject {
webgl_object_: WebGLObject,
array_object: VertexArrayObject,
}
@ -28,7 +28,10 @@ impl WebGLVertexArrayObject {
}
}
pub fn new(context: &WebGLRenderingContext, id: Option<WebGLVertexArrayId>) -> DomRoot<Self> {
pub(crate) fn new(
context: &WebGLRenderingContext,
id: Option<WebGLVertexArrayId>,
) -> DomRoot<Self> {
reflect_dom_object(
Box::new(WebGLVertexArrayObject::new_inherited(context, id)),
&*context.global(),
@ -36,39 +39,39 @@ impl WebGLVertexArrayObject {
)
}
pub fn id(&self) -> Option<WebGLVertexArrayId> {
pub(crate) fn id(&self) -> Option<WebGLVertexArrayId> {
self.array_object.id()
}
pub fn is_deleted(&self) -> bool {
pub(crate) fn is_deleted(&self) -> bool {
self.array_object.is_deleted()
}
pub fn delete(&self, operation_fallibility: Operation) {
pub(crate) fn delete(&self, operation_fallibility: Operation) {
self.array_object.delete(operation_fallibility);
}
pub fn ever_bound(&self) -> bool {
pub(crate) fn ever_bound(&self) -> bool {
self.array_object.ever_bound()
}
pub fn set_ever_bound(&self) {
pub(crate) fn set_ever_bound(&self) {
self.array_object.set_ever_bound();
}
pub fn element_array_buffer(&self) -> &MutNullableDom<WebGLBuffer> {
pub(crate) fn element_array_buffer(&self) -> &MutNullableDom<WebGLBuffer> {
self.array_object.element_array_buffer()
}
pub fn get_vertex_attrib(&self, index: u32) -> Option<Ref<VertexAttribData>> {
pub(crate) fn get_vertex_attrib(&self, index: u32) -> Option<Ref<VertexAttribData>> {
self.array_object.get_vertex_attrib(index)
}
pub fn set_vertex_attrib_type(&self, index: u32, type_: u32) {
pub(crate) fn set_vertex_attrib_type(&self, index: u32, type_: u32) {
self.array_object.set_vertex_attrib_type(index, type_);
}
pub fn vertex_attrib_pointer(
pub(crate) fn vertex_attrib_pointer(
&self,
index: u32,
size: i32,
@ -81,19 +84,19 @@ impl WebGLVertexArrayObject {
.vertex_attrib_pointer(index, size, type_, normalized, stride, offset)
}
pub fn vertex_attrib_divisor(&self, index: u32, value: u32) {
pub(crate) fn vertex_attrib_divisor(&self, index: u32, value: u32) {
self.array_object.vertex_attrib_divisor(index, value);
}
pub fn enabled_vertex_attrib_array(&self, index: u32, value: bool) {
pub(crate) fn enabled_vertex_attrib_array(&self, index: u32, value: bool) {
self.array_object.enabled_vertex_attrib_array(index, value);
}
pub fn unbind_buffer(&self, buffer: &WebGLBuffer) {
pub(crate) fn unbind_buffer(&self, buffer: &WebGLBuffer) {
self.array_object.unbind_buffer(buffer);
}
pub fn validate_for_draw(
pub(crate) fn validate_for_draw(
&self,
required_len: u32,
instance_count: u32,