debug: Add actual profiling for rendeirng

This commit is contained in:
Victoria Brekenfeld 2023-03-06 18:50:11 +01:00
parent 26743d6bdc
commit 1c62d6d061
10 changed files with 184 additions and 1 deletions

View file

@ -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(&params.buffer).unwrap();
if buffer_size != geometry.size.to_buffer(1, Transform::Normal) {