parent
b1b025992f
commit
811df39214
|
@ -124,6 +124,7 @@ impl Buffer for Dmabuf {
|
|||
}
|
||||
|
||||
/// Builder for Dmabufs
|
||||
#[derive(Debug)]
|
||||
pub struct DmabufBuilder {
|
||||
internal: DmabufInternal,
|
||||
}
|
||||
|
|
|
@ -35,6 +35,7 @@ pub const SLOT_CAP: usize = 4;
|
|||
/// If you have associated resources for each buffer that can be reused (e.g. framebuffer `Handle`s for a `DrmDevice`),
|
||||
/// you can store then in the `Slot`s userdata field. If a buffer is re-used, its userdata is preserved for the next time
|
||||
/// it is returned by `acquire()`.
|
||||
#[derive(Debug)]
|
||||
pub struct Swapchain<A: Allocator<B>, B: Buffer, U: 'static> {
|
||||
/// Allocator used by the swapchain
|
||||
pub allocator: A,
|
||||
|
@ -52,8 +53,10 @@ pub struct Swapchain<A: Allocator<B>, B: Buffer, U: 'static> {
|
|||
/// Can be cloned and passed around freely, the buffer is marked for re-use
|
||||
/// once all copies are dropped. Holding on to this struct will block the
|
||||
/// buffer in the swapchain.
|
||||
#[derive(Debug)]
|
||||
pub struct Slot<B: Buffer, U: 'static>(Arc<InternalSlot<B, U>>);
|
||||
|
||||
#[derive(Debug)]
|
||||
struct InternalSlot<B: Buffer, U: 'static> {
|
||||
buffer: Option<B>,
|
||||
acquired: AtomicBool,
|
||||
|
|
|
@ -29,7 +29,7 @@ pub type Mapping = (
|
|||
HashMap<framebuffer::Handle, HashMap<String, property::Handle>>,
|
||||
HashMap<plane::Handle, HashMap<String, property::Handle>>,
|
||||
);
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct AtomicDrmDevice<A: AsRawFd + 'static> {
|
||||
pub(crate) fd: Arc<FdWrapper<A>>,
|
||||
pub(crate) active: Arc<AtomicBool>,
|
||||
|
|
|
@ -12,6 +12,7 @@ use crate::backend::drm::error::Error;
|
|||
|
||||
use slog::{error, info, o};
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct LegacyDrmDevice<A: AsRawFd + 'static> {
|
||||
pub(crate) fd: Arc<FdWrapper<A>>,
|
||||
pub(crate) active: Arc<AtomicBool>,
|
||||
|
|
|
@ -20,6 +20,7 @@ use legacy::LegacyDrmDevice;
|
|||
use slog::{error, info, o, trace, warn};
|
||||
|
||||
/// An open drm device
|
||||
#[derive(Debug)]
|
||||
pub struct DrmDevice<A: AsRawFd + 'static> {
|
||||
pub(super) dev_id: dev_t,
|
||||
pub(crate) internal: Arc<DrmDeviceInternal<A>>,
|
||||
|
@ -42,6 +43,7 @@ impl<A: AsRawFd + 'static> AsRawFd for DrmDevice<A> {
|
|||
impl<A: AsRawFd + 'static> BasicDevice for DrmDevice<A> {}
|
||||
impl<A: AsRawFd + 'static> ControlDevice for DrmDevice<A> {}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct FdWrapper<A: AsRawFd + 'static> {
|
||||
fd: A,
|
||||
pub(super) privileged: bool,
|
||||
|
@ -67,6 +69,7 @@ impl<A: AsRawFd + 'static> Drop for FdWrapper<A> {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum DrmDeviceInternal<A: AsRawFd + 'static> {
|
||||
Atomic(AtomicDrmDevice<A>),
|
||||
Legacy(LegacyDrmDevice<A>),
|
||||
|
@ -301,6 +304,7 @@ impl<A: AsRawFd> DevPath for A {
|
|||
}
|
||||
|
||||
/// Events that can be generated by a DrmDevice
|
||||
#[derive(Debug)]
|
||||
pub enum DrmEvent {
|
||||
/// A vblank blank event on the provided crtc has happend
|
||||
VBlank(crtc::Handle),
|
||||
|
|
|
@ -75,6 +75,7 @@ pub use surface::DrmSurface;
|
|||
use drm::control::{crtc, plane, Device as ControlDevice, PlaneType};
|
||||
|
||||
/// A set of planes as supported by a crtc
|
||||
#[derive(Debug)]
|
||||
pub struct Planes {
|
||||
/// The primary plane of the crtc (automatically selected for [DrmDevice::create_surface])
|
||||
pub primary: plane::Handle,
|
||||
|
|
|
@ -107,6 +107,7 @@ pub struct PlaneInfo {
|
|||
h: u32,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct AtomicDrmSurface<A: AsRawFd + 'static> {
|
||||
pub(super) fd: Arc<DrmDeviceInternal<A>>,
|
||||
pub(super) active: Arc<AtomicBool>,
|
||||
|
|
|
@ -29,6 +29,16 @@ pub struct GbmBufferedSurface<D: AsRawFd + 'static> {
|
|||
drm: Arc<DrmSurface<D>>,
|
||||
}
|
||||
|
||||
// TODO: Replace with #[derive(Debug)] once gbm::BufferObject implements debug
|
||||
impl<D: std::fmt::Debug + AsRawFd + 'static> std::fmt::Debug for GbmBufferedSurface<D> {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
f.debug_struct("GbmBufferedSurface")
|
||||
.field("buffers", &self.buffers)
|
||||
.field("drm", &self.drm)
|
||||
.finish_non_exhaustive()
|
||||
}
|
||||
}
|
||||
|
||||
impl<D> GbmBufferedSurface<D>
|
||||
where
|
||||
D: AsRawFd + 'static,
|
||||
|
@ -266,6 +276,7 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
struct FbHandle<D: AsRawFd + 'static> {
|
||||
drm: Arc<DrmSurface<D>>,
|
||||
fb: framebuffer::Handle,
|
||||
|
@ -287,6 +298,15 @@ struct Buffers<D: AsRawFd + 'static> {
|
|||
next_fb: Option<DmabufSlot<D>>,
|
||||
}
|
||||
|
||||
// TODO: Replace with #[derive(Debug)] once gbm::BufferObject implements debug
|
||||
impl<D: std::fmt::Debug + AsRawFd + 'static> std::fmt::Debug for Buffers<D> {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
f.debug_struct("Buffers")
|
||||
.field("drm", &self.drm)
|
||||
.finish_non_exhaustive()
|
||||
}
|
||||
}
|
||||
|
||||
impl<D> Buffers<D>
|
||||
where
|
||||
D: AsRawFd + 'static,
|
||||
|
|
|
@ -70,6 +70,7 @@ impl State {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct LegacyDrmSurface<A: AsRawFd + 'static> {
|
||||
pub(super) fd: Arc<DrmDeviceInternal<A>>,
|
||||
pub(super) active: Arc<AtomicBool>,
|
||||
|
|
|
@ -22,6 +22,7 @@ use legacy::LegacyDrmSurface;
|
|||
use slog::trace;
|
||||
|
||||
/// An open crtc + plane combination that can be used for scan-out
|
||||
#[derive(Debug)]
|
||||
pub struct DrmSurface<A: AsRawFd + 'static> {
|
||||
// This field is only read when 'backend_session' is enabled
|
||||
#[allow(dead_code)]
|
||||
|
@ -34,6 +35,7 @@ pub struct DrmSurface<A: AsRawFd + 'static> {
|
|||
pub(super) links: RefCell<Vec<crate::signaling::SignalToken>>,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub enum DrmSurfaceInternal<A: AsRawFd + 'static> {
|
||||
Atomic(AtomicDrmSurface<A>),
|
||||
Legacy(LegacyDrmSurface<A>),
|
||||
|
|
|
@ -42,7 +42,7 @@ pub fn make_sure_egl_is_loaded() {
|
|||
});
|
||||
}
|
||||
|
||||
#[allow(clippy::all)]
|
||||
#[allow(clippy::all, missing_debug_implementations)]
|
||||
pub mod egl {
|
||||
use super::*;
|
||||
use libloading::Library;
|
||||
|
|
|
@ -227,6 +227,7 @@ pub unsafe trait EGLNativeSurface: Send + Sync {
|
|||
|
||||
#[cfg(feature = "backend_winit")]
|
||||
/// Typed Xlib window for the `X11` backend
|
||||
#[derive(Debug)]
|
||||
pub struct XlibWindow(pub raw::c_ulong);
|
||||
|
||||
#[cfg(feature = "backend_winit")]
|
||||
|
|
|
@ -40,7 +40,7 @@ use wayland_server::protocol::{wl_buffer, wl_shm};
|
|||
|
||||
use slog::{debug, error, info, o, trace, warn};
|
||||
|
||||
#[allow(clippy::all, missing_docs)]
|
||||
#[allow(clippy::all, missing_docs, missing_debug_implementations)]
|
||||
pub mod ffi {
|
||||
include!(concat!(env!("OUT_DIR"), "/gl_bindings.rs"));
|
||||
}
|
||||
|
@ -172,6 +172,15 @@ pub struct Gles2Frame {
|
|||
programs: [Gles2Program; shaders::FRAGMENT_COUNT],
|
||||
}
|
||||
|
||||
impl fmt::Debug for Gles2Frame {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("Gles2Frame")
|
||||
.field("current_projection", &self.current_projection)
|
||||
.field("programs", &self.programs)
|
||||
.finish_non_exhaustive()
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for Gles2Renderer {
|
||||
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||
f.debug_struct("Gles2Renderer")
|
||||
|
|
|
@ -453,6 +453,7 @@ impl<R: Renderer + ImportShm + ImportDma> ImportAll for R {
|
|||
#[cfg(feature = "wayland_frontend")]
|
||||
#[non_exhaustive]
|
||||
/// Buffer type of a given wl_buffer, if managed by smithay
|
||||
#[derive(Debug)]
|
||||
pub enum BufferType {
|
||||
/// Buffer is managed by the [`crate::wayland::shm`] global
|
||||
Shm,
|
||||
|
|
|
@ -270,7 +270,7 @@ impl WinitGraphicsBackend {
|
|||
}
|
||||
|
||||
/// Virtual input device used by the backend to associate input events
|
||||
#[derive(PartialEq, Eq, Hash)]
|
||||
#[derive(PartialEq, Eq, Hash, Debug)]
|
||||
pub struct WinitVirtualDevice;
|
||||
|
||||
impl Device for WinitVirtualDevice {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#![warn(missing_docs, rust_2018_idioms)]
|
||||
#![warn(missing_docs, missing_debug_implementations, rust_2018_idioms)]
|
||||
// Allow acronyms like EGL
|
||||
#![allow(clippy::upper_case_acronyms)]
|
||||
|
||||
|
|
|
@ -136,6 +136,12 @@ pub struct MultiCache {
|
|||
caches: appendlist::AppendList<Box<dyn Cache + Send>>,
|
||||
}
|
||||
|
||||
impl std::fmt::Debug for MultiCache {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
f.debug_struct("MultiCache").finish_non_exhaustive()
|
||||
}
|
||||
}
|
||||
|
||||
impl MultiCache {
|
||||
pub(crate) fn new() -> MultiCache {
|
||||
MultiCache {
|
||||
|
|
|
@ -277,6 +277,7 @@ pub(crate) fn implement_subcompositor(
|
|||
*/
|
||||
|
||||
/// The cached state associated with a subsurface
|
||||
#[derive(Debug)]
|
||||
pub struct SubsurfaceCachedState {
|
||||
/// Location of the top-left corner of this subsurface
|
||||
/// relative to its parent coordinate space
|
||||
|
|
|
@ -133,6 +133,7 @@ struct Marker<R> {
|
|||
///
|
||||
/// By default, all surfaces have a [`SurfaceAttributes`] cached state,
|
||||
/// and subsurface also have a [`SubsurfaceCachedState`] state as well.
|
||||
#[derive(Debug)]
|
||||
pub struct SurfaceData {
|
||||
/// The current role of the surface.
|
||||
///
|
||||
|
|
|
@ -197,6 +197,7 @@ xdg_role!(
|
|||
/// xdg_surface description).
|
||||
///
|
||||
/// Attaching a null buffer to a toplevel unmaps the surface.
|
||||
#[derive(Debug)]
|
||||
XdgToplevelSurfaceRoleAttributes {
|
||||
/// The parent field of a toplevel should be used
|
||||
/// by the compositor to determine which toplevel
|
||||
|
@ -272,6 +273,7 @@ xdg_role!(
|
|||
///
|
||||
/// The client must call wl_surface.commit on the corresponding wl_surface
|
||||
/// for the xdg_popup state to take effect.
|
||||
#[derive(Debug)]
|
||||
XdgPopupSurfaceRoleAttributes {
|
||||
/// Holds the parent for the xdg_popup.
|
||||
///
|
||||
|
|
|
@ -26,6 +26,7 @@ pub(crate) fn prepare_x11_sockets(log: ::slog::Logger) -> Result<(X11Lock, [Unix
|
|||
))
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub(crate) struct X11Lock {
|
||||
display: u32,
|
||||
log: ::slog::Logger,
|
||||
|
|
|
@ -68,6 +68,7 @@ use wayland_server::{Client, Display, Filter};
|
|||
use super::x11_sockets::{prepare_x11_sockets, X11Lock};
|
||||
|
||||
/// The XWayland handle
|
||||
#[derive(Debug)]
|
||||
pub struct XWayland<Data> {
|
||||
inner: Rc<RefCell<Inner<Data>>>,
|
||||
}
|
||||
|
@ -143,6 +144,7 @@ impl<Data> Drop for XWayland<Data> {
|
|||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
struct XWaylandInstance {
|
||||
display_lock: X11Lock,
|
||||
wayland_client: Option<Client>,
|
||||
|
@ -151,6 +153,7 @@ struct XWaylandInstance {
|
|||
}
|
||||
|
||||
// Inner implementation of the XWayland manager
|
||||
#[derive(Debug)]
|
||||
struct Inner<Data> {
|
||||
sender: SyncSender<XWaylandEvent>,
|
||||
handle: LoopHandle<'static, Data>,
|
||||
|
@ -227,6 +230,7 @@ fn launch<Data: Any>(inner: &Rc<RefCell<Inner<Data>>>) -> std::io::Result<()> {
|
|||
Ok(())
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct XWaylandSource {
|
||||
channel: Channel<XWaylandEvent>,
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue