diff --git a/src/ComputeSharp.D2D1.WinUI/Extensions/ID2D1EffectExtensions.cs b/src/ComputeSharp.D2D1.WinUI/Extensions/ID2D1EffectExtensions.cs
index 17ed5183..fa5a5bf8 100644
--- a/src/ComputeSharp.D2D1.WinUI/Extensions/ID2D1EffectExtensions.cs
+++ b/src/ComputeSharp.D2D1.WinUI/Extensions/ID2D1EffectExtensions.cs
@@ -76,17 +76,17 @@ internal static unsafe class ID2D1EffectExtensions
}
///
- /// Gets the instance from a given object.
+ /// Gets the instance from a given object.
///
/// The type of shader being used.
/// The input instance.
- /// The instance for .
- public static D2D1TransformMapper? GetTransformMapper(this ref ID2D1Effect d2D1Effect)
+ /// The instance for .
+ public static D2D1DrawTransformMapper? GetTransformMapper(this ref ID2D1Effect d2D1Effect)
where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor
{
- using ComPtr d2D1TransformMapper = default;
+ using ComPtr d2D1TransformMapper = default;
- // Get the ID2D1TransformMapper object from the effect
+ // Get the ID2D1DrawTransformMapper object from the effect
d2D1Effect.GetValue(
index: D2D1PixelShaderEffectProperty.TransformMapper,
type: D2D1_PROPERTY_TYPE.D2D1_PROPERTY_TYPE_IUNKNOWN,
@@ -100,7 +100,7 @@ internal static unsafe class ID2D1EffectExtensions
}
// Otherwise, check if it's an internal CCW and retrieve the managed wrapper
- using ComPtr d2D1TransformMapperInternal = default;
+ using ComPtr d2D1TransformMapperInternal = default;
d2D1TransformMapper.CopyTo(d2D1TransformMapperInternal.GetAddressOf()).Assert();
@@ -110,7 +110,7 @@ internal static unsafe class ID2D1EffectExtensions
d2D1TransformMapperInternal.Get()->GetManagedWrapperHandle((void**)&handlePtr).Assert();
// Retrieve the managed wrapper from the GCHandle
- return (D2D1TransformMapper)GCHandle.FromIntPtr(handlePtr).Target!;
+ return (D2D1DrawTransformMapper)GCHandle.FromIntPtr(handlePtr).Target!;
}
///
diff --git a/src/ComputeSharp.D2D1.WinUI/PixelShaderEffect{T}.Properties.Interop.cs b/src/ComputeSharp.D2D1.WinUI/PixelShaderEffect{T}.Properties.Interop.cs
index b8040498..f7a7f14a 100644
--- a/src/ComputeSharp.D2D1.WinUI/PixelShaderEffect{T}.Properties.Interop.cs
+++ b/src/ComputeSharp.D2D1.WinUI/PixelShaderEffect{T}.Properties.Interop.cs
@@ -55,7 +55,7 @@ unsafe partial class PixelShaderEffect
/// Gets the marshalled value for .
///
/// The marshalled value for .
- private D2D1TransformMapper? GetTransformMapper()
+ private D2D1DrawTransformMapper? GetTransformMapper()
{
using ReferenceTracker.Lease _0 = GetReferenceTracker().GetLease();
@@ -73,7 +73,7 @@ unsafe partial class PixelShaderEffect
/// Sets the marshalled value for .
///
/// The value to set for .
- private void SetTransformMapper(D2D1TransformMapper value)
+ private void SetTransformMapper(D2D1DrawTransformMapper value)
{
using ReferenceTracker.Lease _0 = GetReferenceTracker().GetLease();
diff --git a/src/ComputeSharp.D2D1.WinUI/PixelShaderEffect{T}.Properties.cs b/src/ComputeSharp.D2D1.WinUI/PixelShaderEffect{T}.Properties.cs
index eb0fb811..09fa8dad 100644
--- a/src/ComputeSharp.D2D1.WinUI/PixelShaderEffect{T}.Properties.cs
+++ b/src/ComputeSharp.D2D1.WinUI/PixelShaderEffect{T}.Properties.cs
@@ -18,11 +18,11 @@ partial class PixelShaderEffect
}
///
- /// Gets or sets the instance to use for the effect, if any.
+ /// Gets or sets the instance to use for the effect, if any.
///
/// Thrown if the value is set to .
[DisallowNull]
- public D2D1TransformMapper? TransformMapper
+ public D2D1DrawTransformMapper? TransformMapper
{
get => GetTransformMapper();
set => SetTransformMapper(value);
diff --git a/src/ComputeSharp.D2D1.WinUI/PixelShaderEffect{T}.cs b/src/ComputeSharp.D2D1.WinUI/PixelShaderEffect{T}.cs
index be34464c..65e2ddc5 100644
--- a/src/ComputeSharp.D2D1.WinUI/PixelShaderEffect{T}.cs
+++ b/src/ComputeSharp.D2D1.WinUI/PixelShaderEffect{T}.cs
@@ -54,7 +54,7 @@ public sealed partial class PixelShaderEffect : IReferenceTrackedObject, ICan
///
/// The backing field for .
///
- private D2D1TransformMapper? transformMapper;
+ private D2D1DrawTransformMapper? transformMapper;
///
/// The backing field for .
diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1DrawInfoUpdateContext{T}.cs b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1DrawInfoUpdateContext{T}.cs
index 58c5dda7..b1052412 100644
--- a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1DrawInfoUpdateContext{T}.cs
+++ b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1DrawInfoUpdateContext{T}.cs
@@ -7,7 +7,7 @@ using ComputeSharp.D2D1.Shaders.Loaders;
namespace ComputeSharp.D2D1.Interop;
///
-/// An object allowing to interact with the shader data from within a transform.
+/// An object allowing to interact with the shader data from within a transform.
///
/// The type of shader the transform will interact with.
public readonly unsafe ref struct D2D1DrawInfoUpdateContext
diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1TransformMapperFactory{T}.cs b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1DrawTransformMapper{T}.Factories.cs
similarity index 55%
rename from src/ComputeSharp.D2D1/Shaders/Interop/D2D1TransformMapperFactory{T}.cs
rename to src/ComputeSharp.D2D1/Shaders/Interop/D2D1DrawTransformMapper{T}.Factories.cs
index aeef84c0..e7c297b4 100644
--- a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1TransformMapperFactory{T}.cs
+++ b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1DrawTransformMapper{T}.Factories.cs
@@ -1,46 +1,42 @@
using System;
using System.Numerics;
-using ComputeSharp.D2D1.Descriptors;
using ComputeSharp.D2D1.Shaders.Interop.Factories;
namespace ComputeSharp.D2D1.Interop;
-///
-/// Provides built-in transform mapper factories for common transform mapping operations.
-///
-/// The type of D2D1 pixel shader associated to the transform mapper.
-public static class D2D1TransformMapperFactory
- where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor
+///
+partial class D2D1DrawTransformMapper
{
///
- /// Creates an instance for an inflate transform.
+ /// Creates an instance for an inflate transform.
///
/// The fixed inflate amount to use (applies to all edges of the input area).
- /// The resulting instance for an inflate transform.
- public static D2D1TransformMapper Inflate(int amount)
+ /// The resulting instance for an inflate transform.
+ public static D2D1DrawTransformMapper Inflate(int amount)
{
return new D2D1InflateTransformMapper.ConstantAmount { Amount = amount };
}
///
- /// Creates an instance for an inflate transform.
+ /// Creates an instance for an inflate transform.
///
/// The fixed left inflate amount to use.
/// The fixed top inflate amount to use.
/// The fixed right inflate amount to use.
/// The fixed bottom inflate amount to use.
- /// The resulting instance for an inflate transform.
- public static D2D1TransformMapper Inflate(int left, int top, int right, int bottom)
+ /// The resulting instance for an inflate transform.
+ public static D2D1DrawTransformMapper Inflate(int left, int top, int right, int bottom)
{
return new D2D1InflateTransformMapper.ConstantLeftTopRightBottomAmount { Left = left, Top = top, Right = right, Bottom = bottom };
}
///
- /// Creates an instance for an inflate transform.
+ /// Creates an instance for an inflate transform.
///
/// The input instance to retrieve the inflate amount to use (applies to all edges of the input area).
- /// The resulting instance for an inflate transform.
- public static D2D1TransformMapper Inflate(Accessor accessor)
+ /// The resulting instance for an inflate transform.
+ /// Thrown if is .
+ public static D2D1DrawTransformMapper Inflate(Accessor accessor)
{
default(ArgumentNullException).ThrowIfNull(accessor);
@@ -48,11 +44,11 @@ public static class D2D1TransformMapperFactory
}
///
- /// Creates an instance for an inflate transform.
+ /// Creates an instance for an inflate transform.
///
/// The input instance to retrieve the inflate amount to use.
- /// The resulting instance for an inflate transform.
- public static D2D1TransformMapper Inflate(Accessor<(int Left, int Top, int Right, int Bottom)> accessor)
+ /// The resulting instance for an inflate transform.
+ public static D2D1DrawTransformMapper Inflate(Accessor<(int Left, int Top, int Right, int Bottom)> accessor)
{
default(ArgumentNullException).ThrowIfNull(accessor);
@@ -60,21 +56,22 @@ public static class D2D1TransformMapperFactory
}
///
- /// Creates an instance for an affine transform.
+ /// Creates an instance for an affine transform.
///
/// The fixed transformation matrix to use.
- /// The resulting instance for an affine transform.
- public static D2D1TransformMapper Transform(Matrix3x2 matrix)
+ /// The resulting instance for an affine transform.
+ public static D2D1DrawTransformMapper Transform(Matrix3x2 matrix)
{
return new D2D1AffineTransformMapper.ConstantMatrix { Amount = matrix };
}
///
- /// Creates an instance for an affine transform.
+ /// Creates an instance for an affine transform.
///
/// The input instance to retrieve the transformation matrix to use.
- /// The resulting instance for an affine transform.
- public static D2D1TransformMapper Transform(Accessor accessor)
+ /// The resulting instance for an affine transform.
+ /// Thrown if is .
+ public static D2D1DrawTransformMapper Transform(Accessor accessor)
{
default(ArgumentNullException).ThrowIfNull(accessor);
diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1TransformMapper{T}.cs b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1DrawTransformMapper{T}.cs
similarity index 86%
rename from src/ComputeSharp.D2D1/Shaders/Interop/D2D1TransformMapper{T}.cs
rename to src/ComputeSharp.D2D1/Shaders/Interop/D2D1DrawTransformMapper{T}.cs
index 6b5f4d19..23d8d6de 100644
--- a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1TransformMapper{T}.cs
+++ b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1DrawTransformMapper{T}.cs
@@ -3,7 +3,6 @@ using System.Drawing;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using ComputeSharp.D2D1.Descriptors;
-using ComputeSharp.D2D1.Interop.Effects;
using ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers;
using ComputeSharp.Win32;
@@ -12,7 +11,7 @@ using ComputeSharp.Win32;
namespace ComputeSharp.D2D1.Interop;
///
-/// Provides an ID2D1TransformMapper implementation, which can be used to customize the draw transform logic in
+/// Provides an ID2D1DrawTransformMapper implementation, which can be used to customize the draw transform logic in
/// an effect created with and also shared across multiple instances of a given effect.
///
/// The type of shader the transform will interact with.
@@ -27,7 +26,7 @@ namespace ComputeSharp.D2D1.Interop;
/// These managers are COM objects implementing the following interface:
///
/// [uuid(02E6D48D-B892-4FBC-AA54-119203BAB802)]
-/// interface ID2D1TransformMapper : IUnknown
+/// interface ID2D1DrawTransformMapper : IUnknown
/// {
/// HRESULT MapInputRectsToOutputRect(
/// [in] const ID2D1DrawInfoUpdateContext* updateContext,
@@ -79,44 +78,44 @@ namespace ComputeSharp.D2D1.Interop;
///
///
///
-/// That is, ID2D1DrawInfoUpdateContext allows a custom transform (an ID2D1TransformMapper instance) to interact with the underlying ID2D1DrawInfo object
+/// That is, ID2D1DrawInfoUpdateContext allows a custom transform (an ID2D1DrawTransformMapper instance) to interact with the underlying ID2D1DrawInfo object
/// that is owned by the effect being used, in a safe way. For instance, it allows a transform to read and update the constant buffer, which can be used to allow a transform to
/// pass the exact dispatch area size to an input shader, without the consumer having to manually query that information beforehand (which might not be available either).
///
///
-/// This interface is implemented by ComputeSharp.D2D1, and it can be used through the APIs in , in several ways.
-/// That is, consumers can either implement a type inheriting from to implement their own fully customized transform
-/// mapping logic, or they can use the helper methods exposed by to easily retrieve ready to use transforms.
+/// This interface is implemented by ComputeSharp.D2D1, and it can be used through the APIs in , in several ways.
+/// That is, consumers can either implement a type inheriting from to implement their own fully customized transform
+/// mapping logic, or they can use the helper methods exposed by to easily retrieve ready to use transforms.
///
///
/// A CCW (COM callable wrapper, see ) is also available for all
-/// of these APIs, implemented via the same type. That is, a given instance can expose its underlying CCW through the
+/// of these APIs, implemented via the same type. That is, a given instance can expose its underlying CCW through the
/// interface, and this can then be passed to an existing D2D1 effect instance.
///
///
-public abstract unsafe class D2D1TransformMapper : ICustomQueryInterface, ID2D1TransformMapperInterop
+public abstract unsafe partial class D2D1DrawTransformMapper : ICustomQueryInterface, ID2D1DrawTransformMapperInterop
where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor
{
///
- /// The object wrapped by the current instance.
+ /// The object wrapped by the current instance.
///
- private ComPtr d2D1TransformMapperImpl;
+ private ComPtr d2D1TransformMapperImpl;
///
- /// Creates a new instance.
+ /// Creates a new instance.
///
- public D2D1TransformMapper()
+ public D2D1DrawTransformMapper()
{
- fixed (D2D1TransformMapperImpl** d2D1TransformMapperImpl = this.d2D1TransformMapperImpl)
+ fixed (D2D1DrawTransformMapperImpl** d2D1TransformMapperImpl = this.d2D1TransformMapperImpl)
{
- D2D1TransformMapperImpl.Factory(this, d2D1TransformMapperImpl);
+ D2D1DrawTransformMapperImpl.Factory(this, d2D1TransformMapperImpl);
}
}
///
- /// Releases the underlying ID2D1TransformMapper object.
+ /// Releases the underlying ID2D1DrawTransformMapper object.
///
- ~D2D1TransformMapper()
+ ~D2D1DrawTransformMapper()
{
this.d2D1TransformMapperImpl.Dispose();
}
@@ -189,11 +188,11 @@ public abstract unsafe class D2D1TransformMapper : ICustomQueryInterface, ID2
public abstract void MapInvalidOutput(int inputIndex, in Rectangle invalidInput, out Rectangle invalidOutput);
///
- /// Gets the underlying object.
+ /// Gets the underlying object.
///
- /// The underlying object.
+ /// The underlying object.
[MethodImpl(MethodImplOptions.AggressiveInlining)]
- internal void GetD2D1TransformMapper(ID2D1TransformMapper** transformMapper)
+ internal void GetD2D1TransformMapper(ID2D1DrawTransformMapper** transformMapper)
{
bool lockTaken = false;
@@ -249,7 +248,7 @@ public abstract unsafe class D2D1TransformMapper : ICustomQueryInterface, ID2
}
///
- void ID2D1TransformMapperInterop.MapInputsToOutput(
+ void ID2D1DrawTransformMapperInterop.MapInputsToOutput(
ID2D1DrawInfoUpdateContext* d2D1DrawInfoUpdateContext,
ReadOnlySpan inputs,
ReadOnlySpan opaqueInputs,
@@ -265,13 +264,13 @@ public abstract unsafe class D2D1TransformMapper : ICustomQueryInterface, ID2
}
///
- void ID2D1TransformMapperInterop.MapOutputToInputs(in Rectangle output, Span inputs)
+ void ID2D1DrawTransformMapperInterop.MapOutputToInputs(in Rectangle output, Span inputs)
{
MapOutputToInputs(in output, inputs);
}
///
- void ID2D1TransformMapperInterop.MapInvalidOutput(int inputIndex, in Rectangle invalidInput, out Rectangle invalidOutput)
+ void ID2D1DrawTransformMapperInterop.MapInvalidOutput(int inputIndex, in Rectangle invalidInput, out Rectangle invalidOutput)
{
MapInvalidOutput(inputIndex, in invalidInput, out invalidOutput);
}
diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1PixelShaderEffect.cs b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1PixelShaderEffect.cs
index a17e28b4..f4ff4a8d 100644
--- a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1PixelShaderEffect.cs
+++ b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1PixelShaderEffect.cs
@@ -485,7 +485,7 @@ public static unsafe class D2D1PixelShaderEffect
/// Sets the transform mapper for an input D2D1 effect, by calling ID2D1Effect::SetValue.
///
/// A pointer to the ID2D1Effect instance to use.
- /// The input ID2D1TransformMapper object (see ).
+ /// The input ID2D1DrawTransformMapper object (see ).
/// Thrown if or are .
/// For more info, see .
public static void SetTransformMapperForD2D1Effect(void* d2D1Effect, void* transformMapper)
@@ -504,16 +504,16 @@ public static unsafe class D2D1PixelShaderEffect
/// Sets the transform mapper for an input D2D1 effect, by calling ID2D1Effect::SetValue.
///
/// A pointer to the ID2D1Effect instance to use.
- /// The input ID2D1TransformMapper object.
+ /// The input ID2D1DrawTransformMapper object.
/// Thrown if or are .
/// For more info, see .
- public static void SetTransformMapperForD2D1Effect(void* d2D1Effect, D2D1TransformMapper transformMapper)
+ public static void SetTransformMapperForD2D1Effect(void* d2D1Effect, D2D1DrawTransformMapper transformMapper)
where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor
{
default(ArgumentNullException).ThrowIfNull(d2D1Effect);
default(ArgumentNullException).ThrowIfNull(transformMapper);
- using ComPtr transformMapper2 = default;
+ using ComPtr transformMapper2 = default;
transformMapper.GetD2D1TransformMapper(transformMapper2.GetAddressOf());
diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1PixelShaderEffectProperty.cs b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1PixelShaderEffectProperty.cs
index eaa7ad43..5b823089 100644
--- a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1PixelShaderEffectProperty.cs
+++ b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1PixelShaderEffectProperty.cs
@@ -18,7 +18,7 @@ public static class D2D1PixelShaderEffectProperty
public const uint ConstantBuffer = 0;
///
- /// The index for the ID2D1TransformMapper property of a object.
+ /// The index for the ID2D1DrawTransformMapper property of a object.
///
///
/// The value of this property is of type D2D1_PROPERTY_TYPE_IUNKNOWN.
diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.ID2D1DrawTransformMethods.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.ID2D1DrawTransformMethods.cs
index 38781454..8b6feab4 100644
--- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.ID2D1DrawTransformMethods.cs
+++ b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.ID2D1DrawTransformMethods.cs
@@ -72,7 +72,7 @@ partial struct PixelShaderEffect
if (@this->d2D1TransformMapper.Get() is not null)
{
- // Forward to the current ID2D1TransformMapper instance
+ // Forward to the current ID2D1DrawTransformMapper instance
@this->d2D1TransformMapper.Get()->MapOutputRectToInputRects(outputRect, inputRects, inputRectsCount).Assert();
}
else
@@ -129,7 +129,7 @@ partial struct PixelShaderEffect
constantBufferSize: @this->GetGlobals().ConstantBufferSize,
d2D1DrawInfo: @this->d2D1DrawInfo.Get()).Assert();
- // Forward the call to the input ID2D1TransformMapper instance
+ // Forward the call to the input ID2D1DrawTransformMapper instance
HRESULT hresult = @this->d2D1TransformMapper.Get()->MapInputRectsToOutputRect(
updateContext: (ID2D1DrawInfoUpdateContext*)d2D1DrawInfoUpdateContext.Get(),
inputRects: inputRects,
@@ -212,7 +212,7 @@ partial struct PixelShaderEffect
if (@this->d2D1TransformMapper.Get() is not null)
{
- // Forward to the current ID2D1TransformMapper instance
+ // Forward to the current ID2D1DrawTransformMapper instance
@this->d2D1TransformMapper.Get()->MapInvalidRect(inputIndex, invalidInputRect, invalidOutputRect).Assert();
}
else
diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.Properties.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.Properties.cs
index 404b0be1..cf1c5497 100644
--- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.Properties.cs
+++ b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.Properties.cs
@@ -107,7 +107,7 @@ unsafe partial struct PixelShaderEffect
default(ArgumentNullException).ThrowIfNull(data);
default(ArgumentOutOfRangeException).ThrowIfLessThan((int)dataSize, sizeof(void*), nameof(dataSize));
- @this->d2D1TransformMapper.CopyTo((ID2D1TransformMapper**)data).Assert();
+ @this->d2D1TransformMapper.CopyTo((ID2D1DrawTransformMapper**)data).Assert();
if (actualSize is not null)
{
@@ -138,9 +138,9 @@ unsafe partial struct PixelShaderEffect
default(ArgumentNullException).ThrowIfNull(value);
using ComPtr unknown = new((IUnknown*)value);
- using ComPtr transformMapper = default;
+ using ComPtr transformMapper = default;
- // Check that the input object implements ID2D1TransformMapper
+ // Check that the input object implements ID2D1DrawTransformMapper
unknown.CopyTo(transformMapper.GetAddressOf()).Assert();
// Store the transform mapper manager into the effect
diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.cs
index 2bd23ae0..740026c5 100644
--- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.cs
+++ b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.cs
@@ -78,9 +78,9 @@ internal unsafe partial struct PixelShaderEffect
private byte* constantBuffer;
///
- /// The instance to use, if any.
+ /// The instance to use, if any.
///
- private ComPtr d2D1TransformMapper;
+ private ComPtr d2D1TransformMapper;
///
/// The instance currently in use.
diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1TransformMapperImpl.ID2D1TransformMapper.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1DrawTransformMapperImpl.ID2D1DrawTransformMapper.cs
similarity index 72%
rename from src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1TransformMapperImpl.ID2D1TransformMapper.cs
rename to src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1DrawTransformMapperImpl.ID2D1DrawTransformMapper.cs
index f7fd92d9..019a711f 100644
--- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1TransformMapperImpl.ID2D1TransformMapper.cs
+++ b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1DrawTransformMapperImpl.ID2D1DrawTransformMapper.cs
@@ -3,44 +3,43 @@ using System.Drawing;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using ComputeSharp.D2D1.Extensions;
-using ComputeSharp.D2D1.Interop.Effects;
using ComputeSharp.Win32;
namespace ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers;
///
-unsafe partial struct D2D1TransformMapperImpl
+unsafe partial struct D2D1DrawTransformMapperImpl
{
///
- /// The implementation for .
+ /// The implementation for .
///
- private static class ID2D1TransformMapperMethods
+ private static class ID2D1DrawTransformMapperMethods
{
- ///
+ ///
[UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])]
- public static int QueryInterface(D2D1TransformMapperImpl* @this, Guid* riid, void** ppvObject)
+ public static int QueryInterface(D2D1DrawTransformMapperImpl* @this, Guid* riid, void** ppvObject)
{
return @this->QueryInterface(riid, ppvObject);
}
- ///
+ ///
[UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])]
- public static uint AddRef(D2D1TransformMapperImpl* @this)
+ public static uint AddRef(D2D1DrawTransformMapperImpl* @this)
{
return @this->AddRef();
}
- ///
+ ///
[UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])]
- public static uint Release(D2D1TransformMapperImpl* @this)
+ public static uint Release(D2D1DrawTransformMapperImpl* @this)
{
return @this->Release();
}
- ///
+ ///
[UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])]
public static int MapInputRectsToOutputRect(
- D2D1TransformMapperImpl* @this,
+ D2D1DrawTransformMapperImpl* @this,
ID2D1DrawInfoUpdateContext* d2D1DrawInfoUpdateContext,
RECT* inputRects,
RECT* inputOpaqueSubRects,
@@ -63,7 +62,7 @@ unsafe partial struct D2D1TransformMapperImpl
// Invoke MapInputsToOutput and handle exceptions so they don't cross the ABI boundary
try
{
- Unsafe.As(@this->transformMapperHandle.Target!).MapInputsToOutput(
+ Unsafe.As(@this->transformMapperHandle.Target!).MapInputsToOutput(
d2D1DrawInfoUpdateContext,
inputs,
opaqueInputs,
@@ -81,10 +80,10 @@ unsafe partial struct D2D1TransformMapperImpl
return S.S_OK;
}
- ///
+ ///
[UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])]
public static int MapOutputRectToInputRects(
- D2D1TransformMapperImpl* @this,
+ D2D1DrawTransformMapperImpl* @this,
RECT* outputRect,
RECT* inputRects,
uint inputRectsCount)
@@ -100,7 +99,7 @@ unsafe partial struct D2D1TransformMapperImpl
// Handle exceptions, as mentioned above
try
{
- Unsafe.As(@this->transformMapperHandle.Target!).MapOutputToInputs(in output, inputs);
+ Unsafe.As(@this->transformMapperHandle.Target!).MapOutputToInputs(in output, inputs);
}
catch (Exception e)
{
@@ -115,10 +114,10 @@ unsafe partial struct D2D1TransformMapperImpl
return S.S_OK;
}
- ///
+ ///
[UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])]
public static int MapInvalidRect(
- D2D1TransformMapperImpl* @this,
+ D2D1DrawTransformMapperImpl* @this,
uint inputIndex,
RECT invalidInputRect,
RECT* invalidOutputRect)
@@ -129,7 +128,7 @@ unsafe partial struct D2D1TransformMapperImpl
// Handle exceptions once again
try
{
- Unsafe.As(@this->transformMapperHandle.Target!).MapInvalidOutput((int)inputIndex, invalidInput, out invalidOutput);
+ Unsafe.As(@this->transformMapperHandle.Target!).MapInvalidOutput((int)inputIndex, invalidInput, out invalidOutput);
}
catch (Exception e)
{
diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1DrawTransformMapperImpl.ID2D1DrawTransformMapperInternal.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1DrawTransformMapperImpl.ID2D1DrawTransformMapperInternal.cs
new file mode 100644
index 00000000..00e54b00
--- /dev/null
+++ b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1DrawTransformMapperImpl.ID2D1DrawTransformMapperInternal.cs
@@ -0,0 +1,59 @@
+using System;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using ComputeSharp.Win32;
+
+namespace ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers;
+
+///
+unsafe partial struct D2D1DrawTransformMapperImpl
+{
+ ///
+ /// The implementation for .
+ ///
+ private static class ID2D1DrawTransformMapperInternalMethods
+ {
+ ///
+ [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])]
+ public static int QueryInterface(D2D1DrawTransformMapperImpl* @this, Guid* riid, void** ppvObject)
+ {
+ @this = (D2D1DrawTransformMapperImpl*)&((void**)@this)[-1];
+
+ return @this->QueryInterface(riid, ppvObject);
+ }
+
+ ///
+ [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])]
+ public static uint AddRef(D2D1DrawTransformMapperImpl* @this)
+ {
+ @this = (D2D1DrawTransformMapperImpl*)&((void**)@this)[-1];
+
+ return @this->AddRef();
+ }
+
+ ///
+ [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])]
+ public static uint Release(D2D1DrawTransformMapperImpl* @this)
+ {
+ @this = (D2D1DrawTransformMapperImpl*)&((void**)@this)[-1];
+
+ return @this->Release();
+ }
+
+ ///
+ [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])]
+ public static int GetManagedWrapperHandle(D2D1DrawTransformMapperImpl* @this, void** ppvHandle)
+ {
+ @this = (D2D1DrawTransformMapperImpl*)&((void**)@this)[-1];
+
+ if (ppvHandle is null)
+ {
+ return E.E_POINTER;
+ }
+
+ *ppvHandle = (void*)GCHandle.ToIntPtr(@this->transformMapperHandle);
+
+ return S.S_OK;
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1TransformMapperImpl.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1DrawTransformMapperImpl.cs
similarity index 61%
rename from src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1TransformMapperImpl.cs
rename to src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1DrawTransformMapperImpl.cs
index 94763090..dba74a5d 100644
--- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1TransformMapperImpl.cs
+++ b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1DrawTransformMapperImpl.cs
@@ -4,60 +4,59 @@ using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Threading;
using ComputeSharp.D2D1.Interop;
-using ComputeSharp.D2D1.Interop.Effects;
using ComputeSharp.Win32;
namespace ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers;
///
-/// An implementation of the interface wrapping .
+/// An implementation of the interface wrapping .
///
-internal unsafe partial struct D2D1TransformMapperImpl
+internal unsafe partial struct D2D1DrawTransformMapperImpl
{
///
- /// The shared vtable pointer for instance, for .
+ /// The shared vtable pointer for instance, for .
///
- private static readonly void** VtblForID2D1TransformMapper = InitVtblForID2D1TransformMapperAndID2D1TransformMapperInternal();
+ private static readonly void** VtblForID2D1DrawTransformMapper = InitVtblForID2D1DrawTransformMapperAndID2D1DrawTransformMapperInternal();
///
- /// The shared vtable pointer for instance, for .
+ /// The shared vtable pointer for instance, for .
///
- private static readonly void** VtblForID2D1TransformMapperInternal = &VtblForID2D1TransformMapper[6];
+ private static readonly void** VtblForID2D1DrawTransformMapperInternal = &VtblForID2D1DrawTransformMapper[6];
///
- /// Initializes the combined vtable for and .
+ /// Initializes the combined vtable for and .
///
- /// The combined vtable for and .
- private static void** InitVtblForID2D1TransformMapperAndID2D1TransformMapperInternal()
+ /// The combined vtable for and .
+ private static void** InitVtblForID2D1DrawTransformMapperAndID2D1DrawTransformMapperInternal()
{
void** lpVtbl = (void**)D2D1AssemblyAssociatedMemory.Allocate(sizeof(void*) * 10);
// ID2D1ResourceTextureManager
- lpVtbl[0] = (delegate* unmanaged[MemberFunction])&ID2D1TransformMapperMethods.QueryInterface;
- lpVtbl[1] = (delegate* unmanaged[MemberFunction])&ID2D1TransformMapperMethods.AddRef;
- lpVtbl[2] = (delegate* unmanaged[MemberFunction])&ID2D1TransformMapperMethods.Release;
- lpVtbl[3] = (delegate* unmanaged[MemberFunction])&ID2D1TransformMapperMethods.MapInputRectsToOutputRect;
- lpVtbl[4] = (delegate* unmanaged[MemberFunction])&ID2D1TransformMapperMethods.MapOutputRectToInputRects;
- lpVtbl[5] = (delegate* unmanaged[MemberFunction])&ID2D1TransformMapperMethods.MapInvalidRect;
+ lpVtbl[0] = (delegate* unmanaged[MemberFunction])&ID2D1DrawTransformMapperMethods.QueryInterface;
+ lpVtbl[1] = (delegate* unmanaged[MemberFunction])&ID2D1DrawTransformMapperMethods.AddRef;
+ lpVtbl[2] = (delegate* unmanaged[MemberFunction])&ID2D1DrawTransformMapperMethods.Release;
+ lpVtbl[3] = (delegate* unmanaged[MemberFunction])&ID2D1DrawTransformMapperMethods.MapInputRectsToOutputRect;
+ lpVtbl[4] = (delegate* unmanaged[MemberFunction])&ID2D1DrawTransformMapperMethods.MapOutputRectToInputRects;
+ lpVtbl[5] = (delegate* unmanaged[MemberFunction])&ID2D1DrawTransformMapperMethods.MapInvalidRect;
- // ID2D1TransformMapperInternal
- lpVtbl[6 + 0] = (delegate* unmanaged[MemberFunction])&ID2D1TransformMapperInternalMethods.QueryInterface;
- lpVtbl[6 + 1] = (delegate* unmanaged[MemberFunction])&ID2D1TransformMapperInternalMethods.AddRef;
- lpVtbl[6 + 2] = (delegate* unmanaged[MemberFunction])&ID2D1TransformMapperInternalMethods.Release;
- lpVtbl[6 + 3] = (delegate* unmanaged[MemberFunction])&ID2D1TransformMapperInternalMethods.GetManagedWrapperHandle;
+ // ID2D1DrawTransformMapperInternal
+ lpVtbl[6 + 0] = (delegate* unmanaged[MemberFunction])&ID2D1DrawTransformMapperInternalMethods.QueryInterface;
+ lpVtbl[6 + 1] = (delegate* unmanaged[MemberFunction])&ID2D1DrawTransformMapperInternalMethods.AddRef;
+ lpVtbl[6 + 2] = (delegate* unmanaged[MemberFunction])&ID2D1DrawTransformMapperInternalMethods.Release;
+ lpVtbl[6 + 3] = (delegate* unmanaged[MemberFunction])&ID2D1DrawTransformMapperInternalMethods.GetManagedWrapperHandle;
return lpVtbl;
}
///
- /// The vtable pointer for the current instance, for .
+ /// The vtable pointer for the current instance, for .
///
- private void** lpVtblForID2D1TransformMapper;
+ private void** lpVtblForID2D1DrawTransformMapper;
///
- /// The vtable pointer for the current instance, for .
+ /// The vtable pointer for the current instance, for .
///
- private void** lpVtblForID2D1TransformMapperInternal;
+ private void** lpVtblForID2D1DrawTransformMapperInternal;
///
/// The current reference count for the object (from ).
@@ -65,7 +64,7 @@ internal unsafe partial struct D2D1TransformMapperImpl
private volatile int referenceCount;
///
- /// A to the wrapped instance.
+ /// A to the wrapped instance.
///
private GCHandle transformMapperHandle;
@@ -75,18 +74,18 @@ internal unsafe partial struct D2D1TransformMapperImpl
private SpinLock spinLock;
///
- /// The factory method for instances.
+ /// The factory method for instances.
///
- /// The input instance to wrap.
- /// The resulting instance.
+ /// The input instance to wrap.
+ /// The resulting instance.
public static void Factory(
- ID2D1TransformMapperInterop transformMapper,
- D2D1TransformMapperImpl** d2D1TransformMapperProxy)
+ ID2D1DrawTransformMapperInterop transformMapper,
+ D2D1DrawTransformMapperImpl** d2D1TransformMapperProxy)
{
- D2D1TransformMapperImpl* @this = (D2D1TransformMapperImpl*)NativeMemory.Alloc((nuint)sizeof(D2D1TransformMapperImpl));
+ D2D1DrawTransformMapperImpl* @this = (D2D1DrawTransformMapperImpl*)NativeMemory.Alloc((nuint)sizeof(D2D1DrawTransformMapperImpl));
- @this->lpVtblForID2D1TransformMapper = VtblForID2D1TransformMapper;
- @this->lpVtblForID2D1TransformMapperInternal = VtblForID2D1TransformMapperInternal;
+ @this->lpVtblForID2D1DrawTransformMapper = VtblForID2D1DrawTransformMapper;
+ @this->lpVtblForID2D1DrawTransformMapperInternal = VtblForID2D1DrawTransformMapperInternal;
@this->referenceCount = 1;
@this->transformMapperHandle = GCHandle.Alloc(transformMapper);
@this->spinLock = new SpinLock(enableThreadOwnerTracking: false);
@@ -103,9 +102,9 @@ internal unsafe partial struct D2D1TransformMapperImpl
///
/// Ensures the target of the current CCW is tracked and is keeping it alive.
///
- /// The associated object to track.
+ /// The associated object to track.
[MethodImpl(MethodImplOptions.AggressiveInlining)]
- public void EnsureTargetIsTracked(ID2D1TransformMapperInterop target)
+ public void EnsureTargetIsTracked(ID2D1DrawTransformMapperInterop target)
{
this.transformMapperHandle.Target = target;
}
@@ -113,15 +112,15 @@ internal unsafe partial struct D2D1TransformMapperImpl
///
/// Copies the current object onto a target pointer.
///
- /// The target pointer.
+ /// The target pointer.
/// The for the operation.
/// This method must only be called if the caller has taken a lock on already.
[MethodImpl(MethodImplOptions.AggressiveInlining)]
- public void CopyToWithNoLock(ID2D1TransformMapper** transformMapper)
+ public void CopyToWithNoLock(ID2D1DrawTransformMapper** transformMapper)
{
this.referenceCount++;
- *transformMapper = (ID2D1TransformMapper*)Unsafe.AsPointer(ref this);
+ *transformMapper = (ID2D1DrawTransformMapper*)Unsafe.AsPointer(ref this);
}
///
@@ -137,9 +136,9 @@ internal unsafe partial struct D2D1TransformMapperImpl
return E.E_POINTER;
}
- // ID2D1TransformMapper
+ // ID2D1DrawTransformMapper
if (riid->Equals(Windows.__uuidof()) ||
- riid->Equals(Windows.__uuidof()))
+ riid->Equals(Windows.__uuidof()))
{
this.referenceCount++;
@@ -148,8 +147,8 @@ internal unsafe partial struct D2D1TransformMapperImpl
return S.S_OK;
}
- // ID2D1TransformMapperInternal
- if (riid->Equals(Windows.__uuidof()))
+ // ID2D1DrawTransformMapperInternal
+ if (riid->Equals(Windows.__uuidof()))
{
this.referenceCount++;
diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1TransformMapperImpl.ID2D1TransformMapperInternal.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1TransformMapperImpl.ID2D1TransformMapperInternal.cs
deleted file mode 100644
index c0e1f10d..00000000
--- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1TransformMapperImpl.ID2D1TransformMapperInternal.cs
+++ /dev/null
@@ -1,59 +0,0 @@
-using System;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using ComputeSharp.Win32;
-
-namespace ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers;
-
-///
-unsafe partial struct D2D1TransformMapperImpl
-{
- ///
- /// The implementation for .
- ///
- private static class ID2D1TransformMapperInternalMethods
- {
- ///
- [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])]
- public static int QueryInterface(D2D1TransformMapperImpl* @this, Guid* riid, void** ppvObject)
- {
- @this = (D2D1TransformMapperImpl*)&((void**)@this)[-1];
-
- return @this->QueryInterface(riid, ppvObject);
- }
-
- ///
- [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])]
- public static uint AddRef(D2D1TransformMapperImpl* @this)
- {
- @this = (D2D1TransformMapperImpl*)&((void**)@this)[-1];
-
- return @this->AddRef();
- }
-
- ///
- [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])]
- public static uint Release(D2D1TransformMapperImpl* @this)
- {
- @this = (D2D1TransformMapperImpl*)&((void**)@this)[-1];
-
- return @this->Release();
- }
-
- ///
- [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])]
- public static int GetManagedWrapperHandle(D2D1TransformMapperImpl* @this, void** ppvHandle)
- {
- @this = (D2D1TransformMapperImpl*)&((void**)@this)[-1];
-
- if (ppvHandle is null)
- {
- return E.E_POINTER;
- }
-
- *ppvHandle = (void*)GCHandle.ToIntPtr(@this->transformMapperHandle);
-
- return S.S_OK;
- }
- }
-}
\ No newline at end of file
diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/ID2D1TransformMapper.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/ID2D1DrawTransformMapper.cs
similarity index 85%
rename from src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/ID2D1TransformMapper.cs
rename to src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/ID2D1DrawTransformMapper.cs
index 7b542195..caa5a9e7 100644
--- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/ID2D1TransformMapper.cs
+++ b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/ID2D1DrawTransformMapper.cs
@@ -10,7 +10,7 @@ namespace ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers;
///
/// The transform mapper manager type to use with built-in effects.
///
-internal unsafe struct ID2D1TransformMapper : IComObject
+internal unsafe struct ID2D1DrawTransformMapper : IComObject
{
///
static Guid* IComObject.IID
@@ -60,8 +60,8 @@ internal unsafe struct ID2D1TransformMapper : IComObject
RECT* outputRect,
RECT* outputOpaqueSubRect)
{
- return ((delegate* unmanaged[MemberFunction])this.lpVtbl[3])(
- (ID2D1TransformMapper*)Unsafe.AsPointer(ref this),
+ return ((delegate* unmanaged[MemberFunction])this.lpVtbl[3])(
+ (ID2D1DrawTransformMapper*)Unsafe.AsPointer(ref this),
updateContext,
inputRects,
inputOpaqueSubRects,
@@ -83,8 +83,8 @@ internal unsafe struct ID2D1TransformMapper : IComObject
RECT* inputRects,
uint inputRectsCount)
{
- return ((delegate* unmanaged[MemberFunction])this.lpVtbl[4])(
- (ID2D1TransformMapper*)Unsafe.AsPointer(ref this),
+ return ((delegate* unmanaged[MemberFunction])this.lpVtbl[4])(
+ (ID2D1DrawTransformMapper*)Unsafe.AsPointer(ref this),
outputRect,
inputRects,
inputRectsCount);
@@ -103,8 +103,8 @@ internal unsafe struct ID2D1TransformMapper : IComObject
RECT invalidInputRect,
RECT* invalidOutputRect)
{
- return ((delegate* unmanaged[MemberFunction])this.lpVtbl[5])(
- (ID2D1TransformMapper*)Unsafe.AsPointer(ref this),
+ return ((delegate* unmanaged[MemberFunction])this.lpVtbl[5])(
+ (ID2D1DrawTransformMapper*)Unsafe.AsPointer(ref this),
inputIndex,
invalidInputRect,
invalidOutputRect);
diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/ID2D1TransformMapperInternal.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/ID2D1DrawTransformMapperInternal.cs
similarity index 84%
rename from src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/ID2D1TransformMapperInternal.cs
rename to src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/ID2D1DrawTransformMapperInternal.cs
index 3a998e56..1f072660 100644
--- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/ID2D1TransformMapperInternal.cs
+++ b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/ID2D1DrawTransformMapperInternal.cs
@@ -10,7 +10,7 @@ namespace ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers;
///
/// The internal transform mapper manager interface.
///
-internal unsafe struct ID2D1TransformMapperInternal : IComObject
+internal unsafe struct ID2D1DrawTransformMapperInternal : IComObject
{
///
static Guid* IComObject.IID
@@ -49,8 +49,8 @@ internal unsafe struct ID2D1TransformMapperInternal : IComObject
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public HRESULT GetManagedWrapperHandle(void** ppvHandle)
{
- return ((delegate* unmanaged[MemberFunction])this.lpVtbl[3])(
- (ID2D1TransformMapperInternal*)Unsafe.AsPointer(ref this),
+ return ((delegate* unmanaged[MemberFunction])this.lpVtbl[3])(
+ (ID2D1DrawTransformMapperInternal*)Unsafe.AsPointer(ref this),
ppvHandle);
}
}
\ No newline at end of file
diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/ID2D1TransformMapperInterop.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/ID2D1DrawTransformMapperInterop.cs
similarity index 70%
rename from src/ComputeSharp.D2D1/Shaders/Interop/Effects/ID2D1TransformMapperInterop.cs
rename to src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/ID2D1DrawTransformMapperInterop.cs
index 23417b24..a7d520a2 100644
--- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/ID2D1TransformMapperInterop.cs
+++ b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/ID2D1DrawTransformMapperInterop.cs
@@ -1,15 +1,15 @@
using System;
using System.Drawing;
-using ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers;
+using ComputeSharp.D2D1.Interop;
-namespace ComputeSharp.D2D1.Interop.Effects;
+namespace ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers;
///
-/// A base type to support non-generic uses.
+/// A base type to support non-generic uses.
///
-internal unsafe interface ID2D1TransformMapperInterop
+internal unsafe interface ID2D1DrawTransformMapperInterop
{
- ///
+ ///
/// The instance associated with the current effect.
/// The input rectangles to be mapped to the output rectangle. This parameter is always equal to the input bounds.
/// The input rectangles to be mapped to the opaque output rectangle.
@@ -22,9 +22,9 @@ internal unsafe interface ID2D1TransformMapperInterop
out Rectangle output,
out Rectangle opaqueOutput);
- ///
+ ///
void MapOutputToInputs(in Rectangle output, Span inputs);
- ///
+ ///
void MapInvalidOutput(int inputIndex, in Rectangle invalidInput, out Rectangle invalidOutput);
}
\ No newline at end of file
diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Factories/Abstract/D2D1TransformMapper{T,TParameters}.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Factories/Abstract/D2D1TransformMapper{T,TParameters}.cs
index 34fcf9ba..d0af4b72 100644
--- a/src/ComputeSharp.D2D1/Shaders/Interop/Factories/Abstract/D2D1TransformMapper{T,TParameters}.cs
+++ b/src/ComputeSharp.D2D1/Shaders/Interop/Factories/Abstract/D2D1TransformMapper{T,TParameters}.cs
@@ -12,7 +12,7 @@ namespace ComputeSharp.D2D1.Shaders.Interop.Factories.Abstract;
///
/// The type of D2D1 pixel shader associated to the transform mapper.
/// The type of parameters that the transform mapper will use.
-internal abstract class D2D1TransformMapper : D2D1TransformMapper
+internal abstract class D2D1DrawTransformMapper : D2D1DrawTransformMapper
where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor
where TParameters : unmanaged
{
@@ -22,7 +22,7 @@ internal abstract class D2D1TransformMapper : D2D1TransformMappe
private TParameters parameters;
///
- public override void MapInputsToOutput(
+ public sealed override void MapInputsToOutput(
D2D1DrawInfoUpdateContext drawInfoUpdateContext,
ReadOnlySpan inputs,
ReadOnlySpan opaqueInputs,
@@ -56,7 +56,7 @@ internal abstract class D2D1TransformMapper : D2D1TransformMappe
}
///
- public override void MapOutputToInputs(in Rectangle output, Span inputs)
+ public sealed override void MapOutputToInputs(in Rectangle output, Span inputs)
{
Rectangle64 output64 = Rectangle64.FromRectangle(output);
@@ -66,7 +66,7 @@ internal abstract class D2D1TransformMapper : D2D1TransformMappe
}
///
- public override void MapInvalidOutput(int inputIndex, in Rectangle invalidInput, out Rectangle invalidOutput)
+ public sealed override void MapInvalidOutput(int inputIndex, in Rectangle invalidInput, out Rectangle invalidOutput)
{
Rectangle64 output64 = Rectangle64.FromRectangle(invalidInput);
diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Factories/D2D1AffineTransformMapper{T}.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Factories/D2D1AffineTransformMapper{T}.cs
index 33c15902..4105fd9e 100644
--- a/src/ComputeSharp.D2D1/Shaders/Interop/Factories/D2D1AffineTransformMapper{T}.cs
+++ b/src/ComputeSharp.D2D1/Shaders/Interop/Factories/D2D1AffineTransformMapper{T}.cs
@@ -77,10 +77,10 @@ file static class D2D1AffineTransformMapper
}
///
-/// A custom implementation for an affine transform.
+/// A custom implementation for an affine transform.
///
/// The type of D2D1 pixel shader associated to the transform mapper.
-internal abstract class D2D1AffineTransformMapper : D2D1TransformMapper
+internal abstract class D2D1AffineTransformMapper : D2D1DrawTransformMapper
where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor
{
///
@@ -130,9 +130,9 @@ internal abstract class D2D1AffineTransformMapper : D2D1TransformMapper
{
///
- /// Gets the instance to get the dynamic affine transform matrix.
+ /// Gets the instance to get the dynamic affine transform matrix.
///
- public required D2D1TransformMapperFactory.Accessor Accessor { get; init; }
+ public required Accessor Accessor { get; init; }
///
protected override Matrix3x2 GetParameters(D2D1DrawInfoUpdateContext drawInfoUpdateContext)
diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Factories/D2D1InflateTransformMapper{T}.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Factories/D2D1InflateTransformMapper{T}.cs
index ba955962..63f7e925 100644
--- a/src/ComputeSharp.D2D1/Shaders/Interop/Factories/D2D1InflateTransformMapper{T}.cs
+++ b/src/ComputeSharp.D2D1/Shaders/Interop/Factories/D2D1InflateTransformMapper{T}.cs
@@ -6,10 +6,10 @@ using ComputeSharp.D2D1.Shaders.Interop.Helpers;
namespace ComputeSharp.D2D1.Shaders.Interop.Factories;
///
-/// A custom implementation for an inflate transform.
+/// A custom implementation for an inflate transform.
///
/// The type of D2D1 pixel shader associated to the transform mapper.
-internal abstract class D2D1InflateTransformMapper : D2D1TransformMapper
+internal abstract class D2D1InflateTransformMapper : D2D1DrawTransformMapper
where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor
{
///
@@ -42,7 +42,7 @@ internal abstract class D2D1InflateTransformMapper : D2D1TransformMapper
- /// A implementation for a constant inflate LTRB amount.
+ /// A implementation for a constant inflate LTRB amount.
///
public sealed class ConstantLeftTopRightBottomAmount : D2D1InflateTransformMapper
{
@@ -74,14 +74,14 @@ internal abstract class D2D1InflateTransformMapper : D2D1TransformMapper
- /// A implementation for a dynamic inflate amount.
+ /// A implementation for a dynamic inflate amount.
///
public sealed class DynamicAmount : D2D1InflateTransformMapper
{
///
- /// Gets the instance to get the dynamic inflate amount.
+ /// Gets the instance to get the dynamic inflate amount.
///
- public required D2D1TransformMapperFactory.Accessor Accessor { get; init; }
+ public required Accessor Accessor { get; init; }
///
protected override (int Left, int Top, int Right, int Bottom) GetParameters(D2D1DrawInfoUpdateContext drawInfoUpdateContext)
@@ -93,14 +93,14 @@ internal abstract class D2D1InflateTransformMapper : D2D1TransformMapper
- /// A implementation for a dynamic inflate LTRB amount.
+ /// A implementation for a dynamic inflate LTRB amount.
///
public sealed class DynamicLeftTopRightBottomAmount : D2D1InflateTransformMapper
{
///
- /// Gets the instance to get the dynamic inflate LTRB amount.
+ /// Gets the instance to get the dynamic inflate LTRB amount.
///
- public required D2D1TransformMapperFactory.Accessor<(int, int, int, int)> Accessor { get; init; }
+ public required Accessor<(int, int, int, int)> Accessor { get; init; }
///
protected override (int Left, int Top, int Right, int Bottom) GetParameters(D2D1DrawInfoUpdateContext drawInfoUpdateContext)
diff --git a/tests/ComputeSharp.D2D1.Tests/D2D1PixelShaderEffectTests.cs b/tests/ComputeSharp.D2D1.Tests/D2D1PixelShaderEffectTests.cs
index 511b064b..1a426ebe 100644
--- a/tests/ComputeSharp.D2D1.Tests/D2D1PixelShaderEffectTests.cs
+++ b/tests/ComputeSharp.D2D1.Tests/D2D1PixelShaderEffectTests.cs
@@ -95,7 +95,7 @@ public partial class D2D1PixelShaderEffectTests
[ExpectedException(typeof(ArgumentNullException), AllowDerivedTypes = false)]
public unsafe void SetTransformMapperForD2D1Effect_RCW_NullD2D1ResourceTextureManager()
{
- D2D1PixelShaderEffect.SetTransformMapperForD2D1Effect((void*)1, (D2D1TransformMapper)null!);
+ D2D1PixelShaderEffect.SetTransformMapperForD2D1Effect((void*)1, (D2D1DrawTransformMapper)null!);
}
[TestMethod]
diff --git a/tests/ComputeSharp.D2D1.Tests/D2D1TransformMapperTests.cs b/tests/ComputeSharp.D2D1.Tests/D2D1TransformMapperTests.cs
index 255bebd5..444892e7 100644
--- a/tests/ComputeSharp.D2D1.Tests/D2D1TransformMapperTests.cs
+++ b/tests/ComputeSharp.D2D1.Tests/D2D1TransformMapperTests.cs
@@ -20,7 +20,7 @@ public partial class D2D1TransformMapperTests
[TestMethod]
public unsafe void VerifyInterfaces()
{
- D2D1TransformMapper transformMapper = D2D1TransformMapperFactory.Inflate(4);
+ D2D1DrawTransformMapper transformMapper = D2D1DrawTransformMapper.Inflate(4);
using ComPtr unknown = default;
using ComPtr transformMapper2 = default;
@@ -58,7 +58,7 @@ public partial class D2D1TransformMapperTests
D2D1PixelShaderEffect.RegisterForD2D1Factory1(d2D1Factory2.Get(), out _);
- D2D1TransformMapper transformMapper = D2D1TransformMapperFactory.Inflate(4);
+ D2D1DrawTransformMapper transformMapper = D2D1DrawTransformMapper.Inflate(4);
using ComPtr transformMapper2 = default;
@@ -99,7 +99,7 @@ public partial class D2D1TransformMapperTests
[TestMethod]
public unsafe void VerifyManagedWrapperRetrieval()
{
- D2D1TransformMapper transformMapper = D2D1TransformMapperFactory.Inflate(4);
+ D2D1DrawTransformMapper transformMapper = D2D1DrawTransformMapper.Inflate(4);
using ComPtr unknown = default;
using ComPtr transformMapperInternal = default;
@@ -139,7 +139,7 @@ public partial class D2D1TransformMapperTests
IUnknown** transformMapperUnknown,
out GCHandle transformMapperHandle)
{
- D2D1TransformMapper transformMapper = D2D1TransformMapperFactory.Inflate(4);
+ D2D1DrawTransformMapper transformMapper = D2D1DrawTransformMapper.Inflate(4);
Guid uuidOfTransformMapper = new("02E6D48D-B892-4FBC-AA54-119203BAB802");
@@ -243,7 +243,7 @@ public partial class D2D1TransformMapperTests
TolerantImageComparer.AssertEqual(destinationPath, expectedPath, 0.00001f);
}
- private sealed class DispatchAreaTransformMapper : D2D1TransformMapper
+ private sealed class DispatchAreaTransformMapper : D2D1DrawTransformMapper
{
public int ExpectedWidth;
public int ExpectedHeight;
diff --git a/tests/ComputeSharp.D2D1.Tests/Effects/BokehBlurEffect.cs b/tests/ComputeSharp.D2D1.Tests/Effects/BokehBlurEffect.cs
index 255fb506..9b8727e5 100644
--- a/tests/ComputeSharp.D2D1.Tests/Effects/BokehBlurEffect.cs
+++ b/tests/ComputeSharp.D2D1.Tests/Effects/BokehBlurEffect.cs
@@ -479,9 +479,9 @@ public sealed partial class BokehBlurEffect
internal sealed partial class VerticalConvolution
{
///
- /// The for the shader.
+ /// The for the shader.
///
- public static D2D1TransformMapper Transform { get; } = D2D1TransformMapperFactory.Inflate(static (in Shader shader) => (0, shader.kernelLength, 0, shader.kernelLength));
+ public static D2D1DrawTransformMapper Transform { get; } = D2D1DrawTransformMapper.Inflate(static (in Shader shader) => (0, shader.kernelLength, 0, shader.kernelLength));
///
/// Kernel for the vertical convolution pass for real or imaginary components.
@@ -526,9 +526,9 @@ public sealed partial class BokehBlurEffect
internal sealed partial class HorizontalConvolutionAndAccumulatePartials
{
///
- /// The for the shader.
+ /// The for the shader.
///
- public static D2D1TransformMapper Transform { get; } = D2D1TransformMapperFactory.Inflate(static (in Shader shader) => (shader.kernelLength, 0, shader.kernelLength, 0));
+ public static D2D1DrawTransformMapper Transform { get; } = D2D1DrawTransformMapper.Inflate(static (in Shader shader) => (shader.kernelLength, 0, shader.kernelLength, 0));
///
/// Kernel for the horizontal convolution pass.
diff --git a/tests/ComputeSharp.D2D1.Tests/EffectsTests.cs b/tests/ComputeSharp.D2D1.Tests/EffectsTests.cs
index 3086cc5b..f8fce90d 100644
--- a/tests/ComputeSharp.D2D1.Tests/EffectsTests.cs
+++ b/tests/ComputeSharp.D2D1.Tests/EffectsTests.cs
@@ -49,7 +49,7 @@ public class EffectsTests
{
D2D1TestRunner.RunAndCompareShader(
new PixelateEffect(new PixelateEffect.Constants(1280, 840, 16)),
- D2D1TransformMapperFactory.Inflate(16),
+ D2D1DrawTransformMapper.Inflate(16),
"Landscape.png",
"Landscape_Pixelate.png");
}
diff --git a/tests/ComputeSharp.D2D1.Tests/Helpers/D2D1TestRunner.cs b/tests/ComputeSharp.D2D1.Tests/Helpers/D2D1TestRunner.cs
index b47cfd31..b356fd56 100644
--- a/tests/ComputeSharp.D2D1.Tests/Helpers/D2D1TestRunner.cs
+++ b/tests/ComputeSharp.D2D1.Tests/Helpers/D2D1TestRunner.cs
@@ -19,7 +19,7 @@ internal static class D2D1TestRunner
/// Executes a pixel shader and compares the expected results.
///
/// The type of pixel shader to run.
- /// A custom instance for the effect.
+ /// A custom instance for the effect.
/// The name of the source image.
/// The name of the expected result image.
/// The name of the destination image to save results to.
@@ -27,7 +27,7 @@ internal static class D2D1TestRunner
/// The allowed difference threshold for the normalized delta.
public static void RunAndCompareShader(
in T shader,
- D2D1TransformMapper? transformMapper,
+ D2D1DrawTransformMapper? transformMapper,
string originalFileName,
string expectedFileName,
[CallerMemberName] string destinationFileName = "",
@@ -101,12 +101,12 @@ internal static class D2D1TestRunner
///
/// The shader type to execute.
/// The shader to run.
- /// A custom instance for the effect.
+ /// A custom instance for the effect.
/// The source path for the image to run the shader on.
/// The destination path for the result.
private static unsafe void ExecutePixelShaderAndSaveToFile(
in T shader,
- D2D1TransformMapper? transformMapper,
+ D2D1DrawTransformMapper? transformMapper,
string sourcePath,
string destinationPath)
where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor
@@ -148,12 +148,12 @@ internal static class D2D1TestRunner
/// The shader to run.
/// The resulting width.
/// The resulting height.
- /// A custom instance for the effect.
+ /// A custom instance for the effect.
/// The destination path for the result.
/// The additional resource textures to use to run the shader.
private static unsafe void ExecutePixelShaderAndSaveToFile(
in T shader,
- D2D1TransformMapper? transformMapper,
+ D2D1DrawTransformMapper? transformMapper,
int width,
int height,
string destinationPath,