@shopify/react-native-skia 1.5.3 → 1.5.4
Sign up to get free protection for your applications and to get access to all the features.
- package/android/CMakeLists.txt +52 -13
- package/android/build.gradle +3 -0
- package/android/cpp/rnskia-android/RNSkAndroidPlatformContext.h +18 -1
- package/android/cpp/rnskia-android/RNSkAndroidVideo.cpp +12 -1
- package/android/cpp/rnskia-android/RNSkOpenGLCanvasProvider.cpp +13 -0
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaBaseView.java +0 -1
- package/cpp/api/JsiSkImage.h +15 -2
- package/cpp/api/JsiSkSurface.h +18 -3
- package/cpp/rnskia/DawnContext.h +241 -0
- package/cpp/rnskia/DawnUtils.h +127 -0
- package/cpp/rnskia/DawnWindowContext.cpp +19 -0
- package/cpp/rnskia/DawnWindowContext.h +77 -0
- package/cpp/rnskia/ImageProvider.h +100 -0
- package/cpp/rnskia/RNSkView.h +6 -0
- package/cpp/skia/include/android/SkAnimatedImage.h +14 -0
- package/cpp/skia/include/codec/SkAvifDecoder.h +39 -3
- package/cpp/skia/include/codec/SkCodec.h +16 -0
- package/cpp/skia/include/config/SkUserConfig.h +3 -2
- package/cpp/skia/include/core/SkCanvas.h +55 -10
- package/cpp/skia/include/core/SkContourMeasure.h +76 -0
- package/cpp/skia/include/core/SkFontScanner.h +48 -0
- package/cpp/skia/include/core/SkMilestone.h +1 -1
- package/cpp/skia/include/core/SkPath.h +11 -0
- package/cpp/skia/include/core/SkPathEffect.h +0 -23
- package/cpp/skia/include/core/SkRect.h +2 -0
- package/cpp/skia/include/core/SkString.h +4 -0
- package/cpp/skia/include/core/SkTypeface.h +5 -0
- package/cpp/skia/include/core/SkTypes.h +8 -3
- package/cpp/skia/include/docs/SkPDFDocument.h +3 -3
- package/cpp/skia/include/effects/SkOverdrawColorFilter.h +1 -0
- package/cpp/skia/include/effects/SkRuntimeEffect.h +2 -1
- package/cpp/skia/include/encode/SkJpegEncoder.h +4 -0
- package/cpp/skia/include/gpu/ganesh/GrContextOptions.h +8 -1
- package/cpp/skia/include/gpu/ganesh/GrDirectContext.h +18 -3
- package/cpp/skia/include/gpu/ganesh/GrTypes.h +11 -0
- package/cpp/skia/include/gpu/ganesh/gl/GrGLFunctions.h +5 -1
- package/cpp/skia/include/gpu/ganesh/gl/GrGLInterface.h +0 -1
- package/cpp/skia/include/gpu/graphite/GraphiteTypes.h +8 -0
- package/cpp/skia/include/gpu/graphite/Recorder.h +0 -2
- package/cpp/skia/include/gpu/graphite/precompile/PaintOptions.h +7 -4
- package/cpp/skia/include/gpu/graphite/precompile/PrecompileImageFilter.h +2 -0
- package/cpp/skia/include/gpu/graphite/precompile/PrecompileMaskFilter.h +2 -0
- package/cpp/skia/include/ports/SkFontMgr_android_ndk.h +25 -0
- package/cpp/skia/include/ports/SkFontMgr_fontconfig.h +4 -2
- package/cpp/skia/include/ports/SkFontScanner_Fontations.h +15 -0
- package/cpp/skia/include/ports/SkFontScanner_FreeType.h +15 -0
- package/cpp/skia/include/private/SkExif.h +14 -0
- package/cpp/skia/include/private/SkPathRef.h +36 -0
- package/cpp/skia/include/private/base/SkFeatures.h +4 -0
- package/cpp/skia/include/private/base/SkSpan_impl.h +1 -3
- package/cpp/skia/modules/skcms/src/skcms_internals.h +3 -0
- package/cpp/skia/src/base/SkMathPriv.h +1 -8
- package/ios/RNSkia-iOS/RNSkMetalCanvasProvider.h +1 -2
- package/ios/RNSkia-iOS/RNSkMetalCanvasProvider.mm +25 -19
- package/ios/RNSkia-iOS/RNSkiOSPlatformContext.mm +23 -0
- package/ios/RNSkia-iOS/SkiaMetalSurfaceFactory.h +22 -8
- package/ios/RNSkia-iOS/SkiaMetalSurfaceFactory.mm +0 -20
- package/libs/android/arm64-v8a/libskia.a +0 -0
- package/libs/android/arm64-v8a/libskottie.a +0 -0
- package/libs/android/armeabi-v7a/libskia.a +0 -0
- package/libs/android/armeabi-v7a/libskottie.a +0 -0
- package/libs/android/x86/libskia.a +0 -0
- package/libs/android/x86/libskottie.a +0 -0
- package/libs/android/x86_64/libskia.a +0 -0
- package/libs/android/x86_64/libskottie.a +0 -0
- package/libs/ios/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
- package/libs/ios/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
- package/libs/ios/libskottie.xcframework/ios-arm64_arm64e/libskottie.a +0 -0
- package/libs/ios/libskottie.xcframework/ios-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
- package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e/libskparagraph.a +0 -0
- package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e_x86_64-simulator/libskparagraph.a +0 -0
- package/libs/ios/libsksg.xcframework/ios-arm64_arm64e/libsksg.a +0 -0
- package/libs/ios/libsksg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
- package/libs/ios/libskshaper.xcframework/Info.plist +5 -5
- package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
- package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
- package/libs/ios/libskunicode_core.xcframework/Info.plist +5 -5
- package/libs/ios/libskunicode_core.xcframework/ios-arm64_arm64e/libskunicode_core.a +0 -0
- package/libs/ios/libskunicode_core.xcframework/ios-arm64_arm64e_x86_64-simulator/libskunicode_core.a +0 -0
- package/libs/ios/libskunicode_libgrapheme.xcframework/Info.plist +5 -5
- package/libs/ios/libskunicode_libgrapheme.xcframework/ios-arm64_arm64e/libskunicode_libgrapheme.a +0 -0
- package/libs/ios/libskunicode_libgrapheme.xcframework/ios-arm64_arm64e_x86_64-simulator/libskunicode_libgrapheme.a +0 -0
- package/libs/ios/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
- package/libs/ios/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
- package/package.json +1 -1
- package/react-native-skia.podspec +35 -9
- package/src/renderer/__tests__/e2e/SVG.spec.tsx +2 -1
@@ -4,6 +4,29 @@ require "json"
|
|
4
4
|
|
5
5
|
package = JSON.parse(File.read(File.join(__dir__, "package.json")))
|
6
6
|
|
7
|
+
# Check for GRAPHITE env var
|
8
|
+
use_graphite = ENV['SK_GRAPHITE'] == '1'
|
9
|
+
|
10
|
+
# Set preprocessor definitions based on GRAPHITE flag
|
11
|
+
preprocessor_defs = use_graphite ?
|
12
|
+
'$(inherited) SK_GRAPHITE=1' :
|
13
|
+
'$(inherited) SK_METAL=1 SK_GANESH=1'
|
14
|
+
|
15
|
+
# Define base frameworks
|
16
|
+
base_frameworks = ['libs/ios/libskia.xcframework',
|
17
|
+
'libs/ios/libsvg.xcframework',
|
18
|
+
'libs/ios/libskshaper.xcframework',
|
19
|
+
'libs/ios/libskparagraph.xcframework',
|
20
|
+
'libs/ios/libskunicode_core.xcframework',
|
21
|
+
'libs/ios/libskunicode_libgrapheme.xcframework',]
|
22
|
+
|
23
|
+
# Add Graphite frameworks if enabled
|
24
|
+
graphite_frameworks = [
|
25
|
+
'libs/ios/libdawn_native_static.xcframework',
|
26
|
+
'libs/ios/libdawn_platform_static.xcframework',
|
27
|
+
'libs/ios/libdawn_proc_static.xcframework'
|
28
|
+
]
|
29
|
+
|
7
30
|
Pod::Spec.new do |s|
|
8
31
|
s.name = "react-native-skia"
|
9
32
|
s.version = package["version"]
|
@@ -23,7 +46,7 @@ Pod::Spec.new do |s|
|
|
23
46
|
|
24
47
|
s.requires_arc = true
|
25
48
|
s.pod_target_xcconfig = {
|
26
|
-
'GCC_PREPROCESSOR_DEFINITIONS' =>
|
49
|
+
'GCC_PREPROCESSOR_DEFINITIONS' => preprocessor_defs,
|
27
50
|
'CLANG_CXX_LANGUAGE_STANDARD' => 'c++17',
|
28
51
|
'DEFINES_MODULE' => 'YES',
|
29
52
|
"HEADER_SEARCH_PATHS" => '"$(PODS_TARGET_SRCROOT)/cpp/"/**'
|
@@ -31,14 +54,9 @@ Pod::Spec.new do |s|
|
|
31
54
|
|
32
55
|
s.frameworks = 'MetalKit'
|
33
56
|
|
34
|
-
s.ios.vendored_frameworks =
|
35
|
-
|
36
|
-
|
37
|
-
'libs/ios/libskshaper.xcframework',
|
38
|
-
'libs/ios/libskparagraph.xcframework',
|
39
|
-
'libs/ios/libskunicode_core.xcframework',
|
40
|
-
'libs/ios/libskunicode_libgrapheme.xcframework',
|
41
|
-
]
|
57
|
+
s.ios.vendored_frameworks = use_graphite ?
|
58
|
+
base_frameworks + graphite_frameworks :
|
59
|
+
base_frameworks
|
42
60
|
|
43
61
|
# All iOS cpp/h files
|
44
62
|
s.source_files = [
|
@@ -46,6 +64,14 @@ Pod::Spec.new do |s|
|
|
46
64
|
"cpp/**/*.{h,cpp}"
|
47
65
|
]
|
48
66
|
|
67
|
+
graphite_exclusions = [
|
68
|
+
'cpp/rnskia/DawnContext.h',
|
69
|
+
'cpp/rnskia/DawnUtils.h',
|
70
|
+
'cpp/rnskia/DawnWindowContext.h',
|
71
|
+
'cpp/rnskia/DawnWindowContext.cpp',
|
72
|
+
'cpp/rnskia/ImageProvider.h'
|
73
|
+
]
|
74
|
+
s.exclude_files = graphite_exclusions unless use_graphite
|
49
75
|
|
50
76
|
if defined?(install_modules_dependencies()) != nil
|
51
77
|
install_modules_dependencies(s)
|
@@ -170,7 +170,8 @@ describe("Displays SVGs", () => {
|
|
170
170
|
</Group>
|
171
171
|
</>
|
172
172
|
);
|
173
|
-
|
173
|
+
// TODO: Currently there are artifacts on Graphite/iOS
|
174
|
+
checkImage(image, docPath("opacity-tiger.png"), { maxPixelDiff: 500 });
|
174
175
|
});
|
175
176
|
|
176
177
|
itRunsE2eOnly("text shouldn't crash on iOS", async () => {
|