diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2017-05-07 11:05:21 +0200 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2017-05-07 11:05:21 +0200 |
| commit | 7a41b24cb3efcf9bb32189028ddbfedd591e8706 (patch) | |
| tree | 8e2744824314e793044c478751d6496e43e1fc9b /src/Interface.cs | |
| parent | a4be468bb4df28213bee49af6d72463b8becde4a (diff) | |
first working Crow interface double buffered on drm
Diffstat (limited to 'src/Interface.cs')
| -rw-r--r-- | src/Interface.cs | 47 |
1 files changed, 25 insertions, 22 deletions
diff --git a/src/Interface.cs b/src/Interface.cs index 8439c31e..6c7d99c4 100644 --- a/src/Interface.cs +++ b/src/Interface.cs @@ -511,28 +511,30 @@ namespace Crow clipping.stroke (ctx, Color.Red.AdjustAlpha(0.5)); #endif lock (RenderMutex) { - if (IsDirty) - DirtyRect += clipping.Bounds; - else - DirtyRect = clipping.Bounds; - - DirtyRect.Left = Math.Max (0, DirtyRect.Left); - DirtyRect.Top = Math.Max (0, DirtyRect.Top); - DirtyRect.Width = Math.Min (ClientRectangle.Width - DirtyRect.Left, DirtyRect.Width); - DirtyRect.Height = Math.Min (ClientRectangle.Height - DirtyRect.Top, DirtyRect.Height); - DirtyRect.Width = Math.Max (0, DirtyRect.Width); - DirtyRect.Height = Math.Max (0, DirtyRect.Height); - - if (DirtyRect.Width > 0 && DirtyRect.Height >0) { - dirtyBmp = new byte[4 * DirtyRect.Width * DirtyRect.Height]; - for (int y = 0; y < DirtyRect.Height; y++) { - Array.Copy (bmp, - ((DirtyRect.Top + y) * ClientRectangle.Width * 4) + DirtyRect.Left * 4, - dirtyBmp, y * DirtyRect.Width * 4, DirtyRect.Width * 4); - } - IsDirty = true; - } else - IsDirty = false; + Array.Copy (bmp, dirtyBmp, bmp.Length); + IsDirty = true; +// if (IsDirty) +// DirtyRect += clipping.Bounds; +// else +// DirtyRect = clipping.Bounds; +// +// DirtyRect.Left = Math.Max (0, DirtyRect.Left); +// DirtyRect.Top = Math.Max (0, DirtyRect.Top); +// DirtyRect.Width = Math.Min (ClientRectangle.Width - DirtyRect.Left, DirtyRect.Width); +// DirtyRect.Height = Math.Min (ClientRectangle.Height - DirtyRect.Top, DirtyRect.Height); +// DirtyRect.Width = Math.Max (0, DirtyRect.Width); +// DirtyRect.Height = Math.Max (0, DirtyRect.Height); +// +// if (DirtyRect.Width > 0 && DirtyRect.Height >0) { +// dirtyBmp = new byte[4 * DirtyRect.Width * DirtyRect.Height]; +// for (int y = 0; y < DirtyRect.Height; y++) { +// Array.Copy (bmp, +// ((DirtyRect.Top + y) * ClientRectangle.Width * 4) + DirtyRect.Left * 4, +// dirtyBmp, y * DirtyRect.Width * 4, DirtyRect.Width * 4); +// } +// +// } else +// IsDirty = false; } clipping.Reset (); } @@ -646,6 +648,7 @@ namespace Crow int stride = 4 * ClientRectangle.Width; int bmpSize = Math.Abs (stride) * ClientRectangle.Height; bmp = new byte[bmpSize]; + dirtyBmp = new byte[bmpSize]; foreach (GraphicObject g in GraphicTree) g.RegisterForLayouting (LayoutingType.All); |