25 changed files with 131 additions and 180 deletions
@ -0,0 +1,5 @@ |
|||
<ProjectConfiguration> |
|||
<Settings> |
|||
<PreviouslyBuiltSuccessfully>True</PreviouslyBuiltSuccessfully> |
|||
</Settings> |
|||
</ProjectConfiguration> |
|||
@ -1,18 +0,0 @@ |
|||
using System; |
|||
|
|||
namespace Avalonia.Rendering |
|||
{ |
|||
/// <summary>
|
|||
/// Defines a factory for creating <see cref="IRenderer"/> instances.
|
|||
/// </summary>
|
|||
public interface IRendererFactory |
|||
{ |
|||
/// <summary>
|
|||
/// Creates a new renderer for the specified render root.
|
|||
/// </summary>
|
|||
/// <param name="root">The render root.</param>
|
|||
/// <param name="renderLoop">The render loop.</param>
|
|||
/// <returns>An instance of an <see cref="IRenderer"/>.</returns>
|
|||
IRenderer CreateRenderer(IRenderRoot root, IRenderLoop renderLoop); |
|||
} |
|||
} |
|||
@ -1,29 +0,0 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Avalonia.Rendering; |
|||
|
|||
namespace Avalonia.UnitTests |
|||
{ |
|||
public class MockRendererFactory : IRendererFactory |
|||
{ |
|||
private readonly Func<IRenderRoot, IRenderLoop, IRenderer> _cb; |
|||
|
|||
public MockRendererFactory(Func<IRenderRoot, IRenderLoop, IRenderer> cb = null) |
|||
{ |
|||
_cb = cb; |
|||
} |
|||
|
|||
public MockRendererFactory(IRenderer renderer) : this((_, __) => renderer) |
|||
{ |
|||
|
|||
} |
|||
|
|||
public IRenderer CreateRenderer(IRenderRoot root, IRenderLoop renderLoop) |
|||
{ |
|||
return _cb?.Invoke(root, renderLoop); |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue