@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
package/android/CMakeLists.txt
CHANGED
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.4.1)
|
|
3
3
|
|
4
4
|
set (CMAKE_VERBOSE_MAKEFILE ON)
|
5
5
|
set (CMAKE_CXX_STANDARD 17)
|
6
|
-
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSK_GL -DSK_BUILD_FOR_ANDROID -DFOLLY_NO_CONFIG=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 -DFOLLY_HAVE_MEMRCHR=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_MOBILE=1 -DON_ANDROID -DONANDROID")
|
6
|
+
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSK_GL -DSK_GANESH -DSK_BUILD_FOR_ANDROID -DFOLLY_NO_CONFIG=1 -DFOLLY_HAVE_CLOCK_GETTIME=1 -DFOLLY_HAVE_MEMRCHR=1 -DFOLLY_USE_LIBCPP=1 -DFOLLY_MOBILE=1 -DON_ANDROID -DONANDROID")
|
7
7
|
|
8
8
|
set (PACKAGE_NAME "rnskia")
|
9
9
|
set (SKIA_LIB "skia")
|
package/android/build.gradle
CHANGED
@@ -101,7 +101,7 @@ sk_sp<SkImage> JniPlatformContext::takeScreenshotFromViewTag(size_t tag) {
|
|
101
101
|
// Create pixmap from pixels and make a copy of it so that
|
102
102
|
// the SkImage owns its own pixels
|
103
103
|
SkPixmap pm(skInfo, pixels, bmi.stride);
|
104
|
-
auto skImage =
|
104
|
+
auto skImage = SkImages::RasterFromPixmapCopy(pm);
|
105
105
|
|
106
106
|
// Unlock pixels
|
107
107
|
AndroidBitmap_unlockPixels(env, bitmap);
|
@@ -23,23 +23,8 @@ public:
|
|
23
23
|
: JsiSkWrappingSkPtrHostObject<SkColorFilter>(std::move(context),
|
24
24
|
std::move(colorFilter)) {}
|
25
25
|
|
26
|
-
|
27
|
-
|
28
|
-
return jsi::String::createFromUtf8(runtime, "ColorFilter");
|
29
|
-
}
|
30
|
-
|
31
|
-
JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkColorFilter,
|
32
|
-
__typename__))
|
33
|
-
|
34
|
-
/**
|
35
|
-
Returns the underlying object from a host object of this type
|
36
|
-
*/
|
37
|
-
static sk_sp<SkColorFilter> fromValue(jsi::Runtime &runtime,
|
38
|
-
const jsi::Value &obj) {
|
39
|
-
return obj.asObject(runtime)
|
40
|
-
.asHostObject<JsiSkColorFilter>(runtime)
|
41
|
-
->getObject();
|
42
|
-
}
|
26
|
+
EXPORT_JSI_API_TYPENAME(JsiSkColorFilter, "ColorFilter")
|
27
|
+
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkColorFilter, dispose))
|
43
28
|
};
|
44
29
|
|
45
30
|
} // namespace RNSkia
|
@@ -68,26 +68,12 @@ public:
|
|
68
68
|
return JsiSkPath::toValue(runtime, getContext(), std::move(path));
|
69
69
|
}
|
70
70
|
|
71
|
-
|
72
|
-
return jsi::String::createFromUtf8(runtime, "ContourMeasure");
|
73
|
-
}
|
74
|
-
|
75
|
-
JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkContourMeasure,
|
76
|
-
__typename__))
|
71
|
+
EXPORT_JSI_API_TYPENAME(JsiSkContourMeasure, "ContourMeasure")
|
77
72
|
|
78
73
|
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkContourMeasure, getPosTan),
|
79
74
|
JSI_EXPORT_FUNC(JsiSkContourMeasure, length),
|
80
75
|
JSI_EXPORT_FUNC(JsiSkContourMeasure, isClosed),
|
81
|
-
JSI_EXPORT_FUNC(JsiSkContourMeasure, getSegment)
|
82
|
-
|
83
|
-
/**
|
84
|
-
Returns the underlying object from a host object of this type
|
85
|
-
*/
|
86
|
-
static sk_sp<SkContourMeasure> fromValue(jsi::Runtime &runtime,
|
87
|
-
const jsi::Value &obj) {
|
88
|
-
return obj.asObject(runtime)
|
89
|
-
.asHostObject<JsiSkContourMeasure>(runtime)
|
90
|
-
->getObject();
|
91
|
-
}
|
76
|
+
JSI_EXPORT_FUNC(JsiSkContourMeasure, getSegment),
|
77
|
+
JSI_EXPORT_FUNC(JsiSkContourMeasure, dispose))
|
92
78
|
};
|
93
79
|
} // namespace RNSkia
|
@@ -29,14 +29,6 @@ public:
|
|
29
29
|
std::move(context), std::make_shared<SkContourMeasureIter>(
|
30
30
|
path, forceClosed, resScale)) {}
|
31
31
|
|
32
|
-
// TODO: declare in JsiSkWrappingSkPtrHostObject via extra template parameter?
|
33
|
-
JSI_PROPERTY_GET(__typename__) {
|
34
|
-
return jsi::String::createFromUtf8(runtime, "ContourMeasureIter");
|
35
|
-
}
|
36
|
-
|
37
|
-
JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkContourMeasureIter,
|
38
|
-
__typename__), )
|
39
|
-
|
40
32
|
JSI_HOST_FUNCTION(next) {
|
41
33
|
auto next = getObject()->next();
|
42
34
|
if (next == nullptr) {
|
@@ -48,17 +40,10 @@ public:
|
|
48
40
|
return jsi::Object::createFromHostObject(runtime, std::move(nextObject));
|
49
41
|
}
|
50
42
|
|
51
|
-
|
43
|
+
EXPORT_JSI_API_TYPENAME(JsiSkContourMeasureIter, "ContourMeasureIter")
|
52
44
|
|
53
|
-
|
54
|
-
|
55
|
-
*/
|
56
|
-
static std::shared_ptr<SkContourMeasureIter>
|
57
|
-
fromValue(jsi::Runtime &runtime, const jsi::Value &obj) {
|
58
|
-
return obj.asObject(runtime)
|
59
|
-
.asHostObject<JsiSkContourMeasureIter>(runtime)
|
60
|
-
->getObject();
|
61
|
-
}
|
45
|
+
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkContourMeasureIter, next),
|
46
|
+
JSI_EXPORT_FUNC(JsiSkContourMeasureIter, dispose))
|
62
47
|
|
63
48
|
/**
|
64
49
|
* Creates the function for construction a new instance of the
|
package/cpp/api/JsiSkData.h
CHANGED
@@ -24,24 +24,7 @@ public:
|
|
24
24
|
JsiSkData(std::shared_ptr<RNSkPlatformContext> context, sk_sp<SkData> asset)
|
25
25
|
: JsiSkWrappingSkPtrHostObject(std::move(context), std::move(asset)) {}
|
26
26
|
|
27
|
-
|
28
|
-
return jsi::String::createFromUtf8(runtime, "Data");
|
29
|
-
}
|
30
|
-
|
31
|
-
JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkData, __typename__))
|
32
|
-
|
33
|
-
JSI_HOST_FUNCTION(dispose) {
|
34
|
-
setObject(nullptr);
|
35
|
-
return jsi::Value::undefined();
|
36
|
-
}
|
37
|
-
|
27
|
+
EXPORT_JSI_API_TYPENAME(JsiSkData, "Data")
|
38
28
|
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkData, dispose))
|
39
|
-
|
40
|
-
/**
|
41
|
-
Returns the underlying object from a host object of this type
|
42
|
-
*/
|
43
|
-
static sk_sp<SkData> fromValue(jsi::Runtime &runtime, const jsi::Value &obj) {
|
44
|
-
return obj.asObject(runtime).asHostObject<JsiSkData>(runtime)->getObject();
|
45
|
-
}
|
46
29
|
};
|
47
30
|
} // namespace RNSkia
|
package/cpp/api/JsiSkFont.h
CHANGED
@@ -28,11 +28,6 @@ namespace jsi = facebook::jsi;
|
|
28
28
|
|
29
29
|
class JsiSkFont : public JsiSkWrappingSharedPtrHostObject<SkFont> {
|
30
30
|
public:
|
31
|
-
// TODO: declare in JsiSkWrappingSkPtrHostObject via extra template parameter?
|
32
|
-
JSI_PROPERTY_GET(__typename__) {
|
33
|
-
return jsi::String::createFromUtf8(runtime, "Font");
|
34
|
-
}
|
35
|
-
|
36
31
|
JSI_HOST_FUNCTION(getGlyphWidths) {
|
37
32
|
auto jsiGlyphs = arguments[0].asObject(runtime).asArray(runtime);
|
38
33
|
std::vector<SkGlyphID> glyphs;
|
@@ -244,6 +239,8 @@ public:
|
|
244
239
|
return jsi::Value::undefined();
|
245
240
|
}
|
246
241
|
|
242
|
+
EXPORT_JSI_API_TYPENAME(JsiSkFont, "Font")
|
243
|
+
|
247
244
|
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkFont, getSize),
|
248
245
|
JSI_EXPORT_FUNC(JsiSkFont, getMetrics),
|
249
246
|
JSI_EXPORT_FUNC(JsiSkFont, getGlyphIDs),
|
@@ -262,20 +259,13 @@ public:
|
|
262
259
|
JSI_EXPORT_FUNC(JsiSkFont, setSubpixel),
|
263
260
|
JSI_EXPORT_FUNC(JsiSkFont, setTypeface),
|
264
261
|
JSI_EXPORT_FUNC(JsiSkFont, getGlyphWidths),
|
265
|
-
JSI_EXPORT_FUNC(JsiSkFont, getTextWidth)
|
262
|
+
JSI_EXPORT_FUNC(JsiSkFont, getTextWidth),
|
263
|
+
JSI_EXPORT_FUNC(JsiSkFont, dispose))
|
266
264
|
|
267
265
|
JsiSkFont(std::shared_ptr<RNSkPlatformContext> context, const SkFont &font)
|
268
266
|
: JsiSkWrappingSharedPtrHostObject(std::move(context),
|
269
267
|
std::make_shared<SkFont>(font)) {}
|
270
268
|
|
271
|
-
/**
|
272
|
-
Returns the underlying object from a host object of this type
|
273
|
-
*/
|
274
|
-
static std::shared_ptr<SkFont> fromValue(jsi::Runtime &runtime,
|
275
|
-
const jsi::Value &obj) {
|
276
|
-
return obj.asObject(runtime).asHostObject<JsiSkFont>(runtime)->getObject();
|
277
|
-
}
|
278
|
-
|
279
269
|
/**
|
280
270
|
* Creates the function for construction a new instance of the SkFont
|
281
271
|
* wrapper
|
@@ -11,7 +11,8 @@ namespace RNSkia {
|
|
11
11
|
namespace jsi = facebook::jsi;
|
12
12
|
|
13
13
|
/**
|
14
|
-
* Base class for jsi host objects
|
14
|
+
* Base class for jsi host objects - these are all implemented as JsiHostObjects
|
15
|
+
* and has a pointer to the platform context.
|
15
16
|
*/
|
16
17
|
class JsiSkHostObject : public RNJsi::JsiHostObject {
|
17
18
|
public:
|
@@ -32,6 +33,15 @@ private:
|
|
32
33
|
std::shared_ptr<RNSkPlatformContext> _context;
|
33
34
|
};
|
34
35
|
|
36
|
+
#define JSI_API_TYPENAME(A) \
|
37
|
+
JSI_PROPERTY_GET(__typename__) { \
|
38
|
+
return jsi::String::createFromUtf8(runtime, #A); \
|
39
|
+
}
|
40
|
+
|
41
|
+
#define EXPORT_JSI_API_TYPENAME(CLASS, TYPENAME) \
|
42
|
+
JSI_API_TYPENAME(TYPENAME) \
|
43
|
+
JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(CLASS, __typename__))
|
44
|
+
|
35
45
|
template <typename T> class JsiSkWrappingHostObject : public JsiSkHostObject {
|
36
46
|
public:
|
37
47
|
/**
|
@@ -39,32 +49,65 @@ public:
|
|
39
49
|
* @param context Platform context
|
40
50
|
*/
|
41
51
|
JsiSkWrappingHostObject(std::shared_ptr<RNSkPlatformContext> context,
|
42
|
-
T
|
52
|
+
T object)
|
43
53
|
: JsiSkHostObject(std::move(context)), _object(std::move(object)) {}
|
44
54
|
|
45
|
-
JsiSkWrappingHostObject(std::shared_ptr<RNSkPlatformContext> context,
|
46
|
-
const T &object)
|
47
|
-
: JsiSkHostObject(std::move(context)), _object(object) {}
|
48
|
-
|
49
55
|
/**
|
50
56
|
* Returns the underlying object exposed by this host object. This object
|
51
57
|
* should be wrapped in a shared pointer of some kind
|
52
58
|
* @return Underlying object
|
53
59
|
*/
|
54
|
-
T
|
55
|
-
const T
|
60
|
+
T getObject() { return _object; }
|
61
|
+
const T getObject() const { return _object; }
|
56
62
|
|
57
63
|
/**
|
58
64
|
Updates the inner object with a new version of the object.
|
59
65
|
*/
|
60
|
-
void setObject(T
|
61
|
-
|
66
|
+
void setObject(T object) { _object = object; }
|
67
|
+
|
68
|
+
/**
|
69
|
+
Dispose function that can be exposed to JS by using the JSI_API_TYPENAME
|
70
|
+
macro
|
71
|
+
*/
|
72
|
+
JSI_HOST_FUNCTION(dispose) {
|
73
|
+
safeDispose();
|
74
|
+
return jsi::Value::undefined();
|
75
|
+
}
|
76
|
+
|
77
|
+
protected:
|
78
|
+
/**
|
79
|
+
Override to implement disposale of allocated resources like smart pointers
|
80
|
+
etc. This method will only be called once for each instance of this class.
|
81
|
+
*/
|
82
|
+
virtual void releaseResources() = 0;
|
83
|
+
|
84
|
+
/**
|
85
|
+
Throws a runtime error if this method is called after the object has been
|
86
|
+
disposed.
|
87
|
+
*/
|
88
|
+
void ensureNotDisposed() {
|
89
|
+
if (_isDisposed) {
|
90
|
+
throw std::runtime_error("API Object accessed after it was disposed");
|
91
|
+
}
|
92
|
+
}
|
62
93
|
|
63
94
|
private:
|
95
|
+
void safeDispose() {
|
96
|
+
if (!_isDisposed) {
|
97
|
+
_isDisposed = true;
|
98
|
+
releaseResources();
|
99
|
+
}
|
100
|
+
}
|
101
|
+
|
64
102
|
/**
|
65
103
|
* Wrapped object
|
66
104
|
*/
|
67
105
|
T _object;
|
106
|
+
|
107
|
+
/**
|
108
|
+
Resource disposed flag
|
109
|
+
*/
|
110
|
+
std::atomic<bool> _isDisposed = {false};
|
68
111
|
};
|
69
112
|
|
70
113
|
template <typename T>
|
@@ -75,6 +118,22 @@ public:
|
|
75
118
|
std::shared_ptr<T> object)
|
76
119
|
: JsiSkWrappingHostObject<std::shared_ptr<T>>(std::move(context),
|
77
120
|
std::move(object)) {}
|
121
|
+
|
122
|
+
/**
|
123
|
+
Returns the underlying object from a host object of this type
|
124
|
+
*/
|
125
|
+
static std::shared_ptr<T> fromValue(jsi::Runtime &runtime,
|
126
|
+
const jsi::Value &obj) {
|
127
|
+
return std::static_pointer_cast<JsiSkWrappingSharedPtrHostObject>(
|
128
|
+
obj.asObject(runtime).asHostObject(runtime))
|
129
|
+
->getObject();
|
130
|
+
}
|
131
|
+
|
132
|
+
protected:
|
133
|
+
void releaseResources() override {
|
134
|
+
// Clear internally allocated objects
|
135
|
+
this->setObject(nullptr);
|
136
|
+
}
|
78
137
|
};
|
79
138
|
|
80
139
|
template <typename T>
|
@@ -84,5 +143,21 @@ public:
|
|
84
143
|
sk_sp<T> object)
|
85
144
|
: JsiSkWrappingHostObject<sk_sp<T>>(std::move(context),
|
86
145
|
std::move(object)) {}
|
146
|
+
|
147
|
+
/**
|
148
|
+
Returns the underlying object from a host object of this type
|
149
|
+
*/
|
150
|
+
static sk_sp<T> fromValue(jsi::Runtime &runtime, const jsi::Value &obj) {
|
151
|
+
return std::static_pointer_cast<JsiSkWrappingSkPtrHostObject>(
|
152
|
+
obj.asObject(runtime).asHostObject(runtime))
|
153
|
+
->getObject();
|
154
|
+
}
|
155
|
+
|
156
|
+
protected:
|
157
|
+
void releaseResources() override {
|
158
|
+
// Clear internally allocated objects
|
159
|
+
this->setObject(nullptr);
|
160
|
+
}
|
87
161
|
};
|
162
|
+
|
88
163
|
} // namespace RNSkia
|
package/cpp/api/JsiSkImage.h
CHANGED
@@ -14,7 +14,9 @@
|
|
14
14
|
#include "SkBase64.h"
|
15
15
|
#include "SkImage.h"
|
16
16
|
#include "SkStream.h"
|
17
|
-
#include
|
17
|
+
#include "codec/SkEncodedImageFormat.h"
|
18
|
+
#include "include/encode/SkJpegEncoder.h"
|
19
|
+
#include "include/encode/SkPngEncoder.h"
|
18
20
|
|
19
21
|
#pragma clang diagnostic pop
|
20
22
|
|
@@ -70,7 +72,15 @@ public:
|
|
70
72
|
auto quality = count == 2 ? arguments[1].asNumber() : 100.0;
|
71
73
|
|
72
74
|
// Get data
|
73
|
-
|
75
|
+
sk_sp<SkData> data;
|
76
|
+
if (format == SkEncodedImageFormat::kJPEG) {
|
77
|
+
SkJpegEncoder::Options options;
|
78
|
+
options.fQuality = quality;
|
79
|
+
data = SkJpegEncoder::Encode(nullptr, getObject().get(), options);
|
80
|
+
} else {
|
81
|
+
SkPngEncoder::Options options;
|
82
|
+
data = SkPngEncoder::Encode(nullptr, getObject().get(), options);
|
83
|
+
}
|
74
84
|
auto arrayCtor =
|
75
85
|
runtime.global().getPropertyAsFunction(runtime, "Uint8Array");
|
76
86
|
size_t size = data->size();
|
@@ -95,8 +105,19 @@ public:
|
|
95
105
|
: SkEncodedImageFormat::kPNG;
|
96
106
|
|
97
107
|
auto quality = count == 2 ? arguments[1].asNumber() : 100.0;
|
98
|
-
|
99
|
-
|
108
|
+
auto image = getObject();
|
109
|
+
if (image->isTextureBacked()) {
|
110
|
+
image = image->makeNonTextureImage();
|
111
|
+
}
|
112
|
+
sk_sp<SkData> data;
|
113
|
+
if (format == SkEncodedImageFormat::kJPEG) {
|
114
|
+
SkJpegEncoder::Options options;
|
115
|
+
options.fQuality = quality;
|
116
|
+
data = SkJpegEncoder::Encode(nullptr, image.get(), options);
|
117
|
+
} else {
|
118
|
+
SkPngEncoder::Options options;
|
119
|
+
data = SkPngEncoder::Encode(nullptr, image.get(), options);
|
120
|
+
}
|
100
121
|
auto len = SkBase64::Encode(data->bytes(), data->size(), nullptr);
|
101
122
|
auto buffer = std::string(len, 0);
|
102
123
|
SkBase64::Encode(data->bytes(), data->size(),
|
@@ -110,10 +131,7 @@ public:
|
|
110
131
|
runtime, std::make_shared<JsiSkImage>(getContext(), std::move(image)));
|
111
132
|
}
|
112
133
|
|
113
|
-
|
114
|
-
setObject(nullptr);
|
115
|
-
return jsi::Value::undefined();
|
116
|
-
}
|
134
|
+
EXPORT_JSI_API_TYPENAME(JsiSkImage, "Image")
|
117
135
|
|
118
136
|
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkImage, width),
|
119
137
|
JSI_EXPORT_FUNC(JsiSkImage, height),
|
@@ -128,14 +146,6 @@ public:
|
|
128
146
|
const sk_sp<SkImage> image)
|
129
147
|
: JsiSkWrappingSkPtrHostObject<SkImage>(std::move(context),
|
130
148
|
std::move(image)) {}
|
131
|
-
|
132
|
-
/**
|
133
|
-
Returns the underlying object from a host object of this type
|
134
|
-
*/
|
135
|
-
static sk_sp<SkImage> fromValue(jsi::Runtime &runtime,
|
136
|
-
const jsi::Value &obj) {
|
137
|
-
return obj.asObject(runtime).asHostObject<JsiSkImage>(runtime)->getObject();
|
138
|
-
}
|
139
149
|
};
|
140
150
|
|
141
151
|
} // namespace RNSkia
|
@@ -18,7 +18,7 @@ class JsiSkImageFactory : public JsiSkHostObject {
|
|
18
18
|
public:
|
19
19
|
JSI_HOST_FUNCTION(MakeImageFromEncoded) {
|
20
20
|
auto data = JsiSkData::fromValue(runtime, arguments[0]);
|
21
|
-
auto image =
|
21
|
+
auto image = SkImages::DeferredFromEncodedData(data);
|
22
22
|
if (image == nullptr) {
|
23
23
|
return jsi::Value::null();
|
24
24
|
}
|
@@ -30,7 +30,7 @@ public:
|
|
30
30
|
auto imageInfo = JsiSkImageInfo::fromValue(runtime, arguments[0]);
|
31
31
|
auto pixelData = JsiSkData::fromValue(runtime, arguments[1]);
|
32
32
|
auto bytesPerRow = arguments[2].asNumber();
|
33
|
-
auto image =
|
33
|
+
auto image = SkImages::RasterFromData(*imageInfo, pixelData, bytesPerRow);
|
34
34
|
if (image == nullptr) {
|
35
35
|
return jsi::Value::null();
|
36
36
|
}
|
@@ -25,23 +25,7 @@ public:
|
|
25
25
|
: JsiSkWrappingSkPtrHostObject<SkImageFilter>(std::move(context),
|
26
26
|
std::move(imageFilter)) {}
|
27
27
|
|
28
|
-
|
29
|
-
JSI_PROPERTY_GET(__typename__) {
|
30
|
-
return jsi::String::createFromUtf8(runtime, "ImageFilter");
|
31
|
-
}
|
32
|
-
|
33
|
-
JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkImageFilter,
|
34
|
-
__typename__))
|
35
|
-
|
36
|
-
/**
|
37
|
-
Returns the underlying object from a host object of this type
|
38
|
-
*/
|
39
|
-
static sk_sp<SkImageFilter> fromValue(jsi::Runtime &runtime,
|
40
|
-
const jsi::Value &obj) {
|
41
|
-
return obj.asObject(runtime)
|
42
|
-
.asHostObject<JsiSkImageFilter>(runtime)
|
43
|
-
->getObject();
|
44
|
-
}
|
28
|
+
EXPORT_JSI_API_TYPENAME(JsiSkImageFilter, "ImageFilter")
|
45
29
|
};
|
46
30
|
|
47
31
|
} // namespace RNSkia
|
@@ -25,23 +25,7 @@ public:
|
|
25
25
|
: JsiSkWrappingSkPtrHostObject<SkMaskFilter>(std::move(context),
|
26
26
|
std::move(maskFilter)) {}
|
27
27
|
|
28
|
-
|
29
|
-
JSI_PROPERTY_GET(__typename__) {
|
30
|
-
return jsi::String::createFromUtf8(runtime, "MaskFilter");
|
31
|
-
}
|
32
|
-
|
33
|
-
JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkMaskFilter,
|
34
|
-
__typename__))
|
35
|
-
|
36
|
-
/**
|
37
|
-
Returns the underlying object from a host object of this type
|
38
|
-
*/
|
39
|
-
static sk_sp<SkMaskFilter> fromValue(jsi::Runtime &runtime,
|
40
|
-
const jsi::Value &obj) {
|
41
|
-
return obj.asObject(runtime)
|
42
|
-
.asHostObject<JsiSkMaskFilter>(runtime)
|
43
|
-
->getObject();
|
44
|
-
}
|
28
|
+
EXPORT_JSI_API_TYPENAME(JsiSkMaskFilter, "MaskFilter")
|
45
29
|
};
|
46
30
|
|
47
31
|
} // namespace RNSkia
|
package/cpp/api/JsiSkMatrix.h
CHANGED
@@ -40,10 +40,6 @@ public:
|
|
40
40
|
pers0, pers1, pers2);
|
41
41
|
}
|
42
42
|
|
43
|
-
JSI_PROPERTY_GET(__typename__) {
|
44
|
-
return jsi::String::createFromUtf8(runtime, "Matrix");
|
45
|
-
}
|
46
|
-
|
47
43
|
JSI_HOST_FUNCTION(concat) {
|
48
44
|
auto m3 = JsiSkMatrix::fromValue(runtime, arguments[0]);
|
49
45
|
getObject()->preConcat(*m3);
|
@@ -90,7 +86,7 @@ public:
|
|
90
86
|
return values;
|
91
87
|
}
|
92
88
|
|
93
|
-
|
89
|
+
EXPORT_JSI_API_TYPENAME(JsiSkMatrix, "Matrix")
|
94
90
|
|
95
91
|
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkMatrix, concat),
|
96
92
|
JSI_EXPORT_FUNC(JsiSkMatrix, translate),
|
@@ -98,7 +94,8 @@ public:
|
|
98
94
|
JSI_EXPORT_FUNC(JsiSkMatrix, skew),
|
99
95
|
JSI_EXPORT_FUNC(JsiSkMatrix, rotate),
|
100
96
|
JSI_EXPORT_FUNC(JsiSkMatrix, identity),
|
101
|
-
JSI_EXPORT_FUNC(JsiSkMatrix, get),
|
97
|
+
JSI_EXPORT_FUNC(JsiSkMatrix, get),
|
98
|
+
JSI_EXPORT_FUNC(JsiSkMatrix, dispose))
|
102
99
|
|
103
100
|
/**
|
104
101
|
* Returns the underlying object from a host object of this type
|
package/cpp/api/JsiSkPaint.h
CHANGED
@@ -25,12 +25,7 @@ namespace jsi = facebook::jsi;
|
|
25
25
|
|
26
26
|
class JsiSkPaint : public JsiSkWrappingSharedPtrHostObject<SkPaint> {
|
27
27
|
public:
|
28
|
-
|
29
|
-
JSI_PROPERTY_GET(__typename__) {
|
30
|
-
return jsi::String::createFromUtf8(runtime, "Paint");
|
31
|
-
}
|
32
|
-
|
33
|
-
JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkPaint, __typename__))
|
28
|
+
EXPORT_JSI_API_TYPENAME(JsiSkPaint, "Paint")
|
34
29
|
|
35
30
|
JSI_HOST_FUNCTION(copy) {
|
36
31
|
const auto *paint = getObject().get();
|
@@ -183,7 +178,8 @@ public:
|
|
183
178
|
JSI_EXPORT_FUNC(JsiSkPaint, setStrokeWidth),
|
184
179
|
JSI_EXPORT_FUNC(JsiSkPaint, setStyle),
|
185
180
|
JSI_EXPORT_FUNC(JsiSkPaint, setColor),
|
186
|
-
JSI_EXPORT_FUNC(JsiSkPaint, setAlphaf)
|
181
|
+
JSI_EXPORT_FUNC(JsiSkPaint, setAlphaf),
|
182
|
+
JSI_EXPORT_FUNC(JsiSkPaint, dispose))
|
187
183
|
|
188
184
|
JsiSkPaint(std::shared_ptr<RNSkPlatformContext> context, SkPaint paint)
|
189
185
|
: JsiSkWrappingSharedPtrHostObject<SkPaint>(
|
@@ -196,14 +192,6 @@ public:
|
|
196
192
|
setObject(std::make_shared<SkPaint>(std::move(paint)));
|
197
193
|
}
|
198
194
|
|
199
|
-
/**
|
200
|
-
Returns the underlying object from a host object of this type
|
201
|
-
*/
|
202
|
-
static std::shared_ptr<SkPaint> fromValue(jsi::Runtime &runtime,
|
203
|
-
const jsi::Value &obj) {
|
204
|
-
return obj.asObject(runtime).asHostObject<JsiSkPaint>(runtime)->getObject();
|
205
|
-
}
|
206
|
-
|
207
195
|
/**
|
208
196
|
* Creates the function for construction a new instance of the SkPaint
|
209
197
|
* wrapper
|
package/cpp/api/JsiSkPath.h
CHANGED
@@ -7,6 +7,7 @@
|
|
7
7
|
#include <jsi/jsi.h>
|
8
8
|
|
9
9
|
#include "JsiSkHostObjects.h"
|
10
|
+
#include "JsiSkMatrix.h"
|
10
11
|
#include "JsiSkPoint.h"
|
11
12
|
#include "JsiSkRRect.h"
|
12
13
|
#include "JsiSkRect.h"
|
@@ -20,13 +21,12 @@
|
|
20
21
|
#include "SkPathEffect.h"
|
21
22
|
#include "SkPathOps.h"
|
22
23
|
#include "SkPathTypes.h"
|
24
|
+
#include "SkPathUtils.h"
|
23
25
|
#include "SkString.h"
|
24
26
|
#include "SkStrokeRec.h"
|
25
27
|
#include "SkTextUtils.h"
|
26
28
|
#include "SkTrimPathEffect.h"
|
27
29
|
|
28
|
-
#include "JsiSkMatrix.h"
|
29
|
-
|
30
30
|
#pragma clang diagnostic pop
|
31
31
|
|
32
32
|
namespace RNSkia {
|
@@ -36,11 +36,6 @@ namespace jsi = facebook::jsi;
|
|
36
36
|
class JsiSkPath : public JsiSkWrappingSharedPtrHostObject<SkPath> {
|
37
37
|
|
38
38
|
public:
|
39
|
-
// TODO: declare in JsiSkWrappingSkPtrHostObject via extra template parameter?
|
40
|
-
JSI_PROPERTY_GET(__typename__) {
|
41
|
-
return jsi::String::createFromUtf8(runtime, "Path");
|
42
|
-
}
|
43
|
-
|
44
39
|
JSI_HOST_FUNCTION(addPath) {
|
45
40
|
auto src = JsiSkPath::fromValue(runtime, arguments[0]);
|
46
41
|
auto matrix =
|
@@ -289,8 +284,11 @@ public:
|
|
289
284
|
|
290
285
|
auto jsiPrecision = opts.getProperty(runtime, "precision");
|
291
286
|
auto precision = jsiPrecision.isUndefined() ? 1 : jsiPrecision.asNumber();
|
292
|
-
auto result =
|
293
|
-
|
287
|
+
auto result =
|
288
|
+
skpathutils::FillPathWithPaint(path, p, &path, nullptr, precision);
|
289
|
+
if (result) {
|
290
|
+
getObject()->swap(path);
|
291
|
+
}
|
294
292
|
return result ? thisValue.getObject(runtime) : jsi::Value::null();
|
295
293
|
}
|
296
294
|
|
@@ -325,8 +323,7 @@ public:
|
|
325
323
|
|
326
324
|
JSI_HOST_FUNCTION(toSVGString) {
|
327
325
|
SkPath path = *getObject();
|
328
|
-
|
329
|
-
SkParsePath::ToSVGString(path, &s);
|
326
|
+
auto s = SkParsePath::ToSVGString(path);
|
330
327
|
return jsi::String::createFromUtf8(runtime, s.c_str());
|
331
328
|
}
|
332
329
|
|
@@ -526,7 +523,7 @@ public:
|
|
526
523
|
return cmds;
|
527
524
|
}
|
528
525
|
|
529
|
-
|
526
|
+
EXPORT_JSI_API_TYPENAME(JsiSkPath, "Path")
|
530
527
|
|
531
528
|
JSI_EXPORT_FUNCTIONS(
|
532
529
|
JSI_EXPORT_FUNC(JsiSkPath, addPath), JSI_EXPORT_FUNC(JsiSkPath, addArc),
|
@@ -562,20 +559,12 @@ public:
|
|
562
559
|
JSI_EXPORT_FUNC(JsiSkPath, op),
|
563
560
|
JSI_EXPORT_FUNC(JsiSkPath, isInterpolatable),
|
564
561
|
JSI_EXPORT_FUNC(JsiSkPath, interpolate),
|
565
|
-
JSI_EXPORT_FUNC(JsiSkPath, toCmds), )
|
562
|
+
JSI_EXPORT_FUNC(JsiSkPath, toCmds), JSI_EXPORT_FUNC(JsiSkPath, dispose))
|
566
563
|
|
567
564
|
JsiSkPath(std::shared_ptr<RNSkPlatformContext> context, SkPath path)
|
568
565
|
: JsiSkWrappingSharedPtrHostObject<SkPath>(
|
569
566
|
std::move(context), std::make_shared<SkPath>(std::move(path))) {}
|
570
567
|
|
571
|
-
/**
|
572
|
-
Returns the underlying object from a host object of this type
|
573
|
-
*/
|
574
|
-
static std::shared_ptr<SkPath> fromValue(jsi::Runtime &runtime,
|
575
|
-
const jsi::Value &obj) {
|
576
|
-
return obj.asObject(runtime).asHostObject<JsiSkPath>(runtime)->getObject();
|
577
|
-
}
|
578
|
-
|
579
568
|
static jsi::Value toValue(jsi::Runtime &runtime,
|
580
569
|
std::shared_ptr<RNSkPlatformContext> context,
|
581
570
|
const SkPath &path) {
|
@@ -25,23 +25,8 @@ public:
|
|
25
25
|
: JsiSkWrappingSkPtrHostObject<SkPathEffect>(std::move(context),
|
26
26
|
std::move(pathEffect)) {}
|
27
27
|
|
28
|
-
|
29
|
-
|
30
|
-
return jsi::String::createFromUtf8(runtime, "PathEffect");
|
31
|
-
}
|
32
|
-
|
33
|
-
JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkPathEffect,
|
34
|
-
__typename__))
|
35
|
-
|
36
|
-
/**
|
37
|
-
Returns the underlying object from a host object of this type
|
38
|
-
*/
|
39
|
-
static sk_sp<SkPathEffect> fromValue(jsi::Runtime &runtime,
|
40
|
-
const jsi::Value &obj) {
|
41
|
-
return obj.asObject(runtime)
|
42
|
-
.asHostObject<JsiSkPathEffect>(runtime)
|
43
|
-
->getObject();
|
44
|
-
}
|
28
|
+
EXPORT_JSI_API_TYPENAME(JsiSkPathEffect, "PathEffect")
|
29
|
+
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkColorFilter, dispose))
|
45
30
|
};
|
46
31
|
|
47
32
|
} // namespace RNSkia
|