@shopify/react-native-skia 0.1.192 → 0.1.194

Sign up to get free protection for your applications and to get access to all the features.
Files changed (304) hide show
  1. package/android/CMakeLists.txt +1 -1
  2. package/android/build.gradle +1 -0
  3. package/android/cpp/jni/JniPlatformContext.cpp +1 -1
  4. package/android/src/main/java/com/shopify/reactnative/skia/ViewScreenshotService.java +104 -103
  5. package/cpp/api/JsiSkImage.h +25 -4
  6. package/cpp/api/JsiSkImageFactory.h +2 -2
  7. package/cpp/api/JsiSkPath.h +8 -6
  8. package/cpp/rnskia/dom/base/Declaration.h +5 -7
  9. package/cpp/rnskia/dom/base/JsiDomDrawingNode.h +3 -1
  10. package/cpp/rnskia/dom/nodes/JsiBlurMaskNode.h +1 -0
  11. package/cpp/rnskia/dom/nodes/JsiPathNode.h +2 -2
  12. package/cpp/rnskia/dom/props/BoxShadowProps.h +2 -0
  13. package/cpp/skia/include/android/SkAndroidFrameworkUtils.h +2 -8
  14. package/cpp/skia/include/android/SkImageAndroid.h +101 -0
  15. package/cpp/skia/include/codec/SkAndroidCodec.h +26 -8
  16. package/cpp/skia/include/codec/SkCodec.h +31 -17
  17. package/cpp/skia/include/codec/SkEncodedImageFormat.h +36 -0
  18. package/cpp/skia/include/codec/SkPixmapUtils.h +31 -0
  19. package/cpp/skia/include/config/SkUserConfig.h +61 -29
  20. package/cpp/skia/include/core/SkBitmap.h +25 -25
  21. package/cpp/skia/include/core/SkBlurTypes.h +0 -2
  22. package/cpp/skia/include/core/SkCanvas.h +32 -15
  23. package/cpp/skia/include/core/SkCapabilities.h +2 -2
  24. package/cpp/skia/include/core/SkColor.h +2 -0
  25. package/cpp/skia/include/core/SkColorPriv.h +19 -4
  26. package/cpp/skia/include/core/SkColorSpace.h +14 -17
  27. package/cpp/skia/include/core/SkColorType.h +1 -0
  28. package/cpp/skia/include/core/SkContourMeasure.h +1 -1
  29. package/cpp/skia/include/core/SkCoverageMode.h +0 -2
  30. package/cpp/skia/include/core/SkCubicMap.h +2 -0
  31. package/cpp/skia/include/core/SkData.h +5 -2
  32. package/cpp/skia/include/core/SkDataTable.h +6 -2
  33. package/cpp/skia/include/core/SkDeferredDisplayList.h +11 -10
  34. package/cpp/skia/include/core/SkDeferredDisplayListRecorder.h +9 -8
  35. package/cpp/skia/include/core/SkDrawable.h +10 -2
  36. package/cpp/skia/include/core/SkEncodedImageFormat.h +3 -30
  37. package/cpp/skia/include/core/SkFlattenable.h +4 -2
  38. package/cpp/skia/include/core/SkFont.h +1 -0
  39. package/cpp/skia/include/core/SkFontMetrics.h +1 -0
  40. package/cpp/skia/include/core/SkFontMgr.h +20 -29
  41. package/cpp/skia/include/core/SkFontStyle.h +4 -1
  42. package/cpp/skia/include/core/SkGraphics.h +21 -18
  43. package/cpp/skia/include/core/SkICC.h +3 -13
  44. package/cpp/skia/include/core/SkImage.h +395 -717
  45. package/cpp/skia/include/core/SkImageGenerator.h +19 -74
  46. package/cpp/skia/include/core/SkImageInfo.h +7 -5
  47. package/cpp/skia/include/core/SkM44.h +11 -0
  48. package/cpp/skia/include/core/SkMaskFilter.h +6 -3
  49. package/cpp/skia/include/core/SkMatrix.h +14 -4
  50. package/cpp/skia/include/core/SkMesh.h +52 -18
  51. package/cpp/skia/include/core/SkMilestone.h +1 -1
  52. package/cpp/skia/include/core/SkPaint.h +11 -34
  53. package/cpp/skia/include/core/SkPath.h +23 -4
  54. package/cpp/skia/include/core/SkPathBuilder.h +13 -5
  55. package/cpp/skia/include/core/SkPathMeasure.h +1 -1
  56. package/cpp/skia/include/core/SkPathTypes.h +0 -2
  57. package/cpp/skia/include/core/SkPathUtils.h +42 -0
  58. package/cpp/skia/include/core/SkPicture.h +3 -2
  59. package/cpp/skia/include/core/SkPictureRecorder.h +2 -0
  60. package/cpp/skia/include/core/SkPixelRef.h +4 -8
  61. package/cpp/skia/include/core/SkPixmap.h +12 -20
  62. package/cpp/skia/include/core/SkPoint.h +4 -2
  63. package/cpp/skia/include/core/SkPromiseImageTexture.h +2 -2
  64. package/cpp/skia/include/core/SkRRect.h +5 -1
  65. package/cpp/skia/include/core/SkRect.h +6 -3
  66. package/cpp/skia/include/core/SkRefCnt.h +9 -14
  67. package/cpp/skia/include/core/SkRegion.h +1 -1
  68. package/cpp/skia/include/core/SkScalar.h +2 -4
  69. package/cpp/skia/include/core/SkSerialProcs.h +18 -10
  70. package/cpp/skia/include/core/SkShader.h +1 -64
  71. package/cpp/skia/include/core/SkSize.h +2 -0
  72. package/cpp/skia/include/core/SkSpan.h +4 -112
  73. package/cpp/skia/include/core/SkStream.h +11 -12
  74. package/cpp/skia/include/core/SkString.h +9 -25
  75. package/cpp/skia/include/core/SkStrokeRec.h +1 -1
  76. package/cpp/skia/include/core/SkSurface.h +83 -61
  77. package/cpp/skia/include/core/SkSurfaceCharacterization.h +3 -3
  78. package/cpp/skia/include/core/SkSurfaceProps.h +9 -1
  79. package/cpp/skia/include/core/SkTextBlob.h +2 -2
  80. package/cpp/skia/include/core/SkTextureCompressionType.h +30 -0
  81. package/cpp/skia/include/core/SkTime.h +1 -1
  82. package/cpp/skia/include/core/SkTypeface.h +9 -2
  83. package/cpp/skia/include/core/SkTypes.h +37 -466
  84. package/cpp/skia/include/core/SkVertices.h +2 -0
  85. package/cpp/skia/include/core/SkYUVAInfo.h +4 -0
  86. package/cpp/skia/include/core/SkYUVAPixmaps.h +7 -1
  87. package/cpp/skia/include/docs/SkPDFDocument.h +12 -1
  88. package/cpp/skia/include/effects/SkColorMatrix.h +2 -1
  89. package/cpp/skia/include/effects/SkGradientShader.h +65 -14
  90. package/cpp/skia/include/effects/SkImageFilters.h +0 -11
  91. package/cpp/skia/include/effects/SkRuntimeEffect.h +41 -11
  92. package/cpp/skia/include/encode/SkEncoder.h +7 -3
  93. package/cpp/skia/include/encode/SkICC.h +36 -0
  94. package/cpp/skia/include/encode/SkJpegEncoder.h +102 -71
  95. package/cpp/skia/include/encode/SkPngEncoder.h +89 -71
  96. package/cpp/skia/include/encode/SkWebpEncoder.h +65 -38
  97. package/cpp/skia/include/gpu/GpuTypes.h +23 -1
  98. package/cpp/skia/include/gpu/GrBackendSurface.h +9 -7
  99. package/cpp/skia/include/gpu/GrContextOptions.h +28 -9
  100. package/cpp/skia/include/gpu/GrContextThreadSafeProxy.h +6 -4
  101. package/cpp/skia/include/gpu/GrDirectContext.h +84 -63
  102. package/cpp/skia/include/gpu/GrDriverBugWorkarounds.h +2 -1
  103. package/cpp/skia/include/gpu/GrRecordingContext.h +9 -5
  104. package/cpp/skia/include/gpu/GrTypes.h +18 -18
  105. package/cpp/skia/include/gpu/d3d/GrD3DTypes.h +4 -4
  106. package/cpp/skia/include/gpu/dawn/GrDawnTypes.h +3 -3
  107. package/cpp/skia/include/gpu/ganesh/GrTextureGenerator.h +77 -0
  108. package/cpp/skia/include/gpu/ganesh/SkImageGanesh.h +385 -0
  109. package/cpp/skia/include/gpu/gl/GrGLExtensions.h +3 -3
  110. package/cpp/skia/include/gpu/gl/GrGLFunctions.h +1 -1
  111. package/cpp/skia/include/gpu/gl/GrGLInterface.h +0 -3
  112. package/cpp/skia/include/gpu/gl/GrGLTypes.h +2 -1
  113. package/cpp/skia/include/gpu/graphite/BackendTexture.h +72 -3
  114. package/cpp/skia/include/gpu/graphite/Context.h +85 -32
  115. package/cpp/skia/include/gpu/graphite/ContextOptions.h +15 -11
  116. package/cpp/skia/include/gpu/graphite/GraphiteTypes.h +55 -5
  117. package/cpp/skia/include/gpu/graphite/ImageProvider.h +6 -4
  118. package/cpp/skia/include/gpu/graphite/Recorder.h +41 -11
  119. package/cpp/skia/include/gpu/graphite/Recording.h +50 -3
  120. package/cpp/skia/include/gpu/graphite/TextureInfo.h +47 -8
  121. package/cpp/skia/include/gpu/graphite/YUVABackendTextures.h +139 -0
  122. package/cpp/skia/include/gpu/graphite/dawn/DawnTypes.h +40 -0
  123. package/cpp/skia/include/gpu/graphite/dawn/DawnUtils.h +28 -0
  124. package/cpp/skia/include/gpu/graphite/mtl/MtlBackendContext.h +1 -1
  125. package/cpp/skia/include/gpu/graphite/mtl/{MtlTypes.h → MtlGraphiteTypes.h} +7 -6
  126. package/cpp/skia/include/gpu/graphite/mtl/MtlGraphiteUtils.h +27 -0
  127. package/cpp/skia/include/gpu/graphite/vk/VulkanGraphiteTypes.h +4 -9
  128. package/cpp/skia/include/gpu/graphite/vk/VulkanGraphiteUtils.h +28 -0
  129. package/cpp/skia/include/gpu/mock/GrMockTypes.h +17 -13
  130. package/cpp/skia/include/gpu/mtl/GrMtlTypes.h +2 -2
  131. package/cpp/skia/include/gpu/vk/GrVkBackendContext.h +1 -1
  132. package/cpp/skia/include/gpu/vk/GrVkTypes.h +3 -3
  133. package/cpp/skia/include/gpu/vk/VulkanExtensions.h +3 -3
  134. package/cpp/skia/include/gpu/vk/VulkanMemoryAllocator.h +5 -7
  135. package/cpp/skia/include/pathops/SkPathOps.h +3 -3
  136. package/cpp/skia/include/ports/SkFontMgr_data.h +22 -0
  137. package/cpp/skia/include/ports/SkFontMgr_indirect.h +14 -14
  138. package/cpp/skia/include/ports/SkRemotableFontMgr.h +2 -2
  139. package/cpp/skia/include/ports/SkTypeface_win.h +2 -1
  140. package/cpp/skia/include/private/SkChecksum.h +32 -7
  141. package/cpp/skia/include/private/SkColorData.h +1 -26
  142. package/cpp/skia/include/private/SkGainmapInfo.h +97 -0
  143. package/cpp/skia/include/private/SkGainmapShader.h +53 -0
  144. package/cpp/skia/include/private/SkIDChangeListener.h +4 -3
  145. package/cpp/skia/include/private/SkJpegGainmapEncoder.h +71 -0
  146. package/cpp/skia/include/private/SkJpegMetadataDecoder.h +61 -0
  147. package/cpp/skia/include/private/SkOpts_spi.h +3 -1
  148. package/cpp/skia/include/private/SkPathRef.h +64 -47
  149. package/cpp/skia/include/private/SkSLDefines.h +5 -5
  150. package/cpp/skia/include/private/SkSLSampleUsage.h +0 -4
  151. package/cpp/skia/include/private/SkSpinlock.h +1 -1
  152. package/cpp/skia/include/private/SkWeakRefCnt.h +3 -0
  153. package/cpp/skia/include/private/{SingleOwner.h → base/SingleOwner.h} +8 -5
  154. package/cpp/skia/include/private/base/SkAPI.h +52 -0
  155. package/cpp/skia/include/private/base/SkAlign.h +39 -0
  156. package/cpp/skia/include/private/base/SkAlignedStorage.h +32 -0
  157. package/cpp/skia/include/private/base/SkAssert.h +92 -0
  158. package/cpp/skia/include/private/base/SkAttributes.h +102 -0
  159. package/cpp/skia/include/private/base/SkCPUTypes.h +25 -0
  160. package/cpp/skia/include/private/base/SkContainers.h +46 -0
  161. package/cpp/skia/include/private/base/SkDebug.h +27 -0
  162. package/cpp/skia/include/private/{SkDeque.h → base/SkDeque.h} +3 -1
  163. package/cpp/skia/include/private/base/SkFeatures.h +151 -0
  164. package/cpp/skia/include/private/{SkFixed.h → base/SkFixed.h} +9 -7
  165. package/cpp/skia/include/private/{SkFloatBits.h → base/SkFloatBits.h} +2 -3
  166. package/cpp/skia/include/private/{SkFloatingPoint.h → base/SkFloatingPoint.h} +18 -9
  167. package/cpp/skia/include/private/base/SkLoadUserConfig.h +63 -0
  168. package/cpp/skia/include/private/{SkMacros.h → base/SkMacros.h} +17 -2
  169. package/cpp/skia/include/private/{SkMalloc.h → base/SkMalloc.h} +4 -7
  170. package/cpp/skia/include/{core → private/base}/SkMath.h +25 -2
  171. package/cpp/skia/include/private/{SkMutex.h → base/SkMutex.h} +5 -5
  172. package/cpp/skia/include/private/{SkNoncopyable.h → base/SkNoncopyable.h} +2 -2
  173. package/cpp/skia/include/private/{SkOnce.h → base/SkOnce.h} +3 -1
  174. package/cpp/skia/include/private/base/SkPathEnums.h +25 -0
  175. package/cpp/skia/include/private/{SkSafe32.h → base/SkSafe32.h} +16 -1
  176. package/cpp/skia/include/private/{SkSemaphore.h → base/SkSemaphore.h} +4 -3
  177. package/cpp/skia/include/private/base/SkSpan_impl.h +129 -0
  178. package/cpp/skia/include/private/base/SkTArray.h +694 -0
  179. package/cpp/skia/include/private/{SkTDArray.h → base/SkTDArray.h} +17 -54
  180. package/cpp/skia/include/private/{SkTFitsIn.h → base/SkTFitsIn.h} +14 -8
  181. package/cpp/skia/include/private/{SkTLogic.h → base/SkTLogic.h} +1 -1
  182. package/cpp/skia/include/private/{SkTemplates.h → base/SkTemplates.h} +63 -88
  183. package/cpp/skia/include/private/{SkThreadID.h → base/SkThreadID.h} +5 -2
  184. package/cpp/skia/include/private/{SkTo.h → base/SkTo.h} +13 -2
  185. package/cpp/skia/include/private/base/SkTypeTraits.h +33 -0
  186. package/cpp/skia/include/private/chromium/GrVkSecondaryCBDrawContext.h +130 -0
  187. package/cpp/skia/include/private/chromium/SkChromeRemoteGlyphCache.h +5 -9
  188. package/cpp/skia/include/private/chromium/SkDiscardableMemory.h +70 -0
  189. package/cpp/skia/include/private/chromium/Slug.h +0 -9
  190. package/cpp/skia/include/private/gpu/ganesh/GrContext_Base.h +2 -1
  191. package/cpp/skia/include/private/gpu/ganesh/GrD3DTypesMinimal.h +1 -1
  192. package/cpp/skia/include/private/gpu/ganesh/GrDawnTypesPriv.h +1 -1
  193. package/cpp/skia/include/private/gpu/ganesh/GrGLTypesPriv.h +1 -1
  194. package/cpp/skia/include/private/gpu/ganesh/GrImageContext.h +1 -1
  195. package/cpp/skia/include/private/gpu/ganesh/GrMockTypesPriv.h +3 -2
  196. package/cpp/skia/include/private/gpu/ganesh/GrMtlTypesPriv.h +1 -1
  197. package/cpp/skia/include/private/gpu/ganesh/GrTypesPriv.h +17 -23
  198. package/cpp/skia/include/private/gpu/ganesh/GrVkTypesPriv.h +2 -2
  199. package/cpp/skia/include/private/gpu/graphite/DawnTypesPriv.h +38 -0
  200. package/cpp/skia/include/private/gpu/graphite/{MtlTypesPriv.h → MtlGraphiteTypesPriv.h} +5 -5
  201. package/cpp/skia/include/private/gpu/graphite/VulkanGraphiteTypesPriv.h +1 -9
  202. package/cpp/skia/include/private/gpu/vk/SkiaVulkan.h +4 -0
  203. package/cpp/skia/include/utils/SkCamera.h +1 -1
  204. package/cpp/skia/include/utils/SkCustomTypeface.h +7 -1
  205. package/cpp/skia/include/utils/SkNWayCanvas.h +6 -6
  206. package/cpp/skia/include/utils/SkOrderedFontMgr.h +7 -6
  207. package/cpp/skia/include/utils/SkPaintFilterCanvas.h +2 -2
  208. package/cpp/skia/include/utils/SkParsePath.h +1 -1
  209. package/cpp/skia/modules/skcms/skcms.h +14 -0
  210. package/cpp/skia/modules/skcms/src/Transform_inl.h +19 -0
  211. package/cpp/skia/modules/skparagraph/include/FontCollection.h +2 -2
  212. package/cpp/skia/modules/skparagraph/include/Paragraph.h +72 -2
  213. package/cpp/skia/modules/skparagraph/include/ParagraphCache.h +1 -11
  214. package/cpp/skia/modules/skparagraph/include/ParagraphPainter.h +63 -0
  215. package/cpp/skia/modules/skparagraph/include/TextStyle.h +27 -4
  216. package/cpp/skia/modules/skparagraph/include/TypefaceFontProvider.h +13 -13
  217. package/cpp/skia/modules/skresources/include/SkResources.h +18 -4
  218. package/cpp/skia/modules/svg/include/SkSVGAttribute.h +1 -1
  219. package/cpp/skia/modules/svg/include/SkSVGAttributeParser.h +2 -2
  220. package/cpp/skia/modules/svg/include/SkSVGContainer.h +2 -2
  221. package/cpp/skia/modules/svg/include/SkSVGDOM.h +1 -1
  222. package/cpp/skia/modules/svg/include/SkSVGFilterContext.h +2 -2
  223. package/cpp/skia/modules/svg/include/SkSVGGradient.h +2 -2
  224. package/cpp/skia/modules/svg/include/SkSVGIDMapper.h +2 -2
  225. package/cpp/skia/modules/svg/include/SkSVGRenderContext.h +3 -3
  226. package/cpp/skia/modules/svg/include/SkSVGSVG.h +1 -1
  227. package/cpp/skia/modules/svg/include/SkSVGTypes.h +22 -21
  228. package/cpp/skia/modules/svg/include/SkSVGValue.h +1 -1
  229. package/cpp/skia/{include/private → src/core}/SkTHash.h +41 -37
  230. package/ios/RNSkia-iOS/RNSkMetalCanvasProvider.mm +1 -2
  231. package/ios/RNSkia-iOS/ViewScreenshotService.mm +1 -1
  232. package/libs/android/arm64-v8a/libskia.a +0 -0
  233. package/libs/android/arm64-v8a/libskottie.a +0 -0
  234. package/libs/android/arm64-v8a/libsksg.a +0 -0
  235. package/libs/android/arm64-v8a/libskshaper.a +0 -0
  236. package/libs/android/arm64-v8a/libsvg.a +0 -0
  237. package/libs/android/armeabi-v7a/libskia.a +0 -0
  238. package/libs/android/armeabi-v7a/libskottie.a +0 -0
  239. package/libs/android/armeabi-v7a/libsksg.a +0 -0
  240. package/libs/android/armeabi-v7a/libskshaper.a +0 -0
  241. package/libs/android/armeabi-v7a/libsvg.a +0 -0
  242. package/libs/android/x86/libskia.a +0 -0
  243. package/libs/android/x86/libskottie.a +0 -0
  244. package/libs/android/x86/libsksg.a +0 -0
  245. package/libs/android/x86/libskshaper.a +0 -0
  246. package/libs/android/x86/libsvg.a +0 -0
  247. package/libs/android/x86_64/libskia.a +0 -0
  248. package/libs/android/x86_64/libskottie.a +0 -0
  249. package/libs/android/x86_64/libsksg.a +0 -0
  250. package/libs/android/x86_64/libskshaper.a +0 -0
  251. package/libs/android/x86_64/libsvg.a +0 -0
  252. package/libs/ios/libskia.xcframework/Info.plist +5 -5
  253. package/libs/ios/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
  254. package/libs/ios/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
  255. package/libs/ios/libskottie.xcframework/ios-arm64_arm64e/libskottie.a +0 -0
  256. package/libs/ios/libskottie.xcframework/ios-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
  257. package/libs/ios/libsksg.xcframework/ios-arm64_arm64e/libsksg.a +0 -0
  258. package/libs/ios/libsksg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
  259. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
  260. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
  261. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
  262. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
  263. package/package.json +1 -1
  264. package/react-native-skia.podspec +1 -1
  265. package/scripts/install-npm.js +11 -1
  266. package/cpp/skia/include/core/SkImageEncoder.h +0 -71
  267. package/cpp/skia/include/gpu/GrConfig.h +0 -53
  268. package/cpp/skia/include/gpu/graphite/CombinationBuilder.h +0 -195
  269. package/cpp/skia/include/private/SkHalf.h +0 -38
  270. package/cpp/skia/include/private/SkImageInfoPriv.h +0 -199
  271. package/cpp/skia/include/private/SkSLIRNode.h +0 -64
  272. package/cpp/skia/include/private/SkSLLayout.h +0 -144
  273. package/cpp/skia/include/private/SkSLModifiers.h +0 -178
  274. package/cpp/skia/include/private/SkSLProgramElement.h +0 -77
  275. package/cpp/skia/include/private/SkSLProgramKind.h +0 -35
  276. package/cpp/skia/include/private/SkSLStatement.h +0 -86
  277. package/cpp/skia/include/private/SkSLString.h +0 -41
  278. package/cpp/skia/include/private/SkSLSymbol.h +0 -94
  279. package/cpp/skia/include/private/SkSafe_math.h +0 -52
  280. package/cpp/skia/include/private/SkStringView.h +0 -51
  281. package/cpp/skia/include/private/SkTArray.h +0 -655
  282. package/cpp/skia/include/private/SkUniquePaintParamsID.h +0 -35
  283. package/cpp/skia/include/private/SkVx.h +0 -1026
  284. package/cpp/skia/include/sksl/DSL.h +0 -37
  285. package/cpp/skia/include/sksl/DSLBlock.h +0 -58
  286. package/cpp/skia/include/sksl/DSLCase.h +0 -62
  287. package/cpp/skia/include/sksl/DSLCore.h +0 -492
  288. package/cpp/skia/include/sksl/DSLExpression.h +0 -241
  289. package/cpp/skia/include/sksl/DSLFunction.h +0 -113
  290. package/cpp/skia/include/sksl/DSLLayout.h +0 -92
  291. package/cpp/skia/include/sksl/DSLModifiers.h +0 -69
  292. package/cpp/skia/include/sksl/DSLStatement.h +0 -82
  293. package/cpp/skia/include/sksl/DSLSymbols.h +0 -61
  294. package/cpp/skia/include/sksl/DSLType.h +0 -271
  295. package/cpp/skia/include/sksl/DSLVar.h +0 -231
  296. package/cpp/skia/include/sksl/SkSLErrorReporter.h +0 -65
  297. package/cpp/skia/include/sksl/SkSLOperator.h +0 -154
  298. package/cpp/skia/include/sksl/SkSLPosition.h +0 -104
  299. package/cpp/skia/include/utils/SkRandom.h +0 -169
  300. package/cpp/skia/src/core/SkLRUCache.h +0 -126
  301. package/cpp/skia/src/core/SkTInternalLList.h +0 -302
  302. /package/cpp/skia/include/{core → codec}/SkPngChunkReader.h +0 -0
  303. /package/cpp/skia/include/private/{SkTPin.h → base/SkTPin.h} +0 -0
  304. /package/cpp/skia/include/private/{SkThreadAnnotations.h → base/SkThreadAnnotations.h} +0 -0
@@ -15,11 +15,11 @@
15
15
  #include "include/core/SkRect.h"
16
16
  #include "include/core/SkSize.h"
17
17
  #include "include/core/SkTypes.h"
18
- #include "include/private/SkTHash.h"
19
18
  #include "modules/skresources/include/SkResources.h"
20
19
  #include "modules/svg/include/SkSVGAttribute.h"
21
20
  #include "modules/svg/include/SkSVGIDMapper.h"
22
- #include "src/core/SkTLazy.h"
21
+ #include "src/base/SkTLazy.h"
22
+ #include "src/core/SkTHash.h"
23
23
 
24
24
  class SkCanvas;
25
25
  class SkSVGLength;
@@ -52,7 +52,7 @@ struct SkSVGPresentationContext {
52
52
  SkSVGPresentationContext(const SkSVGPresentationContext&) = default;
53
53
  SkSVGPresentationContext& operator=(const SkSVGPresentationContext&) = default;
54
54
 
55
- const SkTHashMap<SkString, SkSVGColorType>* fNamedColors = nullptr;
55
+ const skia_private::THashMap<SkString, SkSVGColorType>* fNamedColors = nullptr;
56
56
 
57
57
  // Inherited presentation attributes, computed for the current node.
58
58
  SkSVGPresentationAttributes fInherited;
@@ -10,7 +10,7 @@
10
10
 
11
11
  #include "modules/svg/include/SkSVGContainer.h"
12
12
  #include "modules/svg/include/SkSVGTypes.h"
13
- #include "src/core/SkTLazy.h"
13
+ #include "src/base/SkTLazy.h"
14
14
 
15
15
  class SkSVGLengthContext;
16
16
 
@@ -18,8 +18,9 @@
18
18
  #include "include/core/SkSpan.h"
19
19
  #include "include/core/SkString.h"
20
20
  #include "include/core/SkTypes.h"
21
- #include "include/private/SkTDArray.h"
22
- #include "src/core/SkTLazy.h"
21
+
22
+ #include <optional>
23
+ #include <vector>
23
24
 
24
25
  using SkSVGColorType = SkColor;
25
26
  using SkSVGIntegerType = int;
@@ -27,7 +28,7 @@ using SkSVGNumberType = SkScalar;
27
28
  using SkSVGStringType = SkString;
28
29
  using SkSVGViewBoxType = SkRect;
29
30
  using SkSVGTransformType = SkMatrix;
30
- using SkSVGPointsType = SkTDArray<SkPoint>;
31
+ using SkSVGPointsType = std::vector<SkPoint>;
31
32
 
32
33
  enum class SkSVGPropertyState {
33
34
  kUnspecified,
@@ -45,17 +46,17 @@ public:
45
46
  explicit SkSVGProperty(SkSVGPropertyState state) : fState(state) {}
46
47
 
47
48
  explicit SkSVGProperty(const T& value) : fState(SkSVGPropertyState::kValue) {
48
- fValue.set(value);
49
+ fValue = value;
49
50
  }
50
51
 
51
52
  explicit SkSVGProperty(T&& value) : fState(SkSVGPropertyState::kValue) {
52
- fValue.set(std::move(value));
53
+ fValue = std::move(value);
53
54
  }
54
55
 
55
56
  template <typename... Args>
56
57
  void init(Args&&... args) {
57
58
  fState = SkSVGPropertyState::kValue;
58
- fValue.init(std::forward<Args>(args)...);
59
+ fValue.emplace(std::forward<Args>(args)...);
59
60
  }
60
61
 
61
62
  constexpr bool isInheritable() const { return kInheritable; }
@@ -63,7 +64,7 @@ public:
63
64
  bool isValue() const { return fState == SkSVGPropertyState::kValue; }
64
65
 
65
66
  T* getMaybeNull() const {
66
- return fValue.getMaybeNull();
67
+ return fValue.has_value() ? &fValue.value() : nullptr;
67
68
  }
68
69
 
69
70
  void set(SkSVGPropertyState state) {
@@ -75,41 +76,41 @@ public:
75
76
 
76
77
  void set(const T& value) {
77
78
  fState = SkSVGPropertyState::kValue;
78
- fValue.set(value);
79
+ fValue = value;
79
80
  }
80
81
 
81
82
  void set(T&& value) {
82
83
  fState = SkSVGPropertyState::kValue;
83
- fValue.set(std::move(value));
84
+ fValue = std::move(value);
84
85
  }
85
86
 
86
87
  T* operator->() {
87
88
  SkASSERT(fState == SkSVGPropertyState::kValue);
88
- SkASSERT(fValue.isValid());
89
- return fValue.get();
89
+ SkASSERT(fValue.has_value());
90
+ return &fValue.value();
90
91
  }
91
92
 
92
93
  const T* operator->() const {
93
94
  SkASSERT(fState == SkSVGPropertyState::kValue);
94
- SkASSERT(fValue.isValid());
95
- return fValue.get();
95
+ SkASSERT(fValue.has_value());
96
+ return &fValue.value();
96
97
  }
97
98
 
98
99
  T& operator*() {
99
100
  SkASSERT(fState == SkSVGPropertyState::kValue);
100
- SkASSERT(fValue.isValid());
101
+ SkASSERT(fValue.has_value());
101
102
  return *fValue;
102
103
  }
103
104
 
104
105
  const T& operator*() const {
105
106
  SkASSERT(fState == SkSVGPropertyState::kValue);
106
- SkASSERT(fValue.isValid());
107
+ SkASSERT(fValue.has_value());
107
108
  return *fValue;
108
109
  }
109
110
 
110
111
  private:
111
112
  SkSVGPropertyState fState;
112
- SkTLazy<T> fValue;
113
+ std::optional<T> fValue;
113
114
  };
114
115
 
115
116
  class SkSVGLength {
@@ -180,7 +181,7 @@ public:
180
181
  kColor,
181
182
  kICCColor,
182
183
  };
183
- using Vars = SkSTArray<1, SkString>;
184
+ using Vars = std::vector<SkString>;
184
185
 
185
186
  SkSVGColor() : SkSVGColor(SK_ColorBLACK) {}
186
187
  explicit SkSVGColor(const SkSVGColorType& c) : fType(Type::kColor), fColor(c), fVars(nullptr) {}
@@ -400,7 +401,7 @@ public:
400
401
 
401
402
  SkSVGDashArray() : fType(Type::kNone) {}
402
403
  explicit SkSVGDashArray(Type t) : fType(t) {}
403
- explicit SkSVGDashArray(SkTDArray<SkSVGLength>&& dashArray)
404
+ explicit SkSVGDashArray(std::vector<SkSVGLength>&& dashArray)
404
405
  : fType(Type::kDashArray)
405
406
  , fDashArray(std::move(dashArray)) {}
406
407
 
@@ -414,11 +415,11 @@ public:
414
415
 
415
416
  Type type() const { return fType; }
416
417
 
417
- const SkTDArray<SkSVGLength>& dashArray() const { return fDashArray; }
418
+ const std::vector<SkSVGLength>& dashArray() const { return fDashArray; }
418
419
 
419
420
  private:
420
421
  Type fType;
421
- SkTDArray<SkSVGLength> fDashArray;
422
+ std::vector<SkSVGLength> fDashArray;
422
423
  };
423
424
 
424
425
  class SkSVGStopColor {
@@ -673,7 +674,7 @@ enum class SkSVGFeColorMatrixType {
673
674
  kLuminanceToAlpha,
674
675
  };
675
676
 
676
- using SkSVGFeColorMatrixValues = SkTDArray<SkSVGNumberType>;
677
+ using SkSVGFeColorMatrixValues = std::vector<SkSVGNumberType>;
677
678
 
678
679
  enum class SkSVGFeCompositeOperator {
679
680
  kOver,
@@ -12,7 +12,7 @@
12
12
  #include "include/core/SkMatrix.h"
13
13
  #include "include/core/SkPath.h"
14
14
  #include "include/core/SkTypes.h"
15
- #include "include/private/SkNoncopyable.h"
15
+ #include "include/private/base/SkNoncopyable.h"
16
16
  #include "modules/svg/include/SkSVGTypes.h"
17
17
 
18
18
  class SkSVGValue : public SkNoncopyable {
@@ -10,13 +10,15 @@
10
10
 
11
11
  #include "include/core/SkTypes.h"
12
12
  #include "include/private/SkChecksum.h"
13
- #include "include/private/SkTemplates.h"
13
+ #include "include/private/base/SkTemplates.h"
14
14
 
15
15
  #include <initializer_list>
16
16
  #include <new>
17
17
  #include <utility>
18
18
 
19
- // Before trying to use SkTHashTable, look below to see if SkTHashMap or SkTHashSet works for you.
19
+ namespace skia_private {
20
+
21
+ // Before trying to use THashTable, look below to see if THashMap or THashSet works for you.
20
22
  // They're easier to use, usually perform the same, and have fewer sharp edges.
21
23
 
22
24
  // T and K are treated as ordinary copyable C++ types.
@@ -26,15 +28,15 @@
26
28
  // If the key is large and stored inside T, you may want to make K a const&.
27
29
  // Similarly, if T is large you might want it to be a pointer.
28
30
  template <typename T, typename K, typename Traits = T>
29
- class SkTHashTable {
31
+ class THashTable {
30
32
  public:
31
- SkTHashTable() = default;
32
- ~SkTHashTable() = default;
33
+ THashTable() = default;
34
+ ~THashTable() = default;
33
35
 
34
- SkTHashTable(const SkTHashTable& that) { *this = that; }
35
- SkTHashTable( SkTHashTable&& that) { *this = std::move(that); }
36
+ THashTable(const THashTable& that) { *this = that; }
37
+ THashTable( THashTable&& that) { *this = std::move(that); }
36
38
 
37
- SkTHashTable& operator=(const SkTHashTable& that) {
39
+ THashTable& operator=(const THashTable& that) {
38
40
  if (this != &that) {
39
41
  fCount = that.fCount;
40
42
  fCapacity = that.fCapacity;
@@ -46,7 +48,7 @@ public:
46
48
  return *this;
47
49
  }
48
50
 
49
- SkTHashTable& operator=(SkTHashTable&& that) {
51
+ THashTable& operator=(THashTable&& that) {
50
52
  if (this != &that) {
51
53
  fCount = that.fCount;
52
54
  fCapacity = that.fCapacity;
@@ -58,7 +60,7 @@ public:
58
60
  }
59
61
 
60
62
  // Clear the table.
61
- void reset() { *this = SkTHashTable(); }
63
+ void reset() { *this = THashTable(); }
62
64
 
63
65
  // How many entries are in the table?
64
66
  int count() const { return fCount; }
@@ -75,7 +77,7 @@ public:
75
77
  // If you change an entry so that it no longer has the same key, all hell
76
78
  // will break loose. Do not do that!
77
79
  //
78
- // Please prefer to use SkTHashMap or SkTHashSet, which do not have this danger.
80
+ // Please prefer to use THashMap or THashSet, which do not have this danger.
79
81
 
80
82
  // The pointers returned by set() and find() are valid only until the next call to set().
81
83
  // The pointers you receive in foreach() are only valid for its duration.
@@ -103,7 +105,7 @@ public:
103
105
  }
104
106
  index = this->next(index);
105
107
  }
106
- SkASSERT(fCapacity == 0);
108
+ SkASSERT(fCapacity == fCount);
107
109
  return nullptr;
108
110
  }
109
111
 
@@ -145,8 +147,8 @@ public:
145
147
 
146
148
  fCount = 0;
147
149
  fCapacity = capacity;
148
- SkAutoTArray<Slot> oldSlots = std::move(fSlots);
149
- fSlots = SkAutoTArray<Slot>(capacity);
150
+ AutoTArray<Slot> oldSlots = std::move(fSlots);
151
+ fSlots = AutoTArray<Slot>(capacity);
150
152
 
151
153
  for (int i = 0; i < oldCapacity; i++) {
152
154
  Slot& s = oldSlots[i];
@@ -178,12 +180,12 @@ public:
178
180
  }
179
181
 
180
182
  // A basic iterator-like class which disallows mutation; sufficient for range-based for loops.
181
- // Intended for use by SkTHashMap and SkTHashSet via begin() and end().
183
+ // Intended for use by THashMap and THashSet via begin() and end().
182
184
  // Adding or removing elements may invalidate all iterators.
183
185
  template <typename SlotVal>
184
186
  class Iter {
185
187
  public:
186
- using TTable = SkTHashTable<T, K, Traits>;
188
+ using TTable = THashTable<T, K, Traits>;
187
189
 
188
190
  Iter(const TTable* table, int slot) : fTable(table), fSlot(slot) {}
189
191
 
@@ -411,22 +413,22 @@ private:
411
413
 
412
414
  int fCount = 0,
413
415
  fCapacity = 0;
414
- SkAutoTArray<Slot> fSlots;
416
+ AutoTArray<Slot> fSlots;
415
417
  };
416
418
 
417
- // Maps K->V. A more user-friendly wrapper around SkTHashTable, suitable for most use cases.
419
+ // Maps K->V. A more user-friendly wrapper around THashTable, suitable for most use cases.
418
420
  // K and V are treated as ordinary copyable C++ types, with no assumed relationship between the two.
419
421
  template <typename K, typename V, typename HashK = SkGoodHash>
420
- class SkTHashMap {
422
+ class THashMap {
421
423
  public:
422
424
  // Allow default construction and assignment.
423
- SkTHashMap() = default;
425
+ THashMap() = default;
424
426
 
425
- SkTHashMap(SkTHashMap<K, V, HashK>&& that) = default;
426
- SkTHashMap(const SkTHashMap<K, V, HashK>& that) = default;
427
+ THashMap(THashMap<K, V, HashK>&& that) = default;
428
+ THashMap(const THashMap<K, V, HashK>& that) = default;
427
429
 
428
- SkTHashMap<K, V, HashK>& operator=(SkTHashMap<K, V, HashK>&& that) = default;
429
- SkTHashMap<K, V, HashK>& operator=(const SkTHashMap<K, V, HashK>& that) = default;
430
+ THashMap<K, V, HashK>& operator=(THashMap<K, V, HashK>&& that) = default;
431
+ THashMap<K, V, HashK>& operator=(const THashMap<K, V, HashK>& that) = default;
430
432
 
431
433
  // Construct with an initializer list of key-value pairs.
432
434
  struct Pair : public std::pair<K, V> {
@@ -435,7 +437,7 @@ public:
435
437
  static auto Hash(const K& key) { return HashK()(key); }
436
438
  };
437
439
 
438
- SkTHashMap(std::initializer_list<Pair> pairs) {
440
+ THashMap(std::initializer_list<Pair> pairs) {
439
441
  fTable.resize(pairs.size() * 5 / 3);
440
442
  for (const Pair& p : pairs) {
441
443
  fTable.set(p);
@@ -498,7 +500,7 @@ public:
498
500
  }
499
501
 
500
502
  // Dereferencing an iterator gives back a key-value pair, suitable for structured binding.
501
- using Iter = typename SkTHashTable<Pair, K>::template Iter<std::pair<K, V>>;
503
+ using Iter = typename THashTable<Pair, K>::template Iter<std::pair<K, V>>;
502
504
 
503
505
  Iter begin() const {
504
506
  return Iter::MakeBegin(&fTable);
@@ -509,24 +511,24 @@ public:
509
511
  }
510
512
 
511
513
  private:
512
- SkTHashTable<Pair, K> fTable;
514
+ THashTable<Pair, K> fTable;
513
515
  };
514
516
 
515
517
  // A set of T. T is treated as an ordinary copyable C++ type.
516
518
  template <typename T, typename HashT = SkGoodHash>
517
- class SkTHashSet {
519
+ class THashSet {
518
520
  public:
519
521
  // Allow default construction and assignment.
520
- SkTHashSet() = default;
522
+ THashSet() = default;
521
523
 
522
- SkTHashSet(SkTHashSet<T, HashT>&& that) = default;
523
- SkTHashSet(const SkTHashSet<T, HashT>& that) = default;
524
+ THashSet(THashSet<T, HashT>&& that) = default;
525
+ THashSet(const THashSet<T, HashT>& that) = default;
524
526
 
525
- SkTHashSet<T, HashT>& operator=(SkTHashSet<T, HashT>&& that) = default;
526
- SkTHashSet<T, HashT>& operator=(const SkTHashSet<T, HashT>& that) = default;
527
+ THashSet<T, HashT>& operator=(THashSet<T, HashT>&& that) = default;
528
+ THashSet<T, HashT>& operator=(const THashSet<T, HashT>& that) = default;
527
529
 
528
530
  // Construct with an initializer list of Ts.
529
- SkTHashSet(std::initializer_list<T> vals) {
531
+ THashSet(std::initializer_list<T> vals) {
530
532
  fTable.resize(vals.size() * 5 / 3);
531
533
  for (const T& val : vals) {
532
534
  fTable.set(val);
@@ -574,7 +576,7 @@ private:
574
576
  };
575
577
 
576
578
  public:
577
- using Iter = typename SkTHashTable<T, T, Traits>::template Iter<T>;
579
+ using Iter = typename THashTable<T, T, Traits>::template Iter<T>;
578
580
 
579
581
  Iter begin() const {
580
582
  return Iter::MakeBegin(&fTable);
@@ -585,7 +587,9 @@ public:
585
587
  }
586
588
 
587
589
  private:
588
- SkTHashTable<T, T, Traits> fTable;
590
+ THashTable<T, T, Traits> fTable;
589
591
  };
590
592
 
591
- #endif//SkTHash_DEFINED
593
+ } // namespace skia_private
594
+
595
+ #endif // SkTHash_DEFINED
@@ -77,8 +77,7 @@ void RNSkMetalCanvasProvider::renderToCanvas(
77
77
  // accessed from the main thread so we need to check here.
78
78
  if ([[NSThread currentThread] isMainThread]) {
79
79
  auto state = UIApplication.sharedApplication.applicationState;
80
- if (state == UIApplicationStateBackground ||
81
- state == UIApplicationStateInactive) {
80
+ if (state == UIApplicationStateBackground) {
82
81
  // Request a redraw in the next run loop callback
83
82
  _requestRedraw();
84
83
  // and don't draw now since it might cause errors in the metal renderer if
@@ -85,7 +85,7 @@
85
85
  kBGRA_8888_SkColorType, kPremul_SkAlphaType);
86
86
 
87
87
  // ... and then create the SkImage itself!
88
- return SkImage::MakeRasterData(info, skData, bytesPerRow);
88
+ return SkImages::RasterFromData(info, skData, bytesPerRow);
89
89
  }
90
90
 
91
91
  @end
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -6,32 +6,32 @@
6
6
  <array>
7
7
  <dict>
8
8
  <key>LibraryIdentifier</key>
9
- <string>ios-arm64_arm64e</string>
9
+ <string>ios-arm64_arm64e_x86_64-simulator</string>
10
10
  <key>LibraryPath</key>
11
11
  <string>libskia.a</string>
12
12
  <key>SupportedArchitectures</key>
13
13
  <array>
14
14
  <string>arm64</string>
15
15
  <string>arm64e</string>
16
+ <string>x86_64</string>
16
17
  </array>
17
18
  <key>SupportedPlatform</key>
18
19
  <string>ios</string>
20
+ <key>SupportedPlatformVariant</key>
21
+ <string>simulator</string>
19
22
  </dict>
20
23
  <dict>
21
24
  <key>LibraryIdentifier</key>
22
- <string>ios-arm64_arm64e_x86_64-simulator</string>
25
+ <string>ios-arm64_arm64e</string>
23
26
  <key>LibraryPath</key>
24
27
  <string>libskia.a</string>
25
28
  <key>SupportedArchitectures</key>
26
29
  <array>
27
30
  <string>arm64</string>
28
31
  <string>arm64e</string>
29
- <string>x86_64</string>
30
32
  </array>
31
33
  <key>SupportedPlatform</key>
32
34
  <string>ios</string>
33
- <key>SupportedPlatformVariant</key>
34
- <string>simulator</string>
35
35
  </dict>
36
36
  </array>
37
37
  <key>CFBundlePackageType</key>
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "setup-skia-web": "./scripts/setup-canvaskit.js"
8
8
  },
9
9
  "title": "React Native Skia",
10
- "version": "0.1.192",
10
+ "version": "0.1.194",
11
11
  "description": "High-performance React Native Graphics using Skia",
12
12
  "main": "lib/module/index.js",
13
13
  "files": [
@@ -22,7 +22,7 @@ Pod::Spec.new do |s|
22
22
 
23
23
  s.requires_arc = true
24
24
  s.pod_target_xcconfig = {
25
- 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) SK_GL=1 SK_METAL=1',
25
+ 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) SK_METAL=1 SK_GANESH=1',
26
26
  'CLANG_CXX_LANGUAGE_STANDARD' => 'c++17',
27
27
  'DEFINES_MODULE' => 'YES',
28
28
  "HEADER_SEARCH_PATHS" => '"$(PODS_TARGET_SRCROOT)/cpp/"/**'
@@ -8,7 +8,17 @@ const createSymlink = (p) => {
8
8
  const srcDir = path.resolve(`./cpp/${p}`);
9
9
  const dstDir = path.resolve(`./android/cpp/${p}`);
10
10
 
11
- if (!fs.existsSync(dstDir) || !fs.lstatSync(dstDir).isSymbolicLink()) {
11
+ // Case in PNPM which might turn symlink into a directory:
12
+ // In that case, remove the directory before creating the symlink
13
+ if (fs.existsSync(dstDir)) {
14
+ const lstat = fs.lstatSync(dstDir);
15
+ const isSymbolicLink = lstat.isSymbolicLink();
16
+ if (lstat.isDirectory() && !isSymbolicLink) {
17
+ fs.rmSync(dstDir, { recursive: true });
18
+ }
19
+ }
20
+
21
+ if (!fs.existsSync(dstDir)) {
12
22
  fs.symlinkSync(srcDir, dstDir, "junction");
13
23
  }
14
24
  };
@@ -1,71 +0,0 @@
1
- /*
2
- * Copyright 2011 Google Inc.
3
- *
4
- * Use of this source code is governed by a BSD-style license that can be
5
- * found in the LICENSE file.
6
- */
7
-
8
- #ifndef SkImageEncoder_DEFINED
9
- #define SkImageEncoder_DEFINED
10
-
11
- #include "include/core/SkEncodedImageFormat.h"
12
- #include "include/core/SkRefCnt.h"
13
- #include "include/core/SkTypes.h"
14
-
15
- class SkBitmap;
16
- class SkData;
17
- class SkPixmap;
18
- class SkWStream;
19
-
20
- /**
21
- * Encode SkPixmap in the given binary image format.
22
- *
23
- * @param dst results are written to this stream.
24
- * @param src source pixels.
25
- * @param format image format, not all formats are supported.
26
- * @param quality range from 0-100, this is supported by jpeg and webp.
27
- * higher values correspond to improved visual quality, but less compression.
28
- *
29
- * @return false iff input is bad or format is unsupported.
30
- *
31
- * Will always return false if Skia is compiled without image
32
- * encoders.
33
- *
34
- * For SkEncodedImageFormat::kWEBP, if quality is 100, it will use lossless compression. Otherwise
35
- * it will use lossy.
36
- *
37
- * For examples of encoding an image to a file or to a block of memory,
38
- * see tools/ToolUtils.h.
39
- */
40
- SK_API bool SkEncodeImage(SkWStream* dst, const SkPixmap& src,
41
- SkEncodedImageFormat format, int quality);
42
-
43
- /**
44
- * The following helper function wraps SkEncodeImage().
45
- */
46
- SK_API bool SkEncodeImage(SkWStream* dst, const SkBitmap& src, SkEncodedImageFormat f, int q);
47
-
48
- /**
49
- * Encode SkPixmap in the given binary image format.
50
- *
51
- * @param src source pixels.
52
- * @param format image format, not all formats are supported.
53
- * @param quality range from 0-100, this is supported by jpeg and webp.
54
- * higher values correspond to improved visual quality, but less compression.
55
- *
56
- * @return encoded data or nullptr if input is bad or format is unsupported.
57
- *
58
- * Will always return nullptr if Skia is compiled without image
59
- * encoders.
60
- *
61
- * For SkEncodedImageFormat::kWEBP, if quality is 100, it will use lossless compression. Otherwise
62
- * it will use lossy.
63
- */
64
- SK_API sk_sp<SkData> SkEncodePixmap(const SkPixmap& src, SkEncodedImageFormat format, int quality);
65
-
66
- /**
67
- * Helper that extracts the pixmap from the bitmap, and then calls SkEncodePixmap()
68
- */
69
- SK_API sk_sp<SkData> SkEncodeBitmap(const SkBitmap& src, SkEncodedImageFormat format, int quality);
70
-
71
- #endif // SkImageEncoder_DEFINED