@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
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2016 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 SKSL_MODIFIERS
|
|
9
|
-
#define SKSL_MODIFIERS
|
|
10
|
-
|
|
11
|
-
#include "include/private/SkSLLayout.h"
|
|
12
|
-
|
|
13
|
-
#include <cstddef>
|
|
14
|
-
#include <memory>
|
|
15
|
-
#include <string>
|
|
16
|
-
|
|
17
|
-
namespace SkSL {
|
|
18
|
-
|
|
19
|
-
class Context;
|
|
20
|
-
class Position;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* A set of modifier keywords (in, out, uniform, etc.) appearing before a declaration.
|
|
24
|
-
*/
|
|
25
|
-
struct Modifiers {
|
|
26
|
-
/**
|
|
27
|
-
* OpenGL requires modifiers to be in a strict order:
|
|
28
|
-
* - invariant-qualifier: (invariant)
|
|
29
|
-
* - interpolation-qualifier: flat, noperspective, (smooth)
|
|
30
|
-
* - storage-qualifier: const, uniform
|
|
31
|
-
* - parameter-qualifier: in, out, inout
|
|
32
|
-
* - precision-qualifier: highp, mediump, lowp
|
|
33
|
-
*
|
|
34
|
-
* SkSL does not have `invariant` or `smooth`.
|
|
35
|
-
*/
|
|
36
|
-
|
|
37
|
-
enum Flag {
|
|
38
|
-
kNo_Flag = 0,
|
|
39
|
-
// Real GLSL modifiers
|
|
40
|
-
kFlat_Flag = 1 << 0,
|
|
41
|
-
kNoPerspective_Flag = 1 << 1,
|
|
42
|
-
kConst_Flag = 1 << 2,
|
|
43
|
-
kUniform_Flag = 1 << 3,
|
|
44
|
-
kIn_Flag = 1 << 4,
|
|
45
|
-
kOut_Flag = 1 << 5,
|
|
46
|
-
kHighp_Flag = 1 << 6,
|
|
47
|
-
kMediump_Flag = 1 << 7,
|
|
48
|
-
kLowp_Flag = 1 << 8,
|
|
49
|
-
kReadOnly_Flag = 1 << 9,
|
|
50
|
-
kWriteOnly_Flag = 1 << 10,
|
|
51
|
-
kBuffer_Flag = 1 << 11,
|
|
52
|
-
// We use the Metal name for this one (corresponds to the GLSL 'shared' modifier)
|
|
53
|
-
kThreadgroup_Flag = 1 << 12,
|
|
54
|
-
// SkSL extensions, not present in GLSL
|
|
55
|
-
kExport_Flag = 1 << 13,
|
|
56
|
-
kES3_Flag = 1 << 14,
|
|
57
|
-
kPure_Flag = 1 << 15,
|
|
58
|
-
kInline_Flag = 1 << 16,
|
|
59
|
-
kNoInline_Flag = 1 << 17,
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
Modifiers()
|
|
63
|
-
: fLayout(Layout())
|
|
64
|
-
, fFlags(0) {}
|
|
65
|
-
|
|
66
|
-
Modifiers(const Layout& layout, int flags)
|
|
67
|
-
: fLayout(layout)
|
|
68
|
-
, fFlags(flags) {}
|
|
69
|
-
|
|
70
|
-
std::string description() const {
|
|
71
|
-
return fLayout.description() + DescribeFlags(fFlags) + " ";
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
static std::string DescribeFlags(int flags) {
|
|
75
|
-
// SkSL extensions
|
|
76
|
-
std::string result;
|
|
77
|
-
if (flags & kExport_Flag) {
|
|
78
|
-
result += "$export ";
|
|
79
|
-
}
|
|
80
|
-
if (flags & kES3_Flag) {
|
|
81
|
-
result += "$es3 ";
|
|
82
|
-
}
|
|
83
|
-
if (flags & kPure_Flag) {
|
|
84
|
-
result += "$pure ";
|
|
85
|
-
}
|
|
86
|
-
if (flags & kInline_Flag) {
|
|
87
|
-
result += "inline ";
|
|
88
|
-
}
|
|
89
|
-
if (flags & kNoInline_Flag) {
|
|
90
|
-
result += "noinline ";
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
// Real GLSL qualifiers (must be specified in order in GLSL 4.1 and below)
|
|
94
|
-
if (flags & kFlat_Flag) {
|
|
95
|
-
result += "flat ";
|
|
96
|
-
}
|
|
97
|
-
if (flags & kNoPerspective_Flag) {
|
|
98
|
-
result += "noperspective ";
|
|
99
|
-
}
|
|
100
|
-
if (flags & kConst_Flag) {
|
|
101
|
-
result += "const ";
|
|
102
|
-
}
|
|
103
|
-
if (flags & kUniform_Flag) {
|
|
104
|
-
result += "uniform ";
|
|
105
|
-
}
|
|
106
|
-
if ((flags & kIn_Flag) && (flags & kOut_Flag)) {
|
|
107
|
-
result += "inout ";
|
|
108
|
-
} else if (flags & kIn_Flag) {
|
|
109
|
-
result += "in ";
|
|
110
|
-
} else if (flags & kOut_Flag) {
|
|
111
|
-
result += "out ";
|
|
112
|
-
}
|
|
113
|
-
if (flags & kHighp_Flag) {
|
|
114
|
-
result += "highp ";
|
|
115
|
-
}
|
|
116
|
-
if (flags & kMediump_Flag) {
|
|
117
|
-
result += "mediump ";
|
|
118
|
-
}
|
|
119
|
-
if (flags & kLowp_Flag) {
|
|
120
|
-
result += "lowp ";
|
|
121
|
-
}
|
|
122
|
-
if (flags & kReadOnly_Flag) {
|
|
123
|
-
result += "readonly ";
|
|
124
|
-
}
|
|
125
|
-
if (flags & kWriteOnly_Flag) {
|
|
126
|
-
result += "writeonly ";
|
|
127
|
-
}
|
|
128
|
-
if (flags & kBuffer_Flag) {
|
|
129
|
-
result += "buffer ";
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
// We're using a non-GLSL name for this one; the GLSL equivalent is "shared"
|
|
133
|
-
if (flags & kThreadgroup_Flag) {
|
|
134
|
-
result += "threadgroup ";
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
if (!result.empty()) {
|
|
138
|
-
result.pop_back();
|
|
139
|
-
}
|
|
140
|
-
return result;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
bool operator==(const Modifiers& other) const {
|
|
144
|
-
return fLayout == other.fLayout && fFlags == other.fFlags;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
bool operator!=(const Modifiers& other) const {
|
|
148
|
-
return !(*this == other);
|
|
149
|
-
}
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Verifies that only permitted modifiers and layout flags are included. Reports errors and
|
|
153
|
-
* returns false in the event of a violation.
|
|
154
|
-
*/
|
|
155
|
-
bool checkPermitted(const Context& context,
|
|
156
|
-
Position pos,
|
|
157
|
-
int permittedModifierFlags,
|
|
158
|
-
int permittedLayoutFlags) const;
|
|
159
|
-
|
|
160
|
-
Layout fLayout;
|
|
161
|
-
int fFlags;
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
} // namespace SkSL
|
|
165
|
-
|
|
166
|
-
namespace std {
|
|
167
|
-
|
|
168
|
-
template <>
|
|
169
|
-
struct hash<SkSL::Modifiers> {
|
|
170
|
-
size_t operator()(const SkSL::Modifiers& key) const {
|
|
171
|
-
return (size_t) key.fFlags ^ ((size_t) key.fLayout.fFlags << 8) ^
|
|
172
|
-
((size_t) key.fLayout.fBuiltin << 16);
|
|
173
|
-
}
|
|
174
|
-
};
|
|
175
|
-
|
|
176
|
-
} // namespace std
|
|
177
|
-
|
|
178
|
-
#endif
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2016 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 SKSL_PROGRAMELEMENT
|
|
9
|
-
#define SKSL_PROGRAMELEMENT
|
|
10
|
-
|
|
11
|
-
#include "include/private/SkSLIRNode.h"
|
|
12
|
-
|
|
13
|
-
#include <memory>
|
|
14
|
-
|
|
15
|
-
namespace SkSL {
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Represents a top-level element (e.g. function or global variable) in a program.
|
|
19
|
-
*/
|
|
20
|
-
class ProgramElement : public IRNode {
|
|
21
|
-
public:
|
|
22
|
-
enum class Kind {
|
|
23
|
-
kExtension = 0,
|
|
24
|
-
kFunction,
|
|
25
|
-
kFunctionPrototype,
|
|
26
|
-
kGlobalVar,
|
|
27
|
-
kInterfaceBlock,
|
|
28
|
-
kModifiers,
|
|
29
|
-
kStructDefinition,
|
|
30
|
-
|
|
31
|
-
kFirst = kExtension,
|
|
32
|
-
kLast = kStructDefinition
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
ProgramElement(Position pos, Kind kind)
|
|
36
|
-
: INHERITED(pos, (int) kind) {
|
|
37
|
-
SkASSERT(kind >= Kind::kFirst && kind <= Kind::kLast);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
Kind kind() const {
|
|
41
|
-
return (Kind) fKind;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Use is<T> to check the type of a program element.
|
|
46
|
-
* e.g. replace `el.kind() == ProgramElement::Kind::kExtension` with `el.is<Extension>()`.
|
|
47
|
-
*/
|
|
48
|
-
template <typename T>
|
|
49
|
-
bool is() const {
|
|
50
|
-
return this->kind() == T::kProgramElementKind;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* Use as<T> to downcast program elements. e.g. replace `(Extension&) el` with
|
|
55
|
-
* `el.as<Extension>()`.
|
|
56
|
-
*/
|
|
57
|
-
template <typename T>
|
|
58
|
-
const T& as() const {
|
|
59
|
-
SkASSERT(this->is<T>());
|
|
60
|
-
return static_cast<const T&>(*this);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
template <typename T>
|
|
64
|
-
T& as() {
|
|
65
|
-
SkASSERT(this->is<T>());
|
|
66
|
-
return static_cast<T&>(*this);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
virtual std::unique_ptr<ProgramElement> clone() const = 0;
|
|
70
|
-
|
|
71
|
-
private:
|
|
72
|
-
using INHERITED = IRNode;
|
|
73
|
-
};
|
|
74
|
-
|
|
75
|
-
} // namespace SkSL
|
|
76
|
-
|
|
77
|
-
#endif
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2021 Google LLC.
|
|
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 SkSLProgramKind_DEFINED
|
|
9
|
-
#define SkSLProgramKind_DEFINED
|
|
10
|
-
|
|
11
|
-
#include <cinttypes>
|
|
12
|
-
|
|
13
|
-
namespace SkSL {
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* SkSL supports several different program kinds.
|
|
17
|
-
*/
|
|
18
|
-
enum class ProgramKind : int8_t {
|
|
19
|
-
kFragment,
|
|
20
|
-
kVertex,
|
|
21
|
-
kCompute,
|
|
22
|
-
kGraphiteFragment,
|
|
23
|
-
kGraphiteVertex,
|
|
24
|
-
kRuntimeColorFilter, // Runtime effect only suitable as SkColorFilter
|
|
25
|
-
kRuntimeShader, // " " " " " SkShader
|
|
26
|
-
kRuntimeBlender, // " " " " " SkBlender
|
|
27
|
-
kPrivateRuntimeShader, // Runtime shader with public restrictions lifted
|
|
28
|
-
kMeshVertex, // Vertex portion of a custom mesh
|
|
29
|
-
kMeshFragment, // Fragment " " " " "
|
|
30
|
-
kGeneric,
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
} // namespace SkSL
|
|
34
|
-
|
|
35
|
-
#endif
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2016 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 SKSL_STATEMENT
|
|
9
|
-
#define SKSL_STATEMENT
|
|
10
|
-
|
|
11
|
-
#include "include/private/SkSLIRNode.h"
|
|
12
|
-
#include "include/private/SkSLSymbol.h"
|
|
13
|
-
|
|
14
|
-
namespace SkSL {
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Abstract supertype of all statements.
|
|
18
|
-
*/
|
|
19
|
-
class Statement : public IRNode {
|
|
20
|
-
public:
|
|
21
|
-
enum Kind {
|
|
22
|
-
kBlock = (int) Symbol::Kind::kLast + 1,
|
|
23
|
-
kBreak,
|
|
24
|
-
kContinue,
|
|
25
|
-
kDiscard,
|
|
26
|
-
kDo,
|
|
27
|
-
kExpression,
|
|
28
|
-
kFor,
|
|
29
|
-
kIf,
|
|
30
|
-
kNop,
|
|
31
|
-
kReturn,
|
|
32
|
-
kSwitch,
|
|
33
|
-
kSwitchCase,
|
|
34
|
-
kVarDeclaration,
|
|
35
|
-
|
|
36
|
-
kFirst = kBlock,
|
|
37
|
-
kLast = kVarDeclaration,
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
Statement(Position pos, Kind kind)
|
|
41
|
-
: INHERITED(pos, (int) kind) {
|
|
42
|
-
SkASSERT(kind >= Kind::kFirst && kind <= Kind::kLast);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
Kind kind() const {
|
|
46
|
-
return (Kind) fKind;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Use is<T> to check the type of a statement.
|
|
51
|
-
* e.g. replace `s.kind() == Statement::Kind::kReturn` with `s.is<ReturnStatement>()`.
|
|
52
|
-
*/
|
|
53
|
-
template <typename T>
|
|
54
|
-
bool is() const {
|
|
55
|
-
return this->fKind == T::kStatementKind;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* Use as<T> to downcast statements.
|
|
60
|
-
* e.g. replace `(ReturnStatement&) s` with `s.as<ReturnStatement>()`.
|
|
61
|
-
*/
|
|
62
|
-
template <typename T>
|
|
63
|
-
const T& as() const {
|
|
64
|
-
SkASSERT(this->is<T>());
|
|
65
|
-
return static_cast<const T&>(*this);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
template <typename T>
|
|
69
|
-
T& as() {
|
|
70
|
-
SkASSERT(this->is<T>());
|
|
71
|
-
return static_cast<T&>(*this);
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
virtual bool isEmpty() const {
|
|
75
|
-
return false;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
virtual std::unique_ptr<Statement> clone() const = 0;
|
|
79
|
-
|
|
80
|
-
private:
|
|
81
|
-
using INHERITED = IRNode;
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
} // namespace SkSL
|
|
85
|
-
|
|
86
|
-
#endif
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2017 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 SKSL_STRING
|
|
9
|
-
#define SKSL_STRING
|
|
10
|
-
|
|
11
|
-
#include "include/core/SkTypes.h"
|
|
12
|
-
#include "include/private/SkSLDefines.h"
|
|
13
|
-
|
|
14
|
-
#include <stdarg.h>
|
|
15
|
-
#include <string>
|
|
16
|
-
#include <string_view>
|
|
17
|
-
|
|
18
|
-
namespace SkSL {
|
|
19
|
-
|
|
20
|
-
bool stod(std::string_view s, SKSL_FLOAT* value);
|
|
21
|
-
bool stoi(std::string_view s, SKSL_INT* value);
|
|
22
|
-
|
|
23
|
-
namespace String {
|
|
24
|
-
|
|
25
|
-
std::string printf(const char* fmt, ...) SK_PRINTF_LIKE(1, 2);
|
|
26
|
-
void appendf(std::string* str, const char* fmt, ...) SK_PRINTF_LIKE(2, 3);
|
|
27
|
-
void vappendf(std::string* str, const char* fmt, va_list va) SK_PRINTF_LIKE(2, 0);
|
|
28
|
-
|
|
29
|
-
} // namespace String
|
|
30
|
-
} // namespace SkSL
|
|
31
|
-
|
|
32
|
-
namespace skstd {
|
|
33
|
-
|
|
34
|
-
// We use a custom to_string(float|double) which ignores locale settings and writes `1.0` instead
|
|
35
|
-
// of `1.00000`.
|
|
36
|
-
std::string to_string(float value);
|
|
37
|
-
std::string to_string(double value);
|
|
38
|
-
|
|
39
|
-
} // namespace skstd
|
|
40
|
-
|
|
41
|
-
#endif
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2016 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 SKSL_SYMBOL
|
|
9
|
-
#define SKSL_SYMBOL
|
|
10
|
-
|
|
11
|
-
#include "include/private/SkSLIRNode.h"
|
|
12
|
-
#include "include/private/SkSLProgramElement.h"
|
|
13
|
-
|
|
14
|
-
namespace SkSL {
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Represents a symboltable entry.
|
|
18
|
-
*/
|
|
19
|
-
class Symbol : public IRNode {
|
|
20
|
-
public:
|
|
21
|
-
enum class Kind {
|
|
22
|
-
kExternal = (int) ProgramElement::Kind::kLast + 1,
|
|
23
|
-
kField,
|
|
24
|
-
kFunctionDeclaration,
|
|
25
|
-
kType,
|
|
26
|
-
kVariable,
|
|
27
|
-
|
|
28
|
-
kFirst = kExternal,
|
|
29
|
-
kLast = kVariable
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
Symbol(Position pos, Kind kind, std::string_view name, const Type* type = nullptr)
|
|
33
|
-
: INHERITED(pos, (int) kind)
|
|
34
|
-
, fName(name)
|
|
35
|
-
, fType(type) {
|
|
36
|
-
SkASSERT(kind >= Kind::kFirst && kind <= Kind::kLast);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
~Symbol() override {}
|
|
40
|
-
|
|
41
|
-
const Type& type() const {
|
|
42
|
-
SkASSERT(fType);
|
|
43
|
-
return *fType;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
Kind kind() const {
|
|
47
|
-
return (Kind) fKind;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
std::string_view name() const {
|
|
51
|
-
return fName;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Don't call this directly--use SymbolTable::renameSymbol instead!
|
|
56
|
-
*/
|
|
57
|
-
void setName(std::string_view newName) {
|
|
58
|
-
fName = newName;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* Use is<T> to check the type of a symbol.
|
|
63
|
-
* e.g. replace `sym.kind() == Symbol::Kind::kVariable` with `sym.is<Variable>()`.
|
|
64
|
-
*/
|
|
65
|
-
template <typename T>
|
|
66
|
-
bool is() const {
|
|
67
|
-
return this->kind() == T::kSymbolKind;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Use as<T> to downcast symbols. e.g. replace `(Variable&) sym` with `sym.as<Variable>()`.
|
|
72
|
-
*/
|
|
73
|
-
template <typename T>
|
|
74
|
-
const T& as() const {
|
|
75
|
-
SkASSERT(this->is<T>());
|
|
76
|
-
return static_cast<const T&>(*this);
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
template <typename T>
|
|
80
|
-
T& as() {
|
|
81
|
-
SkASSERT(this->is<T>());
|
|
82
|
-
return static_cast<T&>(*this);
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
private:
|
|
86
|
-
std::string_view fName;
|
|
87
|
-
const Type* fType;
|
|
88
|
-
|
|
89
|
-
using INHERITED = IRNode;
|
|
90
|
-
};
|
|
91
|
-
|
|
92
|
-
} // namespace SkSL
|
|
93
|
-
|
|
94
|
-
#endif
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2016 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 SkSafe_math_DEFINED
|
|
9
|
-
#define SkSafe_math_DEFINED
|
|
10
|
-
|
|
11
|
-
// This file protects against known bugs in ucrt\math.h.
|
|
12
|
-
// Namely, that header defines inline methods without marking them static,
|
|
13
|
-
// which makes it very easy to cause ODR violations and ensuing chaos.
|
|
14
|
-
//
|
|
15
|
-
// TODO: other headers? Here are some potential problem headers:
|
|
16
|
-
// $ grep -R __inline * | grep -v static | cut -f 1 -d: | sort | uniq
|
|
17
|
-
// corecrt.h
|
|
18
|
-
// corecrt_stdio_config.h
|
|
19
|
-
// ctype.h
|
|
20
|
-
// fenv.h
|
|
21
|
-
// locale.h
|
|
22
|
-
// malloc.h
|
|
23
|
-
// math.h
|
|
24
|
-
// tchar.h
|
|
25
|
-
// wchar.h
|
|
26
|
-
// I took a quick look through other headers outside math.h.
|
|
27
|
-
// Nothing looks anywhere near as likely to be used by Skia as math.h.
|
|
28
|
-
|
|
29
|
-
#if defined(_MSC_VER) && !defined(_INC_MATH)
|
|
30
|
-
// Our strategy here is to simply inject "static" into the headers
|
|
31
|
-
// where it should have been written, just before __inline.
|
|
32
|
-
//
|
|
33
|
-
// Most inline-but-not-static methods in math.h are 32-bit only,
|
|
34
|
-
// but not all of them (see frexpf, hypothf, ldexpf...). So to
|
|
35
|
-
// be safe, 32- and 64-bit builds both get this treatment.
|
|
36
|
-
|
|
37
|
-
#define __inline static __inline
|
|
38
|
-
#include <math.h>
|
|
39
|
-
#undef __inline
|
|
40
|
-
|
|
41
|
-
#if !defined(_INC_MATH)
|
|
42
|
-
#error Hmm. Looks like math.h has changed its header guards.
|
|
43
|
-
#endif
|
|
44
|
-
|
|
45
|
-
#define INC_MATH_IS_SAFE_NOW
|
|
46
|
-
|
|
47
|
-
#else
|
|
48
|
-
#include <math.h>
|
|
49
|
-
|
|
50
|
-
#endif
|
|
51
|
-
|
|
52
|
-
#endif//SkSafe_math_DEFINED
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright 2021 Google LLC.
|
|
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 SkStringView_DEFINED
|
|
9
|
-
#define SkStringView_DEFINED
|
|
10
|
-
|
|
11
|
-
#include <string.h>
|
|
12
|
-
#include <string_view>
|
|
13
|
-
|
|
14
|
-
namespace skstd {
|
|
15
|
-
|
|
16
|
-
// C++20 additions
|
|
17
|
-
inline constexpr bool starts_with(std::string_view str, std::string_view prefix) {
|
|
18
|
-
if (prefix.length() > str.length()) {
|
|
19
|
-
return false;
|
|
20
|
-
}
|
|
21
|
-
return prefix.length() == 0 || !memcmp(str.data(), prefix.data(), prefix.length());
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
inline constexpr bool starts_with(std::string_view str, std::string_view::value_type c) {
|
|
25
|
-
return !str.empty() && str.front() == c;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
inline constexpr bool ends_with(std::string_view str, std::string_view suffix) {
|
|
29
|
-
if (suffix.length() > str.length()) {
|
|
30
|
-
return false;
|
|
31
|
-
}
|
|
32
|
-
return suffix.length() == 0 || !memcmp(str.data() + str.length() - suffix.length(),
|
|
33
|
-
suffix.data(), suffix.length());
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
inline constexpr bool ends_with(std::string_view str, std::string_view::value_type c) {
|
|
37
|
-
return !str.empty() && str.back() == c;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
// C++23 additions
|
|
41
|
-
inline constexpr bool contains(std::string_view str, std::string_view needle) {
|
|
42
|
-
return str.find(needle) != std::string_view::npos;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
inline constexpr bool contains(std::string_view str, std::string_view::value_type c) {
|
|
46
|
-
return str.find(c) != std::string_view::npos;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
} // namespace skstd
|
|
50
|
-
|
|
51
|
-
#endif
|