@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
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
#include "include/core/SkTypeface.h"
|
|
14
14
|
#include "include/core/SkTypes.h"
|
|
15
15
|
#include "include/ports/SkRemotableFontMgr.h"
|
|
16
|
-
#include "include/private/SkMutex.h"
|
|
17
|
-
#include "include/private/SkOnce.h"
|
|
18
|
-
#include "include/private/SkTArray.h"
|
|
16
|
+
#include "include/private/base/SkMutex.h"
|
|
17
|
+
#include "include/private/base/SkOnce.h"
|
|
18
|
+
#include "include/private/base/SkTArray.h"
|
|
19
19
|
|
|
20
20
|
class SkData;
|
|
21
21
|
class SkFontStyle;
|
|
@@ -34,18 +34,18 @@ public:
|
|
|
34
34
|
protected:
|
|
35
35
|
int onCountFamilies() const override;
|
|
36
36
|
void onGetFamilyName(int index, SkString* familyName) const override;
|
|
37
|
-
SkFontStyleSet
|
|
37
|
+
sk_sp<SkFontStyleSet> onCreateStyleSet(int index) const override;
|
|
38
38
|
|
|
39
|
-
SkFontStyleSet
|
|
39
|
+
sk_sp<SkFontStyleSet> onMatchFamily(const char familyName[]) const override;
|
|
40
40
|
|
|
41
|
-
SkTypeface
|
|
42
|
-
|
|
41
|
+
sk_sp<SkTypeface> onMatchFamilyStyle(const char familyName[],
|
|
42
|
+
const SkFontStyle& fontStyle) const override;
|
|
43
43
|
|
|
44
|
-
SkTypeface
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
sk_sp<SkTypeface> onMatchFamilyStyleCharacter(const char familyName[],
|
|
45
|
+
const SkFontStyle&,
|
|
46
|
+
const char* bcp47[],
|
|
47
|
+
int bcp47Count,
|
|
48
|
+
SkUnichar character) const override;
|
|
49
49
|
|
|
50
50
|
sk_sp<SkTypeface> onMakeFromStreamIndex(std::unique_ptr<SkStreamAsset>, int ttcIndex) const override;
|
|
51
51
|
sk_sp<SkTypeface> onMakeFromStreamArgs(std::unique_ptr<SkStreamAsset> stream,
|
|
@@ -55,7 +55,7 @@ protected:
|
|
|
55
55
|
sk_sp<SkTypeface> onLegacyMakeTypeface(const char familyName[], SkFontStyle) const override;
|
|
56
56
|
|
|
57
57
|
private:
|
|
58
|
-
SkTypeface
|
|
58
|
+
sk_sp<SkTypeface> createTypefaceFromFontId(const SkFontIdentity& fontId) const;
|
|
59
59
|
|
|
60
60
|
sk_sp<SkFontMgr> fImpl;
|
|
61
61
|
sk_sp<SkRemotableFontMgr> fProxy;
|
|
@@ -93,7 +93,7 @@ private:
|
|
|
93
93
|
* typefaces with that data id. By storing the index next to the typeface,
|
|
94
94
|
* this data cache also acts as a typeface cache.
|
|
95
95
|
*/
|
|
96
|
-
mutable
|
|
96
|
+
mutable skia_private::TArray<DataEntry> fDataCache;
|
|
97
97
|
mutable SkMutex fDataCacheMutex;
|
|
98
98
|
|
|
99
99
|
friend class SkStyleSet_Indirect;
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
#include "include/core/SkFontStyle.h"
|
|
12
12
|
#include "include/core/SkRefCnt.h"
|
|
13
13
|
#include "include/core/SkTypes.h"
|
|
14
|
-
#include "include/private/SkTemplates.h"
|
|
14
|
+
#include "include/private/base/SkTemplates.h"
|
|
15
15
|
|
|
16
16
|
class SkDataTable;
|
|
17
17
|
class SkStreamAsset;
|
|
@@ -48,7 +48,7 @@ private:
|
|
|
48
48
|
friend SkRemotableFontIdentitySet* sk_remotable_font_identity_set_new();
|
|
49
49
|
|
|
50
50
|
int fCount;
|
|
51
|
-
|
|
51
|
+
skia_private::AutoTArray<SkFontIdentity> fData;
|
|
52
52
|
|
|
53
53
|
using INHERITED = SkRefCnt;
|
|
54
54
|
};
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
#ifndef SkTypeface_win_DEFINED
|
|
9
9
|
#define SkTypeface_win_DEFINED
|
|
10
10
|
|
|
11
|
+
#include "include/core/SkRefCnt.h"
|
|
11
12
|
#include "include/core/SkTypeface.h"
|
|
12
13
|
#include "include/core/SkTypes.h"
|
|
13
14
|
|
|
@@ -26,7 +27,7 @@ typedef LOGFONTA LOGFONT;
|
|
|
26
27
|
* corresponding typeface for the specified logfont. The caller is responsible
|
|
27
28
|
* for calling unref() when it is finished.
|
|
28
29
|
*/
|
|
29
|
-
SK_API SkTypeface
|
|
30
|
+
SK_API sk_sp<SkTypeface> SkCreateTypefaceFromLOGFONT(const LOGFONT&);
|
|
30
31
|
|
|
31
32
|
/**
|
|
32
33
|
* Copy the LOGFONT associated with this typeface into the lf parameter. Note
|
|
@@ -10,17 +10,22 @@
|
|
|
10
10
|
|
|
11
11
|
#include "include/core/SkString.h"
|
|
12
12
|
#include "include/core/SkTypes.h"
|
|
13
|
-
#include "include/private/SkNoncopyable.h"
|
|
14
13
|
#include "include/private/SkOpts_spi.h"
|
|
15
|
-
#include "include/private/SkTLogic.h"
|
|
14
|
+
#include "include/private/base/SkTLogic.h"
|
|
16
15
|
|
|
17
16
|
#include <string>
|
|
18
17
|
#include <string_view>
|
|
18
|
+
#include <type_traits>
|
|
19
19
|
|
|
20
|
-
class SkChecksum
|
|
20
|
+
class SkChecksum {
|
|
21
21
|
public:
|
|
22
|
+
SkChecksum() = default;
|
|
23
|
+
// Make noncopyable
|
|
24
|
+
SkChecksum(const SkChecksum&) = delete;
|
|
25
|
+
SkChecksum& operator=(const SkChecksum&) = delete;
|
|
26
|
+
|
|
22
27
|
/**
|
|
23
|
-
* uint32_t -> uint32_t hash, useful for when you're about to
|
|
28
|
+
* uint32_t -> uint32_t hash, useful for when you're about to truncate this hash but you
|
|
24
29
|
* suspect its low bits aren't well mixed.
|
|
25
30
|
*
|
|
26
31
|
* This is the Murmur3 finalizer.
|
|
@@ -35,7 +40,7 @@ public:
|
|
|
35
40
|
}
|
|
36
41
|
|
|
37
42
|
/**
|
|
38
|
-
* uint32_t -> uint32_t hash, useful for when you're about to
|
|
43
|
+
* uint32_t -> uint32_t hash, useful for when you're about to truncate this hash but you
|
|
39
44
|
* suspect its low bits aren't well mixed.
|
|
40
45
|
*
|
|
41
46
|
* This version is 2-lines cheaper than Mix, but seems to be sufficient for the font cache.
|
|
@@ -52,12 +57,14 @@ public:
|
|
|
52
57
|
// It should be both reasonably fast and high quality.
|
|
53
58
|
struct SkGoodHash {
|
|
54
59
|
template <typename K>
|
|
55
|
-
std::enable_if_t<sizeof(K) == 4, uint32_t>
|
|
60
|
+
std::enable_if_t<std::has_unique_object_representations<K>::value && sizeof(K) == 4, uint32_t>
|
|
61
|
+
operator()(const K& k) const {
|
|
56
62
|
return SkChecksum::Mix(*(const uint32_t*)&k);
|
|
57
63
|
}
|
|
58
64
|
|
|
59
65
|
template <typename K>
|
|
60
|
-
std::enable_if_t<sizeof(K) != 4, uint32_t>
|
|
66
|
+
std::enable_if_t<std::has_unique_object_representations<K>::value && sizeof(K) != 4, uint32_t>
|
|
67
|
+
operator()(const K& k) const {
|
|
61
68
|
return SkOpts::hash_fn(&k, sizeof(K), 0);
|
|
62
69
|
}
|
|
63
70
|
|
|
@@ -74,4 +81,22 @@ struct SkGoodHash {
|
|
|
74
81
|
}
|
|
75
82
|
};
|
|
76
83
|
|
|
84
|
+
// The default hashing behavior in SkGoodHash requires the type to have a unique object
|
|
85
|
+
// representation (i.e. all bits in contribute to its identity so can be hashed directly). This is
|
|
86
|
+
// false when a struct has padding for alignment (which can be avoided by using
|
|
87
|
+
// SK_BEGIN|END_REQUIRE_DENSE) or if the struct has floating point members since there are multiple
|
|
88
|
+
// bit representations for NaN.
|
|
89
|
+
//
|
|
90
|
+
// Often Skia code has externally removed the possibility of NaN so the bit representation of a
|
|
91
|
+
// non-NaN float will still hash correctly. SkForceDirectHash<K> produces the same as SkGoodHash
|
|
92
|
+
// for K's that do not satisfy std::has_unique_object_representation. It should be used sparingly
|
|
93
|
+
// and it's use may highlight design issues with the key's data that might warrant an explicitly
|
|
94
|
+
// implemented hash function.
|
|
95
|
+
template <typename K>
|
|
96
|
+
struct SkForceDirectHash {
|
|
97
|
+
uint32_t operator()(const K& k) const {
|
|
98
|
+
return SkOpts::hash_fn(&k, sizeof(K), 0);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
|
|
77
102
|
#endif
|
|
@@ -10,8 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
#include "include/core/SkColor.h"
|
|
12
12
|
#include "include/core/SkColorPriv.h"
|
|
13
|
-
#include "include/private/SkTo.h"
|
|
14
|
-
#include "include/private/SkVx.h"
|
|
13
|
+
#include "include/private/base/SkTo.h"
|
|
15
14
|
|
|
16
15
|
////////////////////////////////////////////////////////////////////////////////////////////
|
|
17
16
|
// Convert a 16bit pixel to a 32bit pixel
|
|
@@ -374,30 +373,6 @@ static inline SkPMColor SkPixel4444ToPixel32(U16CPU c) {
|
|
|
374
373
|
return d | (d << 4);
|
|
375
374
|
}
|
|
376
375
|
|
|
377
|
-
static inline skvx::float4 swizzle_rb(const skvx::float4& x) {
|
|
378
|
-
return skvx::shuffle<2, 1, 0, 3>(x);
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
static inline skvx::float4 swizzle_rb_if_bgra(const skvx::float4& x) {
|
|
382
|
-
#ifdef SK_PMCOLOR_IS_BGRA
|
|
383
|
-
return swizzle_rb(x);
|
|
384
|
-
#else
|
|
385
|
-
return x;
|
|
386
|
-
#endif
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
static inline skvx::float4 Sk4f_fromL32(uint32_t px) {
|
|
390
|
-
return skvx::cast<float>(skvx::byte4::Load(&px)) * (1 / 255.0f);
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
static inline uint32_t Sk4f_toL32(const skvx::float4& px) {
|
|
394
|
-
uint32_t l32;
|
|
395
|
-
// For the expected positive color values, the +0.5 before the pin and cast effectively rounds
|
|
396
|
-
// to the nearest int without having to call round() or lrint().
|
|
397
|
-
skvx::cast<uint8_t>(pin(px * 255.f + 0.5f, skvx::float4(0.f), skvx::float4(255.f))).store(&l32);
|
|
398
|
-
return l32;
|
|
399
|
-
}
|
|
400
|
-
|
|
401
376
|
using SkPMColor4f = SkRGBA4f<kPremul_SkAlphaType>;
|
|
402
377
|
|
|
403
378
|
constexpr SkPMColor4f SK_PMColor4fTRANSPARENT = { 0, 0, 0, 0 };
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2023 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 SkGainmapInfo_DEFINED
|
|
9
|
+
#define SkGainmapInfo_DEFINED
|
|
10
|
+
|
|
11
|
+
#include "include/core/SkColor.h"
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Gainmap rendering parameters. Suppose our display has HDR to SDR ratio of H and we wish to
|
|
15
|
+
* display an image with gainmap on this display. Let B be the pixel value from the base image
|
|
16
|
+
* in a color space that has the primaries of the base image and a linear transfer function. Let
|
|
17
|
+
* G be the pixel value from the gainmap. Let D be the output pixel in the same color space as B.
|
|
18
|
+
* The value of D is computed as follows:
|
|
19
|
+
*
|
|
20
|
+
* First, let W be a weight parameter determing how much the gainmap will be applied.
|
|
21
|
+
* W = clamp((log(H) - log(fDisplayRatioSdr)) /
|
|
22
|
+
* (log(fDisplayRatioHdr) - log(fDisplayRatioSdr), 0, 1)
|
|
23
|
+
*
|
|
24
|
+
* Next, let L be the gainmap value in log space. We compute this from the value G that was
|
|
25
|
+
* sampled from the texture as follows:
|
|
26
|
+
* L = mix(log(fGainmapRatioMin), log(fGainmapRatioMax), pow(G, fGainmapGamma))
|
|
27
|
+
*
|
|
28
|
+
* Finally, apply the gainmap to compute D, the displayed pixel. If the base image is SDR then
|
|
29
|
+
* compute:
|
|
30
|
+
* D = (B + fEpsilonSdr) * exp(L * W) - fEpsilonHdr
|
|
31
|
+
* If the base image is HDR then compute:
|
|
32
|
+
* D = (B + fEpsilonHdr) * exp(L * (W - 1)) - fEpsilonSdr
|
|
33
|
+
*
|
|
34
|
+
* In the above math, log() is a natural logarithm and exp() is natural exponentiation. Note,
|
|
35
|
+
* however, that the base used for the log() and exp() functions does not affect the results of
|
|
36
|
+
* the computation (it cancels out, as long as the same base is used throughout).
|
|
37
|
+
*/
|
|
38
|
+
struct SkGainmapInfo {
|
|
39
|
+
/**
|
|
40
|
+
* Parameters for converting the gainmap from its image encoding to log space. These are
|
|
41
|
+
* specified per color channel. The alpha value is unused.
|
|
42
|
+
*/
|
|
43
|
+
SkColor4f fGainmapRatioMin = {1.f, 1.f, 1.f, 1.0};
|
|
44
|
+
SkColor4f fGainmapRatioMax = {2.f, 2.f, 2.f, 1.0};
|
|
45
|
+
SkColor4f fGainmapGamma = {1.f, 1.f, 1.f, 1.f};
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Parameters sometimes used in gainmap computation to avoid numerical instability.
|
|
49
|
+
*/
|
|
50
|
+
SkColor4f fEpsilonSdr = {0.f, 0.f, 0.f, 1.0};
|
|
51
|
+
SkColor4f fEpsilonHdr = {0.f, 0.f, 0.f, 1.0};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* If the output display's HDR to SDR ratio is less or equal than fDisplayRatioSdr then the SDR
|
|
55
|
+
* rendition is displayed. If the output display's HDR to SDR ratio is greater or equal than
|
|
56
|
+
* fDisplayRatioHdr then the HDR rendition is displayed. If the output display's HDR to SDR
|
|
57
|
+
* ratio is between these values then an interpolation between the two is displayed using the
|
|
58
|
+
* math above.
|
|
59
|
+
*/
|
|
60
|
+
float fDisplayRatioSdr = 1.f;
|
|
61
|
+
float fDisplayRatioHdr = 2.f;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Whether the base image is the SDR image or the HDR image.
|
|
65
|
+
*/
|
|
66
|
+
enum class BaseImageType {
|
|
67
|
+
kSDR,
|
|
68
|
+
kHDR,
|
|
69
|
+
};
|
|
70
|
+
BaseImageType fBaseImageType = BaseImageType::kSDR;
|
|
71
|
+
|
|
72
|
+
inline bool operator==(const SkGainmapInfo& other) {
|
|
73
|
+
return fGainmapRatioMin == other.fGainmapRatioMin &&
|
|
74
|
+
fGainmapRatioMax == other.fGainmapRatioMax && fGainmapGamma == other.fGainmapGamma &&
|
|
75
|
+
fEpsilonSdr == other.fEpsilonSdr && fEpsilonHdr == other.fEpsilonHdr &&
|
|
76
|
+
fDisplayRatioSdr == other.fDisplayRatioSdr &&
|
|
77
|
+
fDisplayRatioHdr == other.fDisplayRatioHdr && fBaseImageType == other.fBaseImageType;
|
|
78
|
+
}
|
|
79
|
+
inline bool operator!=(const SkGainmapInfo& other) { return !(*this == other); }
|
|
80
|
+
|
|
81
|
+
// TODO(ccameron): Remove these parameters once we are certain they are not used in Android.
|
|
82
|
+
enum class Type {
|
|
83
|
+
kUnknown,
|
|
84
|
+
kMultiPicture,
|
|
85
|
+
kJpegR_Linear,
|
|
86
|
+
kJpegR_HLG,
|
|
87
|
+
kJpegR_PQ,
|
|
88
|
+
kHDRGM,
|
|
89
|
+
};
|
|
90
|
+
SkColor4f fLogRatioMin = {0.f, 0.f, 0.f, 1.0};
|
|
91
|
+
SkColor4f fLogRatioMax = {1.f, 1.f, 1.f, 1.0};
|
|
92
|
+
float fHdrRatioMin = 1.f;
|
|
93
|
+
float fHdrRatioMax = 50.f;
|
|
94
|
+
Type fType = Type::kUnknown;
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
#endif
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2023 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 SkGainmapShader_DEFINED
|
|
9
|
+
#define SkGainmapShader_DEFINED
|
|
10
|
+
|
|
11
|
+
#include "include/core/SkRefCnt.h"
|
|
12
|
+
|
|
13
|
+
class SkColorSpace;
|
|
14
|
+
class SkShader;
|
|
15
|
+
class SkImage;
|
|
16
|
+
struct SkGainmapInfo;
|
|
17
|
+
struct SkRect;
|
|
18
|
+
struct SkSamplingOptions;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* A gainmap shader will apply a gainmap to an base image using the math described alongside the
|
|
22
|
+
* definition of SkGainmapInfo.
|
|
23
|
+
*/
|
|
24
|
+
class SK_API SkGainmapShader {
|
|
25
|
+
public:
|
|
26
|
+
/**
|
|
27
|
+
* Make a gainmap shader.
|
|
28
|
+
*
|
|
29
|
+
* When sampling the base image baseImage, the rectangle baseRect will be sampled to map to
|
|
30
|
+
* the rectangle dstRect. Sampling will be done according to baseSamplingOptions.
|
|
31
|
+
*
|
|
32
|
+
* When sampling the gainmap image gainmapImage, the rectangle gainmapRect will be sampled to
|
|
33
|
+
* map to the rectangle dstRect. Sampling will be done according to gainmapSamplingOptions.
|
|
34
|
+
*
|
|
35
|
+
* The gainmap will be applied according to the HDR to SDR ratio specified in dstHdrRatio.
|
|
36
|
+
*
|
|
37
|
+
* This shader must know the color space of the canvas that it will be rendered to. This color
|
|
38
|
+
* space must be specified in dstColorSpace.
|
|
39
|
+
* TODO(ccameron): Remove the need for dstColorSpace.
|
|
40
|
+
*/
|
|
41
|
+
static sk_sp<SkShader> Make(const sk_sp<const SkImage>& baseImage,
|
|
42
|
+
const SkRect& baseRect,
|
|
43
|
+
const SkSamplingOptions& baseSamplingOptions,
|
|
44
|
+
const sk_sp<const SkImage>& gainmapImage,
|
|
45
|
+
const SkRect& gainmapRect,
|
|
46
|
+
const SkSamplingOptions& gainmapSamplingOptions,
|
|
47
|
+
const SkGainmapInfo& gainmapInfo,
|
|
48
|
+
const SkRect& dstRect,
|
|
49
|
+
float dstHdrRatio,
|
|
50
|
+
sk_sp<SkColorSpace> dstColorSpace);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
#endif
|
|
@@ -9,8 +9,9 @@
|
|
|
9
9
|
#define SkIDChangeListener_DEFINED
|
|
10
10
|
|
|
11
11
|
#include "include/core/SkRefCnt.h"
|
|
12
|
-
#include "include/private/SkMutex.h"
|
|
13
|
-
#include "include/private/
|
|
12
|
+
#include "include/private/base/SkMutex.h"
|
|
13
|
+
#include "include/private/base/SkTArray.h"
|
|
14
|
+
#include "include/private/base/SkThreadAnnotations.h"
|
|
14
15
|
|
|
15
16
|
#include <atomic>
|
|
16
17
|
|
|
@@ -65,7 +66,7 @@ public:
|
|
|
65
66
|
|
|
66
67
|
private:
|
|
67
68
|
mutable SkMutex fMutex;
|
|
68
|
-
|
|
69
|
+
skia_private::STArray<1, sk_sp<SkIDChangeListener>> fListeners SK_GUARDED_BY(fMutex);
|
|
69
70
|
};
|
|
70
71
|
|
|
71
72
|
private:
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2023 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 SkJpegGainmapEncoder_DEFINED
|
|
9
|
+
#define SkJpegGainmapEncoder_DEFINED
|
|
10
|
+
|
|
11
|
+
#include "include/encode/SkJpegEncoder.h"
|
|
12
|
+
|
|
13
|
+
class SkPixmap;
|
|
14
|
+
class SkWStream;
|
|
15
|
+
struct SkGainmapInfo;
|
|
16
|
+
|
|
17
|
+
class SK_API SkJpegGainmapEncoder {
|
|
18
|
+
public:
|
|
19
|
+
/**
|
|
20
|
+
* Encode a JpegR image to |dst|.
|
|
21
|
+
*
|
|
22
|
+
* The base image is specified by |base|, and |baseOptions| controls the encoding behavior for
|
|
23
|
+
* the base image.
|
|
24
|
+
*
|
|
25
|
+
* The gainmap image is specified by |gainmap|, and |gainmapOptions| controls the encoding
|
|
26
|
+
* behavior for the gainmap image.
|
|
27
|
+
*
|
|
28
|
+
* The rendering behavior of the gainmap image is provided in |gainmapInfo|. Not all gainmap
|
|
29
|
+
* based images are compatible with JpegR. If the image is not compatible with JpegR, then
|
|
30
|
+
* convert the gainmap to a format that is capable with JpegR. This conversion may result in
|
|
31
|
+
* less precise quantization of the gainmap image.
|
|
32
|
+
*
|
|
33
|
+
* Returns true on success. Returns false on an invalid or unsupported |src|.
|
|
34
|
+
*/
|
|
35
|
+
static bool EncodeJpegR(SkWStream* dst,
|
|
36
|
+
const SkPixmap& base,
|
|
37
|
+
const SkJpegEncoder::Options& baseOptions,
|
|
38
|
+
const SkPixmap& gainmap,
|
|
39
|
+
const SkJpegEncoder::Options& gainmapOptions,
|
|
40
|
+
const SkGainmapInfo& gainmapInfo);
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* Encode an HDRGM image to |dst|.
|
|
44
|
+
*
|
|
45
|
+
* The base image is specified by |base|, and |baseOptions| controls the encoding behavior for
|
|
46
|
+
* the base image.
|
|
47
|
+
*
|
|
48
|
+
* The gainmap image is specified by |gainmap|, and |gainmapOptions| controls the encoding
|
|
49
|
+
* behavior for the gainmap image.
|
|
50
|
+
*
|
|
51
|
+
* The rendering behavior of the gainmap image is provided in |gainmapInfo|.
|
|
52
|
+
*
|
|
53
|
+
* If |baseOptions| or |gainmapOptions| specify XMP metadata, then that metadata will be
|
|
54
|
+
* overwritten.
|
|
55
|
+
*
|
|
56
|
+
* Returns true on success. Returns false on an invalid or unsupported |src|.
|
|
57
|
+
*/
|
|
58
|
+
static bool EncodeHDRGM(SkWStream* dst,
|
|
59
|
+
const SkPixmap& base,
|
|
60
|
+
const SkJpegEncoder::Options& baseOptions,
|
|
61
|
+
const SkPixmap& gainmap,
|
|
62
|
+
const SkJpegEncoder::Options& gainmapOptions,
|
|
63
|
+
const SkGainmapInfo& gainmapInfo);
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Write a Multi Picture Format containing the |imageCount| images specified by |images|.
|
|
67
|
+
*/
|
|
68
|
+
static bool MakeMPF(SkWStream* dst, const SkData** images, size_t imageCount);
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
#endif
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2013 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 SkJpegMetadataDecoder_DEFINED
|
|
9
|
+
#define SkJpegMetadataDecoder_DEFINED
|
|
10
|
+
|
|
11
|
+
#include "include/core/SkData.h"
|
|
12
|
+
#include "include/core/SkRefCnt.h"
|
|
13
|
+
#include "include/core/SkTypes.h"
|
|
14
|
+
|
|
15
|
+
#include <memory>
|
|
16
|
+
#include <vector>
|
|
17
|
+
|
|
18
|
+
struct SkGainmapInfo;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* An interface that can be used to extract metadata from an encoded JPEG file.
|
|
22
|
+
* TODO(https://crbug.com/1404000): Add interface for ICC profile and EXIF extraction.
|
|
23
|
+
*/
|
|
24
|
+
class SK_API SkJpegMetadataDecoder {
|
|
25
|
+
public:
|
|
26
|
+
SkJpegMetadataDecoder() {}
|
|
27
|
+
virtual ~SkJpegMetadataDecoder() {}
|
|
28
|
+
|
|
29
|
+
SkJpegMetadataDecoder(const SkJpegMetadataDecoder&) = delete;
|
|
30
|
+
SkJpegMetadataDecoder& operator=(const SkJpegMetadataDecoder&) = delete;
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* A segment from a JPEG file. This is usually populated from a jpeg_marker_struct.
|
|
34
|
+
*/
|
|
35
|
+
struct SK_API Segment {
|
|
36
|
+
Segment(uint8_t marker, sk_sp<SkData> data) : fMarker(marker), fData(std::move(data)) {}
|
|
37
|
+
|
|
38
|
+
// The segment's marker.
|
|
39
|
+
uint8_t fMarker = 0;
|
|
40
|
+
|
|
41
|
+
// The segment's parameters (not including the marker and parameter length).
|
|
42
|
+
sk_sp<SkData> fData;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Create metadata for the specified segments from a JPEG file's header (defined as all segments
|
|
47
|
+
* before the first StartOfScan). This may return nullptr.
|
|
48
|
+
*/
|
|
49
|
+
static std::unique_ptr<SkJpegMetadataDecoder> Make(std::vector<Segment> headerSegments);
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* Given a JPEG encoded image |baseImageData|, return in |outGainmapImageData| the JPEG encoded
|
|
53
|
+
* gainmap image and return in |outGainmapInfo| its gainmap rendering parameters. Return true if
|
|
54
|
+
* both output variables were successfully populated, otherwise return false.
|
|
55
|
+
*/
|
|
56
|
+
virtual bool findGainmapImage(sk_sp<SkData> baseImageData,
|
|
57
|
+
sk_sp<SkData>& outGainmapImagedata,
|
|
58
|
+
SkGainmapInfo& outGainmapInfo) = 0;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
#endif
|
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
#ifndef SkOpts_spi_DEFINED
|
|
9
9
|
#define SkOpts_spi_DEFINED
|
|
10
10
|
|
|
11
|
-
#include "include/
|
|
11
|
+
#include "include/private/base/SkAPI.h"
|
|
12
|
+
|
|
13
|
+
#include <cstddef>
|
|
12
14
|
|
|
13
15
|
// These are exposed as SK_SPI (e.g. SkParagraph), the rest of SkOpts is
|
|
14
16
|
// declared in src/core
|