From 488add6f728a66abefb3c8c031ee973401925d49 Mon Sep 17 00:00:00 2001 From: jpbruyere Date: Thu, 4 Feb 2016 19:29:28 +0100 Subject: [PATCH] remove Lock for LayoutingQueue: no used for now --- UnitTest/NUnitCrowWindow.cs | 2 -- src/GraphicObjects/GraphicObject.cs | 12 +++++------- src/OpenTKGameWindow.cs | 4 ++-- 3 files changed, 7 insertions(+), 11 deletions(-) diff --git a/UnitTest/NUnitCrowWindow.cs b/UnitTest/NUnitCrowWindow.cs index 086e122b..1ba9a32e 100644 --- a/UnitTest/NUnitCrowWindow.cs +++ b/UnitTest/NUnitCrowWindow.cs @@ -149,7 +149,6 @@ namespace Crow invGOList = invGOList.Reverse ().ToArray (); //Debug.WriteLine ("======= Layouting queue start ======="); - lock (Interface.LayoutingQueue) { while (Interface.LayoutingQueue.Count > 0) { // Stopwatch lqiProcTime = new Stopwatch (); // lqiProcTime.Start (); @@ -162,7 +161,6 @@ namespace Crow // updateTime.ElapsedMilliseconds, lqi.ToString()); // } } - } //final redraw clips should be added only when layout is completed among parents, //that's why it take place in a second pass diff --git a/src/GraphicObjects/GraphicObject.cs b/src/GraphicObjects/GraphicObject.cs index 6fe3a404..f6c9c84d 100644 --- a/src/GraphicObjects/GraphicObject.cs +++ b/src/GraphicObjects/GraphicObject.cs @@ -507,7 +507,7 @@ namespace Crow #if DEBUG_LAYOUTING Debug.WriteLine ("RegisterForLayouting => {1}->{0}", layoutType, this.ToString()); #endif - lock (Interface.LayoutingQueue) { + deleteLQI (layoutType); if ((layoutType & (int)LayoutingType.Width) > 0) { if (Bounds.Width == 0) //stretch in parent @@ -535,7 +535,7 @@ namespace Crow //for x positionning, sizing of parent and this have to be done Interface.LayoutingQueue.EnqueueAfterThisAndParentSizing (LayoutingType.Y, this); } - } + /// trigger dependant sizing component update public virtual void OnLayoutChanges(LayoutingType layoutType) @@ -702,11 +702,9 @@ namespace Crow LastSlots.Height = Slot.Height; break; } - lock (Interface.LayoutingQueue) { - //if no layouting remains in queue for item, registre for redraw - if (this.RegisteredLQIs.Count () <= 0 && bmp == null) - this.RegisterForRedraw (); - } + //if no layouting remains in queue for item, registre for redraw + if (this.RegisteredLQIs.Count () <= 0 && bmp == null) + this.RegisterForRedraw (); } /// This is the common overridable drawing routine to create new widget diff --git a/src/OpenTKGameWindow.cs b/src/OpenTKGameWindow.cs index b5317cef..587dd968 100644 --- a/src/OpenTKGameWindow.cs +++ b/src/OpenTKGameWindow.cs @@ -261,7 +261,7 @@ namespace Crow invGOList = invGOList.Reverse ().ToArray (); //Debug.WriteLine ("======= Layouting queue start ======="); - lock (Interface.LayoutingQueue) { + while (Interface.LayoutingQueue.Count > 0) { // Stopwatch lqiProcTime = new Stopwatch (); // lqiProcTime.Start (); @@ -274,7 +274,7 @@ namespace Crow // updateTime.ElapsedMilliseconds, lqi.ToString()); // } } - } + //Debug.WriteLine ("otd:" + gobjsToRedraw.Count.ToString () + "-"); //final redraw clips should be added only when layout is completed among parents, -- 2.47.3