render: support shm screencopy from direct scanout
This commit is contained in:
parent
9de63bddf3
commit
9fba5f9b45
13 changed files with 203 additions and 62 deletions
|
|
@ -18,7 +18,9 @@ use {
|
|||
crate::{
|
||||
async_engine::AsyncEngine,
|
||||
format::Format,
|
||||
gfx_api::{GfxContext, GfxError, GfxFormat, GfxImage, GfxTexture, ResetStatus},
|
||||
gfx_api::{
|
||||
GfxContext, GfxError, GfxFormat, GfxFramebuffer, GfxImage, GfxTexture, ResetStatus,
|
||||
},
|
||||
gfx_apis::vulkan::{
|
||||
image::VulkanImageMemory, instance::VulkanInstance, renderer::VulkanRenderer,
|
||||
},
|
||||
|
|
@ -255,6 +257,19 @@ impl GfxContext for Context {
|
|||
fn gfx_api(&self) -> GfxApi {
|
||||
GfxApi::Vulkan
|
||||
}
|
||||
|
||||
fn create_fb(
|
||||
self: Rc<Self>,
|
||||
width: i32,
|
||||
height: i32,
|
||||
stride: i32,
|
||||
format: &'static Format,
|
||||
) -> Result<Rc<dyn GfxFramebuffer>, GfxError> {
|
||||
let fb = self
|
||||
.0
|
||||
.create_shm_texture(format, width, height, stride, &[], true)?;
|
||||
Ok(fb)
|
||||
}
|
||||
}
|
||||
|
||||
impl Drop for Context {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue