1
0
Fork 0
forked from wry/wry

all: use trait upcasting

This commit is contained in:
Julian Orth 2025-04-03 16:47:24 +02:00
parent f0caafc862
commit 09e5f89174
44 changed files with 90 additions and 269 deletions

View file

@ -95,7 +95,7 @@ use {
},
isnt::std_1::vec::IsntVecExt,
once_cell::sync::Lazy,
std::{cell::RefCell, error::Error, rc::Rc, sync::Arc},
std::{any::Any, cell::RefCell, error::Error, rc::Rc, sync::Arc},
thiserror::Error,
};
@ -439,7 +439,7 @@ fn handle_explicit_sync(ctx: &GlRenderContext, img: Option<&Rc<EglImage>>, sync:
impl dyn GfxTexture {
fn as_gl(&self) -> &Texture {
self.as_any()
(self as &dyn Any)
.downcast_ref()
.expect("Non-gl texture passed into gl")
}