-
Notifications
You must be signed in to change notification settings - Fork 760
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(perf): Improve perf of the ObjectAnimationUsingKeyFrame
- Loading branch information
Showing
8 changed files
with
783 additions
and
335 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
using System; | ||
using System.Linq; | ||
|
||
namespace Windows.UI.Xaml.Media.Animation | ||
{ | ||
internal interface IKeyFrame | ||
{ | ||
public KeyTime KeyTime { get; } | ||
} | ||
|
||
internal interface IKeyFrame<out TValue> : IKeyFrame | ||
{ | ||
public TValue Value { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#nullable enable | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
|
||
namespace Windows.UI.Xaml.Media.Animation | ||
{ | ||
internal class KeyFrameComparer : IComparer<IKeyFrame> | ||
{ | ||
public static KeyFrameComparer Instance { get; } = new KeyFrameComparer(); | ||
|
||
private KeyFrameComparer() | ||
{ | ||
} | ||
|
||
/// <inheritdoc /> | ||
public int Compare(IKeyFrame x, IKeyFrame y) | ||
=> ((IComparable<KeyTime>)x.KeyTime).CompareTo(y.KeyTime); | ||
} | ||
|
||
internal class KeyFrameComparer<TValue> : IComparer<IKeyFrame<TValue>> | ||
{ | ||
public static KeyFrameComparer<TValue> Instance { get; } = new KeyFrameComparer<TValue>(); | ||
|
||
private KeyFrameComparer() | ||
{ | ||
} | ||
|
||
/// <inheritdoc /> | ||
public int Compare(IKeyFrame<TValue> x, IKeyFrame<TValue> y) | ||
=> ((IComparable<KeyTime>)x.KeyTime).CompareTo(y.KeyTime); | ||
} | ||
} |
Oops, something went wrong.