kms: Use new DrmOutput api

This commit is contained in:
Victoria Brekenfeld 2025-01-02 17:38:59 +01:00 committed by Victoria Brekenfeld
parent e356e3c589
commit 8b87d6524e
10 changed files with 347 additions and 217 deletions

View file

@ -499,6 +499,53 @@ pub enum ElementFilter {
LayerShellOnly,
}
pub fn output_elements<R>(
_gpu: Option<&DrmNode>,
renderer: &mut R,
shell: &Arc<RwLock<Shell>>,
now: Time<Monotonic>,
output: &Output,
cursor_mode: CursorMode,
_fps: Option<(&EguiState, &Timings)>,
) -> Result<Vec<CosmicElement<R>>, RenderError<R::Error>>
where
R: Renderer + ImportAll + ImportMem + AsGlowRenderer,
<R as Renderer>::TextureId: Send + Clone + 'static,
<R as Renderer>::Error: FromGlesError,
CosmicMappedRenderElement<R>: RenderElement<R>,
WorkspaceRenderElement<R>: RenderElement<R>,
{
let shell_guard = shell.read().unwrap();
let (previous_workspace, workspace) = shell_guard.workspaces.active(output);
let (previous_idx, idx) = shell_guard.workspaces.active_num(&output);
let previous_workspace = previous_workspace
.zip(previous_idx)
.map(|((w, start), idx)| (w.handle, idx, start));
let workspace = (workspace.handle, idx);
std::mem::drop(shell_guard);
let element_filter = if workspace_overview_is_open(output) {
ElementFilter::LayerShellOnly
} else {
ElementFilter::All
};
workspace_elements(
_gpu,
renderer,
shell,
now,
output,
previous_workspace,
workspace,
cursor_mode,
element_filter,
_fps,
)
}
#[profiling::function]
pub fn workspace_elements<R>(
_gpu: Option<&DrmNode>,