Merge pull request #863 from Sergio0694/dev/rename-canvaseffect-setproperty

Rename 'CanvasEffect' API to 'SetPropertyAndInvalidateEffectGraph'
このコミットが含まれているのは:
Sergio Pedri authored and GitHub committed 2024-10-21 10:46:14 -07:00
コミット 9753cc97bb
7ファイル変更
+24 -15

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

+2 -2
ファイルの表示
@@ -26,7 +26,7 @@ public sealed partial class HelloWorldEffect : CanvasEffect
public float Time
{
get => this.time;
set => SetAndInvalidateEffectGraph(ref this.time, value);
set => SetPropertyAndInvalidateEffectGraph(ref this.time, value);
}
/// <summary>
@@ -35,7 +35,7 @@ public sealed partial class HelloWorldEffect : CanvasEffect
public Rect DispatchArea
{
get => this.dispatchArea;
set => SetAndInvalidateEffectGraph(ref this.dispatchArea, value);
set => SetPropertyAndInvalidateEffectGraph(ref this.dispatchArea, value);
}
/// <inheritdoc/>
+3 -3
ファイルの表示
@@ -31,7 +31,7 @@ internal abstract partial class PixelShaderEffect : CanvasEffect
public TimeSpan ElapsedTime
{
get => this.elapsedTime;
set => SetAndInvalidateEffectGraph(ref this.elapsedTime, value);
set => SetPropertyAndInvalidateEffectGraph(ref this.elapsedTime, value);
}
/// <summary>
@@ -40,7 +40,7 @@ internal abstract partial class PixelShaderEffect : CanvasEffect
public int ScreenWidth
{
get => this.screenWidth;
set => SetAndInvalidateEffectGraph(ref this.screenWidth, value);
set => SetPropertyAndInvalidateEffectGraph(ref this.screenWidth, value);
}
/// <summary>
@@ -49,7 +49,7 @@ internal abstract partial class PixelShaderEffect : CanvasEffect
public int ScreenHeight
{
get => this.screenHeight;
set => SetAndInvalidateEffectGraph(ref this.screenHeight, value);
set => SetPropertyAndInvalidateEffectGraph(ref this.screenHeight, value);
}
/// <summary>
+3 -3
ファイルの表示
@@ -31,7 +31,7 @@ internal abstract partial class PixelShaderEffect : CanvasEffect
public TimeSpan ElapsedTime
{
get => this.elapsedTime;
set => SetAndInvalidateEffectGraph(ref this.elapsedTime, value);
set => SetPropertyAndInvalidateEffectGraph(ref this.elapsedTime, value);
}
/// <summary>
@@ -40,7 +40,7 @@ internal abstract partial class PixelShaderEffect : CanvasEffect
public int ScreenWidth
{
get => this.screenWidth;
set => SetAndInvalidateEffectGraph(ref this.screenWidth, value);
set => SetPropertyAndInvalidateEffectGraph(ref this.screenWidth, value);
}
/// <summary>
@@ -49,7 +49,7 @@ internal abstract partial class PixelShaderEffect : CanvasEffect
public int ScreenHeight
{
get => this.screenHeight;
set => SetAndInvalidateEffectGraph(ref this.screenHeight, value);
set => SetPropertyAndInvalidateEffectGraph(ref this.screenHeight, value);
}
/// <summary>
+3 -3
ファイルの表示
@@ -31,7 +31,7 @@ public abstract partial class PixelShaderEffect : CanvasEffect
public TimeSpan ElapsedTime
{
get => this.elapsedTime;
set => SetAndInvalidateEffectGraph(ref this.elapsedTime, value);
set => SetPropertyAndInvalidateEffectGraph(ref this.elapsedTime, value);
}
/// <summary>
@@ -40,7 +40,7 @@ public abstract partial class PixelShaderEffect : CanvasEffect
public int ScreenWidth
{
get => this.screenWidth;
set => SetAndInvalidateEffectGraph(ref this.screenWidth, value);
set => SetPropertyAndInvalidateEffectGraph(ref this.screenWidth, value);
}
/// <summary>
@@ -49,7 +49,7 @@ public abstract partial class PixelShaderEffect : CanvasEffect
public int ScreenHeight
{
get => this.screenHeight;
set => SetAndInvalidateEffectGraph(ref this.screenHeight, value);
set => SetPropertyAndInvalidateEffectGraph(ref this.screenHeight, value);
}
/// <summary>
+10 -1
ファイルの表示
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using Microsoft.Graphics.Canvas;
@@ -144,7 +145,7 @@ public abstract partial class CanvasEffect : ICanvasImage, ICanvasImageInterop
/// <param name="storage">The storage for the effect property value.</param>
/// <param name="value">The new effect property value to set.</param>
/// <param name="invalidationType">The invalidation type to request.</param>
protected void SetAndInvalidateEffectGraph<T>([NotNullIfNotNull(nameof(value))] ref T storage, T value, CanvasEffectInvalidationType invalidationType = CanvasEffectInvalidationType.Update)
protected void SetPropertyAndInvalidateEffectGraph<T>([NotNullIfNotNull(nameof(value))] ref T storage, T value, CanvasEffectInvalidationType invalidationType = CanvasEffectInvalidationType.Update)
{
if (EqualityComparer<T>.Default.Equals(storage, value))
{
@@ -156,6 +157,14 @@ public abstract partial class CanvasEffect : ICanvasImage, ICanvasImageInterop
InvalidateEffectGraph(invalidationType);
}
/// <inheritdoc cref="SetPropertyAndInvalidateEffectGraph"/>
[Obsolete("Use 'SetPropertyAndInvalidateEffectGraph' instead.")]
[EditorBrowsable(EditorBrowsableState.Never)]
protected void SetAndInvalidateEffectGraph<T>([NotNullIfNotNull(nameof(value))] ref T storage, T value, CanvasEffectInvalidationType invalidationType = CanvasEffectInvalidationType.Update)
{
SetPropertyAndInvalidateEffectGraph(ref storage, value, invalidationType);
}
/// <summary>
/// Disposes any disposable resources in the current instance.
/// </summary>
+2 -2
ファイルの表示
@@ -390,13 +390,13 @@ public partial class CanvasEffectTests
public int Value
{
get => this.value;
set => SetAndInvalidateEffectGraph(ref this.value, value);
set => SetPropertyAndInvalidateEffectGraph(ref this.value, value);
}
public int ValueWithReload
{
get => this.value;
set => SetAndInvalidateEffectGraph(ref this.value, value, CanvasEffectInvalidationType.Creation);
set => SetPropertyAndInvalidateEffectGraph(ref this.value, value, CanvasEffectInvalidationType.Creation);
}
public int NumberOfBuildEffectGraphCalls { get; private set; }
+1 -1
ファイルの表示
@@ -120,7 +120,7 @@ public class ShadersTests
public T ConstantBuffer
{
get => this.constantBuffer;
set => SetAndInvalidateEffectGraph(ref this.constantBuffer, value);
set => SetPropertyAndInvalidateEffectGraph(ref this.constantBuffer, value);
}
protected override void BuildEffectGraph(CanvasEffectGraph effectGraph)