Fix colorspace in Viewer for Metal

Change-Id: Id8394acf854f1c069c5fde449ede225b2d81968b
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/288056
Auto-Submit: Jim Van Verth <jvanverth@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Reviewed-by: Greg Daniel <egdaniel@google.com>
This commit is contained in:
Jim Van Verth 2020-05-06 07:52:45 -04:00 committed by Skia Commit-Bot
parent 613c92796e
commit 517af96936

View File

@ -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;