screencopy: unconditionally create copy for shm
This commit is contained in:
parent
156785d7c8
commit
17de1650a0
6 changed files with 35 additions and 134 deletions
|
|
@ -7,7 +7,7 @@ use {
|
|||
},
|
||||
gfx_apis::gl::{
|
||||
gl::texture::GlTexture,
|
||||
renderer::{context::GlRenderContext, framebuffer::Framebuffer},
|
||||
renderer::context::GlRenderContext,
|
||||
sys::{
|
||||
GLint, GL_CLAMP_TO_EDGE, GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_TEXTURE_WRAP_T,
|
||||
GL_UNPACK_ROW_LENGTH_EXT,
|
||||
|
|
@ -45,13 +45,6 @@ impl Texture {
|
|||
pub fn height(&self) -> i32 {
|
||||
self.gl.height
|
||||
}
|
||||
|
||||
pub fn to_framebuffer(&self) -> Result<Rc<Framebuffer>, RenderError> {
|
||||
match &self.gl.img {
|
||||
Some(img) => self.ctx.image_to_fb(img),
|
||||
_ => Err(RenderError::ShmTextureToFb),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl GfxTexture for Texture {
|
||||
|
|
@ -67,21 +60,6 @@ impl GfxTexture for Texture {
|
|||
self
|
||||
}
|
||||
|
||||
fn read_pixels(
|
||||
self: Rc<Self>,
|
||||
x: i32,
|
||||
y: i32,
|
||||
width: i32,
|
||||
height: i32,
|
||||
_stride: i32,
|
||||
format: &Format,
|
||||
shm: &[Cell<u8>],
|
||||
) -> Result<(), GfxError> {
|
||||
self.to_framebuffer()?
|
||||
.copy_to_shm(x, y, width, height, format, shm)
|
||||
.map_err(|e| e.into())
|
||||
}
|
||||
|
||||
fn dmabuf(&self) -> Option<&DmaBuf> {
|
||||
self.gl.img.as_ref().map(|i| &i.dmabuf)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue