소스 검색

update avalonia.native to use PixelSize.

Dan Walmsley 7 년 전
부모
커밋
f2d126b9d2
2개의 변경된 파일6개의 추가작업 그리고 9개의 파일을 삭제
  1. 4 5
      src/Avalonia.Native/DeferredFramebuffer.cs
  2. 2 4
      src/Avalonia.Native/WindowImplBase.cs

+ 4 - 5
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
                 };

+ 2 - 4
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; }