1
0
Fork 0
forked from wry/wry

gfx: return formats by reference

This commit is contained in:
Julian Orth 2026-02-15 14:13:30 +01:00
parent b921c81e5d
commit 0f556fc054
7 changed files with 12 additions and 12 deletions

View file

@ -187,8 +187,8 @@ impl GlRenderContext {
self.render_node.clone()
}
pub fn formats(&self) -> Rc<AHashMap<u32, GfxFormat>> {
self.ctx.formats.clone()
pub fn formats(&self) -> &Rc<AHashMap<u32, GfxFormat>> {
&self.ctx.formats
}
fn dmabuf_fb(self: &Rc<Self>, buf: &DmaBuf) -> Result<Rc<Framebuffer>, RenderError> {
@ -253,7 +253,7 @@ impl GfxContext for GlRenderContext {
Some(self.render_node())
}
fn formats(&self) -> Rc<AHashMap<u32, GfxFormat>> {
fn formats(&self) -> &Rc<AHashMap<u32, GfxFormat>> {
self.formats()
}

View file

@ -263,8 +263,8 @@ impl GfxContext for Context {
Some(self.0.device.render_node.clone())
}
fn formats(&self) -> Rc<AHashMap<u32, GfxFormat>> {
self.0.formats.clone()
fn formats(&self) -> &Rc<AHashMap<u32, GfxFormat>> {
&self.0.formats
}
fn fast_ram_access(&self) -> bool {