Skip to content

Commit

Permalink
WIP debug
Browse files Browse the repository at this point in the history
still has errors
  • Loading branch information
ids1024 committed Dec 4, 2024
1 parent 1ca2d88 commit 881cda5
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions anvil/src/udev.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ impl Renderers {
}
}

#[derive(Clone)]
enum Texture {
Pixman(PixmanTexture),
Multi(MultiTexture),
}

pub struct UdevData {
pub session: LibSeatSession,
dh: DisplayHandle,
Expand All @@ -169,7 +175,7 @@ pub struct UdevData {
pointer_images: Vec<(xcursor::parser::Image, MemoryRenderBuffer)>,
pointer_element: PointerElement,
#[cfg(feature = "debug")]
fps_texture: Option<MultiTexture>,
fps_texture: Option<Texture>,
pointer_image: crate::cursor::Cursor,
debug_flags: DebugFlags,
keyboards: Vec<smithay::reexports::input::Device>,
Expand Down Expand Up @@ -431,34 +437,28 @@ pub fn run_udev() {
image::ImageReader::with_format(std::io::Cursor::new(FPS_NUMBERS_PNG), image::ImageFormat::Png)
.decode()
.unwrap();
let res = match &mut renderer {
RendererRef::Multi(renderer) => renderer
.import_memory(
&fps_image.to_rgba8(),
Fourcc::Abgr8888,
(fps_image.width() as i32, fps_image.height() as i32).into(),
false,
)
.expect("Unable to upload FPS texture"),
RendererRef::Pixman(renderer) => renderer
.import_memory(
&fps_image.to_rgba8(),
Fourcc::Abgr8888,
(fps_image.width() as i32, fps_image.height() as i32).into(),
false,
)
.expect("Unable to upload FPS texture"),
let fps_texture = match &mut renderer {
RendererRef::Multi(renderer) => Texture::Multi(
renderer
.import_memory(
&fps_image.to_rgba8(),
Fourcc::Abgr8888,
(fps_image.width() as i32, fps_image.height() as i32).into(),
false,
)
.expect("Unable to upload FPS texture"),
),
RendererRef::Pixman(renderer) => Texture::Pixman(
renderer
.import_memory(
&fps_image.to_rgba8(),
Fourcc::Abgr8888,
(fps_image.width() as i32, fps_image.height() as i32).into(),
false,
)
.expect("Unable to upload FPS texture"),
),
};
let fps_texture = state
.backend_data
.renderer
.import_memory(
&fps_image.to_rgba8(),
Fourcc::Abgr8888,
(fps_image.width() as i32, fps_image.height() as i32).into(),
false,
)
.expect("Unable to upload FPS texture");

for backend in state.backend_data.backends.values_mut() {
for surface in backend.surfaces.values_mut() {
Expand Down

0 comments on commit 881cda5

Please sign in to comment.