@shopify/react-native-skia 0.1.229 → 0.1.231
Sign up to get free protection for your applications and to get access to all the features.
- package/android/CMakeLists.txt +1 -0
- package/android/cpp/jni/JniLoad.cpp +0 -2
- package/android/cpp/rnskia-android/SkiaOpenGLSurfaceFactory.cpp +2 -2
- package/android/src/main/java/com/shopify/reactnative/skia/RNSkiaModule.java +0 -1
- package/android/src/main/java/com/shopify/reactnative/skia/RNSkiaPackage.java +1 -2
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaBaseView.java +7 -12
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaDomView.java +1 -1
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaPictureView.java +1 -1
- package/cpp/api/JsiSkAnimatedImage.h +1 -1
- package/cpp/api/JsiSkApi.h +4 -1
- package/cpp/api/JsiSkDataFactory.h +6 -6
- package/cpp/api/JsiSkImage.h +4 -4
- package/cpp/api/JsiSkParagraph.h +15 -0
- package/cpp/api/JsiSkParagraphBuilder.h +3 -32
- package/cpp/api/JsiSkParagraphBuilderFactory.h +54 -0
- package/cpp/api/JsiSkPath.h +1 -1
- package/cpp/api/JsiSkRRect.h +30 -3
- package/cpp/api/third_party/base64.cpp +153 -0
- package/cpp/api/third_party/base64.h +50 -0
- package/cpp/jsi/JsiPromises.h +1 -1
- package/cpp/rnskia/RNSkJsiViewApi.h +0 -52
- package/cpp/rnskia/RNSkManager.cpp +0 -6
- package/cpp/rnskia/RNSkView.h +2 -91
- package/cpp/rnskia/dom/JsiDomApi.h +0 -9
- package/cpp/rnskia/dom/props/FontProp.h +4 -1
- package/cpp/rnskia/dom/props/RRectProp.h +50 -0
- package/ios/RNSkia-iOS/SkiaMetalSurfaceFactory.mm +1 -1
- package/lib/commonjs/animation/index.d.ts +0 -3
- package/lib/commonjs/animation/index.js +0 -39
- package/lib/commonjs/animation/index.js.map +1 -1
- package/lib/commonjs/dom/nodes/JsiSkDOM.d.ts +3 -3
- package/lib/commonjs/dom/nodes/JsiSkDOM.js +0 -6
- package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -1
- package/lib/commonjs/dom/nodes/Node.d.ts +0 -3
- package/lib/commonjs/dom/nodes/Node.js +0 -5
- package/lib/commonjs/dom/nodes/Node.js.map +1 -1
- package/lib/commonjs/dom/nodes/datatypes/Rect.d.ts +1 -1
- package/lib/commonjs/dom/nodes/drawings/RRectNode.d.ts +3 -3
- package/lib/commonjs/dom/nodes/drawings/RRectNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/index.d.ts +0 -1
- package/lib/commonjs/dom/nodes/drawings/index.js +0 -13
- package/lib/commonjs/dom/nodes/drawings/index.js.map +1 -1
- package/lib/commonjs/dom/types/Common.d.ts +2 -2
- package/lib/commonjs/dom/types/Common.js.map +1 -1
- package/lib/commonjs/dom/types/Drawings.d.ts +0 -4
- package/lib/commonjs/dom/types/Drawings.js.map +1 -1
- package/lib/commonjs/dom/types/NodeType.d.ts +0 -1
- package/lib/commonjs/dom/types/NodeType.js +0 -1
- package/lib/commonjs/dom/types/NodeType.js.map +1 -1
- package/lib/commonjs/dom/types/SkDOM.d.ts +1 -2
- package/lib/commonjs/dom/types/SkDOM.js.map +1 -1
- package/lib/commonjs/headless/index.d.ts +3 -1
- package/lib/commonjs/headless/index.js +12 -6
- package/lib/commonjs/headless/index.js.map +1 -1
- package/lib/commonjs/index.d.ts +0 -1
- package/lib/commonjs/index.js +0 -14
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/mock/index.js +0 -4
- package/lib/commonjs/mock/index.js.map +1 -1
- package/lib/commonjs/renderer/Canvas.js +2 -21
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/renderer/Container.d.ts +1 -3
- package/lib/commonjs/renderer/Container.js +4 -6
- package/lib/commonjs/renderer/Container.js.map +1 -1
- package/lib/commonjs/renderer/HostComponents.d.ts +1 -6
- package/lib/commonjs/renderer/HostComponents.js +0 -3
- package/lib/commonjs/renderer/HostComponents.js.map +1 -1
- package/lib/commonjs/renderer/HostConfig.js +2 -23
- package/lib/commonjs/renderer/HostConfig.js.map +1 -1
- package/lib/commonjs/renderer/Reconciler.d.ts +1 -5
- package/lib/commonjs/renderer/Reconciler.js +3 -18
- package/lib/commonjs/renderer/Reconciler.js.map +1 -1
- package/lib/commonjs/renderer/components/index.d.ts +0 -1
- package/lib/commonjs/renderer/components/index.js +0 -13
- package/lib/commonjs/renderer/components/index.js.map +1 -1
- package/lib/commonjs/renderer/index.d.ts +0 -1
- package/lib/commonjs/renderer/index.js +0 -13
- package/lib/commonjs/renderer/index.js.map +1 -1
- package/lib/commonjs/renderer/processors/Animations/Animations.d.ts +1 -8
- package/lib/commonjs/renderer/processors/Animations/Animations.js +0 -44
- package/lib/commonjs/renderer/processors/Animations/Animations.js.map +1 -1
- package/lib/commonjs/skia/types/Canvas.d.ts +4 -4
- package/lib/commonjs/skia/types/Canvas.js.map +1 -1
- package/lib/commonjs/skia/types/Paragraph/Paragraph.d.ts +23 -0
- package/lib/commonjs/skia/types/Paragraph/Paragraph.js.map +1 -1
- package/lib/commonjs/skia/types/Path/Path.d.ts +2 -2
- package/lib/commonjs/skia/types/Path/Path.js.map +1 -1
- package/lib/commonjs/skia/types/RRect.d.ts +9 -0
- package/lib/commonjs/skia/types/RRect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkCanvas.d.ts +4 -4
- package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkParagraph.d.ts +3 -0
- package/lib/commonjs/skia/web/JsiSkParagraph.js +12 -0
- package/lib/commonjs/skia/web/JsiSkParagraph.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkParagraphBuilderFactory.js +5 -2
- package/lib/commonjs/skia/web/JsiSkParagraphBuilderFactory.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPath.d.ts +2 -2
- package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRRect.d.ts +2 -2
- package/lib/commonjs/skia/web/JsiSkRRect.js +4 -0
- package/lib/commonjs/skia/web/JsiSkRRect.js.map +1 -1
- package/lib/commonjs/views/SkiaBaseWebView.d.ts +0 -7
- package/lib/commonjs/views/SkiaBaseWebView.js +0 -17
- package/lib/commonjs/views/SkiaBaseWebView.js.map +1 -1
- package/lib/commonjs/views/SkiaDomView.d.ts +0 -7
- package/lib/commonjs/views/SkiaDomView.js +3 -14
- package/lib/commonjs/views/SkiaDomView.js.map +1 -1
- package/lib/commonjs/views/SkiaDomView.web.js +4 -14
- package/lib/commonjs/views/SkiaDomView.web.js.map +1 -1
- package/lib/commonjs/views/SkiaPictureView.d.ts +0 -7
- package/lib/commonjs/views/SkiaPictureView.js +3 -14
- package/lib/commonjs/views/SkiaPictureView.js.map +1 -1
- package/lib/commonjs/views/SkiaViewNativeId.d.ts +3 -0
- package/lib/commonjs/views/SkiaViewNativeId.js +11 -0
- package/lib/commonjs/views/SkiaViewNativeId.js.map +1 -0
- package/lib/commonjs/views/index.d.ts +0 -2
- package/lib/commonjs/views/index.js +0 -26
- package/lib/commonjs/views/index.js.map +1 -1
- package/lib/commonjs/views/types.d.ts +2 -15
- package/lib/commonjs/views/types.js.map +1 -1
- package/lib/module/animation/index.d.ts +0 -3
- package/lib/module/animation/index.js +0 -3
- package/lib/module/animation/index.js.map +1 -1
- package/lib/module/dom/nodes/JsiSkDOM.d.ts +3 -3
- package/lib/module/dom/nodes/JsiSkDOM.js +1 -7
- package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -1
- package/lib/module/dom/nodes/Node.d.ts +0 -3
- package/lib/module/dom/nodes/Node.js +0 -5
- package/lib/module/dom/nodes/Node.js.map +1 -1
- package/lib/module/dom/nodes/datatypes/Rect.d.ts +1 -1
- package/lib/module/dom/nodes/drawings/RRectNode.d.ts +3 -3
- package/lib/module/dom/nodes/drawings/RRectNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/index.d.ts +0 -1
- package/lib/module/dom/nodes/drawings/index.js +0 -1
- package/lib/module/dom/nodes/drawings/index.js.map +1 -1
- package/lib/module/dom/types/Common.d.ts +2 -2
- package/lib/module/dom/types/Common.js.map +1 -1
- package/lib/module/dom/types/Drawings.d.ts +0 -4
- package/lib/module/dom/types/Drawings.js.map +1 -1
- package/lib/module/dom/types/NodeType.d.ts +0 -1
- package/lib/module/dom/types/NodeType.js +0 -1
- package/lib/module/dom/types/NodeType.js.map +1 -1
- package/lib/module/dom/types/SkDOM.d.ts +1 -2
- package/lib/module/dom/types/SkDOM.js.map +1 -1
- package/lib/module/headless/index.d.ts +3 -1
- package/lib/module/headless/index.js +5 -3
- package/lib/module/headless/index.js.map +1 -1
- package/lib/module/index.d.ts +0 -1
- package/lib/module/index.js +0 -1
- package/lib/module/index.js.map +1 -1
- package/lib/module/mock/index.js +1 -4
- package/lib/module/mock/index.js.map +1 -1
- package/lib/module/renderer/Canvas.js +2 -20
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/renderer/Container.d.ts +1 -3
- package/lib/module/renderer/Container.js +4 -6
- package/lib/module/renderer/Container.js.map +1 -1
- package/lib/module/renderer/HostComponents.d.ts +1 -6
- package/lib/module/renderer/HostComponents.js +0 -3
- package/lib/module/renderer/HostComponents.js.map +1 -1
- package/lib/module/renderer/HostConfig.js +3 -23
- package/lib/module/renderer/HostConfig.js.map +1 -1
- package/lib/module/renderer/Reconciler.d.ts +1 -5
- package/lib/module/renderer/Reconciler.js +3 -16
- package/lib/module/renderer/Reconciler.js.map +1 -1
- package/lib/module/renderer/components/index.d.ts +0 -1
- package/lib/module/renderer/components/index.js +0 -1
- package/lib/module/renderer/components/index.js.map +1 -1
- package/lib/module/renderer/index.d.ts +0 -1
- package/lib/module/renderer/index.js +0 -1
- package/lib/module/renderer/index.js.map +1 -1
- package/lib/module/renderer/processors/Animations/Animations.d.ts +1 -8
- package/lib/module/renderer/processors/Animations/Animations.js +0 -28
- package/lib/module/renderer/processors/Animations/Animations.js.map +1 -1
- package/lib/module/skia/types/Canvas.d.ts +4 -4
- package/lib/module/skia/types/Canvas.js.map +1 -1
- package/lib/module/skia/types/Paragraph/Paragraph.d.ts +23 -0
- package/lib/module/skia/types/Paragraph/Paragraph.js.map +1 -1
- package/lib/module/skia/types/Path/Path.d.ts +2 -2
- package/lib/module/skia/types/Path/Path.js.map +1 -1
- package/lib/module/skia/types/RRect.d.ts +9 -0
- package/lib/module/skia/types/RRect.js.map +1 -1
- package/lib/module/skia/web/JsiSkCanvas.d.ts +4 -4
- package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/module/skia/web/JsiSkParagraph.d.ts +3 -0
- package/lib/module/skia/web/JsiSkParagraph.js +12 -0
- package/lib/module/skia/web/JsiSkParagraph.js.map +1 -1
- package/lib/module/skia/web/JsiSkParagraphBuilderFactory.js +5 -2
- package/lib/module/skia/web/JsiSkParagraphBuilderFactory.js.map +1 -1
- package/lib/module/skia/web/JsiSkPath.d.ts +2 -2
- package/lib/module/skia/web/JsiSkPath.js.map +1 -1
- package/lib/module/skia/web/JsiSkRRect.d.ts +2 -2
- package/lib/module/skia/web/JsiSkRRect.js +4 -0
- package/lib/module/skia/web/JsiSkRRect.js.map +1 -1
- package/lib/module/views/SkiaBaseWebView.d.ts +0 -7
- package/lib/module/views/SkiaBaseWebView.js +0 -17
- package/lib/module/views/SkiaBaseWebView.js.map +1 -1
- package/lib/module/views/SkiaDomView.d.ts +0 -7
- package/lib/module/views/SkiaDomView.js +2 -13
- package/lib/module/views/SkiaDomView.js.map +1 -1
- package/lib/module/views/SkiaDomView.web.js +4 -13
- package/lib/module/views/SkiaDomView.web.js.map +1 -1
- package/lib/module/views/SkiaPictureView.d.ts +0 -7
- package/lib/module/views/SkiaPictureView.js +2 -13
- package/lib/module/views/SkiaPictureView.js.map +1 -1
- package/lib/module/views/SkiaViewNativeId.d.ts +3 -0
- package/lib/module/views/SkiaViewNativeId.js +4 -0
- package/lib/module/views/SkiaViewNativeId.js.map +1 -0
- package/lib/module/views/index.d.ts +0 -2
- package/lib/module/views/index.js +0 -2
- package/lib/module/views/index.js.map +1 -1
- package/lib/module/views/types.d.ts +2 -15
- package/lib/module/views/types.js.map +1 -1
- package/lib/typescript/src/animation/index.d.ts +0 -3
- package/lib/typescript/src/dom/nodes/JsiSkDOM.d.ts +3 -3
- package/lib/typescript/src/dom/nodes/Node.d.ts +0 -3
- package/lib/typescript/src/dom/nodes/datatypes/Rect.d.ts +1 -1
- package/lib/typescript/src/dom/nodes/drawings/RRectNode.d.ts +3 -3
- package/lib/typescript/src/dom/nodes/drawings/index.d.ts +0 -1
- package/lib/typescript/src/dom/types/Common.d.ts +2 -2
- package/lib/typescript/src/dom/types/Drawings.d.ts +0 -4
- package/lib/typescript/src/dom/types/NodeType.d.ts +0 -1
- package/lib/typescript/src/dom/types/SkDOM.d.ts +1 -2
- package/lib/typescript/src/headless/index.d.ts +3 -1
- package/lib/typescript/src/index.d.ts +0 -1
- package/lib/typescript/src/renderer/Container.d.ts +1 -3
- package/lib/typescript/src/renderer/HostComponents.d.ts +1 -6
- package/lib/typescript/src/renderer/Reconciler.d.ts +1 -5
- package/lib/typescript/src/renderer/components/index.d.ts +0 -1
- package/lib/typescript/src/renderer/index.d.ts +0 -1
- package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +1 -8
- package/lib/typescript/src/skia/types/Canvas.d.ts +4 -4
- package/lib/typescript/src/skia/types/Paragraph/Paragraph.d.ts +23 -0
- package/lib/typescript/src/skia/types/Path/Path.d.ts +2 -2
- package/lib/typescript/src/skia/types/RRect.d.ts +9 -0
- package/lib/typescript/src/skia/web/JsiSkCanvas.d.ts +4 -4
- package/lib/typescript/src/skia/web/JsiSkParagraph.d.ts +3 -0
- package/lib/typescript/src/skia/web/JsiSkPath.d.ts +2 -2
- package/lib/typescript/src/skia/web/JsiSkRRect.d.ts +2 -2
- package/lib/typescript/src/views/SkiaBaseWebView.d.ts +0 -7
- package/lib/typescript/src/views/SkiaDomView.d.ts +0 -7
- package/lib/typescript/src/views/SkiaPictureView.d.ts +0 -7
- package/lib/typescript/src/views/SkiaViewNativeId.d.ts +3 -0
- package/lib/typescript/src/views/index.d.ts +0 -2
- package/lib/typescript/src/views/types.d.ts +2 -15
- package/libs/android/arm64-v8a/libskia.a +0 -0
- package/libs/android/armeabi-v7a/libskia.a +0 -0
- package/libs/android/x86/libskia.a +0 -0
- package/libs/android/x86_64/libskia.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/Info.plist +5 -5
- 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.xcframework/ios-arm64_arm64e/libskunicode.a +0 -0
- package/libs/ios/libskunicode.xcframework/ios-arm64_arm64e_x86_64-simulator/libskunicode.a +0 -0
- package/libs/ios/libsvg.xcframework/Info.plist +5 -5
- 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/src/animation/index.ts +0 -3
- package/src/dom/nodes/JsiSkDOM.ts +0 -12
- package/src/dom/nodes/Node.ts +0 -5
- package/src/dom/nodes/drawings/RRectNode.ts +2 -2
- package/src/dom/nodes/drawings/index.ts +0 -1
- package/src/dom/types/Common.ts +2 -1
- package/src/dom/types/Drawings.ts +0 -5
- package/src/dom/types/NodeType.ts +0 -1
- package/src/dom/types/SkDOM.ts +0 -4
- package/src/headless/index.ts +7 -3
- package/src/index.ts +0 -1
- package/src/mock/index.ts +0 -3
- package/src/renderer/Canvas.tsx +3 -21
- package/src/renderer/Container.tsx +1 -4
- package/src/renderer/HostComponents.ts +0 -13
- package/src/renderer/HostConfig.ts +3 -24
- package/src/renderer/Reconciler.tsx +1 -19
- package/src/renderer/components/index.ts +0 -1
- package/src/renderer/index.ts +0 -1
- package/src/renderer/processors/Animations/Animations.ts +1 -51
- package/src/skia/types/Canvas.ts +4 -4
- package/src/skia/types/Paragraph/Paragraph.ts +25 -0
- package/src/skia/types/Path/Path.ts +2 -2
- package/src/skia/types/RRect.ts +11 -0
- package/src/skia/web/JsiSkCanvas.ts +4 -4
- package/src/skia/web/JsiSkParagraph.ts +11 -0
- package/src/skia/web/JsiSkParagraphBuilderFactory.ts +9 -3
- package/src/skia/web/JsiSkPath.ts +2 -2
- package/src/skia/web/JsiSkRRect.ts +23 -2
- package/src/views/SkiaBaseWebView.tsx +0 -19
- package/src/views/SkiaDomView.tsx +1 -13
- package/src/views/SkiaDomView.web.tsx +1 -6
- package/src/views/SkiaPictureView.tsx +1 -13
- package/src/views/SkiaViewNativeId.ts +1 -0
- package/src/views/index.ts +0 -2
- package/src/views/types.ts +2 -26
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaDrawView.java +0 -44
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaDrawViewManager.java +0 -34
- package/cpp/rnskia/RNSkAnimation.h +0 -65
- package/cpp/rnskia/RNSkValueApi.h +0 -72
- package/cpp/rnskia/dom/base/JsiDependencyManager.h +0 -297
- package/cpp/rnskia/dom/nodes/JsiCustomDrawingNode.h +0 -127
- package/cpp/rnskia/dom/props/DrawingProp.h +0 -35
- package/cpp/rnskia/values/RNSkClockValue.h +0 -140
- package/cpp/rnskia/values/RNSkComputedValue.h +0 -104
- package/cpp/rnskia/values/RNSkReadonlyValue.h +0 -166
- package/cpp/rnskia/values/RNSkValue.h +0 -116
- package/ios/RNSkia-iOS/SkiaDrawView.h +0 -7
- package/ios/RNSkia-iOS/SkiaDrawView.mm +0 -72
- package/ios/RNSkia-iOS/SkiaDrawViewManager.h +0 -7
- package/ios/RNSkia-iOS/SkiaDrawViewManager.mm +0 -50
- package/lib/commonjs/animation/decay/decay.d.ts +0 -2
- package/lib/commonjs/animation/decay/decay.js +0 -42
- package/lib/commonjs/animation/decay/decay.js.map +0 -1
- package/lib/commonjs/animation/decay/index.d.ts +0 -1
- package/lib/commonjs/animation/decay/index.js +0 -14
- package/lib/commonjs/animation/decay/index.js.map +0 -1
- package/lib/commonjs/animation/decay/runDecay.d.ts +0 -10
- package/lib/commonjs/animation/decay/runDecay.js +0 -48
- package/lib/commonjs/animation/decay/runDecay.js.map +0 -1
- package/lib/commonjs/animation/decay/types.d.ts +0 -21
- package/lib/commonjs/animation/decay/types.js +0 -6
- package/lib/commonjs/animation/decay/types.js.map +0 -1
- package/lib/commonjs/animation/spring/Spring.d.ts +0 -65
- package/lib/commonjs/animation/spring/Spring.js +0 -77
- package/lib/commonjs/animation/spring/Spring.js.map +0 -1
- package/lib/commonjs/animation/spring/functions/index.d.ts +0 -1
- package/lib/commonjs/animation/spring/functions/index.js +0 -14
- package/lib/commonjs/animation/spring/functions/index.js.map +0 -1
- package/lib/commonjs/animation/spring/functions/spring.d.ts +0 -10
- package/lib/commonjs/animation/spring/functions/spring.js +0 -94
- package/lib/commonjs/animation/spring/functions/spring.js.map +0 -1
- package/lib/commonjs/animation/spring/index.d.ts +0 -3
- package/lib/commonjs/animation/spring/index.js +0 -30
- package/lib/commonjs/animation/spring/index.js.map +0 -1
- package/lib/commonjs/animation/spring/runSpring.d.ts +0 -19
- package/lib/commonjs/animation/spring/runSpring.js +0 -35
- package/lib/commonjs/animation/spring/runSpring.js.map +0 -1
- package/lib/commonjs/animation/spring/types.d.ts +0 -6
- package/lib/commonjs/animation/spring/types.js +0 -2
- package/lib/commonjs/animation/spring/types.js.map +0 -1
- package/lib/commonjs/animation/spring/useSpring.d.ts +0 -13
- package/lib/commonjs/animation/spring/useSpring.js +0 -27
- package/lib/commonjs/animation/spring/useSpring.js.map +0 -1
- package/lib/commonjs/animation/timing/Easing.d.ts +0 -19
- package/lib/commonjs/animation/timing/Easing.js +0 -108
- package/lib/commonjs/animation/timing/Easing.js.map +0 -1
- package/lib/commonjs/animation/timing/createTiming.d.ts +0 -17
- package/lib/commonjs/animation/timing/createTiming.js +0 -55
- package/lib/commonjs/animation/timing/createTiming.js.map +0 -1
- package/lib/commonjs/animation/timing/functions/bezier.d.ts +0 -1
- package/lib/commonjs/animation/timing/functions/bezier.js +0 -147
- package/lib/commonjs/animation/timing/functions/bezier.js.map +0 -1
- package/lib/commonjs/animation/timing/functions/getResolvedParams.d.ts +0 -7
- package/lib/commonjs/animation/timing/functions/getResolvedParams.js +0 -52
- package/lib/commonjs/animation/timing/functions/getResolvedParams.js.map +0 -1
- package/lib/commonjs/animation/timing/functions/index.d.ts +0 -4
- package/lib/commonjs/animation/timing/functions/index.js +0 -54
- package/lib/commonjs/animation/timing/functions/index.js.map +0 -1
- package/lib/commonjs/animation/timing/functions/timing.d.ts +0 -17
- package/lib/commonjs/animation/timing/functions/timing.js +0 -50
- package/lib/commonjs/animation/timing/functions/timing.js.map +0 -1
- package/lib/commonjs/animation/timing/functions/types.d.ts +0 -7
- package/lib/commonjs/animation/timing/functions/types.js +0 -2
- package/lib/commonjs/animation/timing/functions/types.js.map +0 -1
- package/lib/commonjs/animation/timing/index.d.ts +0 -4
- package/lib/commonjs/animation/timing/index.js +0 -38
- package/lib/commonjs/animation/timing/index.js.map +0 -1
- package/lib/commonjs/animation/timing/runTiming.d.ts +0 -19
- package/lib/commonjs/animation/timing/runTiming.js +0 -36
- package/lib/commonjs/animation/timing/runTiming.js.map +0 -1
- package/lib/commonjs/animation/timing/useLoop.d.ts +0 -11
- package/lib/commonjs/animation/timing/useLoop.js +0 -25
- package/lib/commonjs/animation/timing/useLoop.js.map +0 -1
- package/lib/commonjs/animation/timing/useTiming.d.ts +0 -13
- package/lib/commonjs/animation/timing/useTiming.js +0 -67
- package/lib/commonjs/animation/timing/useTiming.js.map +0 -1
- package/lib/commonjs/dom/nodes/drawings/CustomDrawingNode.d.ts +0 -8
- package/lib/commonjs/dom/nodes/drawings/CustomDrawingNode.js +0 -28
- package/lib/commonjs/dom/nodes/drawings/CustomDrawingNode.js.map +0 -1
- package/lib/commonjs/renderer/DependencyManager.d.ts +0 -46
- package/lib/commonjs/renderer/DependencyManager.js +0 -185
- package/lib/commonjs/renderer/DependencyManager.js.map +0 -1
- package/lib/commonjs/renderer/components/Drawing.d.ts +0 -8
- package/lib/commonjs/renderer/components/Drawing.js +0 -22
- package/lib/commonjs/renderer/components/Drawing.js.map +0 -1
- package/lib/commonjs/specs/SkiaDrawViewNativeComponent.d.ts +0 -8
- package/lib/commonjs/specs/SkiaDrawViewNativeComponent.js +0 -16
- package/lib/commonjs/specs/SkiaDrawViewNativeComponent.js.map +0 -1
- package/lib/commonjs/values/api.d.ts +0 -26
- package/lib/commonjs/values/api.js +0 -55
- package/lib/commonjs/values/api.js.map +0 -1
- package/lib/commonjs/values/api.web.d.ts +0 -2
- package/lib/commonjs/values/api.web.js +0 -18
- package/lib/commonjs/values/api.web.js.map +0 -1
- package/lib/commonjs/values/hooks/index.d.ts +0 -4
- package/lib/commonjs/values/hooks/index.js +0 -58
- package/lib/commonjs/values/hooks/index.js.map +0 -1
- package/lib/commonjs/values/hooks/useClockValue.d.ts +0 -9
- package/lib/commonjs/values/hooks/useClockValue.js +0 -30
- package/lib/commonjs/values/hooks/useClockValue.js.map +0 -1
- package/lib/commonjs/values/hooks/useComputedValue.d.ts +0 -11
- package/lib/commonjs/values/hooks/useComputedValue.js +0 -32
- package/lib/commonjs/values/hooks/useComputedValue.js.map +0 -1
- package/lib/commonjs/values/hooks/useValue.d.ts +0 -10
- package/lib/commonjs/values/hooks/useValue.js +0 -26
- package/lib/commonjs/values/hooks/useValue.js.map +0 -1
- package/lib/commonjs/values/hooks/useValueEffect.d.ts +0 -10
- package/lib/commonjs/values/hooks/useValueEffect.js +0 -25
- package/lib/commonjs/values/hooks/useValueEffect.js.map +0 -1
- package/lib/commonjs/values/index.d.ts +0 -4
- package/lib/commonjs/values/index.js +0 -58
- package/lib/commonjs/values/index.js.map +0 -1
- package/lib/commonjs/values/selector.d.ts +0 -14
- package/lib/commonjs/values/selector.js +0 -24
- package/lib/commonjs/values/selector.js.map +0 -1
- package/lib/commonjs/values/types.d.ts +0 -63
- package/lib/commonjs/values/types.js +0 -2
- package/lib/commonjs/values/types.js.map +0 -1
- package/lib/commonjs/values/web/RNSkAnimation.d.ts +0 -9
- package/lib/commonjs/values/web/RNSkAnimation.js +0 -46
- package/lib/commonjs/values/web/RNSkAnimation.js.map +0 -1
- package/lib/commonjs/values/web/RNSkClockValue.d.ts +0 -13
- package/lib/commonjs/values/web/RNSkClockValue.js +0 -75
- package/lib/commonjs/values/web/RNSkClockValue.js.map +0 -1
- package/lib/commonjs/values/web/RNSkComputedValue.d.ts +0 -10
- package/lib/commonjs/values/web/RNSkComputedValue.js +0 -59
- package/lib/commonjs/values/web/RNSkComputedValue.js.map +0 -1
- package/lib/commonjs/values/web/RNSkReadonlyValue.d.ts +0 -12
- package/lib/commonjs/values/web/RNSkReadonlyValue.js +0 -51
- package/lib/commonjs/values/web/RNSkReadonlyValue.js.map +0 -1
- package/lib/commonjs/values/web/RNSkValue.d.ts +0 -14
- package/lib/commonjs/values/web/RNSkValue.js +0 -73
- package/lib/commonjs/values/web/RNSkValue.js.map +0 -1
- package/lib/commonjs/values/web/api.d.ts +0 -2
- package/lib/commonjs/values/web/api.js +0 -31
- package/lib/commonjs/values/web/api.js.map +0 -1
- package/lib/commonjs/values/web/index.d.ts +0 -1
- package/lib/commonjs/values/web/index.js +0 -19
- package/lib/commonjs/values/web/index.js.map +0 -1
- package/lib/commonjs/views/SkiaView.d.ts +0 -35
- package/lib/commonjs/views/SkiaView.js +0 -139
- package/lib/commonjs/views/SkiaView.js.map +0 -1
- package/lib/commonjs/views/SkiaView.web.d.ts +0 -7
- package/lib/commonjs/views/SkiaView.web.js +0 -30
- package/lib/commonjs/views/SkiaView.web.js.map +0 -1
- package/lib/commonjs/views/useDrawCallback.d.ts +0 -8
- package/lib/commonjs/views/useDrawCallback.js +0 -23
- package/lib/commonjs/views/useDrawCallback.js.map +0 -1
- package/lib/module/animation/decay/decay.d.ts +0 -2
- package/lib/module/animation/decay/decay.js +0 -33
- package/lib/module/animation/decay/decay.js.map +0 -1
- package/lib/module/animation/decay/index.d.ts +0 -1
- package/lib/module/animation/decay/index.js +0 -2
- package/lib/module/animation/decay/index.js.map +0 -1
- package/lib/module/animation/decay/runDecay.d.ts +0 -10
- package/lib/module/animation/decay/runDecay.js +0 -38
- package/lib/module/animation/decay/runDecay.js.map +0 -1
- package/lib/module/animation/decay/types.d.ts +0 -21
- package/lib/module/animation/decay/types.js +0 -2
- package/lib/module/animation/decay/types.js.map +0 -1
- package/lib/module/animation/spring/Spring.d.ts +0 -65
- package/lib/module/animation/spring/Spring.js +0 -69
- package/lib/module/animation/spring/Spring.js.map +0 -1
- package/lib/module/animation/spring/functions/index.d.ts +0 -1
- package/lib/module/animation/spring/functions/index.js +0 -2
- package/lib/module/animation/spring/functions/index.js.map +0 -1
- package/lib/module/animation/spring/functions/spring.d.ts +0 -10
- package/lib/module/animation/spring/functions/spring.js +0 -85
- package/lib/module/animation/spring/functions/spring.js.map +0 -1
- package/lib/module/animation/spring/index.d.ts +0 -3
- package/lib/module/animation/spring/index.js +0 -4
- package/lib/module/animation/spring/index.js.map +0 -1
- package/lib/module/animation/spring/runSpring.d.ts +0 -19
- package/lib/module/animation/spring/runSpring.js +0 -24
- package/lib/module/animation/spring/runSpring.js.map +0 -1
- package/lib/module/animation/spring/types.d.ts +0 -6
- package/lib/module/animation/spring/types.js +0 -2
- package/lib/module/animation/spring/types.js.map +0 -1
- package/lib/module/animation/spring/useSpring.d.ts +0 -13
- package/lib/module/animation/spring/useSpring.js +0 -16
- package/lib/module/animation/spring/useSpring.js.map +0 -1
- package/lib/module/animation/timing/Easing.d.ts +0 -19
- package/lib/module/animation/timing/Easing.js +0 -98
- package/lib/module/animation/timing/Easing.js.map +0 -1
- package/lib/module/animation/timing/createTiming.d.ts +0 -17
- package/lib/module/animation/timing/createTiming.js +0 -49
- package/lib/module/animation/timing/createTiming.js.map +0 -1
- package/lib/module/animation/timing/functions/bezier.d.ts +0 -1
- package/lib/module/animation/timing/functions/bezier.js +0 -141
- package/lib/module/animation/timing/functions/bezier.js.map +0 -1
- package/lib/module/animation/timing/functions/getResolvedParams.d.ts +0 -7
- package/lib/module/animation/timing/functions/getResolvedParams.js +0 -48
- package/lib/module/animation/timing/functions/getResolvedParams.js.map +0 -1
- package/lib/module/animation/timing/functions/index.d.ts +0 -4
- package/lib/module/animation/timing/functions/index.js +0 -5
- package/lib/module/animation/timing/functions/index.js.map +0 -1
- package/lib/module/animation/timing/functions/timing.d.ts +0 -17
- package/lib/module/animation/timing/functions/timing.js +0 -41
- package/lib/module/animation/timing/functions/timing.js.map +0 -1
- package/lib/module/animation/timing/functions/types.d.ts +0 -7
- package/lib/module/animation/timing/functions/types.js +0 -2
- package/lib/module/animation/timing/functions/types.js.map +0 -1
- package/lib/module/animation/timing/index.d.ts +0 -4
- package/lib/module/animation/timing/index.js +0 -5
- package/lib/module/animation/timing/index.js.map +0 -1
- package/lib/module/animation/timing/runTiming.d.ts +0 -19
- package/lib/module/animation/timing/runTiming.js +0 -26
- package/lib/module/animation/timing/runTiming.js.map +0 -1
- package/lib/module/animation/timing/useLoop.d.ts +0 -11
- package/lib/module/animation/timing/useLoop.js +0 -16
- package/lib/module/animation/timing/useLoop.js.map +0 -1
- package/lib/module/animation/timing/useTiming.d.ts +0 -13
- package/lib/module/animation/timing/useTiming.js +0 -57
- package/lib/module/animation/timing/useTiming.js.map +0 -1
- package/lib/module/dom/nodes/drawings/CustomDrawingNode.d.ts +0 -8
- package/lib/module/dom/nodes/drawings/CustomDrawingNode.js +0 -17
- package/lib/module/dom/nodes/drawings/CustomDrawingNode.js.map +0 -1
- package/lib/module/renderer/DependencyManager.d.ts +0 -46
- package/lib/module/renderer/DependencyManager.js +0 -174
- package/lib/module/renderer/DependencyManager.js.map +0 -1
- package/lib/module/renderer/components/Drawing.d.ts +0 -8
- package/lib/module/renderer/components/Drawing.js +0 -11
- package/lib/module/renderer/components/Drawing.js.map +0 -1
- package/lib/module/specs/SkiaDrawViewNativeComponent.d.ts +0 -8
- package/lib/module/specs/SkiaDrawViewNativeComponent.js +0 -4
- package/lib/module/specs/SkiaDrawViewNativeComponent.js.map +0 -1
- package/lib/module/values/api.d.ts +0 -26
- package/lib/module/values/api.js +0 -48
- package/lib/module/values/api.js.map +0 -1
- package/lib/module/values/api.web.d.ts +0 -2
- package/lib/module/values/api.web.js +0 -7
- package/lib/module/values/api.web.js.map +0 -1
- package/lib/module/values/hooks/index.d.ts +0 -4
- package/lib/module/values/hooks/index.js +0 -5
- package/lib/module/values/hooks/index.js.map +0 -1
- package/lib/module/values/hooks/useClockValue.d.ts +0 -9
- package/lib/module/values/hooks/useClockValue.js +0 -20
- package/lib/module/values/hooks/useClockValue.js.map +0 -1
- package/lib/module/values/hooks/useComputedValue.d.ts +0 -11
- package/lib/module/values/hooks/useComputedValue.js +0 -21
- package/lib/module/values/hooks/useComputedValue.js.map +0 -1
- package/lib/module/values/hooks/useValue.d.ts +0 -10
- package/lib/module/values/hooks/useValue.js +0 -16
- package/lib/module/values/hooks/useValue.js.map +0 -1
- package/lib/module/values/hooks/useValueEffect.d.ts +0 -10
- package/lib/module/values/hooks/useValueEffect.js +0 -16
- package/lib/module/values/hooks/useValueEffect.js.map +0 -1
- package/lib/module/values/index.d.ts +0 -4
- package/lib/module/values/index.js +0 -5
- package/lib/module/values/index.js.map +0 -1
- package/lib/module/values/selector.d.ts +0 -14
- package/lib/module/values/selector.js +0 -15
- package/lib/module/values/selector.js.map +0 -1
- package/lib/module/values/types.d.ts +0 -63
- package/lib/module/values/types.js +0 -2
- package/lib/module/values/types.js.map +0 -1
- package/lib/module/values/web/RNSkAnimation.d.ts +0 -9
- package/lib/module/values/web/RNSkAnimation.js +0 -36
- package/lib/module/values/web/RNSkAnimation.js.map +0 -1
- package/lib/module/values/web/RNSkClockValue.d.ts +0 -13
- package/lib/module/values/web/RNSkClockValue.js +0 -65
- package/lib/module/values/web/RNSkClockValue.js.map +0 -1
- package/lib/module/values/web/RNSkComputedValue.d.ts +0 -10
- package/lib/module/values/web/RNSkComputedValue.js +0 -49
- package/lib/module/values/web/RNSkComputedValue.js.map +0 -1
- package/lib/module/values/web/RNSkReadonlyValue.d.ts +0 -12
- package/lib/module/values/web/RNSkReadonlyValue.js +0 -42
- package/lib/module/values/web/RNSkReadonlyValue.js.map +0 -1
- package/lib/module/values/web/RNSkValue.d.ts +0 -14
- package/lib/module/values/web/RNSkValue.js +0 -63
- package/lib/module/values/web/RNSkValue.js.map +0 -1
- package/lib/module/values/web/api.d.ts +0 -2
- package/lib/module/values/web/api.js +0 -19
- package/lib/module/values/web/api.js.map +0 -1
- package/lib/module/values/web/index.d.ts +0 -1
- package/lib/module/values/web/index.js +0 -2
- package/lib/module/values/web/index.js.map +0 -1
- package/lib/module/views/SkiaView.d.ts +0 -35
- package/lib/module/views/SkiaView.js +0 -119
- package/lib/module/views/SkiaView.js.map +0 -1
- package/lib/module/views/SkiaView.web.d.ts +0 -7
- package/lib/module/views/SkiaView.web.js +0 -20
- package/lib/module/views/SkiaView.web.js.map +0 -1
- package/lib/module/views/useDrawCallback.d.ts +0 -8
- package/lib/module/views/useDrawCallback.js +0 -14
- package/lib/module/views/useDrawCallback.js.map +0 -1
- package/lib/typescript/src/animation/decay/decay.d.ts +0 -2
- package/lib/typescript/src/animation/decay/index.d.ts +0 -1
- package/lib/typescript/src/animation/decay/runDecay.d.ts +0 -10
- package/lib/typescript/src/animation/decay/types.d.ts +0 -21
- package/lib/typescript/src/animation/spring/Spring.d.ts +0 -65
- package/lib/typescript/src/animation/spring/functions/index.d.ts +0 -1
- package/lib/typescript/src/animation/spring/functions/spring.d.ts +0 -10
- package/lib/typescript/src/animation/spring/index.d.ts +0 -3
- package/lib/typescript/src/animation/spring/runSpring.d.ts +0 -19
- package/lib/typescript/src/animation/spring/types.d.ts +0 -6
- package/lib/typescript/src/animation/spring/useSpring.d.ts +0 -13
- package/lib/typescript/src/animation/timing/Easing.d.ts +0 -19
- package/lib/typescript/src/animation/timing/createTiming.d.ts +0 -17
- package/lib/typescript/src/animation/timing/functions/bezier.d.ts +0 -1
- package/lib/typescript/src/animation/timing/functions/getResolvedParams.d.ts +0 -7
- package/lib/typescript/src/animation/timing/functions/index.d.ts +0 -4
- package/lib/typescript/src/animation/timing/functions/timing.d.ts +0 -17
- package/lib/typescript/src/animation/timing/functions/types.d.ts +0 -7
- package/lib/typescript/src/animation/timing/index.d.ts +0 -4
- package/lib/typescript/src/animation/timing/runTiming.d.ts +0 -19
- package/lib/typescript/src/animation/timing/useLoop.d.ts +0 -11
- package/lib/typescript/src/animation/timing/useTiming.d.ts +0 -13
- package/lib/typescript/src/dom/nodes/drawings/CustomDrawingNode.d.ts +0 -8
- package/lib/typescript/src/renderer/DependencyManager.d.ts +0 -46
- package/lib/typescript/src/renderer/components/Drawing.d.ts +0 -8
- package/lib/typescript/src/specs/SkiaDrawViewNativeComponent.d.ts +0 -8
- package/lib/typescript/src/values/api.d.ts +0 -26
- package/lib/typescript/src/values/api.web.d.ts +0 -2
- package/lib/typescript/src/values/hooks/index.d.ts +0 -4
- package/lib/typescript/src/values/hooks/useClockValue.d.ts +0 -9
- package/lib/typescript/src/values/hooks/useComputedValue.d.ts +0 -11
- package/lib/typescript/src/values/hooks/useValue.d.ts +0 -10
- package/lib/typescript/src/values/hooks/useValueEffect.d.ts +0 -10
- package/lib/typescript/src/values/index.d.ts +0 -4
- package/lib/typescript/src/values/selector.d.ts +0 -14
- package/lib/typescript/src/values/types.d.ts +0 -63
- package/lib/typescript/src/values/web/RNSkAnimation.d.ts +0 -9
- package/lib/typescript/src/values/web/RNSkClockValue.d.ts +0 -13
- package/lib/typescript/src/values/web/RNSkComputedValue.d.ts +0 -10
- package/lib/typescript/src/values/web/RNSkReadonlyValue.d.ts +0 -12
- package/lib/typescript/src/values/web/RNSkValue.d.ts +0 -14
- package/lib/typescript/src/values/web/api.d.ts +0 -2
- package/lib/typescript/src/values/web/index.d.ts +0 -1
- package/lib/typescript/src/views/SkiaView.d.ts +0 -35
- package/lib/typescript/src/views/SkiaView.web.d.ts +0 -7
- package/lib/typescript/src/views/useDrawCallback.d.ts +0 -8
- package/src/animation/decay/decay.ts +0 -35
- package/src/animation/decay/index.ts +0 -1
- package/src/animation/decay/runDecay.ts +0 -40
- package/src/animation/decay/types.ts +0 -24
- package/src/animation/spring/Spring.ts +0 -61
- package/src/animation/spring/functions/index.ts +0 -1
- package/src/animation/spring/functions/spring.ts +0 -86
- package/src/animation/spring/index.ts +0 -3
- package/src/animation/spring/runSpring.ts +0 -40
- package/src/animation/spring/types.ts +0 -6
- package/src/animation/spring/useSpring.ts +0 -31
- package/src/animation/timing/Easing.ts +0 -102
- package/src/animation/timing/createTiming.ts +0 -62
- package/src/animation/timing/functions/bezier.ts +0 -165
- package/src/animation/timing/functions/getResolvedParams.ts +0 -50
- package/src/animation/timing/functions/index.ts +0 -4
- package/src/animation/timing/functions/timing.ts +0 -44
- package/src/animation/timing/functions/types.ts +0 -8
- package/src/animation/timing/index.ts +0 -4
- package/src/animation/timing/runTiming.ts +0 -36
- package/src/animation/timing/useLoop.ts +0 -21
- package/src/animation/timing/useTiming.ts +0 -71
- package/src/dom/nodes/drawings/CustomDrawingNode.ts +0 -21
- package/src/renderer/DependencyManager.tsx +0 -196
- package/src/renderer/components/Drawing.tsx +0 -12
- package/src/specs/SkiaDrawViewNativeComponent.ts +0 -10
- package/src/values/api.ts +0 -61
- package/src/values/api.web.ts +0 -5
- package/src/values/hooks/index.ts +0 -4
- package/src/values/hooks/useClockValue.ts +0 -21
- package/src/values/hooks/useComputedValue.ts +0 -24
- package/src/values/hooks/useValue.ts +0 -17
- package/src/values/hooks/useValueEffect.ts +0 -18
- package/src/values/index.ts +0 -4
- package/src/values/selector.ts +0 -24
- package/src/values/types.ts +0 -73
- package/src/values/web/RNSkAnimation.ts +0 -33
- package/src/values/web/RNSkClockValue.ts +0 -58
- package/src/values/web/RNSkComputedValue.ts +0 -49
- package/src/values/web/RNSkReadonlyValue.ts +0 -38
- package/src/values/web/RNSkValue.ts +0 -57
- package/src/values/web/api.ts +0 -33
- package/src/values/web/index.ts +0 -1
- package/src/views/SkiaView.tsx +0 -111
- package/src/views/SkiaView.web.tsx +0 -22
- package/src/views/useDrawCallback.ts +0 -19
package/android/CMakeLists.txt
CHANGED
@@ -1,6 +1,5 @@
|
|
1
1
|
#include "JniPlatformContext.h"
|
2
2
|
#include "JniSkiaDomView.h"
|
3
|
-
#include "JniSkiaDrawView.h"
|
4
3
|
#include "JniSkiaManager.h"
|
5
4
|
#include "JniSkiaPictureView.h"
|
6
5
|
#include <fbjni/fbjni.h>
|
@@ -9,7 +8,6 @@
|
|
9
8
|
JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) {
|
10
9
|
return facebook::jni::initialize(vm, [] {
|
11
10
|
RNSkia::JniSkiaManager::registerNatives();
|
12
|
-
RNSkia::JniSkiaDrawView::registerNatives();
|
13
11
|
RNSkia::JniSkiaPictureView::registerNatives();
|
14
12
|
RNSkia::JniSkiaDomView::registerNatives();
|
15
13
|
RNSkia::JniPlatformContext::registerNatives();
|
@@ -31,8 +31,8 @@ sk_sp<SkSurface> SkiaOpenGLSurfaceFactory::makeOffscreenSurface(int width,
|
|
31
31
|
// Create texture
|
32
32
|
auto texture =
|
33
33
|
ThreadContextHolder::ThreadSkiaOpenGLContext.directContext
|
34
|
-
->createBackendTexture(width, height, colorType,
|
35
|
-
GrRenderable::kYes);
|
34
|
+
->createBackendTexture(width, height, colorType,
|
35
|
+
skgpu::Mipmapped::kNo, GrRenderable::kYes);
|
36
36
|
|
37
37
|
struct ReleaseContext {
|
38
38
|
SkiaOpenGLContext *context;
|
@@ -6,7 +6,6 @@ import android.util.Log;
|
|
6
6
|
|
7
7
|
import com.facebook.react.bridge.LifecycleEventListener;
|
8
8
|
import com.facebook.react.bridge.ReactApplicationContext;
|
9
|
-
import com.facebook.react.bridge.ReactContextBaseJavaModule;
|
10
9
|
import com.facebook.react.bridge.ReactMethod;
|
11
10
|
import com.facebook.react.module.annotations.ReactModule;
|
12
11
|
|
@@ -42,8 +42,7 @@ public class RNSkiaPackage extends TurboReactPackage {
|
|
42
42
|
|
43
43
|
@Override
|
44
44
|
public List<ViewManager> createViewManagers(ReactApplicationContext reactContext) {
|
45
|
-
return Arrays.<ViewManager>asList(new
|
46
|
-
new SkiaPictureViewManager(), new SkiaDomViewManager());
|
45
|
+
return Arrays.<ViewManager>asList(new SkiaPictureViewManager(), new SkiaDomViewManager());
|
47
46
|
}
|
48
47
|
|
49
48
|
@Override
|
@@ -13,11 +13,8 @@ public abstract class SkiaBaseView extends ReactViewGroup implements TextureView
|
|
13
13
|
|
14
14
|
private String tag = "SkiaView";
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
public SkiaBaseView(Context context, boolean manageTexture) {
|
16
|
+
public SkiaBaseView(Context context) {
|
19
17
|
super(context);
|
20
|
-
this.manageTexture = manageTexture;
|
21
18
|
mTexture = new TextureView(context);
|
22
19
|
mTexture.setSurfaceTextureListener(this);
|
23
20
|
mTexture.setOpaque(false);
|
@@ -30,14 +27,12 @@ public abstract class SkiaBaseView extends ReactViewGroup implements TextureView
|
|
30
27
|
}
|
31
28
|
|
32
29
|
private void createSurfaceTexture() {
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
this.onSurfaceTextureAvailable(surface, this.getMeasuredWidth(), this.getMeasuredHeight());
|
40
|
-
}
|
30
|
+
// This API Level is >= 26, we created our own SurfaceTexture to have a faster time to first frame
|
31
|
+
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.O) {
|
32
|
+
Log.i(tag, "Create SurfaceTexture");
|
33
|
+
SurfaceTexture surface = new SurfaceTexture(false);
|
34
|
+
mTexture.setSurfaceTexture(surface);
|
35
|
+
this.onSurfaceTextureAvailable(surface, this.getMeasuredWidth(), this.getMeasuredHeight());
|
41
36
|
}
|
42
37
|
}
|
43
38
|
|
@@ -11,7 +11,7 @@ public class SkiaDomView extends SkiaBaseView {
|
|
11
11
|
private HybridData mHybridData;
|
12
12
|
|
13
13
|
public SkiaDomView(Context context) {
|
14
|
-
super(context
|
14
|
+
super(context);
|
15
15
|
RNSkiaModule skiaModule = ((ReactContext) context).getNativeModule(RNSkiaModule.class);
|
16
16
|
mHybridData = initHybrid(skiaModule.getSkiaManager());
|
17
17
|
}
|
@@ -11,7 +11,7 @@ public class SkiaPictureView extends SkiaBaseView {
|
|
11
11
|
private HybridData mHybridData;
|
12
12
|
|
13
13
|
public SkiaPictureView(Context context) {
|
14
|
-
super(context
|
14
|
+
super(context);
|
15
15
|
RNSkiaModule skiaModule = ((ReactContext) context).getNativeModule(RNSkiaModule.class);
|
16
16
|
mHybridData = initHybrid(skiaModule.getSkiaManager());
|
17
17
|
}
|
@@ -5,12 +5,12 @@
|
|
5
5
|
#include <utility>
|
6
6
|
|
7
7
|
#include "JsiSkHostObjects.h"
|
8
|
+
#include "third_party/base64.h"
|
8
9
|
|
9
10
|
#pragma clang diagnostic push
|
10
11
|
#pragma clang diagnostic ignored "-Wdocumentation"
|
11
12
|
|
12
13
|
#include "JsiSkImage.h"
|
13
|
-
#include "SkBase64.h"
|
14
14
|
#include "SkStream.h"
|
15
15
|
#include "include/codec/SkEncodedImageFormat.h"
|
16
16
|
|
package/cpp/api/JsiSkApi.h
CHANGED
@@ -25,6 +25,7 @@
|
|
25
25
|
#include "JsiSkMatrix.h"
|
26
26
|
#include "JsiSkPaint.h"
|
27
27
|
#include "JsiSkParagraphBuilder.h"
|
28
|
+
#include "JsiSkParagraphBuilderFactory.h"
|
28
29
|
#include "JsiSkPath.h"
|
29
30
|
#include "JsiSkPathEffect.h"
|
30
31
|
#include "JsiSkPathEffectFactory.h"
|
@@ -62,7 +63,9 @@ public:
|
|
62
63
|
*/
|
63
64
|
JsiSkApi(jsi::Runtime &runtime, std::shared_ptr<RNSkPlatformContext> context)
|
64
65
|
: JsiSkHostObject(context) {
|
65
|
-
|
66
|
+
// We create the system font manager eagerly since it has proven to be too
|
67
|
+
// slow to do it on demand
|
68
|
+
JsiSkFontMgrFactory::getFontMgr(getContext());
|
66
69
|
installFunction("Font", JsiSkFont::createCtor(context));
|
67
70
|
installFunction("Paint", JsiSkPaint::createCtor(context));
|
68
71
|
installFunction("RSXform", JsiSkRSXform::createCtor(context));
|
@@ -7,7 +7,7 @@
|
|
7
7
|
|
8
8
|
#include "JsiPromises.h"
|
9
9
|
#include "JsiSkData.h"
|
10
|
-
#include "
|
10
|
+
#include "third_party/base64.h"
|
11
11
|
|
12
12
|
namespace RNSkia {
|
13
13
|
|
@@ -67,17 +67,17 @@ public:
|
|
67
67
|
// Calculate length
|
68
68
|
size_t len;
|
69
69
|
auto err =
|
70
|
-
|
71
|
-
if (err !=
|
70
|
+
Base64::Decode(&base64.utf8(runtime).c_str()[0], size, nullptr, &len);
|
71
|
+
if (err != Base64::Error::kNone) {
|
72
72
|
throw jsi::JSError(runtime, "Error decoding base64 string");
|
73
73
|
return jsi::Value::undefined();
|
74
74
|
}
|
75
75
|
|
76
76
|
// Create data object and decode
|
77
77
|
auto data = SkData::MakeUninitialized(len);
|
78
|
-
err =
|
79
|
-
|
80
|
-
if (err !=
|
78
|
+
err = Base64::Decode(&base64.utf8(runtime).c_str()[0], size,
|
79
|
+
data->writable_data(), &len);
|
80
|
+
if (err != Base64::Error::kNone) {
|
81
81
|
throw jsi::JSError(runtime, "Error decoding base64 string");
|
82
82
|
return jsi::Value::undefined();
|
83
83
|
}
|
package/cpp/api/JsiSkImage.h
CHANGED
@@ -8,13 +8,13 @@
|
|
8
8
|
#include "JsiSkImageInfo.h"
|
9
9
|
#include "JsiSkMatrix.h"
|
10
10
|
#include "JsiSkShader.h"
|
11
|
+
#include "third_party/base64.h"
|
11
12
|
|
12
13
|
#include "RNSkTypedArray.h"
|
13
14
|
|
14
15
|
#pragma clang diagnostic push
|
15
16
|
#pragma clang diagnostic ignored "-Wdocumentation"
|
16
17
|
|
17
|
-
#include "SkBase64.h"
|
18
18
|
#include "SkImage.h"
|
19
19
|
#include "SkStream.h"
|
20
20
|
#include "include/codec/SkEncodedImageFormat.h"
|
@@ -133,10 +133,10 @@ public:
|
|
133
133
|
JSI_HOST_FUNCTION(encodeToBase64) {
|
134
134
|
auto data = encodeImageData(arguments, count);
|
135
135
|
|
136
|
-
auto len =
|
136
|
+
auto len = Base64::Encode(data->bytes(), data->size(), nullptr);
|
137
137
|
auto buffer = std::string(len, 0);
|
138
|
-
|
139
|
-
|
138
|
+
Base64::Encode(data->bytes(), data->size(),
|
139
|
+
reinterpret_cast<void *>(&buffer[0]));
|
140
140
|
return jsi::String::createFromAscii(runtime, buffer);
|
141
141
|
}
|
142
142
|
|
package/cpp/api/JsiSkParagraph.h
CHANGED
@@ -55,6 +55,18 @@ public:
|
|
55
55
|
return static_cast<double>(_paragraph->getMaxWidth());
|
56
56
|
}
|
57
57
|
|
58
|
+
JSI_HOST_FUNCTION(getMaxIntrinsicWidth) {
|
59
|
+
return static_cast<double>(_paragraph->getMaxIntrinsicWidth());
|
60
|
+
}
|
61
|
+
|
62
|
+
JSI_HOST_FUNCTION(getMinIntrinsicWidth) {
|
63
|
+
return static_cast<double>(_paragraph->getMinIntrinsicWidth());
|
64
|
+
}
|
65
|
+
|
66
|
+
JSI_HOST_FUNCTION(getLongestLine) {
|
67
|
+
return static_cast<double>(_paragraph->getLongestLine());
|
68
|
+
}
|
69
|
+
|
58
70
|
JSI_HOST_FUNCTION(getGlyphPositionAtCoordinate) {
|
59
71
|
auto dx = getArgumentAsNumber(runtime, arguments, count, 0);
|
60
72
|
auto dy = getArgumentAsNumber(runtime, arguments, count, 1);
|
@@ -113,6 +125,9 @@ public:
|
|
113
125
|
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkParagraph, layout),
|
114
126
|
JSI_EXPORT_FUNC(JsiSkParagraph, paint),
|
115
127
|
JSI_EXPORT_FUNC(JsiSkParagraph, getMaxWidth),
|
128
|
+
JSI_EXPORT_FUNC(JsiSkParagraph, getMinIntrinsicWidth),
|
129
|
+
JSI_EXPORT_FUNC(JsiSkParagraph, getMaxIntrinsicWidth),
|
130
|
+
JSI_EXPORT_FUNC(JsiSkParagraph, getLongestLine),
|
116
131
|
JSI_EXPORT_FUNC(JsiSkParagraph, getHeight),
|
117
132
|
JSI_EXPORT_FUNC(JsiSkParagraph, getRectsForPlaceholders),
|
118
133
|
JSI_EXPORT_FUNC(JsiSkParagraph,
|
@@ -7,6 +7,7 @@
|
|
7
7
|
|
8
8
|
#include <JsiSkFont.h>
|
9
9
|
#include <JsiSkFontMgr.h>
|
10
|
+
#include <JsiSkFontMgrFactory.h>
|
10
11
|
#include <JsiSkHostObjects.h>
|
11
12
|
#include <JsiSkParagraph.h>
|
12
13
|
#include <JsiSkParagraphStyle.h>
|
@@ -113,7 +114,8 @@ public:
|
|
113
114
|
sk_sp<SkFontMgr> fontManager)
|
114
115
|
: JsiSkHostObject(std::move(context)) {
|
115
116
|
_fontCollection = sk_make_sp<para::FontCollection>();
|
116
|
-
|
117
|
+
auto fontMgr = JsiSkFontMgrFactory::getFontMgr(getContext());
|
118
|
+
_fontCollection->setDefaultFontManager(fontMgr);
|
117
119
|
if (fontManager != nullptr) {
|
118
120
|
_fontCollection->setAssetFontManager(fontManager);
|
119
121
|
}
|
@@ -125,35 +127,4 @@ private:
|
|
125
127
|
std::unique_ptr<para::ParagraphBuilder> _builder;
|
126
128
|
sk_sp<para::FontCollection> _fontCollection;
|
127
129
|
};
|
128
|
-
|
129
|
-
/**
|
130
|
-
Implementation of the ParagraphBuilderFactory for making ParagraphBuilder JSI
|
131
|
-
object
|
132
|
-
*/
|
133
|
-
class JsiSkParagraphBuilderFactory : public JsiSkHostObject {
|
134
|
-
public:
|
135
|
-
JSI_HOST_FUNCTION(Make) {
|
136
|
-
// Get paragraph style from params
|
137
|
-
auto paragraphStyle =
|
138
|
-
count > 0 ? JsiSkParagraphStyle::fromValue(runtime, arguments[0])
|
139
|
-
: para::ParagraphStyle();
|
140
|
-
|
141
|
-
// get font manager
|
142
|
-
auto fontMgr =
|
143
|
-
count > 1 ? JsiSkTypefaceFontProvider::fromValue(runtime, arguments[1])
|
144
|
-
: nullptr;
|
145
|
-
|
146
|
-
// Create the paragraph builder
|
147
|
-
return jsi::Object::createFromHostObject(
|
148
|
-
runtime, std::make_shared<JsiSkParagraphBuilder>(
|
149
|
-
getContext(), paragraphStyle, fontMgr));
|
150
|
-
}
|
151
|
-
|
152
|
-
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkParagraphBuilderFactory, Make))
|
153
|
-
|
154
|
-
explicit JsiSkParagraphBuilderFactory(
|
155
|
-
std::shared_ptr<RNSkPlatformContext> context)
|
156
|
-
: JsiSkHostObject(std::move(context)) {}
|
157
|
-
};
|
158
|
-
|
159
130
|
} // namespace RNSkia
|
@@ -0,0 +1,54 @@
|
|
1
|
+
#pragma once
|
2
|
+
|
3
|
+
#include <memory>
|
4
|
+
#include <utility>
|
5
|
+
|
6
|
+
#include <jsi/jsi.h>
|
7
|
+
|
8
|
+
#include <JsiSkParagraphBuilder.h>
|
9
|
+
#include <JsiSkParagraphStyle.h>
|
10
|
+
|
11
|
+
#pragma clang diagnostic push
|
12
|
+
#pragma clang diagnostic ignored "-Wdocumentation"
|
13
|
+
|
14
|
+
#include "ParagraphBuilder.h"
|
15
|
+
|
16
|
+
#pragma clang diagnostic pop
|
17
|
+
|
18
|
+
namespace RNSkia {
|
19
|
+
|
20
|
+
namespace jsi = facebook::jsi;
|
21
|
+
|
22
|
+
namespace para = skia::textlayout;
|
23
|
+
|
24
|
+
/**
|
25
|
+
Implementation of the ParagraphBuilderFactory for making ParagraphBuilder JSI
|
26
|
+
object
|
27
|
+
*/
|
28
|
+
class JsiSkParagraphBuilderFactory : public JsiSkHostObject {
|
29
|
+
public:
|
30
|
+
JSI_HOST_FUNCTION(Make) {
|
31
|
+
// Get paragraph style from params
|
32
|
+
auto paragraphStyle =
|
33
|
+
count > 0 ? JsiSkParagraphStyle::fromValue(runtime, arguments[0])
|
34
|
+
: para::ParagraphStyle();
|
35
|
+
|
36
|
+
// get font manager
|
37
|
+
auto fontMgr =
|
38
|
+
count > 1 ? JsiSkTypefaceFontProvider::fromValue(runtime, arguments[1])
|
39
|
+
: nullptr;
|
40
|
+
|
41
|
+
// Create the paragraph builder
|
42
|
+
return jsi::Object::createFromHostObject(
|
43
|
+
runtime, std::make_shared<JsiSkParagraphBuilder>(
|
44
|
+
getContext(), paragraphStyle, fontMgr));
|
45
|
+
}
|
46
|
+
|
47
|
+
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkParagraphBuilderFactory, Make))
|
48
|
+
|
49
|
+
explicit JsiSkParagraphBuilderFactory(
|
50
|
+
std::shared_ptr<RNSkPlatformContext> context)
|
51
|
+
: JsiSkHostObject(std::move(context)) {}
|
52
|
+
};
|
53
|
+
|
54
|
+
} // namespace RNSkia
|
package/cpp/api/JsiSkPath.h
CHANGED
@@ -494,7 +494,7 @@ public:
|
|
494
494
|
JSI_HOST_FUNCTION(interpolate) {
|
495
495
|
auto path2 = JsiSkPath::fromValue(runtime, arguments[0]);
|
496
496
|
auto weight = arguments[1].asNumber();
|
497
|
-
if (count > 2) {
|
497
|
+
if (count > 2 && !arguments[2].isUndefined()) {
|
498
498
|
auto path3 = JsiSkPath::fromValue(runtime, arguments[2]);
|
499
499
|
auto succeed = getObject()->interpolate(*path2, weight, path3.get());
|
500
500
|
if (!succeed) {
|
package/cpp/api/JsiSkRRect.h
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
#include <memory>
|
4
4
|
#include <utility>
|
5
|
+
#include <vector>
|
5
6
|
|
6
7
|
#include <jsi/jsi.h>
|
7
8
|
|
@@ -61,9 +62,35 @@ public:
|
|
61
62
|
} else {
|
62
63
|
auto rect =
|
63
64
|
JsiSkRect::fromValue(runtime, object.getProperty(runtime, "rect"));
|
64
|
-
|
65
|
-
|
66
|
-
|
65
|
+
if (!object.getProperty(runtime, "rx").isUndefined()) {
|
66
|
+
auto rx = object.getProperty(runtime, "rx").asNumber();
|
67
|
+
auto ry = object.getProperty(runtime, "ry").asNumber();
|
68
|
+
return std::make_shared<SkRRect>(SkRRect::MakeRectXY(*rect, rx, ry));
|
69
|
+
} else if (object.getProperty(runtime, "topLeft").isObject() &&
|
70
|
+
object.getProperty(runtime, "topRight").isObject() &&
|
71
|
+
object.getProperty(runtime, "bottomRight").isObject() &&
|
72
|
+
object.getProperty(runtime, "bottomLeft").isObject()) {
|
73
|
+
std::vector<SkPoint> points;
|
74
|
+
std::shared_ptr<SkPoint> topLeft = JsiSkPoint::fromValue(
|
75
|
+
runtime, object.getProperty(runtime, "topLeft").asObject(runtime));
|
76
|
+
std::shared_ptr<SkPoint> topRight = JsiSkPoint::fromValue(
|
77
|
+
runtime, object.getProperty(runtime, "topRight").asObject(runtime));
|
78
|
+
std::shared_ptr<SkPoint> bottomRight = JsiSkPoint::fromValue(
|
79
|
+
runtime,
|
80
|
+
object.getProperty(runtime, "bottomRight").asObject(runtime));
|
81
|
+
std::shared_ptr<SkPoint> bottomLeft = JsiSkPoint::fromValue(
|
82
|
+
runtime,
|
83
|
+
object.getProperty(runtime, "bottomLeft").asObject(runtime));
|
84
|
+
points.push_back(*topLeft.get());
|
85
|
+
points.push_back(*topRight.get());
|
86
|
+
points.push_back(*bottomRight.get());
|
87
|
+
points.push_back(*bottomLeft.get());
|
88
|
+
auto rrect = SkRRect::MakeEmpty();
|
89
|
+
rrect.setRectRadii(*rect, points.data());
|
90
|
+
return std::make_shared<SkRRect>(rrect);
|
91
|
+
} else {
|
92
|
+
throw jsi::JSError(runtime, "Invalid RRect object");
|
93
|
+
}
|
67
94
|
}
|
68
95
|
}
|
69
96
|
|
@@ -0,0 +1,153 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright 2006 The Android Open Source Project
|
3
|
+
*
|
4
|
+
* Use of this source code is governed by a BSD-style license that can be
|
5
|
+
* found in the LICENSE file.
|
6
|
+
*/
|
7
|
+
#include "third_party/base64.h"
|
8
|
+
|
9
|
+
#include <cstdint>
|
10
|
+
|
11
|
+
#define DecodePad -2
|
12
|
+
#define EncodePad 64
|
13
|
+
|
14
|
+
static const char kDefaultEncode[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
15
|
+
"abcdefghijklmnopqrstuvwxyz"
|
16
|
+
"0123456789+/=";
|
17
|
+
|
18
|
+
static const signed char kDecodeData[] = {
|
19
|
+
62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1,
|
20
|
+
-1, -1, DecodePad, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
|
21
|
+
10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
|
22
|
+
-1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35,
|
23
|
+
36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51};
|
24
|
+
|
25
|
+
namespace RNSkia {
|
26
|
+
|
27
|
+
Base64::Error Base64::Decode(const void *srcv, size_t srcLength, void *dstv,
|
28
|
+
size_t *dstLength) {
|
29
|
+
const unsigned char *src = static_cast<const unsigned char *>(srcv);
|
30
|
+
unsigned char *dst = static_cast<unsigned char *>(dstv);
|
31
|
+
|
32
|
+
int i = 0;
|
33
|
+
bool padTwo = false;
|
34
|
+
bool padThree = false;
|
35
|
+
char unsigned const *const end = src + srcLength;
|
36
|
+
while (src < end) {
|
37
|
+
unsigned char bytes[4] = {0, 0, 0, 0};
|
38
|
+
int byte = 0;
|
39
|
+
do {
|
40
|
+
unsigned char srcByte = *src++;
|
41
|
+
if (srcByte == 0) {
|
42
|
+
*dstLength = i;
|
43
|
+
return Error::kNone;
|
44
|
+
}
|
45
|
+
if (srcByte <= ' ') {
|
46
|
+
continue; // treat as white space
|
47
|
+
}
|
48
|
+
if (srcByte < '+' || srcByte > 'z') {
|
49
|
+
return Error::kBadChar;
|
50
|
+
}
|
51
|
+
signed char decoded = kDecodeData[srcByte - '+'];
|
52
|
+
bytes[byte] = decoded;
|
53
|
+
if (decoded != DecodePad) {
|
54
|
+
if (decoded < 0) {
|
55
|
+
return Error::kBadChar;
|
56
|
+
}
|
57
|
+
byte++;
|
58
|
+
if (*src) {
|
59
|
+
continue;
|
60
|
+
}
|
61
|
+
if (byte == 0) {
|
62
|
+
*dstLength = i;
|
63
|
+
return Error::kNone;
|
64
|
+
}
|
65
|
+
if (byte == 4) {
|
66
|
+
break;
|
67
|
+
}
|
68
|
+
}
|
69
|
+
// As an optimization, if we find an equals sign
|
70
|
+
// we assume all future bytes to read are the
|
71
|
+
// appropriate number of padding equals signs.
|
72
|
+
if (byte < 2) {
|
73
|
+
return Error::kBadPadding;
|
74
|
+
}
|
75
|
+
padThree = true;
|
76
|
+
if (byte == 2) {
|
77
|
+
padTwo = true;
|
78
|
+
}
|
79
|
+
break;
|
80
|
+
} while (byte < 4);
|
81
|
+
int two = 0;
|
82
|
+
int three = 0;
|
83
|
+
if (dst) {
|
84
|
+
int one = (uint8_t)(bytes[0] << 2);
|
85
|
+
two = bytes[1];
|
86
|
+
one |= two >> 4;
|
87
|
+
two = (uint8_t)((two << 4) & 0xFF);
|
88
|
+
three = bytes[2];
|
89
|
+
two |= three >> 2;
|
90
|
+
three = (uint8_t)((three << 6) & 0xFF);
|
91
|
+
three |= bytes[3];
|
92
|
+
dst[i] = (unsigned char)one;
|
93
|
+
}
|
94
|
+
i++;
|
95
|
+
if (padTwo) {
|
96
|
+
break;
|
97
|
+
}
|
98
|
+
if (dst) {
|
99
|
+
dst[i] = (unsigned char)two;
|
100
|
+
}
|
101
|
+
i++;
|
102
|
+
if (padThree) {
|
103
|
+
break;
|
104
|
+
}
|
105
|
+
if (dst) {
|
106
|
+
dst[i] = (unsigned char)three;
|
107
|
+
}
|
108
|
+
i++;
|
109
|
+
}
|
110
|
+
*dstLength = i;
|
111
|
+
return Error::kNone;
|
112
|
+
}
|
113
|
+
|
114
|
+
size_t Base64::Encode(const void *srcv, size_t length, void *dstv) {
|
115
|
+
const unsigned char *src = static_cast<const unsigned char *>(srcv);
|
116
|
+
unsigned char *dst = static_cast<unsigned char *>(dstv);
|
117
|
+
|
118
|
+
const char *encode = kDefaultEncode;
|
119
|
+
if (dst) {
|
120
|
+
size_t remainder = length % 3;
|
121
|
+
char unsigned const *const end = &src[length - remainder];
|
122
|
+
while (src < end) {
|
123
|
+
unsigned a = *src++;
|
124
|
+
unsigned b = *src++;
|
125
|
+
unsigned c = *src++;
|
126
|
+
int d = c & 0x3F;
|
127
|
+
c = (c >> 6 | b << 2) & 0x3F;
|
128
|
+
b = (b >> 4 | a << 4) & 0x3F;
|
129
|
+
a = a >> 2;
|
130
|
+
*dst++ = encode[a];
|
131
|
+
*dst++ = encode[b];
|
132
|
+
*dst++ = encode[c];
|
133
|
+
*dst++ = encode[d];
|
134
|
+
}
|
135
|
+
if (remainder > 0) {
|
136
|
+
int k1 = 0;
|
137
|
+
int k2 = EncodePad;
|
138
|
+
int a = (uint8_t)*src++;
|
139
|
+
if (remainder == 2) {
|
140
|
+
int b = *src++;
|
141
|
+
k1 = b >> 4;
|
142
|
+
k2 = (b << 2) & 0x3F;
|
143
|
+
}
|
144
|
+
*dst++ = encode[a >> 2];
|
145
|
+
*dst++ = encode[(k1 | a << 4) & 0x3F];
|
146
|
+
*dst++ = encode[k2];
|
147
|
+
*dst++ = encode[EncodePad];
|
148
|
+
}
|
149
|
+
}
|
150
|
+
return (length + 2) / 3 * 4;
|
151
|
+
}
|
152
|
+
|
153
|
+
} // namespace RNSkia
|
@@ -0,0 +1,50 @@
|
|
1
|
+
/*
|
2
|
+
* Copyright 2006 The Android Open Source Project
|
3
|
+
*
|
4
|
+
* Use of this source code is governed by a BSD-style license that can be
|
5
|
+
* found in the LICENSE file.
|
6
|
+
*/
|
7
|
+
#pragma once
|
8
|
+
|
9
|
+
#include <cstddef>
|
10
|
+
|
11
|
+
namespace RNSkia {
|
12
|
+
|
13
|
+
struct Base64 {
|
14
|
+
public:
|
15
|
+
enum class Error {
|
16
|
+
kNone,
|
17
|
+
kBadPadding,
|
18
|
+
kBadChar,
|
19
|
+
};
|
20
|
+
|
21
|
+
/**
|
22
|
+
Base64 encodes src into dst.
|
23
|
+
|
24
|
+
Normally this is called once with 'dst' nullptr to get the required size,
|
25
|
+
then again with an allocated 'dst' pointer to do the actual encoding.
|
26
|
+
|
27
|
+
@param dst nullptr or a pointer to a buffer large enough to receive the
|
28
|
+
result
|
29
|
+
|
30
|
+
@return the required length of dst for encoding.
|
31
|
+
*/
|
32
|
+
static size_t Encode(const void *src, size_t length, void *dst);
|
33
|
+
|
34
|
+
/**
|
35
|
+
Base64 decodes src into dst.
|
36
|
+
|
37
|
+
Normally this is called once with 'dst' nullptr to get the required size,
|
38
|
+
then again with an allocated 'dst' pointer to do the actual encoding.
|
39
|
+
|
40
|
+
@param dst nullptr or a pointer to a buffer large enough to receive the
|
41
|
+
result
|
42
|
+
|
43
|
+
@param dstLength assigned the length dst is required to be. Must not be
|
44
|
+
nullptr.
|
45
|
+
*/
|
46
|
+
[[nodiscard]] static Error Decode(const void *src, size_t srcLength,
|
47
|
+
void *dst, size_t *dstLength);
|
48
|
+
};
|
49
|
+
|
50
|
+
} // namespace RNSkia
|