diff options
author | Martin Robinson <mrobinson@igalia.com> | 2025-01-31 17:41:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-31 16:41:57 +0000 |
commit | 5466c27f6f9a151ae7f5357cb663cc2580fbca15 (patch) | |
tree | a306c16a4fc0af3fa8ab3976de0b5c79f8503de1 /components/webxr/gl_utils.rs | |
parent | a4c6c205d2d26dd16ac1cd03e73a0262eb4c12f4 (diff) | |
download | servo-5466c27f6f9a151ae7f5357cb663cc2580fbca15.tar.gz servo-5466c27f6f9a151ae7f5357cb663cc2580fbca15.zip |
Finish the integration of `webxr` into the Cargo workspace (#35229)
- Run `cargo fmt` on `webxr` and `webxr-api`
- Fix clippy warnings in the existing `webxr` code
- Integrate the new crates into the workspace
- Expose `webxr` via the libservo API rather than requiring embedders to
depend on it explicitly.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
Diffstat (limited to 'components/webxr/gl_utils.rs')
-rw-r--r-- | components/webxr/gl_utils.rs | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/components/webxr/gl_utils.rs b/components/webxr/gl_utils.rs index fff74017c8d..752a68a45e3 100644 --- a/components/webxr/gl_utils.rs +++ b/components/webxr/gl_utils.rs @@ -2,16 +2,15 @@ * 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/. */ -use crate::SurfmanGL; -use glow as gl; -use glow::Context as Gl; -use glow::HasContext; use std::collections::HashMap; use std::num::NonZero; + +use glow as gl; +use glow::{Context as Gl, HasContext}; use surfman::Device as SurfmanDevice; -use webxr_api::ContextId; -use webxr_api::GLContexts; -use webxr_api::LayerId; +use webxr_api::{ContextId, GLContexts, LayerId}; + +use crate::SurfmanGL; pub(crate) fn framebuffer(framebuffer: u32) -> Option<gl::NativeFramebuffer> { NonZero::new(framebuffer).map(gl::NativeFramebuffer) @@ -93,6 +92,7 @@ impl GlClearer { }) } + #[allow(clippy::too_many_arguments)] pub(crate) fn clear( &mut self, device: &mut SurfmanDevice, @@ -114,8 +114,6 @@ impl GlClearer { let mut clear_color = [0., 0., 0., 0.]; let mut clear_depth = [0.]; let mut clear_stencil = [0]; - let color_mask; - let depth_mask; let mut stencil_mask = [0]; let scissor_enabled = gl.is_enabled(gl::SCISSOR_TEST); let rasterizer_enabled = gl.is_enabled(gl::RASTERIZER_DISCARD); @@ -125,9 +123,9 @@ impl GlClearer { gl.get_parameter_f32_slice(gl::COLOR_CLEAR_VALUE, &mut clear_color[..]); gl.get_parameter_f32_slice(gl::DEPTH_CLEAR_VALUE, &mut clear_depth[..]); gl.get_parameter_i32_slice(gl::STENCIL_CLEAR_VALUE, &mut clear_stencil[..]); - depth_mask = gl.get_parameter_bool(gl::DEPTH_WRITEMASK); + let depth_mask = gl.get_parameter_bool(gl::DEPTH_WRITEMASK); gl.get_parameter_i32_slice(gl::STENCIL_WRITEMASK, &mut stencil_mask[..]); - color_mask = gl.get_parameter_bool_array::<4>(gl::COLOR_WRITEMASK); + let color_mask = gl.get_parameter_bool_array::<4>(gl::COLOR_WRITEMASK); // Clear it gl.bind_framebuffer(gl::FRAMEBUFFER, fbo); |