Skip to content

Commit

Permalink
chore: Start adjusting DisplayInformation
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinZikmund committed Jan 8, 2025
1 parent 9bd973a commit ed805c6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ partial class CompositionGeometricClip
{
switch (Geometry)
{
case CompositionPathGeometry { Path.GeometrySource: SkiaGeometrySource2D geometrySource }:
return geometrySource.TightBounds.ToRect();

case CompositionPathGeometry { Geometry: SkiaGeometrySource2D genericGeometrySource }:
return genericGeometrySource.TightBounds.ToRect();
case CompositionPathGeometry cpg:
throw new InvalidOperationException($"Clipping with source {cpg.Path?.GeometrySource} is not supported");

Expand All @@ -30,7 +29,7 @@ internal override void Apply(SKCanvas canvas, Visual visual)
{
switch (Geometry)
{
case CompositionPathGeometry { Path.GeometrySource: SkiaGeometrySource2D geometrySource }:
case CompositionPathGeometry { Geometry: SkiaGeometrySource2D geometrySource }:
var path = TransformMatrix.IsIdentity
? geometrySource
: geometrySource.Transform(TransformMatrix.ToSKMatrix());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ public partial class CompositionPathGeometry : CompositionGeometry, ID2D1Geometr
private SkiaGeometrySource2D? _geometrySource2D;
private List<CompositionPathCommand> _commands = new();

internal IGeometrySource2D? Geometry => _geometrySource2D ?? Path?.GeometrySource;

internal override IGeometrySource2D? BuildGeometry() => _geometrySource2D;

private void InternalBuildGeometry()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ namespace Microsoft.UI.Composition
public partial class CompositionVisualSurface : CompositionObject, ICompositionSurface, ISkiaSurface
{
private SKSurface? _surface;
private DisplayInformation? _displayInformation;
private float _scale = 1.0f;

SKSurface? ISkiaSurface.Surface { get => _surface; }
Expand Down
2 changes: 0 additions & 2 deletions src/Uno.UI/UI/Xaml/Media/CompositionTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,4 @@ void ICompositionTarget.TryRedirectForManipulation(PointerPoint pointerPoint, In
ContentRoot.InputManager.Pointers.RedirectPointer(pointerPoint, tracker);
#endif
}

global::Windows.Graphics.Display.DisplayInformation ICompositionTarget.DisplayInformation => XamlRoot.GetDisplayInformation(ContentRoot?.XamlRoot);
}

0 comments on commit ed805c6

Please sign in to comment.