mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Use surfman with glow bindings (take II) (#35422)
* Reapply "Use surfman with glow bindings (#34328)" (#35402)
This reverts commit 0fed99590a
.
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
* update surfman
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
---------
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
This commit is contained in:
parent
48e38bcaa2
commit
610a1c2303
13 changed files with 69 additions and 97 deletions
|
@ -180,7 +180,8 @@ impl RenderingContext for SurfmanRenderingContext {
|
|||
fn framebuffer_object(&self) -> u32 {
|
||||
self.context_surface_info()
|
||||
.unwrap_or(None)
|
||||
.map(|info| info.framebuffer_object)
|
||||
.and_then(|info| info.framebuffer_object)
|
||||
.map(|fbo| fbo.0.get())
|
||||
.unwrap_or(0)
|
||||
}
|
||||
#[allow(unsafe_code)]
|
||||
|
@ -217,7 +218,10 @@ impl RenderingContext for SurfmanRenderingContext {
|
|||
} = device.surface_info(&surface);
|
||||
debug!("... getting texture for surface {:?}", front_buffer_id);
|
||||
let surface_texture = device.create_surface_texture(context, surface).unwrap();
|
||||
let gl_texture = device.surface_texture_object(&surface_texture);
|
||||
let gl_texture = device
|
||||
.surface_texture_object(&surface_texture)
|
||||
.map(|tex| tex.0.get())
|
||||
.unwrap_or(0);
|
||||
Some((surface_texture, gl_texture, size))
|
||||
}
|
||||
|
||||
|
@ -425,7 +429,10 @@ impl SurfmanRenderingContext {
|
|||
|
||||
pub fn surface_texture_object(&self, surface: &SurfaceTexture) -> u32 {
|
||||
let device = &self.0.device.borrow();
|
||||
device.surface_texture_object(surface)
|
||||
device
|
||||
.surface_texture_object(surface)
|
||||
.map(|t| t.0.get())
|
||||
.unwrap_or_default()
|
||||
}
|
||||
|
||||
pub fn get_proc_address(&self, name: &str) -> *const c_void {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue