X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fmain.h;h=a96e933c64fbeb1acdfdaa1a0ae1c83da02f33b5;hp=d5ad7a987c7a5b120a5b5847ec9ee7959ec016e9;hb=f0b6c9b6b95fde134927c395afbfbbbc057868e6;hpb=6c0dfe752994312ee58d307b383948bfeb2d6e2e diff --git a/src/main.h b/src/main.h index d5ad7a9..a96e933 100644 --- a/src/main.h +++ b/src/main.h @@ -4,6 +4,7 @@ #include "view.h" #include "screen.h" #include "debugscript.h" +#include "profiler.h" #include @@ -124,7 +125,9 @@ void MainLoop(Document & doc, Screen & scr, View & view, int max_frames = -1) real_clock_prev = real_clock_now; #endif ++frames; + g_profiler.BeginZone("scr.Clear()"); scr.Clear(); + g_profiler.EndZone(); //view.ForceBoundsDirty(); //view.ForceBufferDirty(); //view.ForceRenderDirty(); @@ -135,7 +138,9 @@ void MainLoop(Document & doc, Screen & scr, View & view, int max_frames = -1) return; } + g_profiler.BeginZone("view.Render"); view.Render(scr.ViewportWidth(), scr.ViewportHeight()); + g_profiler.EndZone(); double cpu_frame = scr.GetLastFrameTimeCPU(); double gpu_frame = scr.GetLastFrameTimeGPU(); @@ -210,14 +215,20 @@ void MainLoop(Document & doc, Screen & scr, View & view, int max_frames = -1) } #endif // 0 - scr.Present(); - if (make_movie) { std::stringstream s; s << "frame" << frames << ".bmp"; scr.ScreenShot(s.str().c_str()); - } + } + + + g_profiler.BeginZone("scr.Present()"); + scr.Present(); + g_profiler.EndZone(); + g_profiler.EndFrame(); + + } }