diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2017-01-03 13:20:21 +0100 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2017-01-03 13:20:21 +0100 |
| commit | 3d3e97a4f86c5efd7292142f74dbd2f1168b61d0 (patch) | |
| tree | b38c167468c03efd638336f3c0de889ef0b6def7 /src/Interface.cs | |
| parent | 96698e1d3a00679932bf3b0c4a30f9d91250eea0 (diff) | |
* Grid.cs, TabView.cs, Wrapper.cs, GenericStack.cs, GraphicObject.cs:
IsDirty instead of deleting bmp, resolve blinking bug
* Interface.cs:
DrawingQueue locked inside the foreach loop, once per item
* OpenTKGameWindow.cs:
non blocking mutex inside render frame loop
Diffstat (limited to 'src/Interface.cs')
| -rw-r--r-- | src/Interface.cs | 27 |
1 files changed, 9 insertions, 18 deletions
diff --git a/src/Interface.cs b/src/Interface.cs index 0cff9b87..d63b75de 100644 --- a/src/Interface.cs +++ b/src/Interface.cs @@ -98,14 +98,6 @@ namespace Crow public string Clipboard;//TODO:use object instead for complex copy paste public void EnqueueForRepaint(GraphicObject g) { -// if (g.RegisteredLayoutings != LayoutingType.None) -// return; - ILayoutable l = g; -// while (l.Parent != null) -// l = l.Parent; -// if (!(l is Interface)) -// return; - lock (DrawingQueue) { if (g.IsQueueForRedraw) return; @@ -408,15 +400,16 @@ namespace Crow #if MEASURE_TIME clippingTime.Restart (); #endif - lock (DrawingQueue) { - while (DrawingQueue.Count > 0) { - GraphicObject g = DrawingQueue.Dequeue (); - g.IsQueueForRedraw = false; - g.Parent.RegisterClip (g.LastPaintedSlot); - if (g.getSlot () != g.LastPaintedSlot) - g.Parent.RegisterClip (g.getSlot ()); - } + GraphicObject g = null; + while (DrawingQueue.Count > 0) { + lock (DrawingQueue) + g = DrawingQueue.Dequeue (); + g.IsQueueForRedraw = false; + g.Parent.RegisterClip (g.LastPaintedSlot); + if (g.getSlot () != g.LastPaintedSlot) + g.Parent.RegisterClip (g.getSlot ()); } + #if MEASURE_TIME clippingTime.Stop (); #endif @@ -427,8 +420,6 @@ namespace Crow #endif using (surf = new ImageSurface (bmp, Format.Argb32, ClientRectangle.Width, ClientRectangle.Height, ClientRectangle.Width * 4)) { using (ctx = new Context (surf)){ - - if (clipping.count > 0) { //Link.draw (ctx); clipping.clearAndClip(ctx); |