NullRenderingPlatform.cs 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using Avalonia.Media;
  5. using Avalonia.Platform;
  6. using Avalonia.UnitTests;
  7. namespace Avalonia.Benchmarks
  8. {
  9. internal class NullRenderingPlatform : IPlatformRenderInterface
  10. {
  11. public IFormattedTextImpl CreateFormattedText(string text, Typeface typeface, double fontSize, TextAlignment textAlignment,
  12. TextWrapping wrapping, Size constraint, IReadOnlyList<FormattedTextStyleSpan> spans)
  13. {
  14. return new NullFormattedTextImpl();
  15. }
  16. public IGeometryImpl CreateEllipseGeometry(Rect rect)
  17. {
  18. throw new NotImplementedException();
  19. }
  20. public IGeometryImpl CreateLineGeometry(Point p1, Point p2)
  21. {
  22. throw new NotImplementedException();
  23. }
  24. public IGeometryImpl CreateRectangleGeometry(Rect rect)
  25. {
  26. throw new NotImplementedException();
  27. }
  28. public IStreamGeometryImpl CreateStreamGeometry()
  29. {
  30. return new MockStreamGeometryImpl();
  31. }
  32. public IRenderTarget CreateRenderTarget(IEnumerable<object> surfaces)
  33. {
  34. throw new NotImplementedException();
  35. }
  36. public IRenderTargetBitmapImpl CreateRenderTargetBitmap(PixelSize size, Vector dpi)
  37. {
  38. throw new NotImplementedException();
  39. }
  40. public IWriteableBitmapImpl CreateWriteableBitmap(PixelSize size, Vector dpi, PixelFormat? format = null)
  41. {
  42. throw new NotImplementedException();
  43. }
  44. public IBitmapImpl LoadBitmap(string fileName)
  45. {
  46. throw new NotImplementedException();
  47. }
  48. public IBitmapImpl LoadBitmap(Stream stream)
  49. {
  50. throw new NotImplementedException();
  51. }
  52. public IBitmapImpl LoadBitmap(PixelFormat format, IntPtr data, PixelSize size, Vector dpi, int stride)
  53. {
  54. throw new NotImplementedException();
  55. }
  56. public IFontManagerImpl CreateFontManager()
  57. {
  58. return new MockFontManagerImpl();
  59. }
  60. public IGlyphRunImpl CreateGlyphRun(GlyphRun glyphRun, out double width)
  61. {
  62. width = default;
  63. return new NullGlyphRun();
  64. }
  65. }
  66. }