Cache and reuse D2D1TransformMapper.FactoryOf<T, TMapper>

このコミットが含まれているのは:
Sergio Pedri committed 2022-09-06 02:32:57 +02:00
1 親 b888820e39
コミット d2551a0d19
2ファイル変更
+4 -8

検索条件に一致するファイルはありません

+2 -2
ファイルの表示
@@ -59,7 +59,7 @@ public static unsafe class D2D1PixelShaderEffect
ThrowHelper.ThrowArgumentNullException(nameof(d2D1Factory1), "The input ID2D1Factory1 object cannot be null.");
}
RegisterForD2D1Factory1(d2D1Factory1, D2D1TransformMapper.FactoryOf<T, TMapper>.Get(), out effectId);
RegisterForD2D1Factory1(d2D1Factory1, D2D1TransformMapper.FactoryOf<T, TMapper>.Instance, out effectId);
}
/// <summary>
@@ -278,7 +278,7 @@ public static unsafe class D2D1PixelShaderEffect
where T : unmanaged, ID2D1PixelShader
where TMapper : class, ID2D1TransformMapper<T>, new()
{
return GetRegistrationBlob(D2D1TransformMapper.FactoryOf<T, TMapper>.Get(), out effectId);
return GetRegistrationBlob(D2D1TransformMapper.FactoryOf<T, TMapper>.Instance, out effectId);
}
/// <summary>
+2 -6
ファイルの表示
@@ -111,13 +111,9 @@ internal abstract class D2D1TransformMapper
}
/// <summary>
/// Creates a new <see cref="FactoryOf{T, TMapper}"/> instance for a given transform mapper.
/// Gets the shared <see cref="FactoryOf{T, TMapper}"/> instance for a given transform mapper.
/// </summary>
/// <returns>A new <see cref="FactoryOf{T, TMapper}"/> instance.</returns>
public static FactoryOf<T, TMapper> Get()
{
return new();
}
public static FactoryOf<T, TMapper> Instance { get; } = new();
/// <inheritdoc/>
public ID2D1TransformMapper<T> Create()