debug: Add actual profiling for rendeirng
This commit is contained in:
parent
26743d6bdc
commit
1c62d6d061
10 changed files with 184 additions and 1 deletions
|
|
@ -172,6 +172,9 @@ where
|
|||
R: Renderer + ImportAll,
|
||||
<R as Renderer>::TextureId: 'static,
|
||||
{
|
||||
#[cfg(feature = "debug")]
|
||||
puffin::profile_function!();
|
||||
|
||||
if get_role(&surface) != Some("dnd_icon") {
|
||||
warn!(
|
||||
?surface,
|
||||
|
|
@ -215,6 +218,8 @@ where
|
|||
R: Renderer + ImportMem + ImportAll,
|
||||
<R as Renderer>::TextureId: Clone + 'static,
|
||||
{
|
||||
#[cfg(feature = "debug")]
|
||||
puffin::profile_function!();
|
||||
// draw the cursor as relevant
|
||||
// reset the cursor if the surface is no longer alive
|
||||
let cursor_status = seat
|
||||
|
|
|
|||
|
|
@ -168,6 +168,9 @@ where
|
|||
CosmicMappedRenderElement<R>: RenderElement<R>,
|
||||
E: From<CursorRenderElement<R>> + From<CosmicMappedRenderElement<R>>,
|
||||
{
|
||||
#[cfg(feature = "debug")]
|
||||
puffin::profile_function!();
|
||||
|
||||
let scale = output.current_scale().fractional_scale();
|
||||
let mut elements = Vec::new();
|
||||
|
||||
|
|
@ -293,6 +296,9 @@ where
|
|||
CosmicMappedRenderElement<R>: RenderElement<R>,
|
||||
Source: Clone,
|
||||
{
|
||||
#[cfg(feature = "debug")]
|
||||
puffin::profile_function!();
|
||||
|
||||
if let Some(ref mut fps) = fps {
|
||||
fps.start();
|
||||
#[cfg(feature = "debug")]
|
||||
|
|
@ -448,6 +454,8 @@ where
|
|||
std::ptr::null(),
|
||||
);
|
||||
}
|
||||
|
||||
puffin::GlobalProfiler::lock().new_frame();
|
||||
}
|
||||
|
||||
res
|
||||
|
|
|
|||
|
|
@ -648,6 +648,7 @@ impl State {
|
|||
#[cfg(feature = "debug")]
|
||||
Action::Debug => {
|
||||
self.common.egui.active = !self.common.egui.active;
|
||||
puffin::set_scopes_on(self.common.egui.active);
|
||||
for mapped in self
|
||||
.common
|
||||
.shell
|
||||
|
|
|
|||
|
|
@ -257,6 +257,9 @@ impl FloatingLayout {
|
|||
}
|
||||
|
||||
pub fn refresh(&mut self) {
|
||||
#[cfg(feature = "debug")]
|
||||
puffin::profile_function!();
|
||||
|
||||
self.space.refresh();
|
||||
for element in self
|
||||
.space
|
||||
|
|
@ -352,6 +355,9 @@ impl FloatingLayout {
|
|||
<R as Renderer>::TextureId: 'static,
|
||||
CosmicMappedRenderElement<R>: RenderElement<R>,
|
||||
{
|
||||
#[cfg(feature = "debug")]
|
||||
puffin::profile_function!();
|
||||
|
||||
let output_scale = output.current_scale().fractional_scale();
|
||||
self.space
|
||||
.elements_for_output(output)
|
||||
|
|
|
|||
|
|
@ -896,6 +896,9 @@ impl TilingLayout {
|
|||
}
|
||||
|
||||
pub fn refresh<'a>(&mut self) {
|
||||
#[cfg(feature = "debug")]
|
||||
puffin::profile_function!();
|
||||
|
||||
let dead_windows = self
|
||||
.mapped()
|
||||
.map(|(_, w, _)| w.clone())
|
||||
|
|
@ -1107,6 +1110,9 @@ impl TilingLayout {
|
|||
}
|
||||
|
||||
fn update_space_positions(trees: &mut HashMap<OutputData, Tree<Data>>, gaps: (i32, i32)) {
|
||||
#[cfg(feature = "debug")]
|
||||
puffin::profile_function!();
|
||||
|
||||
let (outer, inner) = gaps;
|
||||
for (output, tree) in trees
|
||||
.iter_mut()
|
||||
|
|
@ -1306,6 +1312,9 @@ impl TilingLayout {
|
|||
<R as Renderer>::TextureId: 'static,
|
||||
CosmicMappedRenderElement<R>: RenderElement<R>,
|
||||
{
|
||||
#[cfg(feature = "debug")]
|
||||
puffin::profile_function!();
|
||||
|
||||
let output_scale = output.current_scale().fractional_scale();
|
||||
|
||||
if !self.trees.contains_key(output) {
|
||||
|
|
|
|||
|
|
@ -1008,6 +1008,9 @@ impl Shell {
|
|||
}
|
||||
|
||||
pub fn refresh(&mut self) {
|
||||
#[cfg(feature = "debug")]
|
||||
puffin::profile_function!();
|
||||
|
||||
self.popups.cleanup();
|
||||
|
||||
match &mut self.workspaces {
|
||||
|
|
|
|||
|
|
@ -77,6 +77,9 @@ impl Workspace {
|
|||
}
|
||||
|
||||
pub fn refresh(&mut self) {
|
||||
#[cfg(feature = "debug")]
|
||||
puffin::profile_function!();
|
||||
|
||||
self.fullscreen.retain(|_, w| w.alive());
|
||||
self.floating_layer.refresh();
|
||||
self.tiling_layer.refresh();
|
||||
|
|
@ -443,6 +446,9 @@ impl Workspace {
|
|||
<R as Renderer>::TextureId: 'static,
|
||||
CosmicMappedRenderElement<R>: RenderElement<R>,
|
||||
{
|
||||
#[cfg(feature = "debug")]
|
||||
puffin::profile_function!();
|
||||
|
||||
let mut render_elements = Vec::new();
|
||||
|
||||
let output_scale = output.current_scale().fractional_scale();
|
||||
|
|
|
|||
|
|
@ -561,6 +561,9 @@ where
|
|||
DamageTrackedRendererError<R>,
|
||||
>,
|
||||
{
|
||||
#[cfg(feature = "debug")]
|
||||
puffin::profile_function!();
|
||||
|
||||
let mut dtr = session
|
||||
.user_data()
|
||||
.get::<SessionDTR>()
|
||||
|
|
@ -861,6 +864,9 @@ pub fn render_window_to_buffer(
|
|||
params: BufferParams,
|
||||
window: &CosmicSurface,
|
||||
) -> Result<bool, (FailureReason, anyhow::Error)> {
|
||||
#[cfg(feature = "debug")]
|
||||
puffin::profile_function!();
|
||||
|
||||
let geometry = window.geometry();
|
||||
let buffer_size = buffer_dimensions(¶ms.buffer).unwrap();
|
||||
if buffer_size != geometry.size.to_buffer(1, Transform::Normal) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue