@shopify/react-native-skia 0.1.192 → 0.1.193
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/CMakeLists.txt +1 -1
- package/android/build.gradle +1 -0
- package/android/cpp/jni/JniPlatformContext.cpp +1 -1
- package/cpp/api/JsiSkImage.h +25 -4
- package/cpp/api/JsiSkImageFactory.h +2 -2
- package/cpp/api/JsiSkPath.h +8 -6
- 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/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/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/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
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -6,32 +6,32 @@
|
|
|
6
6
|
<array>
|
|
7
7
|
<dict>
|
|
8
8
|
<key>LibraryIdentifier</key>
|
|
9
|
-
<string>ios-
|
|
9
|
+
<string>ios-arm64_arm64e_x86_64-simulator</string>
|
|
10
10
|
<key>LibraryPath</key>
|
|
11
11
|
<string>libskia.a</string>
|
|
12
12
|
<key>SupportedArchitectures</key>
|
|
13
13
|
<array>
|
|
14
14
|
<string>arm64</string>
|
|
15
15
|
<string>arm64e</string>
|
|
16
|
+
<string>x86_64</string>
|
|
16
17
|
</array>
|
|
17
18
|
<key>SupportedPlatform</key>
|
|
18
19
|
<string>ios</string>
|
|
20
|
+
<key>SupportedPlatformVariant</key>
|
|
21
|
+
<string>simulator</string>
|
|
19
22
|
</dict>
|
|
20
23
|
<dict>
|
|
21
24
|
<key>LibraryIdentifier</key>
|
|
22
|
-
<string>ios-
|
|
25
|
+
<string>ios-arm64_arm64e</string>
|
|
23
26
|
<key>LibraryPath</key>
|
|
24
27
|
<string>libskia.a</string>
|
|
25
28
|
<key>SupportedArchitectures</key>
|
|
26
29
|
<array>
|
|
27
30
|
<string>arm64</string>
|
|
28
31
|
<string>arm64e</string>
|
|
29
|
-
<string>x86_64</string>
|
|
30
32
|
</array>
|
|
31
33
|
<key>SupportedPlatform</key>
|
|
32
34
|
<string>ios</string>
|
|
33
|
-
<key>SupportedPlatformVariant</key>
|
|
34
|
-
<string>simulator</string>
|
|
35
35
|
</dict>
|
|
36
36
|
</array>
|
|
37
37
|
<key>CFBundlePackageType</key>
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -22,7 +22,7 @@ Pod::Spec.new do |s|
|
|
|
22
22
|
|
|
23
23
|
s.requires_arc = true
|
|
24
24
|
s.pod_target_xcconfig = {
|
|
25
|
-
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited)
|
|
25
|
+
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) SK_METAL=1 SK_GANESH=1',
|
|
26
26
|
'CLANG_CXX_LANGUAGE_STANDARD' => 'c++17',
|
|
27
27
|
'DEFINES_MODULE' => 'YES',
|
|
28
28
|
"HEADER_SEARCH_PATHS" => '"$(PODS_TARGET_SRCROOT)/cpp/"/**'
|
package/scripts/install-npm.js
CHANGED
|
@@ -8,7 +8,17 @@ const createSymlink = (p) => {
|
|
|
8
8
|
const srcDir = path.resolve(`./cpp/${p}`);
|
|
9
9
|
const dstDir = path.resolve(`./android/cpp/${p}`);
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
// Case in PNPM which might turn symlink into a directory:
|
|
12
|
+
// In that case, remove the directory before creating the symlink
|
|
13
|
+
if (fs.existsSync(dstDir)) {
|
|
14
|
+
const lstat = fs.lstatSync(dstDir);
|
|
15
|
+
const isSymbolicLink = lstat.isSymbolicLink();
|
|
16
|
+
if (lstat.isDirectory() && !isSymbolicLink) {
|
|
17
|
+
fs.rmSync(dstDir, { recursive: true });
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
if (!fs.existsSync(dstDir)) {
|
|
12
22
|
fs.symlinkSync(srcDir, dstDir, "junction");
|
|
13
23
|
}
|
|
14
24
|
};
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2011 Google Inc.
|
|
3
|
-
*
|
|
4
|
-
* Use of this source code is governed by a BSD-style license that can be
|
|
5
|
-
* found in the LICENSE file.
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
#ifndef SkImageEncoder_DEFINED
|
|
9
|
-
#define SkImageEncoder_DEFINED
|
|
10
|
-
|
|
11
|
-
#include "include/core/SkEncodedImageFormat.h"
|
|
12
|
-
#include "include/core/SkRefCnt.h"
|
|
13
|
-
#include "include/core/SkTypes.h"
|
|
14
|
-
|
|
15
|
-
class SkBitmap;
|
|
16
|
-
class SkData;
|
|
17
|
-
class SkPixmap;
|
|
18
|
-
class SkWStream;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Encode SkPixmap in the given binary image format.
|
|
22
|
-
*
|
|
23
|
-
* @param dst results are written to this stream.
|
|
24
|
-
* @param src source pixels.
|
|
25
|
-
* @param format image format, not all formats are supported.
|
|
26
|
-
* @param quality range from 0-100, this is supported by jpeg and webp.
|
|
27
|
-
* higher values correspond to improved visual quality, but less compression.
|
|
28
|
-
*
|
|
29
|
-
* @return false iff input is bad or format is unsupported.
|
|
30
|
-
*
|
|
31
|
-
* Will always return false if Skia is compiled without image
|
|
32
|
-
* encoders.
|
|
33
|
-
*
|
|
34
|
-
* For SkEncodedImageFormat::kWEBP, if quality is 100, it will use lossless compression. Otherwise
|
|
35
|
-
* it will use lossy.
|
|
36
|
-
*
|
|
37
|
-
* For examples of encoding an image to a file or to a block of memory,
|
|
38
|
-
* see tools/ToolUtils.h.
|
|
39
|
-
*/
|
|
40
|
-
SK_API bool SkEncodeImage(SkWStream* dst, const SkPixmap& src,
|
|
41
|
-
SkEncodedImageFormat format, int quality);
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* The following helper function wraps SkEncodeImage().
|
|
45
|
-
*/
|
|
46
|
-
SK_API bool SkEncodeImage(SkWStream* dst, const SkBitmap& src, SkEncodedImageFormat f, int q);
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Encode SkPixmap in the given binary image format.
|
|
50
|
-
*
|
|
51
|
-
* @param src source pixels.
|
|
52
|
-
* @param format image format, not all formats are supported.
|
|
53
|
-
* @param quality range from 0-100, this is supported by jpeg and webp.
|
|
54
|
-
* higher values correspond to improved visual quality, but less compression.
|
|
55
|
-
*
|
|
56
|
-
* @return encoded data or nullptr if input is bad or format is unsupported.
|
|
57
|
-
*
|
|
58
|
-
* Will always return nullptr if Skia is compiled without image
|
|
59
|
-
* encoders.
|
|
60
|
-
*
|
|
61
|
-
* For SkEncodedImageFormat::kWEBP, if quality is 100, it will use lossless compression. Otherwise
|
|
62
|
-
* it will use lossy.
|
|
63
|
-
*/
|
|
64
|
-
SK_API sk_sp<SkData> SkEncodePixmap(const SkPixmap& src, SkEncodedImageFormat format, int quality);
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Helper that extracts the pixmap from the bitmap, and then calls SkEncodePixmap()
|
|
68
|
-
*/
|
|
69
|
-
SK_API sk_sp<SkData> SkEncodeBitmap(const SkBitmap& src, SkEncodedImageFormat format, int quality);
|
|
70
|
-
|
|
71
|
-
#endif // SkImageEncoder_DEFINED
|