X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fmain.h;h=75c4b18ffea581805bcd2e7a041934919674783a;hp=654aa09a8504b13551cb48cdedd30e7159002924;hb=a8297c3461718f2d9afc7a2f8ca620d320ac5f97;hpb=667281b828c8515e995c0000706157cee180fa08 diff --git a/src/main.h b/src/main.h index 654aa09..75c4b18 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 @@ -122,7 +123,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(); @@ -133,7 +136,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(); @@ -206,6 +211,9 @@ void MainLoop(Document & doc, Screen & scr, View & view, int max_frames = -1) } #endif // 0 + g_profiler.BeginZone("scr.Present()"); scr.Present(); + g_profiler.EndZone(); + g_profiler.EndFrame(); } }