@shopify/react-native-skia 0.1.192 → 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/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
@@ -9,11 +9,21 @@
|
|
9
9
|
#define SkPixmap_DEFINED
|
10
10
|
|
11
11
|
#include "include/core/SkColor.h"
|
12
|
+
#include "include/core/SkColorType.h"
|
12
13
|
#include "include/core/SkImageInfo.h"
|
14
|
+
#include "include/core/SkRect.h"
|
15
|
+
#include "include/core/SkRefCnt.h"
|
13
16
|
#include "include/core/SkSamplingOptions.h"
|
17
|
+
#include "include/core/SkSize.h"
|
18
|
+
#include "include/private/base/SkAPI.h"
|
19
|
+
#include "include/private/base/SkAssert.h"
|
20
|
+
#include "include/private/base/SkAttributes.h"
|
21
|
+
|
22
|
+
#include <cstddef>
|
23
|
+
#include <cstdint>
|
14
24
|
|
15
25
|
class SkColorSpace;
|
16
|
-
|
26
|
+
enum SkAlphaType : int;
|
17
27
|
struct SkMask;
|
18
28
|
|
19
29
|
/** \class SkPixmap
|
@@ -702,39 +712,21 @@ public:
|
|
702
712
|
*/
|
703
713
|
bool erase(SkColor color) const { return this->erase(color, this->bounds()); }
|
704
714
|
|
705
|
-
/** Writes color to pixels bounded by subset; returns true on success.
|
706
|
-
if subset is nullptr, writes colors pixels inside bounds(). Returns false if
|
707
|
-
colorType() is kUnknown_SkColorType, if subset is not nullptr and does
|
708
|
-
not intersect bounds(), or if subset is nullptr and bounds() is empty.
|
709
|
-
|
710
|
-
@param color sRGB unpremultiplied color to write
|
711
|
-
@param subset bounding integer SkRect of pixels to write; may be nullptr
|
712
|
-
@return true if pixels are changed
|
713
|
-
|
714
|
-
example: https://fiddle.skia.org/c/@Pixmap_erase_3
|
715
|
-
*/
|
716
|
-
bool erase(const SkColor4f& color, const SkIRect* subset = nullptr) const {
|
717
|
-
return this->erase(color, nullptr, subset);
|
718
|
-
}
|
719
|
-
|
720
715
|
/** Writes color to pixels bounded by subset; returns true on success.
|
721
716
|
if subset is nullptr, writes colors pixels inside bounds(). Returns false if
|
722
717
|
colorType() is kUnknown_SkColorType, if subset is not nullptr and does
|
723
718
|
not intersect bounds(), or if subset is nullptr and bounds() is empty.
|
724
719
|
|
725
720
|
@param color unpremultiplied color to write
|
726
|
-
@param cs SkColorSpace of color
|
727
721
|
@param subset bounding integer SkRect of pixels to write; may be nullptr
|
728
722
|
@return true if pixels are changed
|
729
723
|
*/
|
730
|
-
bool erase(const SkColor4f& color,
|
724
|
+
bool erase(const SkColor4f& color, const SkIRect* subset = nullptr) const;
|
731
725
|
|
732
726
|
private:
|
733
727
|
const void* fPixels;
|
734
728
|
size_t fRowBytes;
|
735
729
|
SkImageInfo fInfo;
|
736
|
-
|
737
|
-
friend class SkPixmapPriv;
|
738
730
|
};
|
739
731
|
|
740
732
|
#endif
|
@@ -8,9 +8,11 @@
|
|
8
8
|
#ifndef SkPoint_DEFINED
|
9
9
|
#define SkPoint_DEFINED
|
10
10
|
|
11
|
-
#include "include/core/SkMath.h"
|
12
11
|
#include "include/core/SkScalar.h"
|
13
|
-
#include "include/
|
12
|
+
#include "include/core/SkTypes.h"
|
13
|
+
#include "include/private/base/SkSafe32.h"
|
14
|
+
|
15
|
+
#include <cstdint>
|
14
16
|
|
15
17
|
struct SkIPoint;
|
16
18
|
|
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
#include "include/core/SkTypes.h"
|
12
12
|
|
13
|
-
#if
|
13
|
+
#if defined(SK_GANESH)
|
14
14
|
#include "include/core/SkRefCnt.h"
|
15
15
|
#include "include/gpu/GrBackendSurface.h"
|
16
16
|
/**
|
@@ -41,6 +41,6 @@ private:
|
|
41
41
|
|
42
42
|
GrBackendTexture fBackendTexture;
|
43
43
|
};
|
44
|
-
#endif //
|
44
|
+
#endif // defined(SK_GANESH)
|
45
45
|
|
46
46
|
#endif // SkPromiseImageTexture_DEFINED
|
@@ -10,8 +10,12 @@
|
|
10
10
|
|
11
11
|
#include "include/core/SkPoint.h"
|
12
12
|
#include "include/core/SkRect.h"
|
13
|
+
#include "include/core/SkScalar.h"
|
14
|
+
#include "include/core/SkTypes.h"
|
15
|
+
|
16
|
+
#include <cstdint>
|
17
|
+
#include <cstring>
|
13
18
|
|
14
|
-
class SkPath;
|
15
19
|
class SkMatrix;
|
16
20
|
class SkString;
|
17
21
|
|
@@ -9,12 +9,15 @@
|
|
9
9
|
#define SkRect_DEFINED
|
10
10
|
|
11
11
|
#include "include/core/SkPoint.h"
|
12
|
+
#include "include/core/SkScalar.h"
|
12
13
|
#include "include/core/SkSize.h"
|
13
|
-
#include "include/
|
14
|
-
#include "include/private/
|
14
|
+
#include "include/core/SkTypes.h"
|
15
|
+
#include "include/private/base/SkSafe32.h"
|
16
|
+
#include "include/private/base/SkTFitsIn.h"
|
15
17
|
|
18
|
+
#include <string>
|
16
19
|
#include <algorithm>
|
17
|
-
#include <
|
20
|
+
#include <cstdint>
|
18
21
|
|
19
22
|
struct SkRect;
|
20
23
|
|
@@ -9,14 +9,14 @@
|
|
9
9
|
#define SkRefCnt_DEFINED
|
10
10
|
|
11
11
|
#include "include/core/SkTypes.h"
|
12
|
-
#include "include/private/
|
12
|
+
#include "include/private/base/SkDebug.h"
|
13
13
|
|
14
|
-
#include <atomic>
|
15
|
-
#include <cstddef>
|
16
|
-
#include <
|
17
|
-
#include <
|
18
|
-
#include <type_traits>
|
19
|
-
#include <utility>
|
14
|
+
#include <atomic>
|
15
|
+
#include <cstddef>
|
16
|
+
#include <cstdint>
|
17
|
+
#include <iosfwd>
|
18
|
+
#include <type_traits>
|
19
|
+
#include <utility>
|
20
20
|
|
21
21
|
/** \class SkRefCntBase
|
22
22
|
|
@@ -174,7 +174,7 @@ public:
|
|
174
174
|
|
175
175
|
bool unique() const { return 1 == fRefCnt.load(std::memory_order_acquire); }
|
176
176
|
void ref() const { (void)fRefCnt.fetch_add(+1, std::memory_order_relaxed); }
|
177
|
-
void
|
177
|
+
void unref() const {
|
178
178
|
if (1 == fRefCnt.fetch_add(-1, std::memory_order_acq_rel)) {
|
179
179
|
// restore the 1 for our destructor's assert
|
180
180
|
SkDEBUGCODE(fRefCnt.store(1, std::memory_order_relaxed));
|
@@ -217,12 +217,7 @@ private:
|
|
217
217
|
* may be considered as trivially relocatable by the compiler so that destroying-move operations
|
218
218
|
* i.e. move constructor followed by destructor can be optimized to memcpy.
|
219
219
|
*/
|
220
|
-
|
221
|
-
#define SK_SP_TRIVIAL_ABI [[clang::trivial_abi]]
|
222
|
-
#else
|
223
|
-
#define SK_SP_TRIVIAL_ABI
|
224
|
-
#endif
|
225
|
-
template <typename T> class SK_SP_TRIVIAL_ABI sk_sp {
|
220
|
+
template <typename T> class SK_TRIVIAL_ABI sk_sp {
|
226
221
|
public:
|
227
222
|
using element_type = T;
|
228
223
|
|
@@ -8,10 +8,8 @@
|
|
8
8
|
#ifndef SkScalar_DEFINED
|
9
9
|
#define SkScalar_DEFINED
|
10
10
|
|
11
|
-
#include "include/private/
|
12
|
-
|
13
|
-
#undef SK_SCALAR_IS_FLOAT
|
14
|
-
#define SK_SCALAR_IS_FLOAT 1
|
11
|
+
#include "include/private/base/SkAssert.h"
|
12
|
+
#include "include/private/base/SkFloatingPoint.h"
|
15
13
|
|
16
14
|
typedef float SkScalar;
|
17
15
|
|
@@ -8,9 +8,15 @@
|
|
8
8
|
#ifndef SkSerialProcs_DEFINED
|
9
9
|
#define SkSerialProcs_DEFINED
|
10
10
|
|
11
|
-
#include "include/core/
|
12
|
-
#include "include/
|
13
|
-
|
11
|
+
#include "include/core/SkRefCnt.h"
|
12
|
+
#include "include/private/base/SkAPI.h"
|
13
|
+
|
14
|
+
#include <cstddef>
|
15
|
+
|
16
|
+
class SkData;
|
17
|
+
class SkImage;
|
18
|
+
class SkPicture;
|
19
|
+
class SkTypeface;
|
14
20
|
|
15
21
|
/**
|
16
22
|
* A serial-proc is asked to serialize the specified object (e.g. picture or image).
|
@@ -22,30 +28,32 @@
|
|
22
28
|
* The default action for typefaces is to use Skia's internal format.
|
23
29
|
*/
|
24
30
|
|
25
|
-
|
26
|
-
|
27
|
-
|
31
|
+
using SkSerialPictureProc = sk_sp<SkData> (*)(SkPicture*, void* ctx);
|
32
|
+
using SkSerialImageProc = sk_sp<SkData> (*)(SkImage*, void* ctx);
|
33
|
+
using SkSerialTypefaceProc = sk_sp<SkData> (*)(SkTypeface*, void* ctx);
|
28
34
|
|
29
35
|
/**
|
30
36
|
* Called with the encoded form of a picture (previously written with a custom
|
31
37
|
* SkSerialPictureProc proc). Return a picture object, or nullptr indicating failure.
|
32
38
|
*/
|
33
|
-
|
39
|
+
using SkDeserialPictureProc = sk_sp<SkPicture> (*)(const void* data, size_t length, void* ctx);
|
34
40
|
|
35
41
|
/**
|
36
|
-
* Called with the encoded
|
42
|
+
* Called with the encoded form of an image. The proc can return an image object, or if it
|
37
43
|
* returns nullptr, then Skia will take its default action to try to create an image from the data.
|
38
44
|
*
|
45
|
+
* This will also be used to decode the internal mipmap layers that are saved on some images.
|
46
|
+
*
|
39
47
|
* Note that unlike SkDeserialPictureProc and SkDeserialTypefaceProc, return nullptr from this
|
40
48
|
* does not indicate failure, but is a signal for Skia to take its default action.
|
41
49
|
*/
|
42
|
-
|
50
|
+
using SkDeserialImageProc = sk_sp<SkImage> (*)(const void* data, size_t length, void* ctx);
|
43
51
|
|
44
52
|
/**
|
45
53
|
* Called with the encoded form of a typeface (previously written with a custom
|
46
54
|
* SkSerialTypefaceProc proc). Return a typeface object, or nullptr indicating failure.
|
47
55
|
*/
|
48
|
-
|
56
|
+
using SkDeserialTypefaceProc = sk_sp<SkTypeface> (*)(const void* data, size_t length, void* ctx);
|
49
57
|
|
50
58
|
struct SK_API SkSerialProcs {
|
51
59
|
SkSerialPictureProc fPictureProc = nullptr;
|
@@ -56,69 +56,6 @@ public:
|
|
56
56
|
return this->isAImage(nullptr, (SkTileMode*)nullptr) != nullptr;
|
57
57
|
}
|
58
58
|
|
59
|
-
// TODO(skbug.com/8941): Have Android use SkAndroidFrameworkUtils, move types to SkShaderBase,
|
60
|
-
// and delete asAGradient().
|
61
|
-
#ifndef SK_BUILD_FOR_ANDROID_FRAMEWORK
|
62
|
-
private:
|
63
|
-
#endif
|
64
|
-
|
65
|
-
/**
|
66
|
-
* If the shader subclass can be represented as a gradient, asAGradient
|
67
|
-
* returns the matching GradientType enum (or kNone_GradientType if it
|
68
|
-
* cannot). Also, if info is not null, asAGradient populates info with
|
69
|
-
* the relevant (see below) parameters for the gradient. fColorCount
|
70
|
-
* is both an input and output parameter. On input, it indicates how
|
71
|
-
* many entries in fColors and fColorOffsets can be used, if they are
|
72
|
-
* non-NULL. After asAGradient has run, fColorCount indicates how
|
73
|
-
* many color-offset pairs there are in the gradient. If there is
|
74
|
-
* insufficient space to store all of the color-offset pairs, fColors
|
75
|
-
* and fColorOffsets will not be altered. fColorOffsets specifies
|
76
|
-
* where on the range of 0 to 1 to transition to the given color.
|
77
|
-
* The meaning of fPoint and fRadius is dependant on the type of gradient.
|
78
|
-
*
|
79
|
-
* None:
|
80
|
-
* info is ignored.
|
81
|
-
* Color:
|
82
|
-
* fColorOffsets[0] is meaningless.
|
83
|
-
* Linear:
|
84
|
-
* fPoint[0] and fPoint[1] are the end-points of the gradient
|
85
|
-
* Radial:
|
86
|
-
* fPoint[0] and fRadius[0] are the center and radius
|
87
|
-
* Conical:
|
88
|
-
* fPoint[0] and fRadius[0] are the center and radius of the 1st circle
|
89
|
-
* fPoint[1] and fRadius[1] are the center and radius of the 2nd circle
|
90
|
-
* Sweep:
|
91
|
-
* fPoint[0] is the center of the sweep.
|
92
|
-
*/
|
93
|
-
|
94
|
-
enum GradientType {
|
95
|
-
kNone_GradientType,
|
96
|
-
kColor_GradientType,
|
97
|
-
kLinear_GradientType,
|
98
|
-
kRadial_GradientType,
|
99
|
-
kSweep_GradientType,
|
100
|
-
kConical_GradientType,
|
101
|
-
};
|
102
|
-
|
103
|
-
struct GradientInfo {
|
104
|
-
int fColorCount = 0; //!< In-out parameter, specifies passed size
|
105
|
-
// of fColors/fColorOffsets on input, and
|
106
|
-
// actual number of colors/offsets on
|
107
|
-
// output.
|
108
|
-
SkColor* fColors = nullptr; //!< The colors in the gradient.
|
109
|
-
SkScalar* fColorOffsets = nullptr; //!< The unit offset for color transitions.
|
110
|
-
SkPoint fPoint[2]; //!< Type specific, see above.
|
111
|
-
SkScalar fRadius[2]; //!< Type specific, see above.
|
112
|
-
SkTileMode fTileMode;
|
113
|
-
uint32_t fGradientFlags = 0; //!< see SkGradientShader::Flags
|
114
|
-
};
|
115
|
-
|
116
|
-
GradientType asAGradient(GradientInfo* info) const;
|
117
|
-
|
118
|
-
#ifndef SK_BUILD_FOR_ANDROID_FRAMEWORK
|
119
|
-
public:
|
120
|
-
#endif
|
121
|
-
|
122
59
|
//////////////////////////////////////////////////////////////////////////
|
123
60
|
// Methods to create combinations or variants of shaders
|
124
61
|
|
@@ -148,7 +85,7 @@ public:
|
|
148
85
|
static sk_sp<SkShader> Color(const SkColor4f&, sk_sp<SkColorSpace>);
|
149
86
|
static sk_sp<SkShader> Blend(SkBlendMode mode, sk_sp<SkShader> dst, sk_sp<SkShader> src);
|
150
87
|
static sk_sp<SkShader> Blend(sk_sp<SkBlender>, sk_sp<SkShader> dst, sk_sp<SkShader> src);
|
151
|
-
|
88
|
+
static sk_sp<SkShader> CoordClamp(sk_sp<SkShader>, const SkRect& subset);
|
152
89
|
private:
|
153
90
|
SkShaders() = delete;
|
154
91
|
};
|
@@ -5,117 +5,9 @@
|
|
5
5
|
* found in the LICENSE file.
|
6
6
|
*/
|
7
7
|
|
8
|
-
|
9
|
-
|
8
|
+
// We want SkSpan to be a public API, but it is also fundamental to many of our internal types.
|
9
|
+
// Thus, we have a public file that clients can include. This file defers to the private copy
|
10
|
+
// so we do not have a dependency cycle from our "base" files to our "core" files.
|
10
11
|
|
11
|
-
#include
|
12
|
-
#include <initializer_list>
|
13
|
-
#include <iterator>
|
14
|
-
#include <type_traits>
|
15
|
-
#include <utility>
|
16
|
-
#include "include/private/SkTLogic.h"
|
12
|
+
#include "include/private/base/SkSpan_impl.h" // IWYU pragma: export
|
17
13
|
|
18
|
-
// Add macro to check the lifetime of initializer_list arguments. initializer_list has a very
|
19
|
-
// short life span, and can only be used as a parameter, and not as a variable.
|
20
|
-
#if defined(__clang__) && defined(__has_cpp_attribute) && __has_cpp_attribute(clang::lifetimebound)
|
21
|
-
#define SK_CHECK_IL_LIFETIME [[clang::lifetimebound]]
|
22
|
-
#else
|
23
|
-
#define SK_CHECK_IL_LIFETIME
|
24
|
-
#endif
|
25
|
-
|
26
|
-
/**
|
27
|
-
* SkSpan holds a reference to contiguous data of type T along with a count. SkSpan does not own
|
28
|
-
* the data itself but is merely a reference, therefore you must take care with the lifetime of
|
29
|
-
* the underlying data.
|
30
|
-
*
|
31
|
-
* SkSpan is a count and a pointer into existing array or data type that stores its data in
|
32
|
-
* contiguous memory like std::vector. Any container that works with std::size() and std::data()
|
33
|
-
* can be used.
|
34
|
-
*
|
35
|
-
* SkSpan makes a convenient parameter for a routine to accept array like things. This allows you to
|
36
|
-
* write the routine without overloads for all different container types.
|
37
|
-
*
|
38
|
-
* Example:
|
39
|
-
* void routine(SkSpan<const int> a) { ... }
|
40
|
-
*
|
41
|
-
* std::vector v = {1, 2, 3, 4, 5};
|
42
|
-
*
|
43
|
-
* routine(a);
|
44
|
-
*
|
45
|
-
* A word of caution when working with initializer_list, initializer_lists have a lifetime that is
|
46
|
-
* limited to the current statement. The following is correct and safe:
|
47
|
-
*
|
48
|
-
* Example:
|
49
|
-
* routine({1,2,3,4,5});
|
50
|
-
*
|
51
|
-
* The following is undefined, and will result in erratic execution:
|
52
|
-
*
|
53
|
-
* Bad Example:
|
54
|
-
* initializer_list l = {1, 2, 3, 4, 5}; // The data behind l dies at the ;.
|
55
|
-
* routine(l);
|
56
|
-
*/
|
57
|
-
template <typename T>
|
58
|
-
class SkSpan {
|
59
|
-
public:
|
60
|
-
constexpr SkSpan() : fPtr{nullptr}, fSize{0} {}
|
61
|
-
constexpr SkSpan(T* ptr, size_t size) : fPtr{ptr}, fSize{size} {
|
62
|
-
SkASSERT(ptr || size == 0); // disallow nullptr + a nonzero size
|
63
|
-
SkASSERT(size < kMaxSize);
|
64
|
-
}
|
65
|
-
template <typename U, typename = typename std::enable_if<std::is_same<const U, T>::value>::type>
|
66
|
-
constexpr SkSpan(const SkSpan<U>& that) : fPtr(std::data(that)), fSize{std::size(that)} {}
|
67
|
-
constexpr SkSpan(const SkSpan& o) = default;
|
68
|
-
template<size_t N> constexpr SkSpan(T(&a)[N]) : SkSpan(a, N) { }
|
69
|
-
template<typename Container>
|
70
|
-
constexpr SkSpan(Container& c) : SkSpan{std::data(c), std::size(c)} { }
|
71
|
-
SkSpan(std::initializer_list<T> il SK_CHECK_IL_LIFETIME)
|
72
|
-
: SkSpan(std::data(il), std::size(il)) {}
|
73
|
-
|
74
|
-
constexpr SkSpan& operator=(const SkSpan& that) = default;
|
75
|
-
|
76
|
-
constexpr T& operator [] (size_t i) const {
|
77
|
-
SkASSERT(i < this->size());
|
78
|
-
return fPtr[i];
|
79
|
-
}
|
80
|
-
constexpr T& front() const { return fPtr[0]; }
|
81
|
-
constexpr T& back() const { return fPtr[fSize - 1]; }
|
82
|
-
constexpr T* begin() const { return fPtr; }
|
83
|
-
constexpr T* end() const { return fPtr + fSize; }
|
84
|
-
constexpr auto rbegin() const { return std::make_reverse_iterator(this->end()); }
|
85
|
-
constexpr auto rend() const { return std::make_reverse_iterator(this->begin()); }
|
86
|
-
constexpr T* data() const { return this->begin(); }
|
87
|
-
constexpr size_t size() const { return fSize; }
|
88
|
-
constexpr bool empty() const { return fSize == 0; }
|
89
|
-
constexpr size_t size_bytes() const { return fSize * sizeof(T); }
|
90
|
-
constexpr SkSpan<T> first(size_t prefixLen) const {
|
91
|
-
SkASSERT(prefixLen <= this->size());
|
92
|
-
return SkSpan{fPtr, prefixLen};
|
93
|
-
}
|
94
|
-
constexpr SkSpan<T> last(size_t postfixLen) const {
|
95
|
-
SkASSERT(postfixLen <= this->size());
|
96
|
-
return SkSpan{fPtr + (this->size() - postfixLen), postfixLen};
|
97
|
-
}
|
98
|
-
constexpr SkSpan<T> subspan(size_t offset) const {
|
99
|
-
return this->subspan(offset, this->size() - offset);
|
100
|
-
}
|
101
|
-
constexpr SkSpan<T> subspan(size_t offset, size_t count) const {
|
102
|
-
SkASSERT(offset <= this->size());
|
103
|
-
SkASSERT(count <= this->size() - offset);
|
104
|
-
return SkSpan{fPtr + offset, count};
|
105
|
-
}
|
106
|
-
|
107
|
-
private:
|
108
|
-
static const constexpr size_t kMaxSize = std::numeric_limits<size_t>::max() / sizeof(T);
|
109
|
-
T* fPtr;
|
110
|
-
size_t fSize;
|
111
|
-
};
|
112
|
-
|
113
|
-
template <typename Container>
|
114
|
-
SkSpan(Container&) ->
|
115
|
-
SkSpan<std::remove_pointer_t<decltype(std::data(std::declval<Container&>()))>>;
|
116
|
-
|
117
|
-
template <typename T>
|
118
|
-
SkSpan(std::initializer_list<T>) ->
|
119
|
-
SkSpan<std::remove_pointer_t<decltype(std::data(std::declval<std::initializer_list<T>>()))>>;
|
120
|
-
|
121
|
-
#endif // SkSpan_DEFINED
|
@@ -11,15 +11,16 @@
|
|
11
11
|
#include "include/core/SkData.h"
|
12
12
|
#include "include/core/SkRefCnt.h"
|
13
13
|
#include "include/core/SkScalar.h"
|
14
|
-
#include "include/
|
15
|
-
|
16
|
-
#include
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
14
|
+
#include "include/core/SkTypes.h"
|
15
|
+
#include "include/private/base/SkCPUTypes.h"
|
16
|
+
#include "include/private/base/SkTo.h"
|
17
|
+
|
18
|
+
#include <cstdint>
|
19
|
+
#include <cstdio>
|
20
|
+
#include <cstring>
|
21
|
+
#include <memory>
|
22
|
+
#include <utility>
|
21
23
|
class SkStreamAsset;
|
22
|
-
class SkStreamMemory;
|
23
24
|
|
24
25
|
/**
|
25
26
|
* SkStream -- abstraction for a source of bytes. Subclasses can be backed by
|
@@ -255,10 +256,10 @@ public:
|
|
255
256
|
|
256
257
|
bool writeText(const char text[]) {
|
257
258
|
SkASSERT(text);
|
258
|
-
return this->write(text, strlen(text));
|
259
|
+
return this->write(text, std::strlen(text));
|
259
260
|
}
|
260
261
|
|
261
|
-
bool newline() { return this->write("\n", strlen("\n")); }
|
262
|
+
bool newline() { return this->write("\n", std::strlen("\n")); }
|
262
263
|
|
263
264
|
bool writeDecAsText(int32_t);
|
264
265
|
bool writeBigDecAsText(int64_t, int minDigits = 0);
|
@@ -296,8 +297,6 @@ private:
|
|
296
297
|
|
297
298
|
////////////////////////////////////////////////////////////////////////////////////////
|
298
299
|
|
299
|
-
#include <stdio.h>
|
300
|
-
|
301
300
|
/** A stream that wraps a C FILE* file stream. */
|
302
301
|
class SK_API SkFILEStream : public SkStreamAsset {
|
303
302
|
public:
|
@@ -11,15 +11,16 @@
|
|
11
11
|
#include "include/core/SkRefCnt.h"
|
12
12
|
#include "include/core/SkScalar.h"
|
13
13
|
#include "include/core/SkTypes.h"
|
14
|
-
#include "include/private/
|
15
|
-
#include "include/private/
|
16
|
-
#include "include/private/SkTo.h"
|
14
|
+
#include "include/private/base/SkTo.h"
|
15
|
+
#include "include/private/base/SkTypeTraits.h"
|
17
16
|
|
18
|
-
#include <stdarg.h>
|
19
|
-
#include <string.h>
|
20
17
|
#include <atomic>
|
18
|
+
#include <cstdarg>
|
19
|
+
#include <cstddef>
|
20
|
+
#include <cstdint>
|
21
21
|
#include <string>
|
22
22
|
#include <string_view>
|
23
|
+
#include <type_traits>
|
23
24
|
|
24
25
|
/* Some helper functions for C strings */
|
25
26
|
static inline bool SkStrStartsWith(const char string[], const char prefixStr[]) {
|
@@ -128,6 +129,7 @@ public:
|
|
128
129
|
|
129
130
|
bool isEmpty() const { return 0 == fRec->fLength; }
|
130
131
|
size_t size() const { return (size_t) fRec->fLength; }
|
132
|
+
const char* data() const { return fRec->data(); }
|
131
133
|
const char* c_str() const { return fRec->data(); }
|
132
134
|
char operator[](size_t n) const { return this->c_str()[n]; }
|
133
135
|
|
@@ -173,8 +175,8 @@ public:
|
|
173
175
|
SkString& operator=(SkString&&);
|
174
176
|
SkString& operator=(const char text[]);
|
175
177
|
|
176
|
-
char*
|
177
|
-
char& operator[](size_t n) { return this->
|
178
|
+
char* data();
|
179
|
+
char& operator[](size_t n) { return this->data()[n]; }
|
178
180
|
|
179
181
|
void reset();
|
180
182
|
/** String contents are preserved on resize. (For destructive resize, `set(nullptr, length)`.)
|
@@ -286,22 +288,4 @@ static inline void swap(SkString& a, SkString& b) {
|
|
286
288
|
a.swap(b);
|
287
289
|
}
|
288
290
|
|
289
|
-
enum SkStrSplitMode {
|
290
|
-
// Strictly return all results. If the input is ",," and the separator is ',' this will return
|
291
|
-
// an array of three empty strings.
|
292
|
-
kStrict_SkStrSplitMode,
|
293
|
-
|
294
|
-
// Only nonempty results will be added to the results. Multiple separators will be
|
295
|
-
// coalesced. Separators at the beginning and end of the input will be ignored. If the input is
|
296
|
-
// ",," and the separator is ',', this will return an empty vector.
|
297
|
-
kCoalesce_SkStrSplitMode
|
298
|
-
};
|
299
|
-
|
300
|
-
// Split str on any characters in delimiters into out. (Think, strtok with a sane API.)
|
301
|
-
void SkStrSplit(const char* str, const char* delimiters, SkStrSplitMode splitMode,
|
302
|
-
SkTArray<SkString>* out);
|
303
|
-
inline void SkStrSplit(const char* str, const char* delimiters, SkTArray<SkString>* out) {
|
304
|
-
SkStrSplit(str, delimiters, kCoalesce_SkStrSplitMode, out);
|
305
|
-
}
|
306
|
-
|
307
291
|
#endif
|