We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bbe1f68 commit 92c62fdCopy full SHA for 92c62fd
‎packages/skia/apple/MetalWindowContext.mm
@@ -23,6 +23,15 @@
23
_layer.pixelFormat = MTLPixelFormatBGRA8Unorm;
24
_layer.contentsGravity = kCAGravityBottomLeft;
25
_layer.drawableSize = CGSizeMake(width, height);
26
+ BOOL supportsWideColor = NO;
27
+ if (@available(iOS 10.0, *)) {
28
+ supportsWideColor = [UIScreen mainScreen].traitCollection.displayGamut == UIDisplayGamutP3;
29
+ }
30
+ if (supportsWideColor) {
31
+ CGColorSpaceRef colorSpace = CGColorSpaceCreateWithName(kCGColorSpaceDisplayP3);
32
+ _layer.colorspace = colorSpace;
33
+ CGColorSpaceRelease(colorSpace);
34
35
}
36
37
sk_sp<SkSurface> MetalWindowContext::getSurface() {
@@ -61,4 +70,4 @@
61
70
[commandBuffer presentDrawable:_currentDrawable];
62
71
[commandBuffer commit];
63
72
_skSurface = nullptr;
64
-}
73
+}
0 commit comments