diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2016-03-06 22:44:58 +0100 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2016-03-06 22:44:58 +0100 |
| commit | f6418d2a9219a63116ba706cbf54d8c0e8d88bff (patch) | |
| tree | c6d3139f20c8a52d072a15c07fa4f2df8702fb9a /src/Interface.cs | |
| parent | a14493ce86f811fa37aae035bad9cf189274176b (diff) | |
non blocking update mutex, removed delegates, test parent==null in clip registration
Diffstat (limited to 'src/Interface.cs')
| -rw-r--r-- | src/Interface.cs | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/src/Interface.cs b/src/Interface.cs index 3f4cc918..d09e19e6 100644 --- a/src/Interface.cs +++ b/src/Interface.cs @@ -37,20 +37,12 @@ namespace Crow { public class Interface : ILayoutable { - public delegate void ResizeDelegatePrototype(Rectangle bounds); - public delegate void LoaderDelegatePrototype (string path); - public ResizeDelegatePrototype ResizeDelegate; - public LoaderDelegatePrototype LoadInterfaceDelegate; - #region CTOR static Interface(){ Interface.LoadCursors (); } public Interface(){ Interface.CurrentInterface = this; - - LoadInterfaceDelegate = new LoaderDelegatePrototype(InterfaceLoad); - ResizeDelegate = new ResizeDelegatePrototype (ProcessResize); } #endregion @@ -317,14 +309,16 @@ namespace Crow FocusedWidget.onMouseClick (this, new MouseButtonEventArgs (Mouse.X, Mouse.Y, MouseButton.Left, true)); } } + if (!Monitor.TryEnter (UpdateMutex)) + return; - lock (UpdateMutex) { - processLayouting (); + processLayouting (); - clippingRegistration (); + clippingRegistration (); - processDrawing (); - } + processDrawing (); + + Monitor.Exit (UpdateMutex); // if (ToolTip.isVisible) { // ToolTip.panel.processkLayouting(); @@ -378,6 +372,8 @@ namespace Crow foreach (GraphicObject p in RedrawList) { try { p.IsInRedrawList = false; + if (p.Parent == null) + continue; p.Parent.RegisterClip (p.LastPaintedSlot); p.Parent.RegisterClip (p.getSlot ()); } catch (Exception ex) { |