From 6859f62d120ac5fa5d208f77cdfd6641716286af Mon Sep 17 00:00:00 2001 From: Nikita Tsukanov Date: Wed, 30 Sep 2015 15:30:00 +0300 Subject: [PATCH] Make actual RenderTargetBitmap implement IRenderTarget --- .../Media/Imaging/RenderTargetBitmap.cs | 21 +++++++----------- tests/Perspex.RenderTests/TestBase.cs | Bin 4728 -> 4780 bytes 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/Perspex.SceneGraph/Media/Imaging/RenderTargetBitmap.cs b/src/Perspex.SceneGraph/Media/Imaging/RenderTargetBitmap.cs index 0d751d61c6..5b8bbea6da 100644 --- a/src/Perspex.SceneGraph/Media/Imaging/RenderTargetBitmap.cs +++ b/src/Perspex.SceneGraph/Media/Imaging/RenderTargetBitmap.cs @@ -10,7 +10,7 @@ namespace Perspex.Media.Imaging /// /// A bitmap that holds the rendering of a . /// - public class RenderTargetBitmap : Bitmap, IDisposable + public class RenderTargetBitmap : Bitmap, IDisposable, IRenderTarget { /// /// Initializes a new instance of the class. @@ -27,18 +27,6 @@ namespace Perspex.Media.Imaging /// public new IRenderTargetBitmapImpl PlatformImpl => (IRenderTargetBitmapImpl)base.PlatformImpl; - /// - /// Renders an into the bitmap. - /// - /// The visual to render. - /// - /// Before calling this method, ensure that has been measured. - /// - public void Render(IVisual visual) - { - PlatformImpl.Render(visual); - } - /// /// Disposes of the bitmap. /// @@ -58,5 +46,12 @@ namespace Perspex.Media.Imaging IPlatformRenderInterface factory = PerspexLocator.Current.GetService(); return factory.CreateRenderTargetBitmap(width, height); } + + public IDrawingContext CreateDrawingContext() => PlatformImpl.CreateDrawingContext(); + + void IRenderTarget.Resize(int width, int height) + { + throw new NotSupportedException(); + } } } diff --git a/tests/Perspex.RenderTests/TestBase.cs b/tests/Perspex.RenderTests/TestBase.cs index 2940c5ab3135519282bf23ff0e83c7ce7fef6e2f..7344d4d137a7c0485e26dbcc7192274b8425787f 100644 GIT binary patch delta 28 icmeyNvPN}72GitqOak0N45