diff options
author | Josh Matthews <josh@joshmatthews.net> | 2025-01-10 03:19:19 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-10 08:19:19 +0000 |
commit | c94d909a8688589209cdf0c7ae58e40f9b8c411e (patch) | |
tree | 12febf23eed4438249fd4d276c4d8b35dee22a97 /components/script/dom/webglbuffer.rs | |
parent | f220d6d3a52296794cd19935e9e59cc75a179a44 (diff) | |
download | servo-c94d909a8688589209cdf0c7ae58e40f9b8c411e.tar.gz servo-c94d909a8688589209cdf0c7ae58e40f9b8c411e.zip |
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>
Diffstat (limited to 'components/script/dom/webglbuffer.rs')
-rw-r--r-- | components/script/dom/webglbuffer.rs | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/components/script/dom/webglbuffer.rs b/components/script/dom/webglbuffer.rs index 2b057001eef..3060e5d4bf8 100644 --- a/components/script/dom/webglbuffer.rs +++ b/components/script/dom/webglbuffer.rs @@ -24,7 +24,7 @@ fn target_is_copy_buffer(target: u32) -> bool { } #[dom_struct] -pub struct WebGLBuffer { +pub(crate) struct WebGLBuffer { webgl_object: WebGLObject, #[no_trace] id: WebGLBufferId, @@ -50,7 +50,7 @@ impl WebGLBuffer { } } - pub fn maybe_new(context: &WebGLRenderingContext) -> Option<DomRoot<Self>> { + pub(crate) fn maybe_new(context: &WebGLRenderingContext) -> Option<DomRoot<Self>> { let (sender, receiver) = webgl_channel().unwrap(); context.send_command(WebGLCommand::CreateBuffer(sender)); receiver @@ -59,7 +59,7 @@ impl WebGLBuffer { .map(|id| WebGLBuffer::new(context, id)) } - pub fn new(context: &WebGLRenderingContext, id: WebGLBufferId) -> DomRoot<Self> { + pub(crate) fn new(context: &WebGLRenderingContext, id: WebGLBufferId) -> DomRoot<Self> { reflect_dom_object( Box::new(WebGLBuffer::new_inherited(context, id)), &*context.global(), @@ -69,11 +69,11 @@ impl WebGLBuffer { } impl WebGLBuffer { - pub fn id(&self) -> WebGLBufferId { + pub(crate) fn id(&self) -> WebGLBufferId { self.id } - pub fn buffer_data(&self, target: u32, data: &[u8], usage: u32) -> WebGLResult<()> { + pub(crate) fn buffer_data(&self, target: u32, data: &[u8], usage: u32) -> WebGLResult<()> { match usage { WebGLRenderingContextConstants::STREAM_DRAW | WebGLRenderingContextConstants::STATIC_DRAW | @@ -97,11 +97,11 @@ impl WebGLBuffer { Ok(()) } - pub fn capacity(&self) -> usize { + pub(crate) fn capacity(&self) -> usize { self.capacity.get() } - pub fn mark_for_deletion(&self, operation_fallibility: Operation) { + pub(crate) fn mark_for_deletion(&self, operation_fallibility: Operation) { if self.marked_for_deletion.get() { return; } @@ -121,15 +121,15 @@ impl WebGLBuffer { } } - pub fn is_marked_for_deletion(&self) -> bool { + pub(crate) fn is_marked_for_deletion(&self) -> bool { self.marked_for_deletion.get() } - pub fn is_deleted(&self) -> bool { + pub(crate) fn is_deleted(&self) -> bool { self.marked_for_deletion.get() && !self.is_attached() } - pub fn target(&self) -> Option<u32> { + pub(crate) fn target(&self) -> Option<u32> { self.target.get() } @@ -144,7 +144,7 @@ impl WebGLBuffer { true } - pub fn set_target_maybe(&self, target: u32) -> WebGLResult<()> { + pub(crate) fn set_target_maybe(&self, target: u32) -> WebGLResult<()> { if !self.can_bind_to(target) { return Err(WebGLError::InvalidOperation); } @@ -154,11 +154,11 @@ impl WebGLBuffer { Ok(()) } - pub fn is_attached(&self) -> bool { + pub(crate) fn is_attached(&self) -> bool { self.attached_counter.get() != 0 } - pub fn increment_attached_counter(&self) { + pub(crate) fn increment_attached_counter(&self) { self.attached_counter.set( self.attached_counter .get() @@ -167,7 +167,7 @@ impl WebGLBuffer { ); } - pub fn decrement_attached_counter(&self, operation_fallibility: Operation) { + pub(crate) fn decrement_attached_counter(&self, operation_fallibility: Operation) { self.attached_counter.set( self.attached_counter .get() @@ -179,7 +179,7 @@ impl WebGLBuffer { } } - pub fn usage(&self) -> u32 { + pub(crate) fn usage(&self) -> u32 { self.usage.get() } } |