Browse Source

Get rid of not needed interfaces.

pull/2375/head
Dariusz Komosinski 8 years ago
parent
commit
1b869ff27b
  1. 12
      src/Avalonia.Visuals/Platform/IEllipseGeometryImpl.cs
  2. 12
      src/Avalonia.Visuals/Platform/ILineGeometryImpl.cs
  3. 12
      src/Avalonia.Visuals/Platform/IPlatformRenderInterface.cs
  4. 12
      src/Avalonia.Visuals/Platform/IRectangleGeometryImpl.cs
  5. 3
      src/Skia/Avalonia.Skia/EllipseGeometryImpl.cs
  6. 3
      src/Skia/Avalonia.Skia/LineGeometryImpl.cs
  7. 6
      src/Skia/Avalonia.Skia/PlatformRenderInterface.cs
  8. 3
      src/Skia/Avalonia.Skia/RectangleGeometryImpl.cs
  9. 6
      src/Windows/Avalonia.Direct2D1/Direct2D1Platform.cs
  10. 3
      src/Windows/Avalonia.Direct2D1/Media/EllipseGeometryImpl.cs
  11. 3
      src/Windows/Avalonia.Direct2D1/Media/LineGeometryImpl.cs
  12. 3
      src/Windows/Avalonia.Direct2D1/Media/RectangleGeometryImpl.cs
  13. 12
      tests/Avalonia.UnitTests/MockPlatformRenderInterface.cs
  14. 6
      tests/Avalonia.Visuals.UnitTests/VisualTree/MockRenderInterface.cs

12
src/Avalonia.Visuals/Platform/IEllipseGeometryImpl.cs

@ -1,12 +0,0 @@
// Copyright (c) The Avalonia Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.
namespace Avalonia.Platform
{
/// <summary>
/// Defines the platform-specific interface for a <see cref="Avalonia.Media.EllipseGeometry"/>.
/// </summary>
public interface IEllipseGeometryImpl : IGeometryImpl
{
}
}

12
src/Avalonia.Visuals/Platform/ILineGeometryImpl.cs

@ -1,12 +0,0 @@
// Copyright (c) The Avalonia Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.
namespace Avalonia.Platform
{
/// <summary>
/// Defines the platform-specific interface for a <see cref="Avalonia.Media.LineGeometry"/>.
/// </summary>
public interface ILineGeometryImpl : IGeometryImpl
{
}
}

12
src/Avalonia.Visuals/Platform/IPlatformRenderInterface.cs

@ -40,23 +40,23 @@ namespace Avalonia.Platform
/// Creates an ellipse geometry implementation. /// Creates an ellipse geometry implementation.
/// </summary> /// </summary>
/// <param name="rect">The bounds of the ellipse.</param> /// <param name="rect">The bounds of the ellipse.</param>
/// <returns>An <see cref="IEllipseGeometryImpl"/>.</returns> /// <returns>An ellipse geometry..</returns>
IEllipseGeometryImpl CreateEllipseGeometry(Rect rect); IGeometryImpl CreateEllipseGeometry(Rect rect);
/// <summary> /// <summary>
/// Creates a line geometry implementation. /// Creates a line geometry implementation.
/// </summary> /// </summary>
/// <param name="p1">The start of the line.</param> /// <param name="p1">The start of the line.</param>
/// <param name="p2">The end of the line.</param> /// <param name="p2">The end of the line.</param>
/// <returns>An <see cref="ILineGeometryImpl"/>.</returns> /// <returns>A line geometry.</returns>
ILineGeometryImpl CreateLineGeometry(Point p1, Point p2); IGeometryImpl CreateLineGeometry(Point p1, Point p2);
/// <summary> /// <summary>
/// Creates a rectangle geometry implementation. /// Creates a rectangle geometry implementation.
/// </summary> /// </summary>
/// <param name="rect">The bounds of the rectangle.</param> /// <param name="rect">The bounds of the rectangle.</param>
/// <returns>An <see cref="IRectangleGeometryImpl"/>.</returns> /// <returns>A rectangle.</returns>
IRectangleGeometryImpl CreateRectangleGeometry(Rect rect); IGeometryImpl CreateRectangleGeometry(Rect rect);
/// <summary> /// <summary>
/// Creates a stream geometry implementation. /// Creates a stream geometry implementation.

12
src/Avalonia.Visuals/Platform/IRectangleGeometryImpl.cs

@ -1,12 +0,0 @@
// Copyright (c) The Avalonia Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information.
namespace Avalonia.Platform
{
/// <summary>
/// Defines the platform-specific interface for a <see cref="Avalonia.Media.RectangleGeometry"/>.
/// </summary>
public interface IRectangleGeometryImpl : IGeometryImpl
{
}
}

3
src/Skia/Avalonia.Skia/EllipseGeometryImpl.cs

@ -1,7 +1,6 @@
// Copyright (c) The Avalonia Project. All rights reserved. // Copyright (c) The Avalonia Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information. // Licensed under the MIT license. See licence.md file in the project root for full license information.
using Avalonia.Platform;
using SkiaSharp; using SkiaSharp;
namespace Avalonia.Skia namespace Avalonia.Skia
@ -9,7 +8,7 @@ namespace Avalonia.Skia
/// <summary> /// <summary>
/// A Skia implementation of a <see cref="Avalonia.Media.EllipseGeometry"/>. /// A Skia implementation of a <see cref="Avalonia.Media.EllipseGeometry"/>.
/// </summary> /// </summary>
internal class EllipseGeometryImpl : GeometryImpl, IEllipseGeometryImpl internal class EllipseGeometryImpl : GeometryImpl
{ {
public override Rect Bounds { get; } public override Rect Bounds { get; }
public override SKPath EffectivePath { get; } public override SKPath EffectivePath { get; }

3
src/Skia/Avalonia.Skia/LineGeometryImpl.cs

@ -2,7 +2,6 @@
// Licensed under the MIT license. See licence.md file in the project root for full license information. // Licensed under the MIT license. See licence.md file in the project root for full license information.
using System; using System;
using Avalonia.Platform;
using SkiaSharp; using SkiaSharp;
namespace Avalonia.Skia namespace Avalonia.Skia
@ -10,7 +9,7 @@ namespace Avalonia.Skia
/// <summary> /// <summary>
/// A Skia implementation of a <see cref="Avalonia.Media.LineGeometry"/>. /// A Skia implementation of a <see cref="Avalonia.Media.LineGeometry"/>.
/// </summary> /// </summary>
internal class LineGeometryImpl : GeometryImpl, ILineGeometryImpl internal class LineGeometryImpl : GeometryImpl
{ {
public override Rect Bounds { get; } public override Rect Bounds { get; }
public override SKPath EffectivePath { get; } public override SKPath EffectivePath { get; }

6
src/Skia/Avalonia.Skia/PlatformRenderInterface.cs

@ -50,11 +50,11 @@ namespace Avalonia.Skia
return new FormattedTextImpl(text, typeface, textAlignment, wrapping, constraint, spans); return new FormattedTextImpl(text, typeface, textAlignment, wrapping, constraint, spans);
} }
public IEllipseGeometryImpl CreateEllipseGeometry(Rect rect) => new EllipseGeometryImpl(rect); public IGeometryImpl CreateEllipseGeometry(Rect rect) => new EllipseGeometryImpl(rect);
public ILineGeometryImpl CreateLineGeometry(Point p1, Point p2) => new LineGeometryImpl(p1, p2); public IGeometryImpl CreateLineGeometry(Point p1, Point p2) => new LineGeometryImpl(p1, p2);
public IRectangleGeometryImpl CreateRectangleGeometry(Rect rect) => new RectangleGeometryImpl(rect); public IGeometryImpl CreateRectangleGeometry(Rect rect) => new RectangleGeometryImpl(rect);
/// <inheritdoc /> /// <inheritdoc />
public IStreamGeometryImpl CreateStreamGeometry() public IStreamGeometryImpl CreateStreamGeometry()

3
src/Skia/Avalonia.Skia/RectangleGeometryImpl.cs

@ -1,7 +1,6 @@
// Copyright (c) The Avalonia Project. All rights reserved. // Copyright (c) The Avalonia Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information. // Licensed under the MIT license. See licence.md file in the project root for full license information.
using Avalonia.Platform;
using SkiaSharp; using SkiaSharp;
namespace Avalonia.Skia namespace Avalonia.Skia
@ -9,7 +8,7 @@ namespace Avalonia.Skia
/// <summary> /// <summary>
/// A Skia implementation of a <see cref="Avalonia.Media.RectangleGeometry"/>. /// A Skia implementation of a <see cref="Avalonia.Media.RectangleGeometry"/>.
/// </summary> /// </summary>
internal class RectangleGeometryImpl : GeometryImpl, IRectangleGeometryImpl internal class RectangleGeometryImpl : GeometryImpl
{ {
public override Rect Bounds { get; } public override Rect Bounds { get; }
public override SKPath EffectivePath { get; } public override SKPath EffectivePath { get; }

6
src/Windows/Avalonia.Direct2D1/Direct2D1Platform.cs

@ -182,9 +182,9 @@ namespace Avalonia.Direct2D1
return new WriteableWicBitmapImpl(size, dpi, format); return new WriteableWicBitmapImpl(size, dpi, format);
} }
public IEllipseGeometryImpl CreateEllipseGeometry(Rect rect) => new EllipseGeometryImpl(rect); public IGeometryImpl CreateEllipseGeometry(Rect rect) => new EllipseGeometryImpl(rect);
public ILineGeometryImpl CreateLineGeometry(Point p1, Point p2) => new LineGeometryImpl(p1, p2); public IGeometryImpl CreateLineGeometry(Point p1, Point p2) => new LineGeometryImpl(p1, p2);
public IRectangleGeometryImpl CreateRectangleGeometry(Rect rect) => new RectangleGeometryImpl(rect); public IGeometryImpl CreateRectangleGeometry(Rect rect) => new RectangleGeometryImpl(rect);
public IStreamGeometryImpl CreateStreamGeometry() => new StreamGeometryImpl(); public IStreamGeometryImpl CreateStreamGeometry() => new StreamGeometryImpl();
public IBitmapImpl LoadBitmap(string fileName) public IBitmapImpl LoadBitmap(string fileName)

3
src/Windows/Avalonia.Direct2D1/Media/EllipseGeometryImpl.cs

@ -1,7 +1,6 @@
// Copyright (c) The Avalonia Project. All rights reserved. // Copyright (c) The Avalonia Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information. // Licensed under the MIT license. See licence.md file in the project root for full license information.
using Avalonia.Platform;
using SharpDX.Direct2D1; using SharpDX.Direct2D1;
namespace Avalonia.Direct2D1.Media namespace Avalonia.Direct2D1.Media
@ -9,7 +8,7 @@ namespace Avalonia.Direct2D1.Media
/// <summary> /// <summary>
/// A Direct2D implementation of a <see cref="Avalonia.Media.EllipseGeometry"/>. /// A Direct2D implementation of a <see cref="Avalonia.Media.EllipseGeometry"/>.
/// </summary> /// </summary>
internal class EllipseGeometryImpl : GeometryImpl, IEllipseGeometryImpl internal class EllipseGeometryImpl : GeometryImpl
{ {
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="StreamGeometryImpl"/> class. /// Initializes a new instance of the <see cref="StreamGeometryImpl"/> class.

3
src/Windows/Avalonia.Direct2D1/Media/LineGeometryImpl.cs

@ -1,7 +1,6 @@
// Copyright (c) The Avalonia Project. All rights reserved. // Copyright (c) The Avalonia Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information. // Licensed under the MIT license. See licence.md file in the project root for full license information.
using Avalonia.Platform;
using SharpDX.Direct2D1; using SharpDX.Direct2D1;
namespace Avalonia.Direct2D1.Media namespace Avalonia.Direct2D1.Media
@ -9,7 +8,7 @@ namespace Avalonia.Direct2D1.Media
/// <summary> /// <summary>
/// A Direct2D implementation of a <see cref="Avalonia.Media.LineGeometry"/>. /// A Direct2D implementation of a <see cref="Avalonia.Media.LineGeometry"/>.
/// </summary> /// </summary>
internal class LineGeometryImpl : StreamGeometryImpl, ILineGeometryImpl internal class LineGeometryImpl : StreamGeometryImpl
{ {
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="StreamGeometryImpl"/> class. /// Initializes a new instance of the <see cref="StreamGeometryImpl"/> class.

3
src/Windows/Avalonia.Direct2D1/Media/RectangleGeometryImpl.cs

@ -1,7 +1,6 @@
// Copyright (c) The Avalonia Project. All rights reserved. // Copyright (c) The Avalonia Project. All rights reserved.
// Licensed under the MIT license. See licence.md file in the project root for full license information. // Licensed under the MIT license. See licence.md file in the project root for full license information.
using Avalonia.Platform;
using SharpDX.Direct2D1; using SharpDX.Direct2D1;
namespace Avalonia.Direct2D1.Media namespace Avalonia.Direct2D1.Media
@ -9,7 +8,7 @@ namespace Avalonia.Direct2D1.Media
/// <summary> /// <summary>
/// A Direct2D implementation of a <see cref="Avalonia.Media.RectangleGeometry"/>. /// A Direct2D implementation of a <see cref="Avalonia.Media.RectangleGeometry"/>.
/// </summary> /// </summary>
internal class RectangleGeometryImpl : GeometryImpl, IRectangleGeometryImpl internal class RectangleGeometryImpl : GeometryImpl
{ {
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="StreamGeometryImpl"/> class. /// Initializes a new instance of the <see cref="StreamGeometryImpl"/> class.

12
tests/Avalonia.UnitTests/MockPlatformRenderInterface.cs

@ -22,19 +22,19 @@ namespace Avalonia.UnitTests
return Mock.Of<IFormattedTextImpl>(); return Mock.Of<IFormattedTextImpl>();
} }
public IEllipseGeometryImpl CreateEllipseGeometry(Rect rect) public IGeometryImpl CreateEllipseGeometry(Rect rect)
{ {
return Mock.Of<IEllipseGeometryImpl>(); return Mock.Of<IGeometryImpl>();
} }
public ILineGeometryImpl CreateLineGeometry(Point p1, Point p2) public IGeometryImpl CreateLineGeometry(Point p1, Point p2)
{ {
return Mock.Of<ILineGeometryImpl>(); return Mock.Of<IGeometryImpl>();
} }
public IRectangleGeometryImpl CreateRectangleGeometry(Rect rect) public IGeometryImpl CreateRectangleGeometry(Rect rect)
{ {
return Mock.Of<IRectangleGeometryImpl>(); return Mock.Of<IGeometryImpl>();
} }
public IRenderTarget CreateRenderTarget(IEnumerable<object> surfaces) public IRenderTarget CreateRenderTarget(IEnumerable<object> surfaces)

6
tests/Avalonia.Visuals.UnitTests/VisualTree/MockRenderInterface.cs

@ -56,17 +56,17 @@ namespace Avalonia.Visuals.UnitTests.VisualTree
throw new NotImplementedException(); throw new NotImplementedException();
} }
public IEllipseGeometryImpl CreateEllipseGeometry(Rect rect) public IGeometryImpl CreateEllipseGeometry(Rect rect)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
public ILineGeometryImpl CreateLineGeometry(Point p1, Point p2) public IGeometryImpl CreateLineGeometry(Point p1, Point p2)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }
public IRectangleGeometryImpl CreateRectangleGeometry(Rect rect) public IGeometryImpl CreateRectangleGeometry(Rect rect)
{ {
throw new NotImplementedException(); throw new NotImplementedException();
} }

Loading…
Cancel
Save