]> O.S.I.I.S - jp/crow.git/commitdiff
MEASURE_TIME debug var
authorjpbruyere <jp.bruyere@hotmail.com>
Thu, 4 Feb 2016 19:20:35 +0000 (20:20 +0100)
committerjpbruyere <jp.bruyere@hotmail.com>
Thu, 4 Feb 2016 19:20:35 +0000 (20:20 +0100)
Crow.csproj
Crow.userprefs
Tests/GOLIBTest_4.cs
Tests/GOLIBTests.cs
Tests/Interfaces/testColorList.crow
Tests/Interfaces/testWindow.goml
Tests/Tests.csproj
src/OpenTKGameWindow.cs

index 3f655d1753596130073f749cddb09bf839d1f7b1..a3dbc710556d0bcbbed15931020a80db4f736435 100644 (file)
@@ -46,7 +46,7 @@
   </PropertyGroup>
   <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
     <OutputPath>bin\Debug</OutputPath>
-    <DefineConstants>TRACE;DEBUG;__linux__;DEBUG_LOAD_TIME0;DEBUG_LAYOUTING0;DEBUG_BINDING0;DEBUG_CLIP_RECTANGLE0</DefineConstants>
+    <DefineConstants>TRACE;DEBUG;__linux__;MEASURE_TIME;DEBUG_LOAD_TIME0;DEBUG_LAYOUTING0;DEBUG_BINDING0;DEBUG_CLIP_RECTANGLE0</DefineConstants>
   </PropertyGroup>
   <!--  <PropertyGroup Condition=" '$(Platform)' == 'Linux_x86' ">
     <DefineConstants>__linux__</DefineConstants>
index 54c7b2e0a992124090a3bcb6bfb89d4f344bce20..a89a8f1f7be11402a66266f6545454a02da085d1 100644 (file)
@@ -2,12 +2,16 @@
   <MonoDevelop.Ide.Workspace ActiveConfiguration="Debug|Linux_x86" />
   <MonoDevelop.Ide.Workbench ActiveDocument="Tests/GOLIBTests.cs">
     <Files>
-      <File FileName="Tests/Interfaces/testColorList.crow" Line="21" Column="1" />
-      <File FileName="src/GraphicObjects/ListBox.cs" Line="36" Column="34" />
-      <File FileName="Tests/GOLIBTests.cs" Line="131" Column="31" />
-      <File FileName="src/GraphicObjects/GraphicObject.cs" Line="968" Column="1" />
-      <File FileName="Tests/Interfaces/colorItem.crow" Line="2" Column="41" />
-      <File FileName="src/Colors.cs" Line="143" Column="3" />
+      <File FileName="Tests/GOLIBTests.cs" Line="98" Column="2" />
+      <File FileName="src/GraphicObjects/GraphicObject.cs" Line="538" Column="3" />
+      <File FileName="src/GraphicObjects/Group.cs" Line="197" Column="1" />
+      <File FileName="src/GraphicObjects/PrivateContainer.cs" Line="127" Column="1" />
+      <File FileName="src/OpenTKGameWindow.cs" Line="328" Column="10" />
+      <File FileName="src/Rectangles.cs" Line="90" Column="21" />
+      <File FileName="src/GraphicObjects/Scroller.cs" Line="196" Column="1" />
+      <File FileName="src/LayoutingQueue.cs" Line="30" Column="4" />
+      <File FileName="src/Interface.cs" Line="56" Column="1" />
+      <File FileName="UnitTest/NUnitCrowWindow.cs" Line="163" Column="1" />
     </Files>
   </MonoDevelop.Ide.Workbench>
   <MonoDevelop.Ide.DebuggingService.Breakpoints>
index e4a37b4835565f1c39b3b30c5368472cc0a7aa68..ec47b48c0d971fcc62469c717ae554569dcf3c1b 100644 (file)
@@ -52,8 +52,8 @@ namespace test
                                }
 
                                ValueChanged.Raise(this, new ValueChangeEventArgs ("fps", _fps));
-                               ValueChanged.Raise (this, new ValueChangeEventArgs ("update",
-                                       this.updateTime.ElapsedMilliseconds.ToString () + " ms"));
+//                             ValueChanged.Raise (this, new ValueChangeEventArgs ("update",
+//                                     this.updateTime.ElapsedMilliseconds.ToString () + " ms"));
                        }
                }
 
index 087547c806c84e1e8ffe70f69b34c3dd6dbef753..9ef7784a7c557aaa2a5611477720123a85c6b95b 100644 (file)
@@ -91,10 +91,14 @@ namespace test
                                }
 
                                ValueChanged.Raise(this, new ValueChangeEventArgs ("fps", _fps));
+                               #if MEASURE_TIME
                                ValueChanged.Raise (this, new ValueChangeEventArgs ("update",
-                                       this.updateTime.ElapsedMilliseconds.ToString () + " ms"));
+                                       this.updateTime.ElapsedTicks.ToString () + " ticks"));
+                               ValueChanged.Raise (this, new ValueChangeEventArgs ("layouting",
+                                       this.layoutTime.ElapsedTicks.ToString () + " ticks"));
                                ValueChanged.Raise (this, new ValueChangeEventArgs ("drawing",
-                                       this.drawingTime.ElapsedMilliseconds.ToString () + " ms"));
+                                       this.drawingTime.ElapsedTicks.ToString () + " ticks"));
+                               #endif
                        }
                }
 
@@ -109,6 +113,7 @@ namespace test
                }
                public string update = "";
                public string drawing = "";
+               public string layouting = "";
                #endregion
 
                public int intValue = 25;
index e00b52b8f4133be1d02a76ed42574eef572190e1..fe653dd4a45471a7bffef4788948887b073a9598 100755 (executable)
@@ -1,7 +1,7 @@
 <?xml version="1.0"?>
 <Border BorderWidth="2" Fit="true">
        <VerticalStack Fit="true" Margin="5">
-               <ListBox Data="{TestList}" Background="0,5;0,5;0,5;0,5"
+               <ListBox Data="{TestList}" Background="0,5;0,5;0,5;0,8"
                                         HorizontalAlignment="Center" Width="-1" Height="350" Margin="5"
                                         ItemTemplate="#Tests.Interfaces.colorItem.crow">
                        <Template>
index 7fa41b43a9295d568e31c57c9842e4682e24e2a5..ca3467bf2bb9986a04bd32bcc5277fbcbc7f02df 100755 (executable)
                        <VerticalStack Fit="true" Name="vsFps"  Spacing="10" >
                                <HorizontalStack Fit="true">
                                        <Label Text="Update:" Width="50" TextAlignment="RightCenter"/>
-                                       <Label Name="labUpdate" Text="{update}" Font="droid,12" Width="50" TextAlignment="Center"
+                                       <Label Name="labUpdate" Text="{update}" Font="droid,12" Width="80" TextAlignment="Center"
+                                               Background="vgradient|0:AoEnglish|1:Black"/>
+                               </HorizontalStack>
+                               <HorizontalStack Fit="true">
+                                       <Label Text="Layouting:" Width="50" TextAlignment="RightCenter"/>
+                                       <Label Name="labLayouting" Text="{layouting}" Font="droid,12" Width="80" TextAlignment="Center"
                                                Background="vgradient|0:AoEnglish|1:Black"/>
                                </HorizontalStack>
                                <HorizontalStack Fit="true">
                                        <Label Text="Drawing:" Width="50" TextAlignment="RightCenter"/>
-                                       <Label Name="labDrawing" Text="{drawing}" Font="droid,12" Width="50" TextAlignment="Center"
+                                       <Label Name="labDrawing" Text="{drawing}" Font="droid,12" Width="80" TextAlignment="Center"
                                                Background="vgradient|0:AoEnglish|1:Black"/>
                                </HorizontalStack>
                                <HorizontalStack Fit="true">
index ad4e7b42f8e737bae8ce7cad101fbddcc209926a..612792d0452a00cb8e46fd5d5fcdb3d8e91cdbed 100644 (file)
@@ -33,6 +33,9 @@
     <WarningLevel>0</WarningLevel>
     <ConsolePause>false</ConsolePause>
   </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DefineConstants>DEBUG;TRACE;MEASURE_TIME</DefineConstants>
+  </PropertyGroup>
   <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
   <ItemGroup>
     <Reference Include="System" />
index 81bb0258046be2e0f75570f836dac01ffd9b1d64..6726a87c14260613b814ac828c9017341919067e 100644 (file)
@@ -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 ();