aboutsummaryrefslogtreecommitdiffstats
path: root/components/webxr/glwindow/mod.rs
diff options
context:
space:
mode:
authorSamson <16504129+sagudev@users.noreply.github.com>2025-02-05 07:13:21 +0100
committerGitHub <noreply@github.com>2025-02-05 06:13:21 +0000
commit503bb10c5b1fafe01ebfb6b320902be2e8671c69 (patch)
tree99f78defd020790a5dc1340a1da8df121794d918 /components/webxr/glwindow/mod.rs
parentfdbfecf7dd30e2feb0bca468b9326c5e61e91b49 (diff)
downloadservo-503bb10c5b1fafe01ebfb6b320902be2e8671c69.tar.gz
servo-503bb10c5b1fafe01ebfb6b320902be2e8671c69.zip
Use surfman with glow bindings (#34328)
* Use glowing surfman Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Port https://github.com/servo/webxr/pull/255 Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * fixups rebase Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * fmt Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Update surfman Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> * Fix stale TODO Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com> --------- Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
Diffstat (limited to 'components/webxr/glwindow/mod.rs')
-rw-r--r--components/webxr/glwindow/mod.rs17
1 files changed, 6 insertions, 11 deletions
diff --git a/components/webxr/glwindow/mod.rs b/components/webxr/glwindow/mod.rs
index a1b9136cd9e..e5389c3dcc1 100644
--- a/components/webxr/glwindow/mod.rs
+++ b/components/webxr/glwindow/mod.rs
@@ -3,7 +3,6 @@
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use core::slice;
-use std::num::NonZeroU32;
use std::rc::Rc;
use euclid::{
@@ -25,7 +24,6 @@ use webxr_api::{
VIEWER,
};
-use crate::gl_utils::framebuffer;
use crate::{SurfmanGL, SurfmanLayerManager};
// How far off the ground are the viewer's eyes?
@@ -222,11 +220,10 @@ impl DeviceAPI for GlWindowDevice {
.device
.context_surface_info(&self.context)
.unwrap()
- .map(|info| info.framebuffer_object)
- .unwrap_or(0);
+ .and_then(|info| info.framebuffer_object);
unsafe {
self.gl
- .bind_framebuffer(gl::FRAMEBUFFER, framebuffer(framebuffer_object));
+ .bind_framebuffer(gl::FRAMEBUFFER, framebuffer_object);
debug_assert_eq!(
(
self.gl.get_error(),
@@ -254,10 +251,9 @@ impl DeviceAPI for GlWindowDevice {
.device
.create_surface_texture(&mut self.context, surface)
.unwrap();
- let raw_texture_id = self.device.surface_texture_object(&surface_texture);
- let texture_id = NonZeroU32::new(raw_texture_id).map(gl::NativeTexture);
+ let texture_id = self.device.surface_texture_object(&surface_texture);
let texture_target = self.device.surface_gl_texture_target();
- log::debug!("Presenting texture {}", raw_texture_id);
+ log::debug!("Presenting texture {:?}", texture_id);
if let Some(ref shader) = self.shader {
shader.draw_texture(
@@ -392,9 +388,8 @@ impl GlWindowDevice {
let framebuffer_object = device
.context_surface_info(&context)
.unwrap()
- .map(|info| info.framebuffer_object)
- .unwrap_or(0);
- gl.bind_framebuffer(gl::FRAMEBUFFER, framebuffer(framebuffer_object));
+ .and_then(|info| info.framebuffer_object);
+ gl.bind_framebuffer(gl::FRAMEBUFFER, framebuffer_object);
debug_assert_eq!(
(gl.get_error(), gl.check_framebuffer_status(gl::FRAMEBUFFER)),
(gl::NO_ERROR, gl::FRAMEBUFFER_COMPLETE)