From 517af96936fba634f04eec68b05bc899200487e5 Mon Sep 17 00:00:00 2001 From: Jim Van Verth Date: Wed, 6 May 2020 07:52:45 -0400 Subject: [PATCH] Fix colorspace in Viewer for Metal Change-Id: Id8394acf854f1c069c5fde449ede225b2d81968b Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288056 Auto-Submit: Jim Van Verth Commit-Queue: Greg Daniel Reviewed-by: Greg Daniel --- tools/sk_app/mac/MetalWindowContext_mac.mm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/sk_app/mac/MetalWindowContext_mac.mm b/tools/sk_app/mac/MetalWindowContext_mac.mm index 19723303d9..df8cda9fe5 100644 --- a/tools/sk_app/mac/MetalWindowContext_mac.mm +++ b/tools/sk_app/mac/MetalWindowContext_mac.mm @@ -65,6 +65,8 @@ bool MetalWindowContext_mac::onInitializeContext() { fMetalLayer.autoresizingMask = kCALayerHeightSizable | kCALayerWidthSizable; fMetalLayer.contentsGravity = kCAGravityTopLeft; fMetalLayer.magnificationFilter = kCAFilterNearest; + NSColorSpace* cs = fMainView.window.colorSpace; + fMetalLayer.colorspace = cs.CGColorSpace; fMainView.layer = fMetalLayer; fMainView.wantsLayer = YES;