1
0
Fork 0
forked from wry/wry

render: hide graphics API behind traits

This commit is contained in:
Julian Orth 2023-10-22 20:00:32 +02:00
parent d650b3375d
commit 24e410a5b5
40 changed files with 601 additions and 246 deletions

View file

@ -1,7 +1,7 @@
use {
crate::{
client::{Client, ClientError},
gfx_apis::gl::RenderContext,
gfx_api::GfxContext,
leaks::Tracker,
object::Object,
utils::{
@ -21,10 +21,10 @@ pub struct JayRenderCtx {
}
impl JayRenderCtx {
pub fn send_render_ctx(&self, ctx: Option<&Rc<RenderContext>>) {
pub fn send_render_ctx(&self, ctx: Option<Rc<dyn GfxContext>>) {
let mut fd = None;
if let Some(ctx) = ctx {
match ctx.gbm.drm.dup_render() {
match ctx.gbm().drm.dup_render() {
Ok(d) => fd = Some(d.fd().clone()),
Err(e) => {
log::error!("Could not dup drm fd: {}", ErrorFmt(e));