@shopify/react-native-skia 0.1.152 → 0.1.153

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.
@@ -1,3 +1,4 @@
1
+ project(RNSkia)
1
2
  cmake_minimum_required(VERSION 3.4.1)
2
3
 
3
4
  if(${BUILD_TYPE} STREQUAL "debug")
@@ -13,15 +13,21 @@
13
13
  #pragma clang diagnostic pop
14
14
 
15
15
  // These static class members are used by all Skia Views
16
- id<MTLDevice> RNSkMetalCanvasProvider::_device = MTLCreateSystemDefaultDevice();
17
- id<MTLCommandQueue> RNSkMetalCanvasProvider::_commandQueue = id<MTLCommandQueue>(CFRetain((GrMTLHandle)[_device newCommandQueue]));
18
-
16
+ id<MTLDevice> RNSkMetalCanvasProvider::_device = nullptr;
17
+ id<MTLCommandQueue> RNSkMetalCanvasProvider::_commandQueue = nullptr;
19
18
  sk_sp<GrDirectContext> RNSkMetalCanvasProvider::_skContext = nullptr;
20
19
 
21
20
  RNSkMetalCanvasProvider::RNSkMetalCanvasProvider(std::function<void()> requestRedraw,
22
21
  std::shared_ptr<RNSkia::RNSkPlatformContext> context):
23
22
  RNSkCanvasProvider(requestRedraw),
24
23
  _context(context) {
24
+ if (!_device) {
25
+ _device = MTLCreateSystemDefaultDevice();
26
+ }
27
+ if (!_commandQueue) {
28
+ _commandQueue = id<MTLCommandQueue>(CFRetain((GrMTLHandle)[_device newCommandQueue]));
29
+ }
30
+
25
31
  #pragma clang diagnostic push
26
32
  #pragma clang diagnostic ignored "-Wunguarded-availability-new"
27
33
  _layer = [CAMetalLayer layer];
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "setup-skia-web": "./scripts/setup-canvaskit.js"
8
8
  },
9
9
  "title": "React Native Skia",
10
- "version": "0.1.152",
10
+ "version": "0.1.153",
11
11
  "description": "High-performance React Native Graphics using Skia",
12
12
  "main": "lib/module/index.js",
13
13
  "files": [
@@ -82,8 +82,8 @@
82
82
  "eslint-config-react-native-wcandillon": "3.9.0",
83
83
  "eslint-plugin-reanimated": "2.0.0",
84
84
  "jest": "28.1.3",
85
- "react": "17.0.2",
86
- "react-native": "0.66.2",
85
+ "react": "18.1.0",
86
+ "react-native": "0.70.1",
87
87
  "react-native-builder-bob": "^0.18.2",
88
88
  "ts-jest": "^28.0.7",
89
89
  "typescript": "4.8.3"