Commit c904f2bf authored by Tomeu Vizoso's avatar Tomeu Vizoso
Browse files

pathfinder: Use trace for canvas_text with 2 frames



The existing trace had only one frame, in which the rendering was
together with the setup (shaders, etc).

This caused for continuous growing of resources when looping over the
last frame when tracking performance, as resources were created but not
released.

By rendering twice, we have a first frame with setup+rendering, and a
second one that just renders. This frame is more amenable for using for
performance tracking.

To take this frame, the application had to be modified with the patch in
this commit (0001-canvas-text-Render-twice.patch).
Signed-off-by: Tomeu Vizoso's avatarTomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <!36>
parent f781eec0
Pipeline #374250 passed with stages
in 3 minutes and 16 seconds
From 7149bf418102cda0748988163dfdfd97ef9b255a Mon Sep 17 00:00:00 2001
From: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Date: Tue, 3 Aug 2021 08:05:55 +0200
Subject: [PATCH] canvas-text: Render twice
Because the second frame will have the rendering but not the setup
(shaders, etc).
This helps with using a trace of this for measuring rendering performance.
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
---
examples/canvas_text/src/main.rs | 2 ++
1 file changed, 2 insertions(+)
diff --git a/examples/canvas_text/src/main.rs b/examples/canvas_text/src/main.rs
index 39dd1e91a8c3..c592d7c19795 100644
--- a/examples/canvas_text/src/main.rs
+++ b/examples/canvas_text/src/main.rs
@@ -70,6 +70,7 @@ fn main() {
match event_pump.wait_event() {
Event::Quit {..} | Event::KeyDown { keycode: Some(Keycode::Escape), .. } => return,
Event::Window { win_event: WindowEvent::Exposed, .. } => {
+ for _n in 0..2 {
// Make a canvas.
let mut canvas = Canvas::new(window_size.to_f32()).get_context_2d(font_context.clone());
@@ -86,6 +87,7 @@ fn main() {
RayonExecutor);
scene.build_and_render(&mut renderer, BuildOptions::default());
window.gl_swap_window();
+ }
},
_ => {}
}
--
2.31.1
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment