Split EffectFactoryManager and EffectFactory classes
このコミットが含まれているのは:
1 親
af7bd0a8b2
コミット
39e67a3ba0
2ファイル変更
+12
-4
検索条件に一致するファイルはありません
@@ -38,7 +38,7 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Helpers\ResourceManager.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Loaders\D2D1ImmutableArrayResourceTextureDescriptionsLoader.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)Loaders\D2D1IndexBitmaskResourceTextureDescriptionsLoader.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)PixelShaderEffect{T}.EffectFactoryManager.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)PixelShaderEffect{T}.ICanvasEffectFactoryNative.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)PixelShaderEffect{T}.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)PixelShaderEffect{T}.ICanvasEffect.cs" />
|
||||
<Compile Include="$(MSBuildThisFileDirectory)PixelShaderEffect{T}.ICanvasImage.cs" />
|
||||
|
||||
+11
-3
@@ -23,9 +23,9 @@ namespace ComputeSharp.D2D1.WinUI;
|
||||
unsafe partial class PixelShaderEffect<T>
|
||||
{
|
||||
/// <summary>
|
||||
/// A manager type to handle the effect factory logic and registration for <see cref="ICanvasEffectFactoryNative"/>.
|
||||
/// A manager type to handle the effect factory registration logic for <see cref="ICanvasEffectFactoryNative"/>.
|
||||
/// </summary>
|
||||
private sealed class EffectFactoryManager : ICanvasEffectFactoryNative.Interface
|
||||
private sealed class EffectFactoryManager
|
||||
{
|
||||
/// <summary>
|
||||
/// Lock object used to synchronize the registration logic.
|
||||
@@ -58,13 +58,21 @@ unsafe partial class PixelShaderEffect<T>
|
||||
{
|
||||
if (!this.isEffectFactoryRegistered)
|
||||
{
|
||||
ResourceManager.RegisterEffectFactory(PixelShaderEffect.For<T>.Instance.Id, this);
|
||||
ResourceManager.RegisterEffectFactory(
|
||||
effectId: PixelShaderEffect.For<T>.Instance.Id,
|
||||
factory: new EffectFactory());
|
||||
|
||||
this.isEffectFactoryRegistered = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A managed implementation of <see cref="ICanvasEffectFactoryNative"/> for <see cref="PixelShaderEffect{T}"/>.
|
||||
/// </summary>
|
||||
private sealed class EffectFactory : ICanvasEffectFactoryNative.Interface
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
int ICanvasEffectFactoryNative.Interface.CreateWrapper(ICanvasDevice* device, ID2D1Effect* resource, float dpi, IInspectable** wrapper)
|
||||
{
|
||||
新しいイシューから参照
ユーザーをブロックする