@shopify/react-native-skia 2.0.0-next.5 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/apple/MetalWindowContext.mm +10 -1
- package/package.json +2 -3
@@ -23,6 +23,15 @@ MetalWindowContext::MetalWindowContext(GrDirectContext *directContext,
|
|
23
23
|
_layer.pixelFormat = MTLPixelFormatBGRA8Unorm;
|
24
24
|
_layer.contentsGravity = kCAGravityBottomLeft;
|
25
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
|
+
}
|
26
35
|
}
|
27
36
|
|
28
37
|
sk_sp<SkSurface> MetalWindowContext::getSurface() {
|
@@ -61,4 +70,4 @@ void MetalWindowContext::present() {
|
|
61
70
|
[commandBuffer presentDrawable:_currentDrawable];
|
62
71
|
[commandBuffer commit];
|
63
72
|
_skSurface = nullptr;
|
64
|
-
}
|
73
|
+
}
|
package/package.json
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
"setup-skia-web": "scripts/setup-canvaskit.js"
|
9
9
|
},
|
10
10
|
"title": "React Native Skia",
|
11
|
-
"version": "2.0.
|
11
|
+
"version": "2.0.1",
|
12
12
|
"description": "High-performance React Native Graphics using Skia",
|
13
13
|
"main": "lib/module/index.js",
|
14
14
|
"react-native": "src/index.ts",
|
@@ -155,6 +155,5 @@
|
|
155
155
|
}
|
156
156
|
]
|
157
157
|
]
|
158
|
-
}
|
159
|
-
"stableVersion": "0.0.0"
|
158
|
+
}
|
160
159
|
}
|