wlcs_anvil: Adjust dummy renderer for changes

This commit is contained in:
Victor Brekenfeld 2021-10-26 14:22:02 +02:00 committed by Victor Berger
parent 87069f26e9
commit 2db2611817
1 changed files with 14 additions and 6 deletions

View File

@ -1,10 +1,9 @@
use std::cell::Cell; use std::cell::Cell;
use cgmath::Vector2;
use smithay::{ use smithay::{
backend::{ backend::{
allocator::dmabuf::Dmabuf, allocator::dmabuf::Dmabuf,
renderer::{Frame, ImportDma, ImportShm, Renderer, Texture, Transform}, renderer::{Frame, ImportDma, ImportShm, Renderer, Texture, TextureFilter, Transform},
SwapBuffersError, SwapBuffersError,
}, },
reexports::wayland_server::protocol::wl_buffer, reexports::wayland_server::protocol::wl_buffer,
@ -28,7 +27,7 @@ impl Renderer for DummyRenderer {
fn render<F, R>( fn render<F, R>(
&mut self, &mut self,
_size: Size<i32, Physical>, _size: Size<i32, Physical>,
_transform: Transform, _dst_transform: Transform,
rendering: F, rendering: F,
) -> Result<R, Self::Error> ) -> Result<R, Self::Error>
where where
@ -37,6 +36,14 @@ impl Renderer for DummyRenderer {
let mut frame = DummyFrame {}; let mut frame = DummyFrame {};
Ok(rendering(self, &mut frame)) Ok(rendering(self, &mut frame))
} }
fn upscale_filter(&mut self, _filter: TextureFilter) -> Result<(), Self::Error> {
Ok(())
}
fn downscale_filter(&mut self, _filter: TextureFilter) -> Result<(), Self::Error> {
Ok(())
}
} }
impl ImportShm for DummyRenderer { impl ImportShm for DummyRenderer {
@ -94,11 +101,12 @@ impl Frame for DummyFrame {
Ok(()) Ok(())
} }
fn render_texture( fn render_texture_from_to(
&mut self, &mut self,
_texture: &Self::TextureId, _texture: &Self::TextureId,
_matrix: cgmath::Matrix3<f32>, _src: Rectangle<i32, Buffer>,
_tex_coords: [Vector2<f32>; 4], _dst: Rectangle<f64, Physical>,
_src_transform: Transform,
_alpha: f32, _alpha: f32,
) -> Result<(), Self::Error> { ) -> Result<(), Self::Error> {
Ok(()) Ok(())