Skip to content

Commit

Permalink
fix: Use Rgba8888 for Skia/macOS/metal
Browse files Browse the repository at this point in the history
  • Loading branch information
spouliot committed Sep 17, 2024
1 parent e4d13bc commit 0dfe51e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Uno.UI.Runtime.Skia.MacOS/MacOSWindowHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ private void MetalDraw(double nativeWidth, double nativeHeight, nint texture)

// we can't cache anything since the texture will be different on next calls
using var target = MacOSMetalRenderer.CreateTarget(_context!, nativeWidth, nativeHeight, texture);
using var surface = SKSurface.Create(_context, target, GRSurfaceOrigin.TopLeft, SKColorType.Bgra8888);
using var surface = SKSurface.Create(_context, target, GRSurfaceOrigin.TopLeft, SKColorType.Rgba8888);

surface.Canvas.Scale(scale, scale);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ - (nonnull instancetype)initWithMetalKitView:(nonnull MTKView *)mtkView
_device = mtkView.device;
self.queue = [_device newCommandQueue];

mtkView.colorPixelFormat = MTLPixelFormatBGRA8Unorm;
mtkView.colorPixelFormat = MTLPixelFormatRGBA8Unorm;
mtkView.depthStencilPixelFormat = MTLPixelFormatDepth32Float_Stencil8;
mtkView.sampleCount = 1;
// this property has no effect on x86_64, only on arm64, and is required for sampling (which acrylicbrush does)
Expand Down

0 comments on commit 0dfe51e

Please sign in to comment.