using System; using System.Collections.Generic; using System.IO; using Avalonia.Media; using Avalonia.Platform; using Avalonia.Visuals.Media.Imaging; using Moq; namespace Avalonia.UnitTests { public class MockPlatformRenderInterface : IPlatformRenderInterface { public IGeometryImpl CreateEllipseGeometry(Rect rect) { return Mock.Of(); } public IGeometryImpl CreateLineGeometry(Point p1, Point p2) { return Mock.Of(); } public IGeometryImpl CreateRectangleGeometry(Rect rect) { return Mock.Of(x => x.Bounds == rect); } public IRenderTarget CreateRenderTarget(IEnumerable surfaces) { return Mock.Of(); } public IRenderTargetBitmapImpl CreateRenderTargetBitmap(PixelSize size, Vector dpi) { return Mock.Of(); } public IStreamGeometryImpl CreateStreamGeometry() { return new MockStreamGeometryImpl(); } public IGeometryImpl CreateGeometryGroup(FillRule fillRule, IReadOnlyList children) { return Mock.Of(); } public IGeometryImpl CreateCombinedGeometry(GeometryCombineMode combineMode, Geometry g1, Geometry g2) { return Mock.Of(); } public IWriteableBitmapImpl CreateWriteableBitmap( PixelSize size, Vector dpi, PixelFormat format, AlphaFormat alphaFormat) { throw new NotImplementedException(); } public IBitmapImpl LoadBitmap(Stream stream) { return Mock.Of(); } public IWriteableBitmapImpl LoadWriteableBitmapToWidth(Stream stream, int width, BitmapInterpolationMode interpolationMode = BitmapInterpolationMode.HighQuality) { throw new NotImplementedException(); } public IWriteableBitmapImpl LoadWriteableBitmapToHeight(Stream stream, int height, BitmapInterpolationMode interpolationMode = BitmapInterpolationMode.HighQuality) { throw new NotImplementedException(); } public IWriteableBitmapImpl LoadWriteableBitmap(string fileName) { throw new NotImplementedException(); } public IWriteableBitmapImpl LoadWriteableBitmap(Stream stream) { throw new NotImplementedException(); } public IBitmapImpl LoadBitmap(string fileName) { return Mock.Of(); } public IBitmapImpl LoadBitmapToWidth(Stream stream, int width, BitmapInterpolationMode interpolationMode = BitmapInterpolationMode.HighQuality) { return Mock.Of(); } public IBitmapImpl LoadBitmapToHeight(Stream stream, int height, BitmapInterpolationMode interpolationMode = BitmapInterpolationMode.HighQuality) { return Mock.Of(); } public IBitmapImpl ResizeBitmap(IBitmapImpl bitmapImpl, PixelSize destinationSize, BitmapInterpolationMode interpolationMode = BitmapInterpolationMode.HighQuality) { return Mock.Of(); } public IBitmapImpl LoadBitmap( PixelFormat format, AlphaFormat alphaFormat, IntPtr data, PixelSize size, Vector dpi, int stride) { throw new NotImplementedException(); } public IGlyphRunImpl CreateGlyphRun(GlyphRun glyphRun) { return Mock.Of(); } public bool SupportsIndividualRoundRects { get; set; } public AlphaFormat DefaultAlphaFormat => AlphaFormat.Premul; public PixelFormat DefaultPixelFormat => PixelFormat.Rgba8888; } }