-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Memory and performance improvements to the XAML acrylic brush
- Loading branch information
1 parent
c136e2d
commit 9eb8b5c
Showing
9 changed files
with
138 additions
and
30 deletions.
There are no files selected for viewing
9 changes: 6 additions & 3 deletions
9
UICompositionAnimations/Behaviours/Effects/AcrylicEffectMode.cs
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 |
---|---|---|
@@ -1,18 +1,21 @@ | ||
namespace UICompositionAnimations.Behaviours.Effects | ||
using System; | ||
|
||
namespace UICompositionAnimations.Behaviours.Effects | ||
{ | ||
/// <summary> | ||
/// Indicates the UI mode for an acrylic effect brush | ||
/// </summary> | ||
[Flags] | ||
public enum AcrylicEffectMode | ||
{ | ||
/// <summary> | ||
/// The source content is the blurred UI of the application window | ||
/// </summary> | ||
InAppBlur, | ||
InAppBlur = 1, | ||
|
||
/// <summary> | ||
/// The source content is the host screen | ||
/// </summary> | ||
HostBackdrop | ||
HostBackdrop = 1 << 1 | ||
} | ||
} |
35 changes: 35 additions & 0 deletions
35
UICompositionAnimations/Brushes/Cache/HostBackdropInstanceWrapper.cs
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,35 @@ | ||
using Windows.Graphics.Effects; | ||
using Windows.UI.Composition; | ||
using JetBrains.Annotations; | ||
|
||
namespace UICompositionAnimations.Brushes.Cache | ||
{ | ||
/// <summary> | ||
/// A simple class that holds information on a <see cref="CompositionBackdropBrush"/> instance and its effects pipeline | ||
/// </summary> | ||
internal sealed class HostBackdropInstanceWrapper | ||
{ | ||
/// <summary> | ||
/// Gets the partial pipeline with the host backdrop effect | ||
/// </summary> | ||
[NotNull] | ||
public IGraphicsEffectSource Pipeline { get; } | ||
|
||
/// <summary> | ||
/// Gets the host backdrop effect brush instance | ||
/// </summary> | ||
[NotNull] | ||
public CompositionBackdropBrush Brush { get; } | ||
|
||
/// <summary> | ||
/// Creates a new wrapper instance with the given parameters | ||
/// </summary> | ||
/// <param name="pipeline">The current effects pipeline</param> | ||
/// <param name="brush">The host backdrop brush instance</param> | ||
public HostBackdropInstanceWrapper([NotNull] IGraphicsEffectSource pipeline, [NotNull] CompositionBackdropBrush brush) | ||
{ | ||
Pipeline = pipeline; | ||
Brush = brush; | ||
} | ||
} | ||
} |
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
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
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
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