git.ucc.asn.au
/
ipdf
/
code.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
David's final changes: more profiler features, fixes.
[ipdf/code.git]
/
src
/
main.h
diff --git
a/src/main.h
b/src/main.h
index
d5ad7a9
..
2ead6f6
100644
(file)
--- a/
src/main.h
+++ b/
src/main.h
@@
-4,6
+4,7
@@
#include "view.h"
#include "screen.h"
#include "debugscript.h"
#include "view.h"
#include "screen.h"
#include "debugscript.h"
+#include "profiler.h"
#include <unistd.h>
#include <unistd.h>
@@
-124,7
+125,10
@@
void MainLoop(Document & doc, Screen & scr, View & view, int max_frames = -1)
real_clock_prev = real_clock_now;
#endif
++frames;
real_clock_prev = real_clock_now;
#endif
++frames;
+ g_profiler.BeginZone("MainLoop");
+ g_profiler.BeginZone("scr.Clear()");
scr.Clear();
scr.Clear();
+ g_profiler.EndZone();
//view.ForceBoundsDirty();
//view.ForceBufferDirty();
//view.ForceRenderDirty();
//view.ForceBoundsDirty();
//view.ForceBufferDirty();
//view.ForceRenderDirty();
@@
-135,7
+139,9
@@
void MainLoop(Document & doc, Screen & scr, View & view, int max_frames = -1)
return;
}
return;
}
+ g_profiler.BeginZone("view.Render");
view.Render(scr.ViewportWidth(), scr.ViewportHeight());
view.Render(scr.ViewportWidth(), scr.ViewportHeight());
+ g_profiler.EndZone();
double cpu_frame = scr.GetLastFrameTimeCPU();
double gpu_frame = scr.GetLastFrameTimeGPU();
double cpu_frame = scr.GetLastFrameTimeCPU();
double gpu_frame = scr.GetLastFrameTimeGPU();
@@
-210,14
+216,22
@@
void MainLoop(Document & doc, Screen & scr, View & view, int max_frames = -1)
}
#endif // 0
}
#endif // 0
- scr.Present();
-
if (make_movie)
{
std::stringstream s;
s << "frame" << frames << ".bmp";
scr.ScreenShot(s.str().c_str());
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.EndZone();
+ g_profiler.AddCounter("Total Objects", doc.ObjectCount());
+ g_profiler.EndFrame();
+
+
}
}
}
}
UCC
git Repository :: git.ucc.asn.au