Browse Source

update avalonia.native to use PixelSize.

pull/1889/head
Dan Walmsley 8 years ago
parent
commit
f2d126b9d2
  1. 9
      src/Avalonia.Native/DeferredFramebuffer.cs
  2. 6
      src/Avalonia.Native/WindowImplBase.cs

9
src/Avalonia.Native/DeferredFramebuffer.cs

@ -18,15 +18,14 @@ namespace Avalonia.Native
{
_lockWindow = lockWindow;
Address = Marshal.AllocHGlobal(width * height * 4);
Width = width;
Height = height;
Size = new PixelSize(width, height);
RowBytes = width * 4;
Dpi = dpi;
Format = PixelFormat.Rgba8888;
}
public IntPtr Address { get; set; }
public int Width { get; set; }
public PixelSize Size { get; set; }
public int Height { get; set; }
public int RowBytes { get; set; }
public Vector Dpi { get; set; }
@ -66,8 +65,8 @@ namespace Avalonia.Native
X = Dpi.X,
Y = Dpi.Y
},
Width = Width,
Height = Height,
Width = Size.Width,
Height = Size.Height,
PixelFormat = (AvnPixelFormat)Format,
Stride = RowBytes
};

6
src/Avalonia.Native/WindowImplBase.cs

@ -100,15 +100,13 @@ namespace Avalonia.Native
public FramebufferWrapper(AvnFramebuffer fb)
{
Address = fb.Data;
Width = fb.Width;
Height = fb.Height;
Size = new PixelSize(fb.Width, fb.Height);
RowBytes = fb.Stride;
Dpi = new Vector(fb.Dpi.X, fb.Dpi.Y);
Format = (PixelFormat)fb.PixelFormat;
}
public IntPtr Address { get; set; }
public int Width { get; set; }
public int Height { get; set; }
public PixelSize Size { get; set; }
public int RowBytes {get;set;}
public Vector Dpi { get; set; }
public PixelFormat Format { get; }

Loading…
Cancel
Save