mirror of
https://github.com/pinnacle-comp/pinnacle.git
synced 2024-12-27 21:58:18 +01:00
Add doc comments
This commit is contained in:
parent
3f05b2b608
commit
ebe745d091
1 changed files with 30 additions and 14 deletions
|
@ -534,6 +534,7 @@ struct DrmSurfaceDmabufFeedback {
|
||||||
scanout_feedback: DmabufFeedback,
|
scanout_feedback: DmabufFeedback,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Render surface for an output.
|
||||||
struct RenderSurface {
|
struct RenderSurface {
|
||||||
/// The output global id.
|
/// The output global id.
|
||||||
global: Option<GlobalId>,
|
global: Option<GlobalId>,
|
||||||
|
@ -541,7 +542,10 @@ struct RenderSurface {
|
||||||
display_handle: DisplayHandle,
|
display_handle: DisplayHandle,
|
||||||
/// The node from `connector_connected`.
|
/// The node from `connector_connected`.
|
||||||
device_id: DrmNode,
|
device_id: DrmNode,
|
||||||
/// The node doing the rendering?
|
/// The node rendering to the screen? idk
|
||||||
|
///
|
||||||
|
/// If this is equal to the primary gpu node then it does the rendering operations.
|
||||||
|
/// If it's not it is the node the composited buffer ends up on.
|
||||||
render_node: DrmNode,
|
render_node: DrmNode,
|
||||||
/// The thing rendering elements and queueing frames.
|
/// The thing rendering elements and queueing frames.
|
||||||
compositor: GbmDrmCompositor,
|
compositor: GbmDrmCompositor,
|
||||||
|
@ -564,13 +568,15 @@ type GbmDrmCompositor = DrmCompositor<
|
||||||
DrmDeviceFd,
|
DrmDeviceFd,
|
||||||
>;
|
>;
|
||||||
|
|
||||||
/// The result of a frame render from `GbmDrmCompositor::render_frame`.
|
/// The result of a frame render from `render_frame`.
|
||||||
struct SurfaceCompositorRenderResult {
|
struct SurfaceCompositorRenderResult {
|
||||||
rendered: bool,
|
rendered: bool,
|
||||||
states: RenderElementStates,
|
states: RenderElementStates,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Render a frame with the given elements.
|
/// Render a frame with the given elements.
|
||||||
|
///
|
||||||
|
/// This frame needs to be queued for scanout afterwards.
|
||||||
fn render_frame<R, E, Target>(
|
fn render_frame<R, E, Target>(
|
||||||
compositor: &mut GbmDrmCompositor,
|
compositor: &mut GbmDrmCompositor,
|
||||||
renderer: &mut R,
|
renderer: &mut R,
|
||||||
|
@ -1124,7 +1130,8 @@ impl State {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Render using the gpu on `node` to the provided `crtc`, or all available crtcs if `None`.
|
/// Render to the [`RenderSurface`] associated with the provided `crtc`,
|
||||||
|
/// or all [`RenderSurface`]s on all available crtcs if `None`.
|
||||||
fn render(&mut self, node: DrmNode, crtc: Option<crtc::Handle>) {
|
fn render(&mut self, node: DrmNode, crtc: Option<crtc::Handle>) {
|
||||||
let udev = self.backend.udev_mut();
|
let udev = self.backend.udev_mut();
|
||||||
|
|
||||||
|
@ -1146,6 +1153,7 @@ impl State {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Render to the [`RenderSurface`] associated with the given `crtc`.
|
||||||
fn render_surface(&mut self, node: DrmNode, crtc: crtc::Handle) {
|
fn render_surface(&mut self, node: DrmNode, crtc: crtc::Handle) {
|
||||||
let udev = self.backend.udev_mut();
|
let udev = self.backend.udev_mut();
|
||||||
|
|
||||||
|
@ -1235,15 +1243,14 @@ impl State {
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
|
|
||||||
let result = render_surface(
|
let result = render_surface(
|
||||||
&mut self.cursor_status,
|
surface,
|
||||||
|
&mut renderer,
|
||||||
|
&output,
|
||||||
&self.space,
|
&self.space,
|
||||||
&windows,
|
&windows,
|
||||||
&self.override_redirect_windows,
|
&self.override_redirect_windows,
|
||||||
self.dnd_icon.as_ref(),
|
self.dnd_icon.as_ref(),
|
||||||
surface,
|
&mut self.cursor_status,
|
||||||
&mut renderer,
|
|
||||||
&output,
|
|
||||||
// self.seat.input_method(),
|
|
||||||
&pointer_image,
|
&pointer_image,
|
||||||
&mut udev.pointer_element,
|
&mut udev.pointer_element,
|
||||||
self.pointer_location,
|
self.pointer_location,
|
||||||
|
@ -1306,6 +1313,9 @@ impl State {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Do an initial render that renders nothing to the screen.
|
||||||
|
///
|
||||||
|
/// If that render failed, schedule another one.
|
||||||
fn schedule_initial_render(
|
fn schedule_initial_render(
|
||||||
&mut self,
|
&mut self,
|
||||||
node: DrmNode,
|
node: DrmNode,
|
||||||
|
@ -1348,20 +1358,25 @@ impl State {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Render windows, layers, and everything else needed to the given [`RenderSurface`].
|
||||||
|
/// Also queues the frame for scanout.
|
||||||
#[allow(clippy::too_many_arguments)]
|
#[allow(clippy::too_many_arguments)]
|
||||||
fn render_surface<'a>(
|
fn render_surface<'a>(
|
||||||
cursor_status: &mut CursorImageStatus,
|
|
||||||
space: &Space<WindowElement>,
|
|
||||||
windows: &[WindowElement],
|
|
||||||
override_redirect_windows: &[X11Surface],
|
|
||||||
dnd_icon: Option<&WlSurface>,
|
|
||||||
surface: &'a mut RenderSurface,
|
surface: &'a mut RenderSurface,
|
||||||
renderer: &mut UdevRenderer<'a, '_>,
|
renderer: &mut UdevRenderer<'a, '_>,
|
||||||
output: &Output,
|
output: &Output,
|
||||||
// input_method: &InputMethodHandle,
|
|
||||||
|
space: &Space<WindowElement>,
|
||||||
|
windows: &[WindowElement],
|
||||||
|
override_redirect_windows: &[X11Surface],
|
||||||
|
|
||||||
|
dnd_icon: Option<&WlSurface>,
|
||||||
|
cursor_status: &mut CursorImageStatus,
|
||||||
|
|
||||||
pointer_image: &TextureBuffer<MultiTexture>,
|
pointer_image: &TextureBuffer<MultiTexture>,
|
||||||
pointer_element: &mut PointerElement<MultiTexture>,
|
pointer_element: &mut PointerElement<MultiTexture>,
|
||||||
pointer_location: Point<f64, Logical>,
|
pointer_location: Point<f64, Logical>,
|
||||||
|
|
||||||
clock: &Clock<Monotonic>,
|
clock: &Clock<Monotonic>,
|
||||||
) -> Result<bool, SwapBuffersError> {
|
) -> Result<bool, SwapBuffersError> {
|
||||||
let pending_wins = windows
|
let pending_wins = windows
|
||||||
|
@ -1457,6 +1472,7 @@ fn render_surface<'a>(
|
||||||
Ok(res.rendered)
|
Ok(res.rendered)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Renders nothing to the given [`RenderSurface`].
|
||||||
fn initial_render(
|
fn initial_render(
|
||||||
surface: &mut RenderSurface,
|
surface: &mut RenderSurface,
|
||||||
renderer: &mut UdevRenderer<'_, '_>,
|
renderer: &mut UdevRenderer<'_, '_>,
|
||||||
|
|
Loading…
Reference in a new issue