gfx: implement async shm downloads
This commit is contained in:
parent
aca14d48dd
commit
028d0ed44c
11 changed files with 194 additions and 198 deletions
|
|
@ -265,11 +265,23 @@ pub trait GfxFramebuffer: Debug {
|
|||
clear: Option<&Color>,
|
||||
) -> Result<Option<SyncFile>, GfxError>;
|
||||
|
||||
fn copy_to_shm(self: Rc<Self>, shm: &[Cell<u8>]) -> Result<(), GfxError>;
|
||||
|
||||
fn format(&self) -> &'static Format;
|
||||
}
|
||||
|
||||
pub trait GfxInternalFramebuffer: GfxFramebuffer {
|
||||
fn into_fb(self: Rc<Self>) -> Rc<dyn GfxFramebuffer>;
|
||||
|
||||
fn staging_size(&self) -> usize;
|
||||
|
||||
fn download(
|
||||
self: Rc<Self>,
|
||||
staging: &Rc<dyn GfxStagingBuffer>,
|
||||
callback: Rc<dyn AsyncShmGfxTextureCallback>,
|
||||
mem: Rc<dyn ShmMemory>,
|
||||
damage: Region,
|
||||
) -> Result<Option<PendingShmTransfer>, GfxError>;
|
||||
}
|
||||
|
||||
impl dyn GfxFramebuffer {
|
||||
pub fn clear(
|
||||
&self,
|
||||
|
|
@ -593,13 +605,14 @@ pub trait GfxContext: Debug {
|
|||
|
||||
fn gfx_api(&self) -> GfxApi;
|
||||
|
||||
fn create_fb(
|
||||
fn create_internal_fb(
|
||||
self: Rc<Self>,
|
||||
cpu_worker: &Rc<CpuWorker>,
|
||||
width: i32,
|
||||
height: i32,
|
||||
stride: i32,
|
||||
format: &'static Format,
|
||||
) -> Result<Rc<dyn GfxFramebuffer>, GfxError>;
|
||||
) -> Result<Rc<dyn GfxInternalFramebuffer>, GfxError>;
|
||||
|
||||
fn sync_obj_ctx(&self) -> Option<&Rc<SyncObjCtx>>;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue