ValueChanged.Raise(this, new ValueChangeEventArgs ("fps", _fps));
#if MEASURE_TIME
ValueChanged.Raise (this, new ValueChangeEventArgs ("update",
- this.CrowInterface.updateTime.ElapsedTicks.ToString () + " ticks"));
+ this.CrowInterface.clippingTime.ElapsedTicks.ToString () + " ticks"));
ValueChanged.Raise (this, new ValueChangeEventArgs ("layouting",
this.CrowInterface.layoutTime.ElapsedTicks.ToString () + " ticks"));
ValueChanged.Raise (this, new ValueChangeEventArgs ("drawing",
while (true) {
CrowInterface.Update ();
- Thread.Sleep (10);
+ Thread.Sleep (5);
}
}
CrowInterface.IsDirty = false;
}
}
- uiQuad.Render (PrimitiveType.TriangleStrip);
+ uiQuad.Render (PrimitiveType.TriangleStrip);
GL.BindTexture(TextureTarget.Texture2D, 0);
shader.Disable ();
Margin="10" Focusable="True" >
<VerticalStack Fit="true" Name="vsFps" Spacing="10" >
<HorizontalStack Fit="true">
- <Label Text="Update:" Width="50" TextAlignment="Right"/>
- <Label Name="labUpdate" Text="{update}" Font="droid,12" Width="80" TextAlignment="Center"
+ <Label Text="Layouting:" Width="50" TextAlignment="Right"/>
+ <Label Name="labLayouting" Text="{layouting}" Font="droid,12" Width="80" TextAlignment="Center"
Background="vgradient|0:AoEnglish|1:Black"/>
</HorizontalStack>
<HorizontalStack Fit="true">
- <Label Text="Layouting:" Width="50" TextAlignment="Right"/>
- <Label Name="labLayouting" Text="{layouting}" Font="droid,12" Width="80" TextAlignment="Center"
+ <Label Text="Clipping:" Width="50" TextAlignment="Right"/>
+ <Label Text="{update}" Font="droid,12" Width="80" TextAlignment="Center"
Background="vgradient|0:AoEnglish|1:Black"/>
</HorizontalStack>
<HorizontalStack Fit="true">
</VerticalStack>
</Container>
</Border>
- <Border Fit="true" CornerRadius="5" BorderWidth="1" >
+<!-- <Border Fit="true" CornerRadius="5" BorderWidth="1" >
<Container Name="MainGrp" Background="0,5;0,5;0,5;0,4" Fit="true" Margin="10">
<VerticalStack Fit="true" Spacing="10" >
<HorizontalStack Fit="true">
</HorizontalStack>
</VerticalStack>
</Container>
- </Border>
+ </Border>-->
<HorizontalStack Fit="true" Background="BlueCrayola" Margin="3">
<GraphicObject Margin="10" Background="LimeGreen" Width="5" Height="5"/>
<TextBox Font="droid, 16" Multiline="true" Text="this is a test\nmultiline" Margin="2"/>
public virtual void RegisterForLayouting(LayoutingType layoutType){
if (Parent == null)
return;
- lock (Interface.CurrentInterface.LayoutingQueue) {
+ lock (Interface.CurrentInterface.LayoutMutex) {
//dont set position for stretched item
if (Width == 0)
layoutType &= (~LayoutingType.X);
public GraphicObject LoadInterface (string path)
{
- lock (this) {
+ lock (UpdateMutex) {
GraphicObject tmp = Interface.Load (path, this);
AddWidget (tmp);
return tmp;
#endregion
#if MEASURE_TIME
- public Stopwatch updateTime = new Stopwatch ();
+ public Stopwatch clippingTime = new Stopwatch ();
public Stopwatch layoutTime = new Stopwatch ();
public Stopwatch guTime = new Stopwatch ();
public Stopwatch drawingTime = new Stopwatch ();
public byte[] dirtyBmp;
public bool IsDirty = false;
public Rectangle DirtyRect;
+ public object LayoutMutex = new object();
public object RenderMutex = new object();
public object UpdateMutex = new object();
FocusedWidget.onMouseClick (this, new MouseButtonEventArgs (Mouse.X, Mouse.Y, MouseButton.Left, true));
}
}
- #if MEASURE_TIME
- guTime.Reset ();
- updateTime.Restart ();
- #endif
- lock (this) {
+ lock (UpdateMutex) {
processLayouting ();
clippingRegistration ();
processDrawing ();
}
- #if MEASURE_TIME
- updateTime.Stop ();
- #endif
// if (ToolTip.isVisible) {
// ToolTip.panel.processkLayouting();
// if (ToolTip.panel.layoutIsValid)
#if MEASURE_TIME
layoutTime.Restart();
#endif
- lock (Interface.CurrentInterface.LayoutingQueue) {
+ lock (LayoutMutex) {
//Debug.WriteLine ("======= Layouting queue start =======");
LayoutingQueueItem lqi = null;
while (Interface.CurrentInterface.LayoutingQueue.Count > 0) {
#endif
}
void clippingRegistration(){
+ #if MEASURE_TIME
+ clippingTime.Restart ();
+ #endif
lock (CurrentInterface.GraphicUpdateQueue) {
while (CurrentInterface.GraphicUpdateQueue.Count > 0) {
GraphicObject g = CurrentInterface.GraphicUpdateQueue.Dequeue ();
}
}
RedrawList.Clear ();
+ #if MEASURE_TIME
+ clippingTime.Stop ();
+ #endif
}
void processDrawing(){
#if MEASURE_TIME
public void ProcessResize(Rectangle bounds){
- lock (CurrentInterface) {
+ lock (UpdateMutex) {
clientRectangle = bounds;
int stride = 4 * ClientRectangle.Width;