diff --git a/src/Avalonia.Controls/Remote/RemoteWidget.cs b/src/Avalonia.Controls/Remote/RemoteWidget.cs index 83360a0010..ea8c3ebe52 100644 --- a/src/Avalonia.Controls/Remote/RemoteWidget.cs +++ b/src/Avalonia.Controls/Remote/RemoteWidget.cs @@ -14,7 +14,7 @@ namespace Avalonia.Controls.Remote { private readonly IAvaloniaRemoteTransportConnection _connection; private FrameMessage _lastFrame; - private WritableBitmap _bitmap; + private WriteableBitmap _bitmap; public RemoteWidget(IAvaloniaRemoteTransportConnection connection) { _connection = connection; @@ -62,7 +62,7 @@ namespace Avalonia.Controls.Remote var fmt = (PixelFormat) _lastFrame.Format; if (_bitmap == null || _bitmap.PixelWidth != _lastFrame.Width || _bitmap.PixelHeight != _lastFrame.Height) - _bitmap = new WritableBitmap(_lastFrame.Width, _lastFrame.Height, fmt); + _bitmap = new WriteableBitmap(_lastFrame.Width, _lastFrame.Height, fmt); using (var l = _bitmap.Lock()) { var lineLen = (fmt == PixelFormat.Rgb565 ? 2 : 4) * _lastFrame.Width; diff --git a/src/Avalonia.Visuals/Media/Imaging/WritableBitmap.cs b/src/Avalonia.Visuals/Media/Imaging/WriteableBitmap.cs similarity index 51% rename from src/Avalonia.Visuals/Media/Imaging/WritableBitmap.cs rename to src/Avalonia.Visuals/Media/Imaging/WriteableBitmap.cs index df3e71dc85..af6fde6876 100644 --- a/src/Avalonia.Visuals/Media/Imaging/WritableBitmap.cs +++ b/src/Avalonia.Visuals/Media/Imaging/WriteableBitmap.cs @@ -9,15 +9,15 @@ using Avalonia.Utilities; namespace Avalonia.Media.Imaging { /// - /// Holds a writable bitmap image. + /// Holds a writeable bitmap image. /// - public class WritableBitmap : Bitmap + public class WriteableBitmap : Bitmap { - public WritableBitmap(int width, int height, PixelFormat? format = null) - : base(AvaloniaLocator.Current.GetService().CreateWritableBitmap(width, height, format)) + public WriteableBitmap(int width, int height, PixelFormat? format = null) + : base(AvaloniaLocator.Current.GetService().CreateWriteableBitmap(width, height, format)) { } - public ILockedFramebuffer Lock() => ((IWritableBitmapImpl) PlatformImpl.Item).Lock(); + public ILockedFramebuffer Lock() => ((IWriteableBitmapImpl) PlatformImpl.Item).Lock(); } } diff --git a/src/Avalonia.Visuals/Platform/IPlatformRenderInterface.cs b/src/Avalonia.Visuals/Platform/IPlatformRenderInterface.cs index aab8521f6d..cc17efd2bb 100644 --- a/src/Avalonia.Visuals/Platform/IPlatformRenderInterface.cs +++ b/src/Avalonia.Visuals/Platform/IPlatformRenderInterface.cs @@ -61,13 +61,13 @@ namespace Avalonia.Platform double dpiY); /// - /// Creates a writable bitmap implementation. + /// Creates a writeable bitmap implementation. /// /// The width of the bitmap. /// The height of the bitmap. /// Pixel format (optional). - /// An . - IWritableBitmapImpl CreateWritableBitmap(int width, int height, PixelFormat? format = null); + /// An . + IWriteableBitmapImpl CreateWriteableBitmap(int width, int height, PixelFormat? format = null); /// /// Loads a bitmap implementation from a file.. diff --git a/src/Avalonia.Visuals/Platform/IWritableBitmapImpl.cs b/src/Avalonia.Visuals/Platform/IWriteableBitmapImpl.cs similarity index 75% rename from src/Avalonia.Visuals/Platform/IWritableBitmapImpl.cs rename to src/Avalonia.Visuals/Platform/IWriteableBitmapImpl.cs index b736c11dab..7ab5a7c100 100644 --- a/src/Avalonia.Visuals/Platform/IWritableBitmapImpl.cs +++ b/src/Avalonia.Visuals/Platform/IWriteableBitmapImpl.cs @@ -7,9 +7,9 @@ using System.Threading.Tasks; namespace Avalonia.Platform { /// - /// Defines the platform-specific interface for a . + /// Defines the platform-specific interface for a . /// - public interface IWritableBitmapImpl : IBitmapImpl + public interface IWriteableBitmapImpl : IBitmapImpl { ILockedFramebuffer Lock(); } diff --git a/src/Skia/Avalonia.Skia/BitmapImpl.cs b/src/Skia/Avalonia.Skia/BitmapImpl.cs index 00ab770e01..ccc5a37105 100644 --- a/src/Skia/Avalonia.Skia/BitmapImpl.cs +++ b/src/Skia/Avalonia.Skia/BitmapImpl.cs @@ -6,7 +6,7 @@ using SkiaSharp; namespace Avalonia.Skia { - class BitmapImpl : IRenderTargetBitmapImpl, IWritableBitmapImpl + class BitmapImpl : IRenderTargetBitmapImpl, IWriteableBitmapImpl { private Vector _dpi; diff --git a/src/Skia/Avalonia.Skia/PlatformRenderInterface.cs b/src/Skia/Avalonia.Skia/PlatformRenderInterface.cs index bd3769e4a5..50e65f45dc 100644 --- a/src/Skia/Avalonia.Skia/PlatformRenderInterface.cs +++ b/src/Skia/Avalonia.Skia/PlatformRenderInterface.cs @@ -88,7 +88,7 @@ namespace Avalonia.Skia return new FramebufferRenderTarget(fb); } - public IWritableBitmapImpl CreateWritableBitmap(int width, int height, PixelFormat? format = null) + public IWriteableBitmapImpl CreateWriteableBitmap(int width, int height, PixelFormat? format = null) { return new BitmapImpl(width, height, new Vector(96, 96), format); } diff --git a/src/Windows/Avalonia.Direct2D1/Direct2D1Platform.cs b/src/Windows/Avalonia.Direct2D1/Direct2D1Platform.cs index a47c871f5a..296edcb2d9 100644 --- a/src/Windows/Avalonia.Direct2D1/Direct2D1Platform.cs +++ b/src/Windows/Avalonia.Direct2D1/Direct2D1Platform.cs @@ -168,9 +168,9 @@ namespace Avalonia.Direct2D1 dpiY); } - public IWritableBitmapImpl CreateWritableBitmap(int width, int height, PixelFormat? format = null) + public IWriteableBitmapImpl CreateWriteableBitmap(int width, int height, PixelFormat? format = null) { - return new WritableWicBitmapImpl(s_imagingFactory, width, height, format); + return new WriteableWicBitmapImpl(s_imagingFactory, width, height, format); } public IStreamGeometryImpl CreateStreamGeometry() diff --git a/src/Windows/Avalonia.Direct2D1/Media/Imaging/WritableWicBitmapImpl.cs b/src/Windows/Avalonia.Direct2D1/Media/Imaging/WriteableWicBitmapImpl.cs similarity index 86% rename from src/Windows/Avalonia.Direct2D1/Media/Imaging/WritableWicBitmapImpl.cs rename to src/Windows/Avalonia.Direct2D1/Media/Imaging/WriteableWicBitmapImpl.cs index 5dc07e06c4..fc931c32db 100644 --- a/src/Windows/Avalonia.Direct2D1/Media/Imaging/WritableWicBitmapImpl.cs +++ b/src/Windows/Avalonia.Direct2D1/Media/Imaging/WriteableWicBitmapImpl.cs @@ -9,9 +9,9 @@ using PixelFormat = Avalonia.Platform.PixelFormat; namespace Avalonia.Direct2D1.Media.Imaging { - class WritableWicBitmapImpl : WicBitmapImpl, IWritableBitmapImpl + class WriteableWicBitmapImpl : WicBitmapImpl, IWriteableBitmapImpl { - public WritableWicBitmapImpl(ImagingFactory factory, int width, int height, PixelFormat? pixelFormat) + public WriteableWicBitmapImpl(ImagingFactory factory, int width, int height, PixelFormat? pixelFormat) : base(factory, width, height, pixelFormat) { } diff --git a/tests/Avalonia.RenderTests/Media/BitmapTests.cs b/tests/Avalonia.RenderTests/Media/BitmapTests.cs index a7cd06a894..089579a0a0 100644 --- a/tests/Avalonia.RenderTests/Media/BitmapTests.cs +++ b/tests/Avalonia.RenderTests/Media/BitmapTests.cs @@ -106,9 +106,9 @@ namespace Avalonia.Direct2D1.RenderTests.Media [Theory] [InlineData(PixelFormat.Bgra8888), InlineData(PixelFormat.Rgba8888)] - public void WritableBitmapShouldBeUsable(PixelFormat fmt) + public void WriteableBitmapShouldBeUsable(PixelFormat fmt) { - var writableBitmap = new WritableBitmap(256, 256, fmt); + var writeableBitmap = new WriteableBitmap(256, 256, fmt); var data = new int[256 * 256]; for (int y = 0; y < 256; y++) @@ -116,7 +116,7 @@ namespace Avalonia.Direct2D1.RenderTests.Media data[y * 256 + x] =(int)((uint)(x + (y << 8)) | 0xFF000000u); - using (var l = writableBitmap.Lock()) + using (var l = writeableBitmap.Lock()) { for(var r = 0; r<256; r++) { @@ -125,9 +125,9 @@ namespace Avalonia.Direct2D1.RenderTests.Media } - var name = nameof(WritableBitmapShouldBeUsable) + "_" + fmt; + var name = nameof(WriteableBitmapShouldBeUsable) + "_" + fmt; - writableBitmap.Save(System.IO.Path.Combine(OutputPath, name + ".out.png")); + writeableBitmap.Save(System.IO.Path.Combine(OutputPath, name + ".out.png")); CompareImagesNoRenderer(name); } diff --git a/tests/Avalonia.UnitTests/MockPlatformRenderInterface.cs b/tests/Avalonia.UnitTests/MockPlatformRenderInterface.cs index 8c6c949e07..de2b517956 100644 --- a/tests/Avalonia.UnitTests/MockPlatformRenderInterface.cs +++ b/tests/Avalonia.UnitTests/MockPlatformRenderInterface.cs @@ -39,7 +39,7 @@ namespace Avalonia.UnitTests return new MockStreamGeometryImpl(); } - public IWritableBitmapImpl CreateWritableBitmap(int width, int height, PixelFormat? format = default(PixelFormat?)) + public IWriteableBitmapImpl CreateWriteableBitmap(int width, int height, PixelFormat? format = default(PixelFormat?)) { throw new NotImplementedException(); } diff --git a/tests/Avalonia.Visuals.UnitTests/VisualTree/MockRenderInterface.cs b/tests/Avalonia.Visuals.UnitTests/VisualTree/MockRenderInterface.cs index 54bb5d72d0..93b5a8a764 100644 --- a/tests/Avalonia.Visuals.UnitTests/VisualTree/MockRenderInterface.cs +++ b/tests/Avalonia.Visuals.UnitTests/VisualTree/MockRenderInterface.cs @@ -49,7 +49,7 @@ namespace Avalonia.Visuals.UnitTests.VisualTree throw new NotImplementedException(); } - public IWritableBitmapImpl CreateWritableBitmap(int width, int height, PixelFormat? fmt) + public IWriteableBitmapImpl CreateWriteableBitmap(int width, int height, PixelFormat? fmt) { throw new NotImplementedException(); } diff --git a/tests/TestFiles/Direct2D1/Media/Bitmap/WritableBitmapShouldBeUsable_Bgra8888.expected.png b/tests/TestFiles/Direct2D1/Media/Bitmap/WriteableBitmapShouldBeUsable_Bgra8888.expected.png similarity index 100% rename from tests/TestFiles/Direct2D1/Media/Bitmap/WritableBitmapShouldBeUsable_Bgra8888.expected.png rename to tests/TestFiles/Direct2D1/Media/Bitmap/WriteableBitmapShouldBeUsable_Bgra8888.expected.png diff --git a/tests/TestFiles/Direct2D1/Media/Bitmap/WritableBitmapShouldBeUsable_Rgba8888.expected.png b/tests/TestFiles/Direct2D1/Media/Bitmap/WriteableBitmapShouldBeUsable_Rgba8888.expected.png similarity index 100% rename from tests/TestFiles/Direct2D1/Media/Bitmap/WritableBitmapShouldBeUsable_Rgba8888.expected.png rename to tests/TestFiles/Direct2D1/Media/Bitmap/WriteableBitmapShouldBeUsable_Rgba8888.expected.png diff --git a/tests/TestFiles/Skia/Media/Bitmap/WritableBitmapShouldBeUsable_Bgra8888.expected.png b/tests/TestFiles/Skia/Media/Bitmap/WriteableBitmapShouldBeUsable_Bgra8888.expected.png similarity index 100% rename from tests/TestFiles/Skia/Media/Bitmap/WritableBitmapShouldBeUsable_Bgra8888.expected.png rename to tests/TestFiles/Skia/Media/Bitmap/WriteableBitmapShouldBeUsable_Bgra8888.expected.png diff --git a/tests/TestFiles/Skia/Media/Bitmap/WritableBitmapShouldBeUsable_Rgba8888.expected.png b/tests/TestFiles/Skia/Media/Bitmap/WriteableBitmapShouldBeUsable_Rgba8888.expected.png similarity index 100% rename from tests/TestFiles/Skia/Media/Bitmap/WritableBitmapShouldBeUsable_Rgba8888.expected.png rename to tests/TestFiles/Skia/Media/Bitmap/WriteableBitmapShouldBeUsable_Rgba8888.expected.png