screencapture: implement ext_image_copy_capture_manager_v1
This commit is contained in:
parent
e91993fb18
commit
f0562961e6
28 changed files with 1194 additions and 25 deletions
|
|
@ -21,6 +21,7 @@ pub struct GlRenderBuffer {
|
|||
pub ctx: Rc<EglContext>,
|
||||
pub width: i32,
|
||||
pub height: i32,
|
||||
pub stride: i32,
|
||||
pub format: &'static Format,
|
||||
rbo: GLuint,
|
||||
}
|
||||
|
|
@ -30,6 +31,7 @@ impl GlRenderBuffer {
|
|||
ctx: &Rc<EglContext>,
|
||||
width: i32,
|
||||
height: i32,
|
||||
stride: i32,
|
||||
format: &'static Format,
|
||||
) -> Result<Rc<GlRenderBuffer>, RenderError> {
|
||||
let Some(shm_info) = &format.shm_info else {
|
||||
|
|
@ -46,6 +48,7 @@ impl GlRenderBuffer {
|
|||
ctx: ctx.clone(),
|
||||
width,
|
||||
height,
|
||||
stride,
|
||||
format,
|
||||
rbo,
|
||||
}))
|
||||
|
|
@ -71,6 +74,7 @@ impl GlRenderBuffer {
|
|||
ctx: ctx.clone(),
|
||||
width: img.dmabuf.width,
|
||||
height: img.dmabuf.height,
|
||||
stride: 0,
|
||||
format: img.dmabuf.format,
|
||||
rbo,
|
||||
}))
|
||||
|
|
|
|||
|
|
@ -321,11 +321,11 @@ impl GfxContext for GlRenderContext {
|
|||
_cpu_worker: &Rc<CpuWorker>,
|
||||
width: i32,
|
||||
height: i32,
|
||||
_stride: i32,
|
||||
stride: i32,
|
||||
format: &'static Format,
|
||||
) -> Result<Rc<dyn GfxInternalFramebuffer>, GfxError> {
|
||||
let fb = self.ctx.with_current(|| unsafe {
|
||||
GlRenderBuffer::new(&self.ctx, width, height, format)?.create_framebuffer()
|
||||
GlRenderBuffer::new(&self.ctx, width, height, stride, format)?.create_framebuffer()
|
||||
})?;
|
||||
Ok(Rc::new(Framebuffer { ctx: self, gl: fb }))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -119,6 +119,10 @@ impl GfxInternalFramebuffer for Framebuffer {
|
|||
self
|
||||
}
|
||||
|
||||
fn stride(&self) -> i32 {
|
||||
self.gl.rb.stride
|
||||
}
|
||||
|
||||
fn staging_size(&self) -> usize {
|
||||
0
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue