metal: implement direct scanout
This commit is contained in:
parent
fed2ceb8b5
commit
da84e9ec27
25 changed files with 682 additions and 148 deletions
|
|
@ -186,6 +186,7 @@ impl GlRenderContext {
|
|||
Ok(Rc::new(Texture {
|
||||
ctx: self.clone(),
|
||||
gl,
|
||||
resv: Default::default(),
|
||||
}))
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ impl Image {
|
|||
Ok(Rc::new(Texture {
|
||||
ctx: self.ctx.clone(),
|
||||
gl: GlTexture::import_img(&self.ctx.ctx, &self.gl)?,
|
||||
resv: Default::default(),
|
||||
}))
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
use {
|
||||
crate::{
|
||||
format::Format,
|
||||
gfx_api::{GfxError, GfxTexture},
|
||||
gfx_api::{GfxError, GfxTexture, TextureReservations},
|
||||
gfx_apis::gl::{gl::texture::GlTexture, renderer::context::GlRenderContext, RenderError},
|
||||
video::dmabuf::DmaBuf,
|
||||
},
|
||||
|
|
@ -16,6 +16,7 @@ use {
|
|||
pub struct Texture {
|
||||
pub(in crate::gfx_apis::gl) ctx: Rc<GlRenderContext>,
|
||||
pub(in crate::gfx_apis::gl) gl: GlTexture,
|
||||
pub(in crate::gfx_apis::gl) resv: TextureReservations,
|
||||
}
|
||||
|
||||
impl Debug for Texture {
|
||||
|
|
@ -63,4 +64,8 @@ impl GfxTexture for Texture {
|
|||
fn dmabuf(&self) -> Option<&DmaBuf> {
|
||||
self.gl.img.as_ref().map(|i| &i.dmabuf)
|
||||
}
|
||||
|
||||
fn reservations(&self) -> &TextureReservations {
|
||||
&self.resv
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue