@shopify/react-native-skia 0.1.191 → 0.1.193
Sign up to get free protection for your applications and to get access to all the features.
- package/android/CMakeLists.txt +1 -1
- package/android/build.gradle +1 -0
- package/android/cpp/jni/JniPlatformContext.cpp +1 -1
- package/cpp/api/JsiSkColorFilter.h +2 -17
- package/cpp/api/JsiSkContourMeasure.h +3 -17
- package/cpp/api/JsiSkContourMeasureIter.h +3 -18
- package/cpp/api/JsiSkData.h +1 -18
- package/cpp/api/JsiSkFont.h +4 -14
- package/cpp/api/JsiSkHostObjects.h +85 -10
- package/cpp/api/JsiSkImage.h +26 -16
- package/cpp/api/JsiSkImageFactory.h +2 -2
- package/cpp/api/JsiSkImageFilter.h +1 -17
- package/cpp/api/JsiSkMaskFilter.h +1 -17
- package/cpp/api/JsiSkMatrix.h +3 -6
- package/cpp/api/JsiSkPaint.h +3 -15
- package/cpp/api/JsiSkPath.h +10 -21
- package/cpp/api/JsiSkPathEffect.h +2 -17
- package/cpp/api/JsiSkPicture.h +4 -18
- package/cpp/api/JsiSkPictureRecorder.h +4 -1
- package/cpp/api/JsiSkPoint.h +6 -1
- package/cpp/api/JsiSkRRect.h +6 -1
- package/cpp/api/JsiSkRSXform.h +4 -6
- package/cpp/api/JsiSkRect.h +6 -2
- package/cpp/api/JsiSkRuntimeEffect.h +4 -7
- package/cpp/api/JsiSkRuntimeShaderBuilder.h +2 -10
- package/cpp/api/JsiSkSVG.h +1 -10
- package/cpp/api/JsiSkShader.h +2 -16
- package/cpp/api/JsiSkSurface.h +3 -16
- package/cpp/api/JsiSkTextBlob.h +2 -18
- package/cpp/api/JsiSkTypeface.h +1 -22
- package/cpp/api/JsiSkVertices.h +3 -17
- package/cpp/rnskia/dom/base/Declaration.h +5 -7
- package/cpp/rnskia/dom/nodes/JsiBlurMaskNode.h +1 -0
- package/cpp/rnskia/dom/nodes/JsiPathNode.h +2 -2
- package/cpp/rnskia/dom/props/BoxShadowProps.h +2 -0
- package/cpp/rnskia/values/RNSkReadonlyValue.h +2 -2
- package/cpp/rnskia/values/RNSkValue.h +1 -1
- package/cpp/skia/include/android/SkAndroidFrameworkUtils.h +2 -8
- package/cpp/skia/include/android/SkImageAndroid.h +101 -0
- package/cpp/skia/include/codec/SkAndroidCodec.h +26 -8
- package/cpp/skia/include/codec/SkCodec.h +31 -17
- package/cpp/skia/include/codec/SkEncodedImageFormat.h +36 -0
- package/cpp/skia/include/codec/SkPixmapUtils.h +31 -0
- package/cpp/skia/include/config/SkUserConfig.h +61 -29
- package/cpp/skia/include/core/SkBitmap.h +25 -25
- package/cpp/skia/include/core/SkBlurTypes.h +0 -2
- package/cpp/skia/include/core/SkCanvas.h +32 -15
- package/cpp/skia/include/core/SkCapabilities.h +2 -2
- package/cpp/skia/include/core/SkColor.h +2 -0
- package/cpp/skia/include/core/SkColorPriv.h +19 -4
- package/cpp/skia/include/core/SkColorSpace.h +14 -17
- package/cpp/skia/include/core/SkColorType.h +1 -0
- package/cpp/skia/include/core/SkContourMeasure.h +1 -1
- package/cpp/skia/include/core/SkCoverageMode.h +0 -2
- package/cpp/skia/include/core/SkCubicMap.h +2 -0
- package/cpp/skia/include/core/SkData.h +5 -2
- package/cpp/skia/include/core/SkDataTable.h +6 -2
- package/cpp/skia/include/core/SkDeferredDisplayList.h +11 -10
- package/cpp/skia/include/core/SkDeferredDisplayListRecorder.h +9 -8
- package/cpp/skia/include/core/SkDrawable.h +10 -2
- package/cpp/skia/include/core/SkEncodedImageFormat.h +3 -30
- package/cpp/skia/include/core/SkFlattenable.h +4 -2
- package/cpp/skia/include/core/SkFont.h +1 -0
- package/cpp/skia/include/core/SkFontMetrics.h +1 -0
- package/cpp/skia/include/core/SkFontMgr.h +20 -29
- package/cpp/skia/include/core/SkFontStyle.h +4 -1
- package/cpp/skia/include/core/SkGraphics.h +21 -18
- package/cpp/skia/include/core/SkICC.h +3 -13
- package/cpp/skia/include/core/SkImage.h +395 -717
- package/cpp/skia/include/core/SkImageGenerator.h +19 -74
- package/cpp/skia/include/core/SkImageInfo.h +7 -5
- package/cpp/skia/include/core/SkM44.h +11 -0
- package/cpp/skia/include/core/SkMaskFilter.h +6 -3
- package/cpp/skia/include/core/SkMatrix.h +14 -4
- package/cpp/skia/include/core/SkMesh.h +52 -18
- package/cpp/skia/include/core/SkMilestone.h +1 -1
- package/cpp/skia/include/core/SkPaint.h +11 -34
- package/cpp/skia/include/core/SkPath.h +23 -4
- package/cpp/skia/include/core/SkPathBuilder.h +13 -5
- package/cpp/skia/include/core/SkPathMeasure.h +1 -1
- package/cpp/skia/include/core/SkPathTypes.h +0 -2
- package/cpp/skia/include/core/SkPathUtils.h +42 -0
- package/cpp/skia/include/core/SkPicture.h +3 -2
- package/cpp/skia/include/core/SkPictureRecorder.h +2 -0
- package/cpp/skia/include/core/SkPixelRef.h +4 -8
- package/cpp/skia/include/core/SkPixmap.h +12 -20
- package/cpp/skia/include/core/SkPoint.h +4 -2
- package/cpp/skia/include/core/SkPromiseImageTexture.h +2 -2
- package/cpp/skia/include/core/SkRRect.h +5 -1
- package/cpp/skia/include/core/SkRect.h +6 -3
- package/cpp/skia/include/core/SkRefCnt.h +9 -14
- package/cpp/skia/include/core/SkRegion.h +1 -1
- package/cpp/skia/include/core/SkScalar.h +2 -4
- package/cpp/skia/include/core/SkSerialProcs.h +18 -10
- package/cpp/skia/include/core/SkShader.h +1 -64
- package/cpp/skia/include/core/SkSize.h +2 -0
- package/cpp/skia/include/core/SkSpan.h +4 -112
- package/cpp/skia/include/core/SkStream.h +11 -12
- package/cpp/skia/include/core/SkString.h +9 -25
- package/cpp/skia/include/core/SkStrokeRec.h +1 -1
- package/cpp/skia/include/core/SkSurface.h +83 -61
- package/cpp/skia/include/core/SkSurfaceCharacterization.h +3 -3
- package/cpp/skia/include/core/SkSurfaceProps.h +9 -1
- package/cpp/skia/include/core/SkTextBlob.h +2 -2
- package/cpp/skia/include/core/SkTextureCompressionType.h +30 -0
- package/cpp/skia/include/core/SkTime.h +1 -1
- package/cpp/skia/include/core/SkTypeface.h +9 -2
- package/cpp/skia/include/core/SkTypes.h +37 -466
- package/cpp/skia/include/core/SkVertices.h +2 -0
- package/cpp/skia/include/core/SkYUVAInfo.h +4 -0
- package/cpp/skia/include/core/SkYUVAPixmaps.h +7 -1
- package/cpp/skia/include/docs/SkPDFDocument.h +12 -1
- package/cpp/skia/include/effects/SkColorMatrix.h +2 -1
- package/cpp/skia/include/effects/SkGradientShader.h +65 -14
- package/cpp/skia/include/effects/SkImageFilters.h +0 -11
- package/cpp/skia/include/effects/SkRuntimeEffect.h +41 -11
- package/cpp/skia/include/encode/SkEncoder.h +7 -3
- package/cpp/skia/include/encode/SkICC.h +36 -0
- package/cpp/skia/include/encode/SkJpegEncoder.h +102 -71
- package/cpp/skia/include/encode/SkPngEncoder.h +89 -71
- package/cpp/skia/include/encode/SkWebpEncoder.h +65 -38
- package/cpp/skia/include/gpu/GpuTypes.h +23 -1
- package/cpp/skia/include/gpu/GrBackendSurface.h +9 -7
- package/cpp/skia/include/gpu/GrContextOptions.h +28 -9
- package/cpp/skia/include/gpu/GrContextThreadSafeProxy.h +6 -4
- package/cpp/skia/include/gpu/GrDirectContext.h +84 -63
- package/cpp/skia/include/gpu/GrDriverBugWorkarounds.h +2 -1
- package/cpp/skia/include/gpu/GrRecordingContext.h +9 -5
- package/cpp/skia/include/gpu/GrTypes.h +18 -18
- package/cpp/skia/include/gpu/d3d/GrD3DTypes.h +4 -4
- package/cpp/skia/include/gpu/dawn/GrDawnTypes.h +3 -3
- package/cpp/skia/include/gpu/ganesh/GrTextureGenerator.h +77 -0
- package/cpp/skia/include/gpu/ganesh/SkImageGanesh.h +385 -0
- package/cpp/skia/include/gpu/gl/GrGLExtensions.h +3 -3
- package/cpp/skia/include/gpu/gl/GrGLFunctions.h +1 -1
- package/cpp/skia/include/gpu/gl/GrGLInterface.h +0 -3
- package/cpp/skia/include/gpu/gl/GrGLTypes.h +2 -1
- package/cpp/skia/include/gpu/graphite/BackendTexture.h +72 -3
- package/cpp/skia/include/gpu/graphite/Context.h +85 -32
- package/cpp/skia/include/gpu/graphite/ContextOptions.h +15 -11
- package/cpp/skia/include/gpu/graphite/GraphiteTypes.h +55 -5
- package/cpp/skia/include/gpu/graphite/ImageProvider.h +6 -4
- package/cpp/skia/include/gpu/graphite/Recorder.h +41 -11
- package/cpp/skia/include/gpu/graphite/Recording.h +50 -3
- package/cpp/skia/include/gpu/graphite/TextureInfo.h +47 -8
- package/cpp/skia/include/gpu/graphite/YUVABackendTextures.h +139 -0
- package/cpp/skia/include/gpu/graphite/dawn/DawnTypes.h +40 -0
- package/cpp/skia/include/gpu/graphite/dawn/DawnUtils.h +28 -0
- package/cpp/skia/include/gpu/graphite/mtl/MtlBackendContext.h +1 -1
- package/cpp/skia/include/gpu/graphite/mtl/{MtlTypes.h → MtlGraphiteTypes.h} +7 -6
- package/cpp/skia/include/gpu/graphite/mtl/MtlGraphiteUtils.h +27 -0
- package/cpp/skia/include/gpu/graphite/vk/VulkanGraphiteTypes.h +4 -9
- package/cpp/skia/include/gpu/graphite/vk/VulkanGraphiteUtils.h +28 -0
- package/cpp/skia/include/gpu/mock/GrMockTypes.h +17 -13
- package/cpp/skia/include/gpu/mtl/GrMtlTypes.h +2 -2
- package/cpp/skia/include/gpu/vk/GrVkBackendContext.h +1 -1
- package/cpp/skia/include/gpu/vk/GrVkTypes.h +3 -3
- package/cpp/skia/include/gpu/vk/VulkanExtensions.h +3 -3
- package/cpp/skia/include/gpu/vk/VulkanMemoryAllocator.h +5 -7
- package/cpp/skia/include/pathops/SkPathOps.h +3 -3
- package/cpp/skia/include/ports/SkFontMgr_data.h +22 -0
- package/cpp/skia/include/ports/SkFontMgr_indirect.h +14 -14
- package/cpp/skia/include/ports/SkRemotableFontMgr.h +2 -2
- package/cpp/skia/include/ports/SkTypeface_win.h +2 -1
- package/cpp/skia/include/private/SkChecksum.h +32 -7
- package/cpp/skia/include/private/SkColorData.h +1 -26
- package/cpp/skia/include/private/SkGainmapInfo.h +97 -0
- package/cpp/skia/include/private/SkGainmapShader.h +53 -0
- package/cpp/skia/include/private/SkIDChangeListener.h +4 -3
- package/cpp/skia/include/private/SkJpegGainmapEncoder.h +71 -0
- package/cpp/skia/include/private/SkJpegMetadataDecoder.h +61 -0
- package/cpp/skia/include/private/SkOpts_spi.h +3 -1
- package/cpp/skia/include/private/SkPathRef.h +64 -47
- package/cpp/skia/include/private/SkSLDefines.h +5 -5
- package/cpp/skia/include/private/SkSLSampleUsage.h +0 -4
- package/cpp/skia/include/private/SkSpinlock.h +1 -1
- package/cpp/skia/include/private/SkWeakRefCnt.h +3 -0
- package/cpp/skia/include/private/{SingleOwner.h → base/SingleOwner.h} +8 -5
- package/cpp/skia/include/private/base/SkAPI.h +52 -0
- package/cpp/skia/include/private/base/SkAlign.h +39 -0
- package/cpp/skia/include/private/base/SkAlignedStorage.h +32 -0
- package/cpp/skia/include/private/base/SkAssert.h +92 -0
- package/cpp/skia/include/private/base/SkAttributes.h +102 -0
- package/cpp/skia/include/private/base/SkCPUTypes.h +25 -0
- package/cpp/skia/include/private/base/SkContainers.h +46 -0
- package/cpp/skia/include/private/base/SkDebug.h +27 -0
- package/cpp/skia/include/private/{SkDeque.h → base/SkDeque.h} +3 -1
- package/cpp/skia/include/private/base/SkFeatures.h +151 -0
- package/cpp/skia/include/private/{SkFixed.h → base/SkFixed.h} +9 -7
- package/cpp/skia/include/private/{SkFloatBits.h → base/SkFloatBits.h} +2 -3
- package/cpp/skia/include/private/{SkFloatingPoint.h → base/SkFloatingPoint.h} +18 -9
- package/cpp/skia/include/private/base/SkLoadUserConfig.h +63 -0
- package/cpp/skia/include/private/{SkMacros.h → base/SkMacros.h} +17 -2
- package/cpp/skia/include/private/{SkMalloc.h → base/SkMalloc.h} +4 -7
- package/cpp/skia/include/{core → private/base}/SkMath.h +25 -2
- package/cpp/skia/include/private/{SkMutex.h → base/SkMutex.h} +5 -5
- package/cpp/skia/include/private/{SkNoncopyable.h → base/SkNoncopyable.h} +2 -2
- package/cpp/skia/include/private/{SkOnce.h → base/SkOnce.h} +3 -1
- package/cpp/skia/include/private/base/SkPathEnums.h +25 -0
- package/cpp/skia/include/private/{SkSafe32.h → base/SkSafe32.h} +16 -1
- package/cpp/skia/include/private/{SkSemaphore.h → base/SkSemaphore.h} +4 -3
- package/cpp/skia/include/private/base/SkSpan_impl.h +129 -0
- package/cpp/skia/include/private/base/SkTArray.h +694 -0
- package/cpp/skia/include/private/{SkTDArray.h → base/SkTDArray.h} +17 -54
- package/cpp/skia/include/private/{SkTFitsIn.h → base/SkTFitsIn.h} +14 -8
- package/cpp/skia/include/private/{SkTLogic.h → base/SkTLogic.h} +1 -1
- package/cpp/skia/include/private/{SkTemplates.h → base/SkTemplates.h} +63 -88
- package/cpp/skia/include/private/{SkThreadID.h → base/SkThreadID.h} +5 -2
- package/cpp/skia/include/private/{SkTo.h → base/SkTo.h} +13 -2
- package/cpp/skia/include/private/base/SkTypeTraits.h +33 -0
- package/cpp/skia/include/private/chromium/GrVkSecondaryCBDrawContext.h +130 -0
- package/cpp/skia/include/private/chromium/SkChromeRemoteGlyphCache.h +5 -9
- package/cpp/skia/include/private/chromium/SkDiscardableMemory.h +70 -0
- package/cpp/skia/include/private/chromium/Slug.h +0 -9
- package/cpp/skia/include/private/gpu/ganesh/GrContext_Base.h +2 -1
- package/cpp/skia/include/private/gpu/ganesh/GrD3DTypesMinimal.h +1 -1
- package/cpp/skia/include/private/gpu/ganesh/GrDawnTypesPriv.h +1 -1
- package/cpp/skia/include/private/gpu/ganesh/GrGLTypesPriv.h +1 -1
- package/cpp/skia/include/private/gpu/ganesh/GrImageContext.h +1 -1
- package/cpp/skia/include/private/gpu/ganesh/GrMockTypesPriv.h +3 -2
- package/cpp/skia/include/private/gpu/ganesh/GrMtlTypesPriv.h +1 -1
- package/cpp/skia/include/private/gpu/ganesh/GrTypesPriv.h +17 -23
- package/cpp/skia/include/private/gpu/ganesh/GrVkTypesPriv.h +2 -2
- package/cpp/skia/include/private/gpu/graphite/DawnTypesPriv.h +38 -0
- package/cpp/skia/include/private/gpu/graphite/{MtlTypesPriv.h → MtlGraphiteTypesPriv.h} +5 -5
- package/cpp/skia/include/private/gpu/graphite/VulkanGraphiteTypesPriv.h +1 -9
- package/cpp/skia/include/private/gpu/vk/SkiaVulkan.h +4 -0
- package/cpp/skia/include/utils/SkCamera.h +1 -1
- package/cpp/skia/include/utils/SkCustomTypeface.h +7 -1
- package/cpp/skia/include/utils/SkNWayCanvas.h +6 -6
- package/cpp/skia/include/utils/SkOrderedFontMgr.h +7 -6
- package/cpp/skia/include/utils/SkPaintFilterCanvas.h +2 -2
- package/cpp/skia/include/utils/SkParsePath.h +1 -1
- package/cpp/skia/modules/skcms/skcms.h +14 -0
- package/cpp/skia/modules/skcms/src/Transform_inl.h +19 -0
- package/cpp/skia/modules/skparagraph/include/FontCollection.h +2 -2
- package/cpp/skia/modules/skparagraph/include/Paragraph.h +72 -2
- package/cpp/skia/modules/skparagraph/include/ParagraphCache.h +1 -11
- package/cpp/skia/modules/skparagraph/include/ParagraphPainter.h +63 -0
- package/cpp/skia/modules/skparagraph/include/TextStyle.h +27 -4
- package/cpp/skia/modules/skparagraph/include/TypefaceFontProvider.h +13 -13
- package/cpp/skia/modules/skresources/include/SkResources.h +18 -4
- package/cpp/skia/modules/svg/include/SkSVGAttribute.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGAttributeParser.h +2 -2
- package/cpp/skia/modules/svg/include/SkSVGContainer.h +2 -2
- package/cpp/skia/modules/svg/include/SkSVGDOM.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGFilterContext.h +2 -2
- package/cpp/skia/modules/svg/include/SkSVGGradient.h +2 -2
- package/cpp/skia/modules/svg/include/SkSVGIDMapper.h +2 -2
- package/cpp/skia/modules/svg/include/SkSVGRenderContext.h +3 -3
- package/cpp/skia/modules/svg/include/SkSVGSVG.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGTypes.h +22 -21
- package/cpp/skia/modules/svg/include/SkSVGValue.h +1 -1
- package/cpp/skia/{include/private → src/core}/SkTHash.h +41 -37
- package/ios/RNSkia-iOS/ViewScreenshotService.mm +1 -1
- package/lib/commonjs/renderer/Canvas.js +17 -1
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/skia/core/Data.d.ts +2 -2
- package/lib/commonjs/skia/core/Data.js.map +1 -1
- package/lib/commonjs/skia/types/Data/Data.d.ts +2 -2
- package/lib/commonjs/skia/types/Data/Data.js.map +1 -1
- package/lib/commonjs/skia/types/Image/Image.d.ts +2 -2
- package/lib/commonjs/skia/types/Image/Image.js.map +1 -1
- package/lib/commonjs/skia/types/JsiInstance.d.ts +4 -4
- package/lib/commonjs/skia/types/JsiInstance.js.map +1 -1
- package/lib/commonjs/skia/types/SVG/SVG.d.ts +2 -2
- package/lib/commonjs/skia/types/SVG/SVG.js.map +1 -1
- package/lib/commonjs/skia/types/Typeface/Typeface.d.ts +2 -2
- package/lib/commonjs/skia/types/Typeface/Typeface.js.map +1 -1
- package/lib/commonjs/skia/web/Host.d.ts +1 -0
- package/lib/commonjs/skia/web/Host.js +2 -0
- package/lib/commonjs/skia/web/Host.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkCanvas.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkCanvas.js +6 -0
- package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkColorFilter.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkColorFilter.js +6 -0
- package/lib/commonjs/skia/web/JsiSkColorFilter.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkContourMeasure.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkContourMeasure.js +6 -0
- package/lib/commonjs/skia/web/JsiSkContourMeasure.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkContourMeasureIter.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkContourMeasureIter.js +6 -0
- package/lib/commonjs/skia/web/JsiSkContourMeasureIter.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkData.d.ts +1 -1
- package/lib/commonjs/skia/web/JsiSkData.js +4 -2
- package/lib/commonjs/skia/web/JsiSkData.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkFont.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkFont.js +6 -0
- package/lib/commonjs/skia/web/JsiSkFont.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImage.d.ts +1 -1
- package/lib/commonjs/skia/web/JsiSkImage.js +6 -4
- package/lib/commonjs/skia/web/JsiSkImage.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkImageFilter.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkImageFilter.js +6 -0
- package/lib/commonjs/skia/web/JsiSkImageFilter.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkMaskFilter.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkMaskFilter.js +6 -0
- package/lib/commonjs/skia/web/JsiSkMaskFilter.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkMatrix.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkMatrix.js +5 -0
- package/lib/commonjs/skia/web/JsiSkMatrix.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPaint.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkPaint.js +6 -0
- package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPath.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkPath.js +6 -0
- package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPathEffect.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkPathEffect.js +6 -0
- package/lib/commonjs/skia/web/JsiSkPathEffect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPicture.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkPicture.js +6 -1
- package/lib/commonjs/skia/web/JsiSkPicture.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPictureRecorder.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkPictureRecorder.js +6 -0
- package/lib/commonjs/skia/web/JsiSkPictureRecorder.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkPoint.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkPoint.js +5 -0
- package/lib/commonjs/skia/web/JsiSkPoint.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRRect.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkRRect.js +5 -0
- package/lib/commonjs/skia/web/JsiSkRRect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRSXform.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkRSXform.js +5 -0
- package/lib/commonjs/skia/web/JsiSkRSXform.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRect.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkRect.js +5 -0
- package/lib/commonjs/skia/web/JsiSkRect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkRuntimeEffect.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js +6 -0
- package/lib/commonjs/skia/web/JsiSkRuntimeEffect.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkShader.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkShader.js +6 -0
- package/lib/commonjs/skia/web/JsiSkShader.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkSurface.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkSurface.js +6 -0
- package/lib/commonjs/skia/web/JsiSkSurface.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkTextBlob.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkTextBlob.js +6 -0
- package/lib/commonjs/skia/web/JsiSkTextBlob.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkTypeface.d.ts +1 -1
- package/lib/commonjs/skia/web/JsiSkTypeface.js +6 -4
- package/lib/commonjs/skia/web/JsiSkTypeface.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkVertices.d.ts +1 -0
- package/lib/commonjs/skia/web/JsiSkVertices.js +6 -0
- package/lib/commonjs/skia/web/JsiSkVertices.js.map +1 -1
- package/lib/commonjs/values/hooks/useComputedValue.js +1 -1
- package/lib/commonjs/values/hooks/useComputedValue.js.map +1 -1
- package/lib/commonjs/values/types.d.ts +1 -1
- package/lib/commonjs/values/types.js.map +1 -1
- package/lib/commonjs/values/web/RNSkComputedValue.d.ts +1 -1
- package/lib/commonjs/values/web/RNSkComputedValue.js +1 -1
- package/lib/commonjs/values/web/RNSkComputedValue.js.map +1 -1
- package/lib/commonjs/values/web/RNSkReadonlyValue.d.ts +1 -1
- package/lib/commonjs/values/web/RNSkReadonlyValue.js +1 -1
- package/lib/commonjs/values/web/RNSkReadonlyValue.js.map +1 -1
- package/lib/commonjs/views/SkiaDomView.web.js +14 -4
- package/lib/commonjs/views/SkiaDomView.web.js.map +1 -1
- package/lib/commonjs/views/types.d.ts +2 -1
- package/lib/commonjs/views/types.js.map +1 -1
- package/lib/module/renderer/Canvas.js +15 -1
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/skia/core/Data.d.ts +2 -2
- package/lib/module/skia/core/Data.js.map +1 -1
- package/lib/module/skia/types/Data/Data.d.ts +2 -2
- package/lib/module/skia/types/Data/Data.js.map +1 -1
- package/lib/module/skia/types/Image/Image.d.ts +2 -2
- package/lib/module/skia/types/Image/Image.js.map +1 -1
- package/lib/module/skia/types/JsiInstance.d.ts +4 -4
- package/lib/module/skia/types/JsiInstance.js.map +1 -1
- package/lib/module/skia/types/SVG/SVG.d.ts +2 -2
- package/lib/module/skia/types/SVG/SVG.js.map +1 -1
- package/lib/module/skia/types/Typeface/Typeface.d.ts +2 -2
- package/lib/module/skia/types/Typeface/Typeface.js.map +1 -1
- package/lib/module/skia/web/Host.d.ts +1 -0
- package/lib/module/skia/web/Host.js +2 -0
- package/lib/module/skia/web/Host.js.map +1 -1
- package/lib/module/skia/web/JsiSkCanvas.d.ts +1 -0
- package/lib/module/skia/web/JsiSkCanvas.js +6 -0
- package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
- package/lib/module/skia/web/JsiSkColorFilter.d.ts +1 -0
- package/lib/module/skia/web/JsiSkColorFilter.js +6 -0
- package/lib/module/skia/web/JsiSkColorFilter.js.map +1 -1
- package/lib/module/skia/web/JsiSkContourMeasure.d.ts +1 -0
- package/lib/module/skia/web/JsiSkContourMeasure.js +6 -0
- package/lib/module/skia/web/JsiSkContourMeasure.js.map +1 -1
- package/lib/module/skia/web/JsiSkContourMeasureIter.d.ts +1 -0
- package/lib/module/skia/web/JsiSkContourMeasureIter.js +6 -0
- package/lib/module/skia/web/JsiSkContourMeasureIter.js.map +1 -1
- package/lib/module/skia/web/JsiSkData.d.ts +1 -1
- package/lib/module/skia/web/JsiSkData.js +4 -2
- package/lib/module/skia/web/JsiSkData.js.map +1 -1
- package/lib/module/skia/web/JsiSkFont.d.ts +1 -0
- package/lib/module/skia/web/JsiSkFont.js +6 -0
- package/lib/module/skia/web/JsiSkFont.js.map +1 -1
- package/lib/module/skia/web/JsiSkImage.d.ts +1 -1
- package/lib/module/skia/web/JsiSkImage.js +6 -4
- package/lib/module/skia/web/JsiSkImage.js.map +1 -1
- package/lib/module/skia/web/JsiSkImageFilter.d.ts +1 -0
- package/lib/module/skia/web/JsiSkImageFilter.js +6 -0
- package/lib/module/skia/web/JsiSkImageFilter.js.map +1 -1
- package/lib/module/skia/web/JsiSkMaskFilter.d.ts +1 -0
- package/lib/module/skia/web/JsiSkMaskFilter.js +6 -0
- package/lib/module/skia/web/JsiSkMaskFilter.js.map +1 -1
- package/lib/module/skia/web/JsiSkMatrix.d.ts +1 -0
- package/lib/module/skia/web/JsiSkMatrix.js +5 -0
- package/lib/module/skia/web/JsiSkMatrix.js.map +1 -1
- package/lib/module/skia/web/JsiSkPaint.d.ts +1 -0
- package/lib/module/skia/web/JsiSkPaint.js +6 -0
- package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
- package/lib/module/skia/web/JsiSkPath.d.ts +1 -0
- package/lib/module/skia/web/JsiSkPath.js +6 -0
- package/lib/module/skia/web/JsiSkPath.js.map +1 -1
- package/lib/module/skia/web/JsiSkPathEffect.d.ts +1 -0
- package/lib/module/skia/web/JsiSkPathEffect.js +6 -0
- package/lib/module/skia/web/JsiSkPathEffect.js.map +1 -1
- package/lib/module/skia/web/JsiSkPicture.d.ts +1 -0
- package/lib/module/skia/web/JsiSkPicture.js +6 -0
- package/lib/module/skia/web/JsiSkPicture.js.map +1 -1
- package/lib/module/skia/web/JsiSkPictureRecorder.d.ts +1 -0
- package/lib/module/skia/web/JsiSkPictureRecorder.js +6 -0
- package/lib/module/skia/web/JsiSkPictureRecorder.js.map +1 -1
- package/lib/module/skia/web/JsiSkPoint.d.ts +1 -0
- package/lib/module/skia/web/JsiSkPoint.js +5 -0
- package/lib/module/skia/web/JsiSkPoint.js.map +1 -1
- package/lib/module/skia/web/JsiSkRRect.d.ts +1 -0
- package/lib/module/skia/web/JsiSkRRect.js +5 -0
- package/lib/module/skia/web/JsiSkRRect.js.map +1 -1
- package/lib/module/skia/web/JsiSkRSXform.d.ts +1 -0
- package/lib/module/skia/web/JsiSkRSXform.js +5 -0
- package/lib/module/skia/web/JsiSkRSXform.js.map +1 -1
- package/lib/module/skia/web/JsiSkRect.d.ts +1 -0
- package/lib/module/skia/web/JsiSkRect.js +5 -0
- package/lib/module/skia/web/JsiSkRect.js.map +1 -1
- package/lib/module/skia/web/JsiSkRuntimeEffect.d.ts +1 -0
- package/lib/module/skia/web/JsiSkRuntimeEffect.js +6 -0
- package/lib/module/skia/web/JsiSkRuntimeEffect.js.map +1 -1
- package/lib/module/skia/web/JsiSkShader.d.ts +1 -0
- package/lib/module/skia/web/JsiSkShader.js +6 -0
- package/lib/module/skia/web/JsiSkShader.js.map +1 -1
- package/lib/module/skia/web/JsiSkSurface.d.ts +1 -0
- package/lib/module/skia/web/JsiSkSurface.js +6 -0
- package/lib/module/skia/web/JsiSkSurface.js.map +1 -1
- package/lib/module/skia/web/JsiSkTextBlob.d.ts +1 -0
- package/lib/module/skia/web/JsiSkTextBlob.js +6 -0
- package/lib/module/skia/web/JsiSkTextBlob.js.map +1 -1
- package/lib/module/skia/web/JsiSkTypeface.d.ts +1 -1
- package/lib/module/skia/web/JsiSkTypeface.js +6 -4
- package/lib/module/skia/web/JsiSkTypeface.js.map +1 -1
- package/lib/module/skia/web/JsiSkVertices.d.ts +1 -0
- package/lib/module/skia/web/JsiSkVertices.js +6 -0
- package/lib/module/skia/web/JsiSkVertices.js.map +1 -1
- package/lib/module/values/hooks/useComputedValue.js +1 -1
- package/lib/module/values/hooks/useComputedValue.js.map +1 -1
- package/lib/module/values/types.d.ts +1 -1
- package/lib/module/values/types.js.map +1 -1
- package/lib/module/values/web/RNSkComputedValue.d.ts +1 -1
- package/lib/module/values/web/RNSkComputedValue.js +1 -1
- package/lib/module/values/web/RNSkComputedValue.js.map +1 -1
- package/lib/module/values/web/RNSkReadonlyValue.d.ts +1 -1
- package/lib/module/values/web/RNSkReadonlyValue.js +1 -1
- package/lib/module/values/web/RNSkReadonlyValue.js.map +1 -1
- package/lib/module/views/SkiaDomView.web.js +13 -4
- package/lib/module/views/SkiaDomView.web.js.map +1 -1
- package/lib/module/views/types.d.ts +2 -1
- package/lib/module/views/types.js.map +1 -1
- package/lib/typescript/src/skia/core/Data.d.ts +2 -2
- package/lib/typescript/src/skia/types/Data/Data.d.ts +2 -2
- package/lib/typescript/src/skia/types/Image/Image.d.ts +2 -2
- package/lib/typescript/src/skia/types/JsiInstance.d.ts +4 -4
- package/lib/typescript/src/skia/types/SVG/SVG.d.ts +2 -2
- package/lib/typescript/src/skia/types/Typeface/Typeface.d.ts +2 -2
- package/lib/typescript/src/skia/web/Host.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkCanvas.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkColorFilter.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkContourMeasure.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkContourMeasureIter.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkData.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkFont.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkImage.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkImageFilter.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkMaskFilter.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkMatrix.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkPaint.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkPath.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkPathEffect.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkPicture.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkPictureRecorder.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkPoint.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkRRect.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkRSXform.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkRect.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkRuntimeEffect.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkShader.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkSurface.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkTextBlob.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkTypeface.d.ts +1 -1
- package/lib/typescript/src/skia/web/JsiSkVertices.d.ts +1 -0
- package/lib/typescript/src/values/types.d.ts +1 -1
- package/lib/typescript/src/values/web/RNSkComputedValue.d.ts +1 -1
- package/lib/typescript/src/values/web/RNSkReadonlyValue.d.ts +1 -1
- package/lib/typescript/src/views/types.d.ts +2 -1
- package/libs/android/arm64-v8a/libskia.a +0 -0
- package/libs/android/arm64-v8a/libskottie.a +0 -0
- package/libs/android/arm64-v8a/libsksg.a +0 -0
- package/libs/android/arm64-v8a/libskshaper.a +0 -0
- package/libs/android/arm64-v8a/libsvg.a +0 -0
- package/libs/android/armeabi-v7a/libskia.a +0 -0
- package/libs/android/armeabi-v7a/libskottie.a +0 -0
- package/libs/android/armeabi-v7a/libsksg.a +0 -0
- package/libs/android/armeabi-v7a/libskshaper.a +0 -0
- package/libs/android/armeabi-v7a/libsvg.a +0 -0
- package/libs/android/x86/libskia.a +0 -0
- package/libs/android/x86/libskottie.a +0 -0
- package/libs/android/x86/libsksg.a +0 -0
- package/libs/android/x86/libskshaper.a +0 -0
- package/libs/android/x86/libsvg.a +0 -0
- package/libs/android/x86_64/libskia.a +0 -0
- package/libs/android/x86_64/libskottie.a +0 -0
- package/libs/android/x86_64/libsksg.a +0 -0
- package/libs/android/x86_64/libskshaper.a +0 -0
- package/libs/android/x86_64/libsvg.a +0 -0
- package/libs/ios/libskia.xcframework/Info.plist +5 -5
- 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/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/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/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 +1 -1
- package/scripts/install-npm.js +11 -1
- package/src/renderer/Canvas.tsx +21 -1
- package/src/skia/core/Data.ts +3 -3
- package/src/skia/types/Data/Data.ts +2 -2
- package/src/skia/types/Image/Image.ts +2 -2
- package/src/skia/types/JsiInstance.ts +4 -4
- package/src/skia/types/SVG/SVG.ts +2 -2
- package/src/skia/types/Typeface/Typeface.ts +2 -2
- package/src/skia/web/Host.ts +2 -0
- package/src/skia/web/JsiSkCanvas.ts +4 -0
- package/src/skia/web/JsiSkColorFilter.ts +4 -0
- package/src/skia/web/JsiSkContourMeasure.ts +4 -0
- package/src/skia/web/JsiSkContourMeasureIter.ts +4 -0
- package/src/skia/web/JsiSkData.ts +3 -3
- package/src/skia/web/JsiSkFont.ts +4 -0
- package/src/skia/web/JsiSkImage.ts +2 -2
- package/src/skia/web/JsiSkImageFilter.ts +4 -0
- package/src/skia/web/JsiSkMaskFilter.ts +4 -0
- package/src/skia/web/JsiSkMatrix.ts +4 -0
- package/src/skia/web/JsiSkPaint.ts +4 -0
- package/src/skia/web/JsiSkPath.ts +4 -0
- package/src/skia/web/JsiSkPathEffect.ts +4 -0
- package/src/skia/web/JsiSkPicture.ts +4 -0
- package/src/skia/web/JsiSkPictureRecorder.ts +4 -0
- package/src/skia/web/JsiSkPoint.ts +4 -0
- package/src/skia/web/JsiSkRRect.ts +4 -0
- package/src/skia/web/JsiSkRSXform.ts +4 -0
- package/src/skia/web/JsiSkRect.ts +4 -0
- package/src/skia/web/JsiSkRuntimeEffect.ts +4 -0
- package/src/skia/web/JsiSkShader.ts +4 -0
- package/src/skia/web/JsiSkSurface.ts +4 -0
- package/src/skia/web/JsiSkTextBlob.ts +4 -0
- package/src/skia/web/JsiSkTypeface.ts +2 -2
- package/src/skia/web/JsiSkVertices.ts +4 -0
- package/src/values/hooks/useComputedValue.ts +1 -1
- package/src/values/types.ts +1 -1
- package/src/values/web/RNSkComputedValue.ts +1 -1
- package/src/values/web/RNSkReadonlyValue.ts +1 -1
- package/src/views/SkiaDomView.web.tsx +6 -1
- package/src/views/types.ts +2 -1
- package/cpp/skia/include/core/SkImageEncoder.h +0 -71
- package/cpp/skia/include/gpu/GrConfig.h +0 -53
- package/cpp/skia/include/gpu/graphite/CombinationBuilder.h +0 -195
- package/cpp/skia/include/private/SkHalf.h +0 -38
- package/cpp/skia/include/private/SkImageInfoPriv.h +0 -199
- package/cpp/skia/include/private/SkSLIRNode.h +0 -64
- package/cpp/skia/include/private/SkSLLayout.h +0 -144
- package/cpp/skia/include/private/SkSLModifiers.h +0 -178
- package/cpp/skia/include/private/SkSLProgramElement.h +0 -77
- package/cpp/skia/include/private/SkSLProgramKind.h +0 -35
- package/cpp/skia/include/private/SkSLStatement.h +0 -86
- package/cpp/skia/include/private/SkSLString.h +0 -41
- package/cpp/skia/include/private/SkSLSymbol.h +0 -94
- package/cpp/skia/include/private/SkSafe_math.h +0 -52
- package/cpp/skia/include/private/SkStringView.h +0 -51
- package/cpp/skia/include/private/SkTArray.h +0 -655
- package/cpp/skia/include/private/SkUniquePaintParamsID.h +0 -35
- package/cpp/skia/include/private/SkVx.h +0 -1026
- package/cpp/skia/include/sksl/DSL.h +0 -37
- package/cpp/skia/include/sksl/DSLBlock.h +0 -58
- package/cpp/skia/include/sksl/DSLCase.h +0 -62
- package/cpp/skia/include/sksl/DSLCore.h +0 -492
- package/cpp/skia/include/sksl/DSLExpression.h +0 -241
- package/cpp/skia/include/sksl/DSLFunction.h +0 -113
- package/cpp/skia/include/sksl/DSLLayout.h +0 -92
- package/cpp/skia/include/sksl/DSLModifiers.h +0 -69
- package/cpp/skia/include/sksl/DSLStatement.h +0 -82
- package/cpp/skia/include/sksl/DSLSymbols.h +0 -61
- package/cpp/skia/include/sksl/DSLType.h +0 -271
- package/cpp/skia/include/sksl/DSLVar.h +0 -231
- package/cpp/skia/include/sksl/SkSLErrorReporter.h +0 -65
- package/cpp/skia/include/sksl/SkSLOperator.h +0 -154
- package/cpp/skia/include/sksl/SkSLPosition.h +0 -104
- package/cpp/skia/include/utils/SkRandom.h +0 -169
- package/cpp/skia/src/core/SkLRUCache.h +0 -126
- package/cpp/skia/src/core/SkTInternalLList.h +0 -302
- /package/cpp/skia/include/{core → codec}/SkPngChunkReader.h +0 -0
- /package/cpp/skia/include/private/{SkTPin.h → base/SkTPin.h} +0 -0
- /package/cpp/skia/include/private/{SkThreadAnnotations.h → base/SkThreadAnnotations.h} +0 -0
@@ -15,11 +15,11 @@
|
|
15
15
|
#include "include/core/SkRect.h"
|
16
16
|
#include "include/core/SkSize.h"
|
17
17
|
#include "include/core/SkTypes.h"
|
18
|
-
#include "include/private/SkTHash.h"
|
19
18
|
#include "modules/skresources/include/SkResources.h"
|
20
19
|
#include "modules/svg/include/SkSVGAttribute.h"
|
21
20
|
#include "modules/svg/include/SkSVGIDMapper.h"
|
22
|
-
#include "src/
|
21
|
+
#include "src/base/SkTLazy.h"
|
22
|
+
#include "src/core/SkTHash.h"
|
23
23
|
|
24
24
|
class SkCanvas;
|
25
25
|
class SkSVGLength;
|
@@ -52,7 +52,7 @@ struct SkSVGPresentationContext {
|
|
52
52
|
SkSVGPresentationContext(const SkSVGPresentationContext&) = default;
|
53
53
|
SkSVGPresentationContext& operator=(const SkSVGPresentationContext&) = default;
|
54
54
|
|
55
|
-
const
|
55
|
+
const skia_private::THashMap<SkString, SkSVGColorType>* fNamedColors = nullptr;
|
56
56
|
|
57
57
|
// Inherited presentation attributes, computed for the current node.
|
58
58
|
SkSVGPresentationAttributes fInherited;
|
@@ -18,8 +18,9 @@
|
|
18
18
|
#include "include/core/SkSpan.h"
|
19
19
|
#include "include/core/SkString.h"
|
20
20
|
#include "include/core/SkTypes.h"
|
21
|
-
|
22
|
-
#include
|
21
|
+
|
22
|
+
#include <optional>
|
23
|
+
#include <vector>
|
23
24
|
|
24
25
|
using SkSVGColorType = SkColor;
|
25
26
|
using SkSVGIntegerType = int;
|
@@ -27,7 +28,7 @@ using SkSVGNumberType = SkScalar;
|
|
27
28
|
using SkSVGStringType = SkString;
|
28
29
|
using SkSVGViewBoxType = SkRect;
|
29
30
|
using SkSVGTransformType = SkMatrix;
|
30
|
-
using SkSVGPointsType =
|
31
|
+
using SkSVGPointsType = std::vector<SkPoint>;
|
31
32
|
|
32
33
|
enum class SkSVGPropertyState {
|
33
34
|
kUnspecified,
|
@@ -45,17 +46,17 @@ public:
|
|
45
46
|
explicit SkSVGProperty(SkSVGPropertyState state) : fState(state) {}
|
46
47
|
|
47
48
|
explicit SkSVGProperty(const T& value) : fState(SkSVGPropertyState::kValue) {
|
48
|
-
fValue
|
49
|
+
fValue = value;
|
49
50
|
}
|
50
51
|
|
51
52
|
explicit SkSVGProperty(T&& value) : fState(SkSVGPropertyState::kValue) {
|
52
|
-
fValue
|
53
|
+
fValue = std::move(value);
|
53
54
|
}
|
54
55
|
|
55
56
|
template <typename... Args>
|
56
57
|
void init(Args&&... args) {
|
57
58
|
fState = SkSVGPropertyState::kValue;
|
58
|
-
fValue.
|
59
|
+
fValue.emplace(std::forward<Args>(args)...);
|
59
60
|
}
|
60
61
|
|
61
62
|
constexpr bool isInheritable() const { return kInheritable; }
|
@@ -63,7 +64,7 @@ public:
|
|
63
64
|
bool isValue() const { return fState == SkSVGPropertyState::kValue; }
|
64
65
|
|
65
66
|
T* getMaybeNull() const {
|
66
|
-
return fValue.
|
67
|
+
return fValue.has_value() ? &fValue.value() : nullptr;
|
67
68
|
}
|
68
69
|
|
69
70
|
void set(SkSVGPropertyState state) {
|
@@ -75,41 +76,41 @@ public:
|
|
75
76
|
|
76
77
|
void set(const T& value) {
|
77
78
|
fState = SkSVGPropertyState::kValue;
|
78
|
-
fValue
|
79
|
+
fValue = value;
|
79
80
|
}
|
80
81
|
|
81
82
|
void set(T&& value) {
|
82
83
|
fState = SkSVGPropertyState::kValue;
|
83
|
-
fValue
|
84
|
+
fValue = std::move(value);
|
84
85
|
}
|
85
86
|
|
86
87
|
T* operator->() {
|
87
88
|
SkASSERT(fState == SkSVGPropertyState::kValue);
|
88
|
-
SkASSERT(fValue.
|
89
|
-
return fValue.
|
89
|
+
SkASSERT(fValue.has_value());
|
90
|
+
return &fValue.value();
|
90
91
|
}
|
91
92
|
|
92
93
|
const T* operator->() const {
|
93
94
|
SkASSERT(fState == SkSVGPropertyState::kValue);
|
94
|
-
SkASSERT(fValue.
|
95
|
-
return fValue.
|
95
|
+
SkASSERT(fValue.has_value());
|
96
|
+
return &fValue.value();
|
96
97
|
}
|
97
98
|
|
98
99
|
T& operator*() {
|
99
100
|
SkASSERT(fState == SkSVGPropertyState::kValue);
|
100
|
-
SkASSERT(fValue.
|
101
|
+
SkASSERT(fValue.has_value());
|
101
102
|
return *fValue;
|
102
103
|
}
|
103
104
|
|
104
105
|
const T& operator*() const {
|
105
106
|
SkASSERT(fState == SkSVGPropertyState::kValue);
|
106
|
-
SkASSERT(fValue.
|
107
|
+
SkASSERT(fValue.has_value());
|
107
108
|
return *fValue;
|
108
109
|
}
|
109
110
|
|
110
111
|
private:
|
111
112
|
SkSVGPropertyState fState;
|
112
|
-
|
113
|
+
std::optional<T> fValue;
|
113
114
|
};
|
114
115
|
|
115
116
|
class SkSVGLength {
|
@@ -180,7 +181,7 @@ public:
|
|
180
181
|
kColor,
|
181
182
|
kICCColor,
|
182
183
|
};
|
183
|
-
using Vars =
|
184
|
+
using Vars = std::vector<SkString>;
|
184
185
|
|
185
186
|
SkSVGColor() : SkSVGColor(SK_ColorBLACK) {}
|
186
187
|
explicit SkSVGColor(const SkSVGColorType& c) : fType(Type::kColor), fColor(c), fVars(nullptr) {}
|
@@ -400,7 +401,7 @@ public:
|
|
400
401
|
|
401
402
|
SkSVGDashArray() : fType(Type::kNone) {}
|
402
403
|
explicit SkSVGDashArray(Type t) : fType(t) {}
|
403
|
-
explicit SkSVGDashArray(
|
404
|
+
explicit SkSVGDashArray(std::vector<SkSVGLength>&& dashArray)
|
404
405
|
: fType(Type::kDashArray)
|
405
406
|
, fDashArray(std::move(dashArray)) {}
|
406
407
|
|
@@ -414,11 +415,11 @@ public:
|
|
414
415
|
|
415
416
|
Type type() const { return fType; }
|
416
417
|
|
417
|
-
const
|
418
|
+
const std::vector<SkSVGLength>& dashArray() const { return fDashArray; }
|
418
419
|
|
419
420
|
private:
|
420
421
|
Type fType;
|
421
|
-
|
422
|
+
std::vector<SkSVGLength> fDashArray;
|
422
423
|
};
|
423
424
|
|
424
425
|
class SkSVGStopColor {
|
@@ -673,7 +674,7 @@ enum class SkSVGFeColorMatrixType {
|
|
673
674
|
kLuminanceToAlpha,
|
674
675
|
};
|
675
676
|
|
676
|
-
using SkSVGFeColorMatrixValues =
|
677
|
+
using SkSVGFeColorMatrixValues = std::vector<SkSVGNumberType>;
|
677
678
|
|
678
679
|
enum class SkSVGFeCompositeOperator {
|
679
680
|
kOver,
|
@@ -12,7 +12,7 @@
|
|
12
12
|
#include "include/core/SkMatrix.h"
|
13
13
|
#include "include/core/SkPath.h"
|
14
14
|
#include "include/core/SkTypes.h"
|
15
|
-
#include "include/private/SkNoncopyable.h"
|
15
|
+
#include "include/private/base/SkNoncopyable.h"
|
16
16
|
#include "modules/svg/include/SkSVGTypes.h"
|
17
17
|
|
18
18
|
class SkSVGValue : public SkNoncopyable {
|
@@ -10,13 +10,15 @@
|
|
10
10
|
|
11
11
|
#include "include/core/SkTypes.h"
|
12
12
|
#include "include/private/SkChecksum.h"
|
13
|
-
#include "include/private/SkTemplates.h"
|
13
|
+
#include "include/private/base/SkTemplates.h"
|
14
14
|
|
15
15
|
#include <initializer_list>
|
16
16
|
#include <new>
|
17
17
|
#include <utility>
|
18
18
|
|
19
|
-
|
19
|
+
namespace skia_private {
|
20
|
+
|
21
|
+
// Before trying to use THashTable, look below to see if THashMap or THashSet works for you.
|
20
22
|
// They're easier to use, usually perform the same, and have fewer sharp edges.
|
21
23
|
|
22
24
|
// T and K are treated as ordinary copyable C++ types.
|
@@ -26,15 +28,15 @@
|
|
26
28
|
// If the key is large and stored inside T, you may want to make K a const&.
|
27
29
|
// Similarly, if T is large you might want it to be a pointer.
|
28
30
|
template <typename T, typename K, typename Traits = T>
|
29
|
-
class
|
31
|
+
class THashTable {
|
30
32
|
public:
|
31
|
-
|
32
|
-
~
|
33
|
+
THashTable() = default;
|
34
|
+
~THashTable() = default;
|
33
35
|
|
34
|
-
|
35
|
-
|
36
|
+
THashTable(const THashTable& that) { *this = that; }
|
37
|
+
THashTable( THashTable&& that) { *this = std::move(that); }
|
36
38
|
|
37
|
-
|
39
|
+
THashTable& operator=(const THashTable& that) {
|
38
40
|
if (this != &that) {
|
39
41
|
fCount = that.fCount;
|
40
42
|
fCapacity = that.fCapacity;
|
@@ -46,7 +48,7 @@ public:
|
|
46
48
|
return *this;
|
47
49
|
}
|
48
50
|
|
49
|
-
|
51
|
+
THashTable& operator=(THashTable&& that) {
|
50
52
|
if (this != &that) {
|
51
53
|
fCount = that.fCount;
|
52
54
|
fCapacity = that.fCapacity;
|
@@ -58,7 +60,7 @@ public:
|
|
58
60
|
}
|
59
61
|
|
60
62
|
// Clear the table.
|
61
|
-
void reset() { *this =
|
63
|
+
void reset() { *this = THashTable(); }
|
62
64
|
|
63
65
|
// How many entries are in the table?
|
64
66
|
int count() const { return fCount; }
|
@@ -75,7 +77,7 @@ public:
|
|
75
77
|
// If you change an entry so that it no longer has the same key, all hell
|
76
78
|
// will break loose. Do not do that!
|
77
79
|
//
|
78
|
-
// Please prefer to use
|
80
|
+
// Please prefer to use THashMap or THashSet, which do not have this danger.
|
79
81
|
|
80
82
|
// The pointers returned by set() and find() are valid only until the next call to set().
|
81
83
|
// The pointers you receive in foreach() are only valid for its duration.
|
@@ -103,7 +105,7 @@ public:
|
|
103
105
|
}
|
104
106
|
index = this->next(index);
|
105
107
|
}
|
106
|
-
SkASSERT(fCapacity ==
|
108
|
+
SkASSERT(fCapacity == fCount);
|
107
109
|
return nullptr;
|
108
110
|
}
|
109
111
|
|
@@ -145,8 +147,8 @@ public:
|
|
145
147
|
|
146
148
|
fCount = 0;
|
147
149
|
fCapacity = capacity;
|
148
|
-
|
149
|
-
fSlots =
|
150
|
+
AutoTArray<Slot> oldSlots = std::move(fSlots);
|
151
|
+
fSlots = AutoTArray<Slot>(capacity);
|
150
152
|
|
151
153
|
for (int i = 0; i < oldCapacity; i++) {
|
152
154
|
Slot& s = oldSlots[i];
|
@@ -178,12 +180,12 @@ public:
|
|
178
180
|
}
|
179
181
|
|
180
182
|
// A basic iterator-like class which disallows mutation; sufficient for range-based for loops.
|
181
|
-
// Intended for use by
|
183
|
+
// Intended for use by THashMap and THashSet via begin() and end().
|
182
184
|
// Adding or removing elements may invalidate all iterators.
|
183
185
|
template <typename SlotVal>
|
184
186
|
class Iter {
|
185
187
|
public:
|
186
|
-
using TTable =
|
188
|
+
using TTable = THashTable<T, K, Traits>;
|
187
189
|
|
188
190
|
Iter(const TTable* table, int slot) : fTable(table), fSlot(slot) {}
|
189
191
|
|
@@ -411,22 +413,22 @@ private:
|
|
411
413
|
|
412
414
|
int fCount = 0,
|
413
415
|
fCapacity = 0;
|
414
|
-
|
416
|
+
AutoTArray<Slot> fSlots;
|
415
417
|
};
|
416
418
|
|
417
|
-
// Maps K->V. A more user-friendly wrapper around
|
419
|
+
// Maps K->V. A more user-friendly wrapper around THashTable, suitable for most use cases.
|
418
420
|
// K and V are treated as ordinary copyable C++ types, with no assumed relationship between the two.
|
419
421
|
template <typename K, typename V, typename HashK = SkGoodHash>
|
420
|
-
class
|
422
|
+
class THashMap {
|
421
423
|
public:
|
422
424
|
// Allow default construction and assignment.
|
423
|
-
|
425
|
+
THashMap() = default;
|
424
426
|
|
425
|
-
|
426
|
-
|
427
|
+
THashMap(THashMap<K, V, HashK>&& that) = default;
|
428
|
+
THashMap(const THashMap<K, V, HashK>& that) = default;
|
427
429
|
|
428
|
-
|
429
|
-
|
430
|
+
THashMap<K, V, HashK>& operator=(THashMap<K, V, HashK>&& that) = default;
|
431
|
+
THashMap<K, V, HashK>& operator=(const THashMap<K, V, HashK>& that) = default;
|
430
432
|
|
431
433
|
// Construct with an initializer list of key-value pairs.
|
432
434
|
struct Pair : public std::pair<K, V> {
|
@@ -435,7 +437,7 @@ public:
|
|
435
437
|
static auto Hash(const K& key) { return HashK()(key); }
|
436
438
|
};
|
437
439
|
|
438
|
-
|
440
|
+
THashMap(std::initializer_list<Pair> pairs) {
|
439
441
|
fTable.resize(pairs.size() * 5 / 3);
|
440
442
|
for (const Pair& p : pairs) {
|
441
443
|
fTable.set(p);
|
@@ -498,7 +500,7 @@ public:
|
|
498
500
|
}
|
499
501
|
|
500
502
|
// Dereferencing an iterator gives back a key-value pair, suitable for structured binding.
|
501
|
-
using Iter = typename
|
503
|
+
using Iter = typename THashTable<Pair, K>::template Iter<std::pair<K, V>>;
|
502
504
|
|
503
505
|
Iter begin() const {
|
504
506
|
return Iter::MakeBegin(&fTable);
|
@@ -509,24 +511,24 @@ public:
|
|
509
511
|
}
|
510
512
|
|
511
513
|
private:
|
512
|
-
|
514
|
+
THashTable<Pair, K> fTable;
|
513
515
|
};
|
514
516
|
|
515
517
|
// A set of T. T is treated as an ordinary copyable C++ type.
|
516
518
|
template <typename T, typename HashT = SkGoodHash>
|
517
|
-
class
|
519
|
+
class THashSet {
|
518
520
|
public:
|
519
521
|
// Allow default construction and assignment.
|
520
|
-
|
522
|
+
THashSet() = default;
|
521
523
|
|
522
|
-
|
523
|
-
|
524
|
+
THashSet(THashSet<T, HashT>&& that) = default;
|
525
|
+
THashSet(const THashSet<T, HashT>& that) = default;
|
524
526
|
|
525
|
-
|
526
|
-
|
527
|
+
THashSet<T, HashT>& operator=(THashSet<T, HashT>&& that) = default;
|
528
|
+
THashSet<T, HashT>& operator=(const THashSet<T, HashT>& that) = default;
|
527
529
|
|
528
530
|
// Construct with an initializer list of Ts.
|
529
|
-
|
531
|
+
THashSet(std::initializer_list<T> vals) {
|
530
532
|
fTable.resize(vals.size() * 5 / 3);
|
531
533
|
for (const T& val : vals) {
|
532
534
|
fTable.set(val);
|
@@ -574,7 +576,7 @@ private:
|
|
574
576
|
};
|
575
577
|
|
576
578
|
public:
|
577
|
-
using Iter = typename
|
579
|
+
using Iter = typename THashTable<T, T, Traits>::template Iter<T>;
|
578
580
|
|
579
581
|
Iter begin() const {
|
580
582
|
return Iter::MakeBegin(&fTable);
|
@@ -585,7 +587,9 @@ public:
|
|
585
587
|
}
|
586
588
|
|
587
589
|
private:
|
588
|
-
|
590
|
+
THashTable<T, T, Traits> fTable;
|
589
591
|
};
|
590
592
|
|
591
|
-
|
593
|
+
} // namespace skia_private
|
594
|
+
|
595
|
+
#endif // SkTHash_DEFINED
|
@@ -13,10 +13,14 @@ var _Skia = require("../skia/Skia");
|
|
13
13
|
|
14
14
|
var _types = require("../dom/types");
|
15
15
|
|
16
|
+
var _values = require("../values");
|
17
|
+
|
16
18
|
var _Reconciler = require("./Reconciler");
|
17
19
|
|
18
20
|
var _HostComponents = require("./HostComponents");
|
19
21
|
|
22
|
+
var _processors = require("./processors");
|
23
|
+
|
20
24
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
21
25
|
|
22
26
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
@@ -33,9 +37,21 @@ const Canvas = /*#__PURE__*/(0, _react.forwardRef)((_ref, forwardedRef) => {
|
|
33
37
|
debug,
|
34
38
|
mode,
|
35
39
|
onTouch,
|
36
|
-
onSize,
|
40
|
+
onSize: onSizeReanimatedOrSkia,
|
37
41
|
...props
|
38
42
|
} = _ref;
|
43
|
+
const size = (0, _values.useValue)({
|
44
|
+
width: 0,
|
45
|
+
height: 0
|
46
|
+
});
|
47
|
+
const onSize = (0, _processors.isValue)(onSizeReanimatedOrSkia) ? onSizeReanimatedOrSkia : size;
|
48
|
+
(0, _react.useEffect)(() => {
|
49
|
+
if (!(0, _processors.isValue)(onSizeReanimatedOrSkia) && onSizeReanimatedOrSkia) {
|
50
|
+
return size.addListener(v => onSizeReanimatedOrSkia.value = v);
|
51
|
+
}
|
52
|
+
|
53
|
+
return undefined;
|
54
|
+
}, [onSizeReanimatedOrSkia, size]);
|
39
55
|
const innerRef = useCanvasRef();
|
40
56
|
const ref = useCombinedRefs(forwardedRef, innerRef);
|
41
57
|
const redraw = (0, _react.useCallback)(() => {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["useCanvasRef","useRef","Canvas","forwardRef","forwardedRef","children","style","debug","mode","onTouch","onSize","props","innerRef","ref","useCombinedRefs","redraw","useCallback","current","getNativeId","id","nativeId","registerValues","values","root","useMemo","SkiaRoot","Skia","
|
1
|
+
{"version":3,"names":["useCanvasRef","useRef","Canvas","forwardRef","forwardedRef","children","style","debug","mode","onTouch","onSize","onSizeReanimatedOrSkia","props","size","useValue","width","height","isValue","useEffect","addListener","v","value","undefined","innerRef","ref","useCombinedRefs","redraw","useCallback","current","getNativeId","id","nativeId","registerValues","values","root","useMemo","SkiaRoot","Skia","render","unmount","NATIVE_DOM","dom","canvas","info","touches","ctx","JsiDrawingContext","refs","targetRef","React","forEach"],"sources":["Canvas.tsx"],"sourcesContent":["import React, {\n useEffect,\n useCallback,\n useMemo,\n forwardRef,\n useRef,\n} from \"react\";\nimport type {\n RefObject,\n ReactNode,\n MutableRefObject,\n ForwardedRef,\n} from \"react\";\n\nimport { SkiaDomView, SkiaView } from \"../views\";\nimport { Skia } from \"../skia/Skia\";\nimport type { TouchHandler, SkiaBaseViewProps } from \"../views\";\nimport type { SkiaValue } from \"../values/types\";\nimport { JsiDrawingContext } from \"../dom/types\";\nimport { useValue } from \"../values\";\n\nimport { SkiaRoot } from \"./Reconciler\";\nimport { NATIVE_DOM } from \"./HostComponents\";\nimport { isValue } from \"./processors\";\n\nexport const useCanvasRef = () => useRef<SkiaDomView>(null);\n\nexport interface CanvasProps extends SkiaBaseViewProps {\n ref?: RefObject<SkiaDomView>;\n children: ReactNode;\n onTouch?: TouchHandler;\n}\n\nexport const Canvas = forwardRef<SkiaDomView, CanvasProps>(\n (\n {\n children,\n style,\n debug,\n mode,\n onTouch,\n onSize: onSizeReanimatedOrSkia,\n ...props\n },\n forwardedRef\n ) => {\n const size = useValue({ width: 0, height: 0 });\n const onSize = isValue(onSizeReanimatedOrSkia)\n ? onSizeReanimatedOrSkia\n : size;\n useEffect(() => {\n if (!isValue(onSizeReanimatedOrSkia) && onSizeReanimatedOrSkia) {\n return size.addListener((v) => (onSizeReanimatedOrSkia.value = v));\n }\n return undefined;\n }, [onSizeReanimatedOrSkia, size]);\n const innerRef = useCanvasRef();\n const ref = useCombinedRefs(forwardedRef, innerRef);\n const redraw = useCallback(() => {\n innerRef.current?.redraw();\n }, [innerRef]);\n const getNativeId = useCallback(() => {\n const id = innerRef.current?.nativeId ?? -1;\n return id;\n }, [innerRef]);\n\n const registerValues = useCallback(\n (values: Array<SkiaValue<unknown>>) => {\n if (ref.current !== null) {\n return ref.current.registerValues(values);\n }\n return () => {};\n },\n [ref]\n );\n const root = useMemo(\n () => new SkiaRoot(Skia, registerValues, redraw, getNativeId),\n [redraw, registerValues, getNativeId]\n );\n\n // Render effect\n useEffect(() => {\n root.render(children);\n }, [children, root, redraw]);\n\n useEffect(() => {\n return () => {\n root.unmount();\n };\n }, [root]);\n if (NATIVE_DOM) {\n return (\n <SkiaDomView\n ref={ref}\n style={style}\n root={root.dom}\n onTouch={onTouch}\n onSize={onSize}\n mode={mode}\n debug={debug}\n {...props}\n />\n );\n } else {\n return (\n <SkiaView\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={ref as any}\n style={style}\n mode={mode}\n debug={debug}\n onSize={onSize}\n onDraw={(canvas, info) => {\n onTouch && onTouch(info.touches);\n const ctx = new JsiDrawingContext(Skia, canvas);\n root.dom.render(ctx);\n }}\n {...props}\n />\n );\n }\n }\n) as React.FC<CanvasProps & React.RefAttributes<SkiaDomView>>;\n\n/**\n * Combines a list of refs into a single ref. This can be used to provide\n * both a forwarded ref and an internal ref keeping the same functionality\n * on both of the refs.\n * @param refs Array of refs to combine\n * @returns A single ref that can be used in a ref prop.\n */\nconst useCombinedRefs = <T,>(\n ...refs: Array<MutableRefObject<T> | ForwardedRef<T>>\n) => {\n const targetRef = React.useRef<T>(null);\n React.useEffect(() => {\n refs.forEach((ref) => {\n if (ref) {\n if (typeof ref === \"function\") {\n ref(targetRef.current);\n } else {\n ref.current = targetRef.current;\n }\n }\n });\n }, [refs]);\n return targetRef;\n};\n"],"mappings":";;;;;;;AAAA;;AAcA;;AACA;;AAGA;;AACA;;AAEA;;AACA;;AACA;;;;;;;;AAEO,MAAMA,YAAY,GAAG,MAAM,IAAAC,aAAA,EAAoB,IAApB,CAA3B;;;AAQA,MAAMC,MAAM,gBAAG,IAAAC,iBAAA,EACpB,OAUEC,YAVF,KAWK;EAAA,IAVH;IACEC,QADF;IAEEC,KAFF;IAGEC,KAHF;IAIEC,IAJF;IAKEC,OALF;IAMEC,MAAM,EAAEC,sBANV;IAOE,GAAGC;EAPL,CAUG;EACH,MAAMC,IAAI,GAAG,IAAAC,gBAAA,EAAS;IAAEC,KAAK,EAAE,CAAT;IAAYC,MAAM,EAAE;EAApB,CAAT,CAAb;EACA,MAAMN,MAAM,GAAG,IAAAO,mBAAA,EAAQN,sBAAR,IACXA,sBADW,GAEXE,IAFJ;EAGA,IAAAK,gBAAA,EAAU,MAAM;IACd,IAAI,CAAC,IAAAD,mBAAA,EAAQN,sBAAR,CAAD,IAAoCA,sBAAxC,EAAgE;MAC9D,OAAOE,IAAI,CAACM,WAAL,CAAkBC,CAAD,IAAQT,sBAAsB,CAACU,KAAvB,GAA+BD,CAAxD,CAAP;IACD;;IACD,OAAOE,SAAP;EACD,CALD,EAKG,CAACX,sBAAD,EAAyBE,IAAzB,CALH;EAMA,MAAMU,QAAQ,GAAGvB,YAAY,EAA7B;EACA,MAAMwB,GAAG,GAAGC,eAAe,CAACrB,YAAD,EAAemB,QAAf,CAA3B;EACA,MAAMG,MAAM,GAAG,IAAAC,kBAAA,EAAY,MAAM;IAAA;;IAC/B,qBAAAJ,QAAQ,CAACK,OAAT,wEAAkBF,MAAlB;EACD,CAFc,EAEZ,CAACH,QAAD,CAFY,CAAf;EAGA,MAAMM,WAAW,GAAG,IAAAF,kBAAA,EAAY,MAAM;IAAA;;IACpC,MAAMG,EAAE,GAAG,uBAAAP,QAAQ,CAACK,OAAT,0EAAkBG,QAAlB,KAA8B,CAAC,CAA1C;IACA,OAAOD,EAAP;EACD,CAHmB,EAGjB,CAACP,QAAD,CAHiB,CAApB;EAKA,MAAMS,cAAc,GAAG,IAAAL,kBAAA,EACpBM,MAAD,IAAuC;IACrC,IAAIT,GAAG,CAACI,OAAJ,KAAgB,IAApB,EAA0B;MACxB,OAAOJ,GAAG,CAACI,OAAJ,CAAYI,cAAZ,CAA2BC,MAA3B,CAAP;IACD;;IACD,OAAO,MAAM,CAAE,CAAf;EACD,CANoB,EAOrB,CAACT,GAAD,CAPqB,CAAvB;EASA,MAAMU,IAAI,GAAG,IAAAC,cAAA,EACX,MAAM,IAAIC,oBAAJ,CAAaC,UAAb,EAAmBL,cAAnB,EAAmCN,MAAnC,EAA2CG,WAA3C,CADK,EAEX,CAACH,MAAD,EAASM,cAAT,EAAyBH,WAAzB,CAFW,CAAb,CA9BG,CAmCH;;EACA,IAAAX,gBAAA,EAAU,MAAM;IACdgB,IAAI,CAACI,MAAL,CAAYjC,QAAZ;EACD,CAFD,EAEG,CAACA,QAAD,EAAW6B,IAAX,EAAiBR,MAAjB,CAFH;EAIA,IAAAR,gBAAA,EAAU,MAAM;IACd,OAAO,MAAM;MACXgB,IAAI,CAACK,OAAL;IACD,CAFD;EAGD,CAJD,EAIG,CAACL,IAAD,CAJH;;EAKA,IAAIM,0BAAJ,EAAgB;IACd,oBACE,6BAAC,kBAAD;MACE,GAAG,EAAEhB,GADP;MAEE,KAAK,EAAElB,KAFT;MAGE,IAAI,EAAE4B,IAAI,CAACO,GAHb;MAIE,OAAO,EAAEhC,OAJX;MAKE,MAAM,EAAEC,MALV;MAME,IAAI,EAAEF,IANR;MAOE,KAAK,EAAED;IAPT,GAQMK,KARN,EADF;EAYD,CAbD,MAaO;IACL,oBACE,6BAAC,eAAD,CACE;IADF;MAEE,GAAG,EAAEY,GAFP;MAGE,KAAK,EAAElB,KAHT;MAIE,IAAI,EAAEE,IAJR;MAKE,KAAK,EAAED,KALT;MAME,MAAM,EAAEG,MANV;MAOE,MAAM,EAAE,CAACgC,MAAD,EAASC,IAAT,KAAkB;QACxBlC,OAAO,IAAIA,OAAO,CAACkC,IAAI,CAACC,OAAN,CAAlB;QACA,MAAMC,GAAG,GAAG,IAAIC,wBAAJ,CAAsBT,UAAtB,EAA4BK,MAA5B,CAAZ;QACAR,IAAI,CAACO,GAAL,CAASH,MAAT,CAAgBO,GAAhB;MACD;IAXH,GAYMjC,KAZN,EADF;EAgBD;AACF,CAxFmB,CAAf;AA2FP;AACA;AACA;AACA;AACA;AACA;AACA;;;;AACA,MAAMa,eAAe,GAAG,YAEnB;EAAA,kCADAsB,IACA;IADAA,IACA;EAAA;;EACH,MAAMC,SAAS,GAAGC,cAAA,CAAMhD,MAAN,CAAgB,IAAhB,CAAlB;;EACAgD,cAAA,CAAM/B,SAAN,CAAgB,MAAM;IACpB6B,IAAI,CAACG,OAAL,CAAc1B,GAAD,IAAS;MACpB,IAAIA,GAAJ,EAAS;QACP,IAAI,OAAOA,GAAP,KAAe,UAAnB,EAA+B;UAC7BA,GAAG,CAACwB,SAAS,CAACpB,OAAX,CAAH;QACD,CAFD,MAEO;UACLJ,GAAG,CAACI,OAAJ,GAAcoB,SAAS,CAACpB,OAAxB;QACD;MACF;IACF,CARD;EASD,CAVD,EAUG,CAACmB,IAAD,CAVH;;EAWA,OAAOC,SAAP;AACD,CAhBD"}
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import type { SkData, DataSourceParam,
|
2
|
-
export declare const useRawData: <T extends
|
1
|
+
import type { SkData, DataSourceParam, BaseSkJSIInstance } from "../types";
|
2
|
+
export declare const useRawData: <T extends BaseSkJSIInstance>(source: DataSourceParam, factory: (data: SkData) => T | null, onError?: ((err: Error) => void) | undefined) => T | null;
|
3
3
|
export declare const useData: (source: DataSourceParam, onError?: ((err: Error) => void) | undefined) => SkData | null;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["factoryWrapper","data2","factory","onError","factoryResult","Error","loadData","source","undefined","Promise","resolve","Uint8Array","Skia","Data","fromBytes","uri","Platform","resolveAsset","fromURI","then","d","useLoading","loader","mounted","useRef","data","setData","useState","dataRef","useEffect","current","value","dispose","useRawData","identity","useData"],"sources":["Data.ts"],"sourcesContent":["import { useEffect, useRef, useState } from \"react\";\n\nimport { Skia } from \"../Skia\";\nimport type { SkData, DataSourceParam,
|
1
|
+
{"version":3,"names":["factoryWrapper","data2","factory","onError","factoryResult","Error","loadData","source","undefined","Promise","resolve","Uint8Array","Skia","Data","fromBytes","uri","Platform","resolveAsset","fromURI","then","d","useLoading","loader","mounted","useRef","data","setData","useState","dataRef","useEffect","current","value","dispose","useRawData","identity","useData"],"sources":["Data.ts"],"sourcesContent":["import { useEffect, useRef, useState } from \"react\";\n\nimport { Skia } from \"../Skia\";\nimport type { SkData, DataSourceParam, BaseSkJSIInstance } from \"../types\";\nimport { Platform } from \"../../Platform\";\n\nconst factoryWrapper = <T>(\n data2: SkData,\n factory: (data: SkData) => T,\n onError?: (err: Error) => void\n) => {\n const factoryResult = factory(data2);\n if (factoryResult === null) {\n onError && onError(new Error(\"Could not load data\"));\n return null;\n } else {\n return factoryResult;\n }\n};\n\nconst loadData = <T>(\n source: DataSourceParam,\n factory: (data: SkData) => T | null,\n onError?: (err: Error) => void\n): Promise<T | null> => {\n if (source === null || source === undefined) {\n return new Promise((resolve) => resolve(null));\n } else if (source instanceof Uint8Array) {\n return new Promise((resolve) =>\n resolve(factoryWrapper(Skia.Data.fromBytes(source), factory, onError))\n );\n } else {\n const uri =\n typeof source === \"string\" ? source : Platform.resolveAsset(source);\n return Skia.Data.fromURI(uri).then((d) =>\n factoryWrapper(d, factory, onError)\n );\n }\n};\nconst useLoading = <T extends BaseSkJSIInstance>(\n source: DataSourceParam,\n loader: () => Promise<T | null>\n) => {\n const mounted = useRef(false);\n const [data, setData] = useState<T | null>(null);\n const dataRef = useRef<T | null>(null);\n useEffect(() => {\n mounted.current = true;\n loader().then((value) => {\n if (mounted.current) {\n setData(value);\n dataRef.current = value;\n }\n });\n return () => {\n dataRef.current?.dispose();\n mounted.current = false;\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [source]);\n return data;\n};\n\nexport const useRawData = <T extends BaseSkJSIInstance>(\n source: DataSourceParam,\n factory: (data: SkData) => T | null,\n onError?: (err: Error) => void\n) => useLoading(source, () => loadData<T>(source, factory, onError));\n\nconst identity = (data: SkData) => data;\n\nexport const useData = (\n source: DataSourceParam,\n onError?: (err: Error) => void\n) => useRawData(source, identity, onError);\n"],"mappings":";;;;;;;AAAA;;AAEA;;AAEA;;AAEA,MAAMA,cAAc,GAAG,CACrBC,KADqB,EAErBC,OAFqB,EAGrBC,OAHqB,KAIlB;EACH,MAAMC,aAAa,GAAGF,OAAO,CAACD,KAAD,CAA7B;;EACA,IAAIG,aAAa,KAAK,IAAtB,EAA4B;IAC1BD,OAAO,IAAIA,OAAO,CAAC,IAAIE,KAAJ,CAAU,qBAAV,CAAD,CAAlB;IACA,OAAO,IAAP;EACD,CAHD,MAGO;IACL,OAAOD,aAAP;EACD;AACF,CAZD;;AAcA,MAAME,QAAQ,GAAG,CACfC,MADe,EAEfL,OAFe,EAGfC,OAHe,KAIO;EACtB,IAAII,MAAM,KAAK,IAAX,IAAmBA,MAAM,KAAKC,SAAlC,EAA6C;IAC3C,OAAO,IAAIC,OAAJ,CAAaC,OAAD,IAAaA,OAAO,CAAC,IAAD,CAAhC,CAAP;EACD,CAFD,MAEO,IAAIH,MAAM,YAAYI,UAAtB,EAAkC;IACvC,OAAO,IAAIF,OAAJ,CAAaC,OAAD,IACjBA,OAAO,CAACV,cAAc,CAACY,UAAA,CAAKC,IAAL,CAAUC,SAAV,CAAoBP,MAApB,CAAD,EAA8BL,OAA9B,EAAuCC,OAAvC,CAAf,CADF,CAAP;EAGD,CAJM,MAIA;IACL,MAAMY,GAAG,GACP,OAAOR,MAAP,KAAkB,QAAlB,GAA6BA,MAA7B,GAAsCS,kBAAA,CAASC,YAAT,CAAsBV,MAAtB,CADxC;IAEA,OAAOK,UAAA,CAAKC,IAAL,CAAUK,OAAV,CAAkBH,GAAlB,EAAuBI,IAAvB,CAA6BC,CAAD,IACjCpB,cAAc,CAACoB,CAAD,EAAIlB,OAAJ,EAAaC,OAAb,CADT,CAAP;EAGD;AACF,CAlBD;;AAmBA,MAAMkB,UAAU,GAAG,CACjBd,MADiB,EAEjBe,MAFiB,KAGd;EACH,MAAMC,OAAO,GAAG,IAAAC,aAAA,EAAO,KAAP,CAAhB;EACA,MAAM,CAACC,IAAD,EAAOC,OAAP,IAAkB,IAAAC,eAAA,EAAmB,IAAnB,CAAxB;EACA,MAAMC,OAAO,GAAG,IAAAJ,aAAA,EAAiB,IAAjB,CAAhB;EACA,IAAAK,gBAAA,EAAU,MAAM;IACdN,OAAO,CAACO,OAAR,GAAkB,IAAlB;IACAR,MAAM,GAAGH,IAAT,CAAeY,KAAD,IAAW;MACvB,IAAIR,OAAO,CAACO,OAAZ,EAAqB;QACnBJ,OAAO,CAACK,KAAD,CAAP;QACAH,OAAO,CAACE,OAAR,GAAkBC,KAAlB;MACD;IACF,CALD;IAMA,OAAO,MAAM;MAAA;;MACX,oBAAAH,OAAO,CAACE,OAAR,sEAAiBE,OAAjB;MACAT,OAAO,CAACO,OAAR,GAAkB,KAAlB;IACD,CAHD,CARc,CAYd;EACD,CAbD,EAaG,CAACvB,MAAD,CAbH;EAcA,OAAOkB,IAAP;AACD,CAtBD;;AAwBO,MAAMQ,UAAU,GAAG,CACxB1B,MADwB,EAExBL,OAFwB,EAGxBC,OAHwB,KAIrBkB,UAAU,CAACd,MAAD,EAAS,MAAMD,QAAQ,CAAIC,MAAJ,EAAYL,OAAZ,EAAqBC,OAArB,CAAvB,CAJR;;;;AAMP,MAAM+B,QAAQ,GAAIT,IAAD,IAAkBA,IAAnC;;AAEO,MAAMU,OAAO,GAAG,CACrB5B,MADqB,EAErBJ,OAFqB,KAGlB8B,UAAU,CAAC1B,MAAD,EAAS2B,QAAT,EAAmB/B,OAAnB,CAHR"}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import type {
|
2
|
-
export declare type SkData = SkJSIInstance<"Data"
|
1
|
+
import type { SkJSIInstance } from "../JsiInstance";
|
2
|
+
export declare type SkData = SkJSIInstance<"Data">;
|
3
3
|
declare type RNModule = number;
|
4
4
|
declare type ESModule = {
|
5
5
|
__esModule: true;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["isRNModule","mod"],"sources":["Data.ts"],"sourcesContent":["import type {
|
1
|
+
{"version":3,"names":["isRNModule","mod"],"sources":["Data.ts"],"sourcesContent":["import type { SkJSIInstance } from \"../JsiInstance\";\n\nexport type SkData = SkJSIInstance<\"Data\">;\n\ntype RNModule = number;\ntype ESModule = {\n __esModule: true;\n default: string;\n};\nexport type DataModule = RNModule | ESModule;\nexport type DataSource = DataModule | string | Uint8Array;\nexport type DataSourceParam = DataSource | null | undefined;\n\nexport const isRNModule = (mod: DataModule): mod is RNModule =>\n typeof mod === \"number\";\n"],"mappings":";;;;;;;AAaO,MAAMA,UAAU,GAAIC,GAAD,IACxB,OAAOA,GAAP,KAAe,QADV"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { SkMatrix } from "../Matrix";
|
2
|
-
import type {
|
2
|
+
import type { SkJSIInstance } from "../JsiInstance";
|
3
3
|
import type { TileMode } from "../ImageFilter";
|
4
4
|
import type { SkShader } from "../Shader";
|
5
5
|
export declare enum FilterMode {
|
@@ -16,7 +16,7 @@ export declare enum ImageFormat {
|
|
16
16
|
PNG = 4,
|
17
17
|
WEBP = 6
|
18
18
|
}
|
19
|
-
export interface SkImage extends SkJSIInstance<"Image"
|
19
|
+
export interface SkImage extends SkJSIInstance<"Image"> {
|
20
20
|
/**
|
21
21
|
* Returns the possibly scaled height of the image.
|
22
22
|
*/
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["FilterMode","MipmapMode","ImageFormat"],"sources":["Image.ts"],"sourcesContent":["import type { SkMatrix } from \"../Matrix\";\nimport type {
|
1
|
+
{"version":3,"names":["FilterMode","MipmapMode","ImageFormat"],"sources":["Image.ts"],"sourcesContent":["import type { SkMatrix } from \"../Matrix\";\nimport type { SkJSIInstance } from \"../JsiInstance\";\nimport type { TileMode } from \"../ImageFilter\";\nimport type { SkShader } from \"../Shader\";\n\nexport enum FilterMode {\n Nearest,\n Linear,\n}\n\nexport enum MipmapMode {\n None,\n Nearest,\n Linear,\n}\n\nexport enum ImageFormat {\n JPEG = 3,\n PNG = 4,\n WEBP = 6,\n}\n\nexport interface SkImage extends SkJSIInstance<\"Image\"> {\n /**\n * Returns the possibly scaled height of the image.\n */\n height(): number;\n\n /**\n * Returns the possibly scaled width of the image.\n */\n width(): number;\n\n /**\n * Returns this image as a shader with the specified tiling. It will use cubic sampling.\n * @param tx - tile mode in the x direction.\n * @param ty - tile mode in the y direction.\n * @param fm - The filter mode. (default nearest)\n * @param mm - The mipmap mode. Note: for settings other than None, the image must have mipmaps (default none)\n * calculated with makeCopyWithDefaultMipmaps;\n * @param localMatrix\n */\n makeShaderOptions(\n tx: TileMode,\n ty: TileMode,\n fm: FilterMode,\n mm: MipmapMode,\n localMatrix?: SkMatrix\n ): SkShader;\n\n /**\n * Returns this image as a shader with the specified tiling. It will use cubic sampling.\n * @param tx - tile mode in the x direction.\n * @param ty - tile mode in the y direction.\n * @param B - See CubicResampler in SkSamplingOptions.h for more information\n * @param C - See CubicResampler in SkSamplingOptions.h for more information\n * @param localMatrix\n */\n makeShaderCubic(\n tx: TileMode,\n ty: TileMode,\n B: number,\n C: number,\n localMatrix?: SkMatrix\n ): SkShader;\n\n /** Encodes Image pixels, returning result as UInt8Array. Returns existing\n encoded data if present; otherwise, SkImage is encoded with\n SkEncodedImageFormat::kPNG. Skia must be built with SK_ENCODE_PNG to encode\n SkImage.\n\n Returns nullptr if existing encoded data is missing or invalid, and\n encoding fails.\n\n @param fmt - PNG is the default value.\n @param quality - a value from 0 to 100; 100 is the least lossy. May be ignored.\n\n @return Uint8Array with data\n */\n encodeToBytes(fmt?: ImageFormat, quality?: number): Uint8Array;\n\n /** Encodes Image pixels, returning result as a base64 encoded string. Returns existing\n encoded data if present; otherwise, SkImage is encoded with\n SkEncodedImageFormat::kPNG. Skia must be built with SK_ENCODE_PNG to encode\n SkImage.\n\n Returns nullptr if existing encoded data is missing or invalid, and\n encoding fails.\n\n @param fmt - PNG is the default value.\n @param quality - a value from 0 to 100; 100 is the least lossy. May be ignored.\n\n @return base64 encoded string of data\n */\n encodeToBase64(fmt?: ImageFormat, quality?: number): string;\n\n /**\n * Returns raster image or lazy image. Copies SkImage backed by GPU texture\n * into CPU memory if needed. Returns original SkImage if decoded in raster\n * bitmap, or if encoded in a stream.\n */\n makeNonTextureImage(): SkImage;\n}\n"],"mappings":";;;;;;IAKYA,U;;;WAAAA,U;EAAAA,U,CAAAA,U;EAAAA,U,CAAAA,U;GAAAA,U,0BAAAA,U;;IAKAC,U;;;WAAAA,U;EAAAA,U,CAAAA,U;EAAAA,U,CAAAA,U;EAAAA,U,CAAAA,U;GAAAA,U,0BAAAA,U;;IAMAC,W;;;WAAAA,W;EAAAA,W,CAAAA,W;EAAAA,W,CAAAA,W;EAAAA,W,CAAAA,W;GAAAA,W,2BAAAA,W"}
|
@@ -1,6 +1,6 @@
|
|
1
|
-
export interface
|
2
|
-
__typename__: T;
|
3
|
-
}
|
4
|
-
export interface JsiDisposable {
|
1
|
+
export interface BaseSkJSIInstance {
|
5
2
|
dispose: () => void;
|
6
3
|
}
|
4
|
+
export interface SkJSIInstance<T extends string> extends BaseSkJSIInstance {
|
5
|
+
__typename__: T;
|
6
|
+
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["JsiInstance.ts"],"sourcesContent":["export interface
|
1
|
+
{"version":3,"names":[],"sources":["JsiInstance.ts"],"sourcesContent":["export interface BaseSkJSIInstance {\n dispose: () => void;\n}\n\nexport interface SkJSIInstance<T extends string> extends BaseSkJSIInstance {\n __typename__: T;\n}\n"],"mappings":""}
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import type {
|
2
|
-
export interface SkSVG extends SkJSIInstance<"SVG"
|
1
|
+
import type { SkJSIInstance } from "../JsiInstance";
|
2
|
+
export interface SkSVG extends SkJSIInstance<"SVG"> {
|
3
3
|
width(): number;
|
4
4
|
height(): number;
|
5
5
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["SVG.ts"],"sourcesContent":["import type {
|
1
|
+
{"version":3,"names":[],"sources":["SVG.ts"],"sourcesContent":["import type { SkJSIInstance } from \"../JsiInstance\";\n\nexport interface SkSVG extends SkJSIInstance<\"SVG\"> {\n width(): number;\n height(): number;\n}\n"],"mappings":""}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import type {
|
2
|
-
export declare type SkTypeface = SkJSIInstance<"Typeface"
|
1
|
+
import type { SkJSIInstance } from "../JsiInstance";
|
2
|
+
export declare type SkTypeface = SkJSIInstance<"Typeface">;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":[],"sources":["Typeface.ts"],"sourcesContent":["import type {
|
1
|
+
{"version":3,"names":[],"sources":["Typeface.ts"],"sourcesContent":["import type { SkJSIInstance } from \"../JsiInstance\";\n\nexport type SkTypeface = SkJSIInstance<\"Typeface\">;\n"],"mappings":""}
|
@@ -11,6 +11,7 @@ export declare abstract class BaseHostObject<T, N extends string> extends Host i
|
|
11
11
|
readonly __typename__: N;
|
12
12
|
ref: T;
|
13
13
|
constructor(CanvasKit: CanvasKit, ref: T, typename: N);
|
14
|
+
abstract dispose: () => void;
|
14
15
|
}
|
15
16
|
export declare abstract class HostObject<T, N extends string> extends BaseHostObject<T, N> {
|
16
17
|
static fromValue<T>(value: SkJSIInstance<string>): T;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["NotImplementedOnRNWeb","Error","constructor","msg","Host","CanvasKit","BaseHostObject","ref","typename","__typename__","HostObject","fromValue","value","ckEnum","optEnum","undefined"],"sources":["Host.ts"],"sourcesContent":["import type { CanvasKit, EmbindEnumEntity } from \"canvaskit-wasm\";\n\nimport type { SkJSIInstance } from \"../types\";\n\nexport class NotImplementedOnRNWeb extends Error {\n constructor(msg?: string) {\n super(msg ?? \"Not implemented on React Native Web\");\n }\n}\n\nexport abstract class Host {\n readonly CanvasKit: CanvasKit;\n\n constructor(CanvasKit: CanvasKit) {\n this.CanvasKit = CanvasKit;\n }\n}\n\nexport abstract class BaseHostObject<T, N extends string>\n extends Host\n implements SkJSIInstance<N>\n{\n readonly __typename__: N;\n ref: T;\n\n constructor(CanvasKit: CanvasKit, ref: T, typename: N) {\n super(CanvasKit);\n this.ref = ref;\n this.__typename__ = typename;\n }\n}\n\nexport abstract class HostObject<T, N extends string> extends BaseHostObject<\n T,\n N\n> {\n static fromValue<T>(value: SkJSIInstance<string>) {\n return (value as HostObject<T, string>).ref;\n }\n}\n\nexport const ckEnum = (value: number): EmbindEnumEntity => ({ value });\nexport const optEnum = (\n value: number | undefined\n): EmbindEnumEntity | undefined =>\n value === undefined ? undefined : { value };\n"],"mappings":";;;;;;;;;AAIO,MAAMA,qBAAN,SAAoCC,KAApC,CAA0C;EAC/CC,WAAW,CAACC,GAAD,EAAe;IACxB,MAAMA,GAAG,IAAI,qCAAb;EACD;;AAH8C;;;;AAM1C,MAAeC,IAAf,CAAoB;EAGzBF,WAAW,CAACG,SAAD,EAAuB;IAAA;;IAChC,KAAKA,SAAL,GAAiBA,SAAjB;EACD;;AALwB;;;;AAQpB,MAAeC,cAAf,SACGF,IADH,CAGP;EAIEF,WAAW,CAACG,SAAD,EAAuBE,GAAvB,EAA+BC,QAA/B,EAA4C;IACrD,MAAMH,SAAN;;IADqD;;IAAA;;IAErD,KAAKE,GAAL,GAAWA,GAAX;IACA,KAAKE,YAAL,GAAoBD,QAApB;EACD;;AARH;;;;
|
1
|
+
{"version":3,"names":["NotImplementedOnRNWeb","Error","constructor","msg","Host","CanvasKit","BaseHostObject","ref","typename","__typename__","HostObject","fromValue","value","ckEnum","optEnum","undefined"],"sources":["Host.ts"],"sourcesContent":["import type { CanvasKit, EmbindEnumEntity } from \"canvaskit-wasm\";\n\nimport type { SkJSIInstance } from \"../types\";\n\nexport class NotImplementedOnRNWeb extends Error {\n constructor(msg?: string) {\n super(msg ?? \"Not implemented on React Native Web\");\n }\n}\n\nexport abstract class Host {\n readonly CanvasKit: CanvasKit;\n\n constructor(CanvasKit: CanvasKit) {\n this.CanvasKit = CanvasKit;\n }\n}\n\nexport abstract class BaseHostObject<T, N extends string>\n extends Host\n implements SkJSIInstance<N>\n{\n readonly __typename__: N;\n ref: T;\n\n constructor(CanvasKit: CanvasKit, ref: T, typename: N) {\n super(CanvasKit);\n this.ref = ref;\n this.__typename__ = typename;\n }\n\n abstract dispose: () => void;\n}\n\nexport abstract class HostObject<T, N extends string> extends BaseHostObject<\n T,\n N\n> {\n static fromValue<T>(value: SkJSIInstance<string>) {\n return (value as HostObject<T, string>).ref;\n }\n}\n\nexport const ckEnum = (value: number): EmbindEnumEntity => ({ value });\nexport const optEnum = (\n value: number | undefined\n): EmbindEnumEntity | undefined =>\n value === undefined ? undefined : { value };\n"],"mappings":";;;;;;;;;AAIO,MAAMA,qBAAN,SAAoCC,KAApC,CAA0C;EAC/CC,WAAW,CAACC,GAAD,EAAe;IACxB,MAAMA,GAAG,IAAI,qCAAb;EACD;;AAH8C;;;;AAM1C,MAAeC,IAAf,CAAoB;EAGzBF,WAAW,CAACG,SAAD,EAAuB;IAAA;;IAChC,KAAKA,SAAL,GAAiBA,SAAjB;EACD;;AALwB;;;;AAQpB,MAAeC,cAAf,SACGF,IADH,CAGP;EAIEF,WAAW,CAACG,SAAD,EAAuBE,GAAvB,EAA+BC,QAA/B,EAA4C;IACrD,MAAMH,SAAN;;IADqD;;IAAA;;IAAA;;IAErD,KAAKE,GAAL,GAAWA,GAAX;IACA,KAAKE,YAAL,GAAoBD,QAApB;EACD;;AARH;;;;AAaO,MAAeE,UAAf,SAAuDJ,cAAvD,CAGL;EACgB,OAATK,SAAS,CAAIC,KAAJ,EAAkC;IAChD,OAAQA,KAAD,CAAiCL,GAAxC;EACD;;AAHD;;;;AAMK,MAAMM,MAAM,GAAID,KAAD,KAAsC;EAAEA;AAAF,CAAtC,CAAf;;;;AACA,MAAME,OAAO,GAClBF,KADqB,IAGrBA,KAAK,KAAKG,SAAV,GAAsBA,SAAtB,GAAkC;EAAEH;AAAF,CAH7B"}
|