all: use trait upcasting
This commit is contained in:
parent
f0caafc862
commit
09e5f89174
44 changed files with 90 additions and 269 deletions
|
|
@ -127,10 +127,6 @@ impl GfxFramebuffer for Framebuffer {
|
|||
}
|
||||
|
||||
impl GfxInternalFramebuffer for Framebuffer {
|
||||
fn into_fb(self: Rc<Self>) -> Rc<dyn GfxFramebuffer> {
|
||||
self
|
||||
}
|
||||
|
||||
fn stride(&self) -> i32 {
|
||||
self.gl.rb.stride
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ use {
|
|||
video::dmabuf::DmaBuf,
|
||||
},
|
||||
std::{
|
||||
any::Any,
|
||||
cell::Cell,
|
||||
fmt::{Debug, Formatter},
|
||||
rc::Rc,
|
||||
|
|
@ -52,14 +51,6 @@ impl GfxTexture for Texture {
|
|||
(self.width(), self.height())
|
||||
}
|
||||
|
||||
fn as_any(&self) -> &dyn Any {
|
||||
self
|
||||
}
|
||||
|
||||
fn into_any(self: Rc<Self>) -> Rc<dyn Any> {
|
||||
self
|
||||
}
|
||||
|
||||
fn dmabuf(&self) -> Option<&DmaBuf> {
|
||||
self.gl.img.as_ref().map(|i| &i.dmabuf)
|
||||
}
|
||||
|
|
@ -69,11 +60,7 @@ impl GfxTexture for Texture {
|
|||
}
|
||||
}
|
||||
|
||||
impl ShmGfxTexture for Texture {
|
||||
fn into_texture(self: Rc<Self>) -> Rc<dyn GfxTexture> {
|
||||
self
|
||||
}
|
||||
}
|
||||
impl ShmGfxTexture for Texture {}
|
||||
|
||||
impl AsyncShmGfxTexture for Texture {
|
||||
fn async_upload(
|
||||
|
|
@ -136,8 +123,4 @@ impl AsyncShmGfxTexture for Texture {
|
|||
&& height == self.gl.height
|
||||
&& stride == self.gl.stride
|
||||
}
|
||||
|
||||
fn into_texture(self: Rc<Self>) -> Rc<dyn GfxTexture> {
|
||||
self
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue