Fix some missing Debug implementations
This commit is contained in:
parent
7e47d648d4
commit
6c25dde36e
|
@ -6,6 +6,7 @@ use std::sync::{Arc, Weak};
|
||||||
|
|
||||||
const MAX_PLANES: usize = 4;
|
const MAX_PLANES: usize = 4;
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
pub(crate) struct DmabufInternal {
|
pub(crate) struct DmabufInternal {
|
||||||
pub num_planes: usize,
|
pub num_planes: usize,
|
||||||
pub offsets: [u32; MAX_PLANES],
|
pub offsets: [u32; MAX_PLANES],
|
||||||
|
@ -16,11 +17,11 @@ pub(crate) struct DmabufInternal {
|
||||||
pub format: Format,
|
pub format: Format,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Debug, Clone)]
|
||||||
/// Strong reference to a dmabuf handle
|
/// Strong reference to a dmabuf handle
|
||||||
pub struct Dmabuf(pub(crate) Arc<DmabufInternal>);
|
pub struct Dmabuf(pub(crate) Arc<DmabufInternal>);
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Debug, Clone)]
|
||||||
/// Weak reference to a dmabuf handle
|
/// Weak reference to a dmabuf handle
|
||||||
pub struct WeakDmabuf(pub(crate) Weak<DmabufInternal>);
|
pub struct WeakDmabuf(pub(crate) Weak<DmabufInternal>);
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
//! Module for [DumbBuffer](https://01.org/linuxgraphics/gfx-docs/drm/gpu/drm-kms.html#dumb-buffer-objects) buffers
|
//! Module for [DumbBuffer](https://01.org/linuxgraphics/gfx-docs/drm/gpu/drm-kms.html#dumb-buffer-objects) buffers
|
||||||
|
|
||||||
|
use std::fmt;
|
||||||
use std::os::unix::io::AsRawFd;
|
use std::os::unix::io::AsRawFd;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
@ -16,6 +17,15 @@ pub struct DumbBuffer<A: AsRawFd + 'static> {
|
||||||
format: Format,
|
format: Format,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<A: AsRawFd + 'static> fmt::Debug for DumbBuffer<A> {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
f.debug_struct("DumbBuffer")
|
||||||
|
.field("handle", &self.handle)
|
||||||
|
.field("format", &self.format)
|
||||||
|
.finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<A: AsRawFd + 'static> Allocator<DumbBuffer<A>> for DrmDevice<A> {
|
impl<A: AsRawFd + 'static> Allocator<DumbBuffer<A>> for DrmDevice<A> {
|
||||||
type Error = drm::SystemError;
|
type Error = drm::SystemError;
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
//! Type safe native types for safe egl initialisation
|
//! Type safe native types for safe egl initialisation
|
||||||
|
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
|
use std::fmt;
|
||||||
use std::ffi::CStr;
|
use std::ffi::CStr;
|
||||||
use std::mem::MaybeUninit;
|
use std::mem::MaybeUninit;
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
|
@ -50,7 +51,7 @@ impl Drop for EGLDisplayHandle {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// [`EGLDisplay`] represents an initialised EGL environment
|
/// [`EGLDisplay`] represents an initialised EGL environment
|
||||||
#[derive(Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct EGLDisplay {
|
pub struct EGLDisplay {
|
||||||
pub(crate) display: Arc<EGLDisplayHandle>,
|
pub(crate) display: Arc<EGLDisplayHandle>,
|
||||||
pub(crate) egl_version: (i32, i32),
|
pub(crate) egl_version: (i32, i32),
|
||||||
|
|
|
@ -240,6 +240,7 @@ impl Format {
|
||||||
|
|
||||||
/// Images of the EGL-based [`WlBuffer`].
|
/// Images of the EGL-based [`WlBuffer`].
|
||||||
#[cfg(feature = "wayland_frontend")]
|
#[cfg(feature = "wayland_frontend")]
|
||||||
|
#[derive(Debug)]
|
||||||
pub struct EGLBuffer {
|
pub struct EGLBuffer {
|
||||||
display: Arc<EGLDisplayHandle>,
|
display: Arc<EGLDisplayHandle>,
|
||||||
/// Width in pixels
|
/// Width in pixels
|
||||||
|
@ -253,21 +254,6 @@ pub struct EGLBuffer {
|
||||||
images: Vec<EGLImage>,
|
images: Vec<EGLImage>,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gles2 does not implement debug, so we have to impl Debug manually
|
|
||||||
#[cfg(feature = "wayland_frontend")]
|
|
||||||
impl fmt::Debug for EGLImages {
|
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
|
||||||
f.debug_struct("Point")
|
|
||||||
.field("display", &self.display)
|
|
||||||
.field("width", &self.width)
|
|
||||||
.field("height", &self.height)
|
|
||||||
.field("y_inverted", &self.y_inverted)
|
|
||||||
.field("format", &self.format)
|
|
||||||
.field("images", &self.images)
|
|
||||||
.finish()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[cfg(feature = "wayland_frontend")]
|
#[cfg(feature = "wayland_frontend")]
|
||||||
impl EGLBuffer {
|
impl EGLBuffer {
|
||||||
/// Amount of planes of these `EGLImages`
|
/// Amount of planes of these `EGLImages`
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
//! EGL surface related structs
|
//! EGL surface related structs
|
||||||
|
|
||||||
|
use std::fmt;
|
||||||
use std::sync::{
|
use std::sync::{
|
||||||
atomic::{AtomicPtr, Ordering},
|
atomic::{AtomicPtr, Ordering},
|
||||||
Arc,
|
Arc,
|
||||||
|
@ -24,6 +25,21 @@ pub struct EGLSurface {
|
||||||
surface_attributes: Vec<c_int>,
|
surface_attributes: Vec<c_int>,
|
||||||
logger: ::slog::Logger,
|
logger: ::slog::Logger,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl fmt::Debug for EGLSurface {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
f.debug_struct("EGLSurface")
|
||||||
|
.field("display", &self.display)
|
||||||
|
// native does not necessarily implement Debug
|
||||||
|
.field("surface", &self.surface)
|
||||||
|
.field("config_id", &self.config_id)
|
||||||
|
.field("pixel_format", &self.pixel_format)
|
||||||
|
.field("surface_attributes", &self.surface_attributes)
|
||||||
|
.field("logger", &self.logger)
|
||||||
|
.finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// safe because EGLConfig can be moved between threads
|
// safe because EGLConfig can be moved between threads
|
||||||
// and the other types are thread-safe
|
// and the other types are thread-safe
|
||||||
unsafe impl Send for EGLSurface {}
|
unsafe impl Send for EGLSurface {}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
//! Implementation of the rendering traits using OpenGL ES 2
|
//! Implementation of the rendering traits using OpenGL ES 2
|
||||||
|
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
|
use std::fmt;
|
||||||
use std::ffi::CStr;
|
use std::ffi::CStr;
|
||||||
use std::ptr;
|
use std::ptr;
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
|
@ -38,6 +39,7 @@ struct Gles2Program {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// A handle to a GLES2 texture
|
/// A handle to a GLES2 texture
|
||||||
|
#[derive(Debug)]
|
||||||
pub struct Gles2Texture {
|
pub struct Gles2Texture {
|
||||||
texture: ffi::types::GLuint,
|
texture: ffi::types::GLuint,
|
||||||
texture_kind: usize,
|
texture_kind: usize,
|
||||||
|
@ -56,7 +58,7 @@ impl Texture for Gles2Texture {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Debug, Clone)]
|
||||||
struct WeakGles2Buffer {
|
struct WeakGles2Buffer {
|
||||||
dmabuf: WeakDmabuf,
|
dmabuf: WeakDmabuf,
|
||||||
image: EGLImage,
|
image: EGLImage,
|
||||||
|
@ -64,6 +66,7 @@ struct WeakGles2Buffer {
|
||||||
fbo: ffi::types::GLuint,
|
fbo: ffi::types::GLuint,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug)]
|
||||||
struct Gles2Buffer {
|
struct Gles2Buffer {
|
||||||
internal: WeakGles2Buffer,
|
internal: WeakGles2Buffer,
|
||||||
_dmabuf: Dmabuf,
|
_dmabuf: Dmabuf,
|
||||||
|
@ -83,6 +86,22 @@ pub struct Gles2Renderer {
|
||||||
_not_send: *mut (),
|
_not_send: *mut (),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl fmt::Debug for Gles2Renderer {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
f.debug_struct("Gles2Renderer")
|
||||||
|
.field("buffers", &self.buffers)
|
||||||
|
.field("target_buffer", &self.target_buffer)
|
||||||
|
.field("target_surface", &self.target_surface)
|
||||||
|
.field("current_projection", &self.current_projection)
|
||||||
|
.field("extensions", &self.extensions)
|
||||||
|
.field("programs", &self.programs)
|
||||||
|
// ffi::Gles2 does not implement Debug
|
||||||
|
.field("egl", &self.egl)
|
||||||
|
.field("logger", &self.logger)
|
||||||
|
.finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Error returned during rendering using GL ES
|
/// Error returned during rendering using GL ES
|
||||||
#[derive(thiserror::Error, Debug)]
|
#[derive(thiserror::Error, Debug)]
|
||||||
pub enum Gles2Error {
|
pub enum Gles2Error {
|
||||||
|
|
|
@ -74,7 +74,7 @@ struct LogindSessionImpl {
|
||||||
// DBusConnection does not implement debug, so we have to impl Debug manually
|
// DBusConnection does not implement debug, so we have to impl Debug manually
|
||||||
impl fmt::Debug for LogindSessionImpl {
|
impl fmt::Debug for LogindSessionImpl {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
f.debug_struct("LogindSessionImpl ")
|
f.debug_struct("LogindSessionImpl")
|
||||||
.field("session_id", &self.session_id)
|
.field("session_id", &self.session_id)
|
||||||
.field("conn", &"...")
|
.field("conn", &"...")
|
||||||
.field("session_path", &self.session_path)
|
.field("session_path", &self.session_path)
|
||||||
|
|
|
@ -164,7 +164,7 @@ pub struct DirectSessionNotifier {
|
||||||
|
|
||||||
impl fmt::Debug for DirectSessionNotifier {
|
impl fmt::Debug for DirectSessionNotifier {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
f.debug_struct("Point")
|
f.debug_struct("DirectSessionNotifier")
|
||||||
.field("tty", &self.tty)
|
.field("tty", &self.tty)
|
||||||
.field("active", &self.active)
|
.field("active", &self.active)
|
||||||
.field("signaler", &self.signaler)
|
.field("signaler", &self.signaler)
|
||||||
|
|
|
@ -27,7 +27,7 @@ use winit::{
|
||||||
TouchPhase, WindowEvent,
|
TouchPhase, WindowEvent,
|
||||||
},
|
},
|
||||||
event_loop::{ControlFlow, EventLoop},
|
event_loop::{ControlFlow, EventLoop},
|
||||||
platform::desktop::EventLoopExtDesktop,
|
platform::run_return::EventLoopExtRunReturn,
|
||||||
platform::unix::WindowExtUnix,
|
platform::unix::WindowExtUnix,
|
||||||
window::{Window as WinitWindow, WindowBuilder},
|
window::{Window as WinitWindow, WindowBuilder},
|
||||||
};
|
};
|
||||||
|
|
|
@ -59,7 +59,7 @@ struct PointerInternal {
|
||||||
// image_callback does not implement debug, so we have to impl Debug manually
|
// image_callback does not implement debug, so we have to impl Debug manually
|
||||||
impl fmt::Debug for PointerInternal {
|
impl fmt::Debug for PointerInternal {
|
||||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
f.debug_struct("Point")
|
f.debug_struct("PointerInternal")
|
||||||
.field("known_pointers", &self.known_pointers)
|
.field("known_pointers", &self.known_pointers)
|
||||||
.field("focus", &self.focus)
|
.field("focus", &self.focus)
|
||||||
.field("pending_focus", &self.pending_focus)
|
.field("pending_focus", &self.pending_focus)
|
||||||
|
|
Loading…
Reference in New Issue