Skip to content

Commit

Permalink
chore: Start preparing animation dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinZikmund committed Jan 24, 2025
1 parent 0b22ce8 commit b6db25e
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 10 deletions.
1 change: 1 addition & 0 deletions src/SamplesApp/UITests.Shared/UITests.Shared.projitems
Original file line number Diff line number Diff line change
Expand Up @@ -5553,6 +5553,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Microsoft_UI_Xaml_Controls\AnimatedIconTests\AnimatedIconPage.xaml.cs">
<DependentUpon>AnimatedIconPage.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Microsoft_UI_Xaml_Controls\AnimatedVisualPlayer\Checkmark.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Microsoft_UI_Xaml_Controls\BreadcrumbTests\BreadcrumbBarPage.xaml.cs">
<DependentUpon>BreadcrumbBarPage.xaml</DependentUpon>
</Compile>
Expand Down
34 changes: 25 additions & 9 deletions src/Uno.UI.Composition/Composition/Compositor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,25 +28,41 @@ public Compositor()
// See https://github.com/dotnet/runtime/blob/c52fd37cc835a13bcfa9a64fdfe7520809a75345/src/libraries/System.Private.CoreLib/src/System/Diagnostics/Stopwatch.cs#L157
public long TimestampInTicks => unchecked((long)(Stopwatch.GetTimestamp() * s_tickFrequency));

/// <summary>
/// Creates an instance of AnimationController.
/// </summary>
/// <returns>The created AnimationController object.</returns>
public AnimationController CreateAnimationController() => new(this);

/// <summary>
/// Creates an instance of CompositionColorBrush.
/// </summary>
/// <returns>Returns the created CompositionColorBrush object.</returns>
public CompositionColorBrush CreateColorBrush() => new(this);

/// <summary>
/// Creates an instance of CompositionColorBrush using the specified color.
/// </summary>
/// <param name="color">The color for the brush to use.</param>
/// <returns>Returns the created CompositionColorBrush object.</returns>
public CompositionColorBrush CreateColorBrush(Color color) => new(this)
{
Color = color
};

internal static Compositor GetSharedCompositor() => _sharedCompositorLazy.Value;

[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static CompositionEasingFunction GetDefaultEasingFunction() => _defaultEasingFunction.Value;

public ContainerVisual CreateContainerVisual()
=> new ContainerVisual(this);

public ContainerVisual CreateContainerVisual() => new(this);

public SpriteVisual CreateSpriteVisual()
=> new SpriteVisual(this);

public CompositionColorBrush CreateColorBrush()
=> new CompositionColorBrush(this);

public CompositionColorBrush CreateColorBrush(Color color)
=> new CompositionColorBrush(this)
{
Color = color
};


public ScalarKeyFrameAnimation CreateScalarKeyFrameAnimation()
=> new ScalarKeyFrameAnimation(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ public static float MinGlobalPlaybackRate
#endif
// Skipping already declared method Microsoft.UI.Composition.Compositor.CreateRadialGradientBrush()
// Skipping already declared method Microsoft.UI.Composition.Compositor.CreateVisualSurface()
#if __ANDROID__ || __IOS__ || IS_UNIT_TESTS || __WASM__ || __SKIA__ || __NETSTD_REFERENCE__ || __MACOS__
#if false
[global::Uno.NotImplemented("__ANDROID__", "__IOS__", "IS_UNIT_TESTS", "__WASM__", "__SKIA__", "__NETSTD_REFERENCE__", "__MACOS__")]
public global::Microsoft.UI.Composition.AnimationController CreateAnimationController()
{
Expand Down

0 comments on commit b6db25e

Please sign in to comment.