aboutsummaryrefslogtreecommitdiffstatsci
path: root/src/OpenTKGameWindow.cs
diff options
context:
space:
mode:
authorjpbruyere <jp.bruyere@hotmail.com>2016-02-04 20:20:35 +0100
committerjpbruyere <jp.bruyere@hotmail.com>2016-02-04 20:20:35 +0100
commit335a36c2180bf112f6b4317deeb0f947c10197ac (patch)
tree021d97140e79e0f2126dd7b45a012125796f3e9c /src/OpenTKGameWindow.cs
parentba653e2a710377f0e051977dc43cd34d6f5314a3 (diff)
MEASURE_TIME debug var
Diffstat (limited to 'src/OpenTKGameWindow.cs')
-rw-r--r--src/OpenTKGameWindow.cs22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/OpenTKGameWindow.cs b/src/OpenTKGameWindow.cs
index 81bb0258..6726a87c 100644
--- a/src/OpenTKGameWindow.cs
+++ b/src/OpenTKGameWindow.cs
@@ -225,12 +225,14 @@ namespace Crow
}
#endregion
- #region update
+ #if MEASURE_TIME
public Stopwatch updateTime = new Stopwatch ();
public Stopwatch layoutTime = new Stopwatch ();
public Stopwatch guTime = new Stopwatch ();
public Stopwatch drawingTime = new Stopwatch ();
+ #endif
+ #region update
void update ()
{
if (mouseRepeatCount > 0) {
@@ -240,11 +242,12 @@ namespace Crow
FocusedWidget.onMouseClick (this, new MouseButtonEventArgs (Mouse.X, Mouse.Y, MouseButton.Left, true));
}
}
-
- updateTime.Restart ();
+ #if MEASURE_TIME
layoutTime.Reset ();
guTime.Reset ();
drawingTime.Reset ();
+ updateTime.Restart ();
+ #endif
surf = new ImageSurface(bmp, Format.Argb32, ClientRectangle.Width, ClientRectangle.Height,ClientRectangle.Width*4);
ctx = new Context(surf);
@@ -253,6 +256,9 @@ namespace Crow
GraphicObjects.CopyTo (invGOList,0);
invGOList = invGOList.Reverse ().ToArray ();
+ #if MEASURE_TIME
+ layoutTime.Start ();
+ #endif
//Debug.WriteLine ("======= Layouting queue start =======");
while (Interface.LayoutingQueue.Count > 0) {
@@ -267,7 +273,9 @@ namespace Crow
// updateTime.ElapsedMilliseconds, lqi.ToString());
// }
}
-
+ #if MEASURE_TIME
+ layoutTime.Stop ();
+ #endif
//Debug.WriteLine ("otd:" + gobjsToRedraw.Count.ToString () + "-");
//final redraw clips should be added only when layout is completed among parents,
@@ -278,9 +286,11 @@ namespace Crow
foreach (GraphicObject p in gotr) {
p.registerClipRect ();
}
- updateTime.Stop ();
+ #if MEASURE_TIME
+ updateTime.Stop ();
drawingTime.Start ();
+ #endif
lock (redrawClip) {
if (redrawClip.count > 0) {
@@ -310,7 +320,9 @@ namespace Crow
redrawClip.Reset ();
}
}
+ #if MEASURE_TIME
drawingTime.Stop ();
+ #endif
//surf.WriteToPng (@"/mnt/data/test.png");
ctx.Dispose ();
surf.Dispose ();