diff --git a/src/backend/drm/egl/mod.rs b/src/backend/drm/egl/mod.rs index 759b65d..a867582 100644 --- a/src/backend/drm/egl/mod.rs +++ b/src/backend/drm/egl/mod.rs @@ -1,3 +1,13 @@ +//! +//! [`Device`](../trait.Device.html) and [`Surface`](../trait.Surface.html) +//! implementations using egl contexts and surfaces for efficient rendering. +//! +//! Usually this implementation's [`EglSurface`](struct.EglSurface.html)s implementation +//! of [`GlGraphicsBackend`](../../graphics/gl/trait.GlGraphicsBackend.html) will be used +//! to let your compositor render. +//! Take a look at `anvil`s source code for an example of this. +//! + use drm::control::{crtc, ResourceHandles, ResourceInfo}; use nix::libc::dev_t; use std::os::unix::io::{AsRawFd, RawFd}; @@ -21,7 +31,7 @@ pub use self::surface::*; #[cfg(feature = "backend_session")] pub mod session; -/// Representation of an open gbm device to create rendering backends +/// Representation of an egl device to create egl rendering surfaces pub struct EglDevice< B: Backend::Surface> + 'static, D: Device + NativeDisplay + 'static, @@ -51,10 +61,10 @@ impl< where ::Surface: NativeSurface, { - /// Create a new `EglGbmDrmDevice` from an open drm node + /// Try to create a new `EglDevice` from an open device. /// - /// Returns an error if the file is no valid drm node or context creation was not - /// successful. + /// Returns an error if the file is no valid device or context + /// creation was not successful. pub fn new(dev: D, logger: L) -> Result where L: Into>, @@ -71,10 +81,10 @@ where ) } - /// Create a new `EglGbmDrmDevice` from an open `RawDevice` and given `GlAttributes` + /// Create a new `EglDevice` from an open device and given `GlAttributes` /// - /// Returns an error if the file is no valid drm node or context creation was not - /// successful. + /// Returns an error if the file is no valid device or context + /// creation was not successful. pub fn new_with_gl_attr(mut dev: D, attributes: GlAttributes, logger: L) -> Result where L: Into>, diff --git a/src/backend/drm/egl/session.rs b/src/backend/drm/egl/session.rs index 7247d2d..b07d8a9 100644 --- a/src/backend/drm/egl/session.rs +++ b/src/backend/drm/egl/session.rs @@ -1,4 +1,9 @@ -use drm::control::{connector, crtc, Mode}; +//! +//! Support to register an [`EglDevice`](../struct.EglDevice.html) +//! to an open [`Session`](../../session/trait.Session.html). +//! + +use drm::control::crtc; use std::os::unix::io::RawFd; use super::EglDevice; @@ -6,7 +11,9 @@ use backend::drm::Device; use backend::egl::native::{Backend, NativeDisplay, NativeSurface}; use backend::session::{AsSessionObserver, SessionObserver}; -/// `SessionObserver` linked to the `DrmDevice` it was created from. +/// [`SessionObserver`](../../session/trait.SessionObserver.html) +/// linked to the [`EglDevice`](../struct.EglDevice.html) it was +/// created from. pub struct EglDeviceObserver { observer: S, } diff --git a/src/backend/drm/egl/surface.rs b/src/backend/drm/egl/surface.rs index b8be770..0c17a9b 100644 --- a/src/backend/drm/egl/surface.rs +++ b/src/backend/drm/egl/surface.rs @@ -12,6 +12,7 @@ use backend::graphics::gl::GLGraphicsBackend; use backend::graphics::PixelFormat; use backend::graphics::{CursorBackend, SwapBuffersError}; +/// Egl surface for rendering pub struct EglSurface< B: Backend::Surface> + 'static, D: Device + NativeDisplay + 'static,