render: hide graphics API behind traits
This commit is contained in:
parent
d650b3375d
commit
24e410a5b5
40 changed files with 601 additions and 246 deletions
|
|
@ -1,6 +1,6 @@
|
|||
use {
|
||||
crate::{
|
||||
gfx_apis::gl::RenderContext,
|
||||
gfx_apis::create_gfx_context,
|
||||
ifs::wl_seat::POINTER,
|
||||
portal::{
|
||||
ptl_render_ctx::PortalRenderCtx, ptl_screencast::ScreencastSession,
|
||||
|
|
@ -169,7 +169,7 @@ impl UsrJayRenderCtxOwner for PortalDisplay {
|
|||
}
|
||||
if self.render_ctx.get().is_none() {
|
||||
let drm = Drm::open_existing(fd);
|
||||
let ctx = match RenderContext::from_drm_device(&drm) {
|
||||
let ctx = match create_gfx_context(&drm) {
|
||||
Ok(c) => c,
|
||||
Err(e) => {
|
||||
log::error!(
|
||||
|
|
@ -179,10 +179,7 @@ impl UsrJayRenderCtxOwner for PortalDisplay {
|
|||
return;
|
||||
}
|
||||
};
|
||||
let ctx = Rc::new(PortalRenderCtx {
|
||||
dev_id,
|
||||
ctx: Rc::new(ctx),
|
||||
});
|
||||
let ctx = Rc::new(PortalRenderCtx { dev_id, ctx });
|
||||
self.render_ctx.set(Some(ctx.clone()));
|
||||
self.state.render_ctxs.set(dev_id, Rc::downgrade(&ctx));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue