-
Notifications
You must be signed in to change notification settings - Fork 730
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(composition): Implement CompositionCapabilities
- Loading branch information
Showing
7 changed files
with
61 additions
and
33 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
src/Uno.UI.Composition/Composition/CompositionCapabilities.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,26 @@ | ||
#nullable enable | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Windows.Foundation; | ||
|
||
namespace Windows.UI.Composition | ||
{ | ||
public partial class CompositionCapabilities | ||
{ | ||
private Compositor? _compositor; | ||
|
||
internal CompositionCapabilities(Compositor? compositor) => _compositor = compositor; | ||
|
||
public static CompositionCapabilities GetForCurrentView() => new CompositionCapabilities(Compositor.Current); | ||
|
||
public partial bool AreEffectsSupported(); | ||
|
||
public partial bool AreEffectsFast(); | ||
|
||
TypedEventHandler<CompositionCapabilities, object>? Changed; | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/Uno.UI.Composition/Composition/CompositionCapabilities.skia.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,18 @@ | ||
#nullable enable | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Windows.Foundation; | ||
|
||
namespace Windows.UI.Composition | ||
{ | ||
public partial class CompositionCapabilities | ||
{ | ||
public partial bool AreEffectsSupported() => true; | ||
|
||
public partial bool AreEffectsFast() => _compositor?.IsSoftwareRenderer is not true; | ||
} | ||
} |
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