@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
@@ -8,32 +8,25 @@
8
8
  #ifndef SkImageGenerator_DEFINED
9
9
  #define SkImageGenerator_DEFINED
10
10
 
11
- #include "include/core/SkBitmap.h"
12
- #include "include/core/SkColor.h"
13
- #include "include/core/SkImage.h"
11
+ #include "include/core/SkData.h"
14
12
  #include "include/core/SkImageInfo.h"
15
- #include "include/core/SkSurfaceProps.h"
13
+ #include "include/core/SkPixmap.h"
14
+ #include "include/core/SkRefCnt.h"
16
15
  #include "include/core/SkYUVAPixmaps.h"
16
+ #include "include/private/base/SkAPI.h"
17
17
 
18
+ #if defined(SK_GRAPHITE)
19
+ #include "include/core/SkImage.h"
20
+ #include "include/gpu/graphite/Recorder.h"
21
+ #endif
22
+
23
+ #include <cstddef>
24
+ #include <cstdint>
25
+ #include <memory>
18
26
  #include <optional>
19
27
 
20
28
  class GrRecordingContext;
21
- class GrSurfaceProxyView;
22
- class GrSamplerState;
23
- class SkBitmap;
24
- class SkData;
25
- class SkMatrix;
26
- class SkPaint;
27
- class SkPicture;
28
-
29
- enum class GrImageTexGenPolicy : int;
30
-
31
- #if SK_GRAPHITE_ENABLED
32
- namespace skgpu::graphite {
33
- enum class Mipmapped : bool;
34
- class Recorder;
35
- }
36
- #endif
29
+ enum SkAlphaType : int;
37
30
 
38
31
  class SK_API SkImageGenerator {
39
32
  public:
@@ -121,36 +114,12 @@ public:
121
114
  */
122
115
  bool getYUVAPlanes(const SkYUVAPixmaps& yuvaPixmaps);
123
116
 
124
- #if SK_SUPPORT_GPU
125
- /**
126
- * If the generator can natively/efficiently return its pixels as a GPU image (backed by a
127
- * texture) this will return that image. If not, this will return NULL.
128
- *
129
- * Regarding the GrRecordingContext parameter:
130
- *
131
- * It must be non-NULL. The generator should only succeed if:
132
- * - its internal context is the same
133
- * - it can somehow convert its texture into one that is valid for the provided context.
134
- *
135
- * If the mipmapped parameter is kYes, the generator should try to create a TextureProxy that
136
- * at least has the mip levels allocated and the base layer filled in. If this is not possible,
137
- * the generator is allowed to return a non mipped proxy, but this will have some additional
138
- * overhead in later allocating mips and copying of the base layer.
139
- *
140
- * GrImageTexGenPolicy determines whether or not a new texture must be created (and its budget
141
- * status) or whether this may (but is not required to) return a pre-existing texture that is
142
- * retained by the generator (kDraw).
143
- */
144
- GrSurfaceProxyView generateTexture(GrRecordingContext*,
145
- const SkImageInfo& info,
146
- GrMipmapped mipmapped,
147
- GrImageTexGenPolicy);
148
- #endif
117
+ virtual bool isTextureGenerator() const { return false; }
149
118
 
150
- #if SK_GRAPHITE_ENABLED
119
+ #if defined(SK_GRAPHITE)
151
120
  sk_sp<SkImage> makeTextureImage(skgpu::graphite::Recorder*,
152
121
  const SkImageInfo&,
153
- skgpu::graphite::Mipmapped);
122
+ skgpu::Mipmapped);
154
123
  #endif
155
124
 
156
125
  /**
@@ -164,17 +133,6 @@ public:
164
133
  static std::unique_ptr<SkImageGenerator> MakeFromEncoded(
165
134
  sk_sp<SkData>, std::optional<SkAlphaType> = std::nullopt);
166
135
 
167
- /** Return a new image generator backed by the specified picture. If the size is empty or
168
- * the picture is NULL, this returns NULL.
169
- * The optional matrix and paint arguments are passed to drawPicture() at rasterization
170
- * time.
171
- */
172
- static std::unique_ptr<SkImageGenerator> MakeFromPicture(const SkISize&, sk_sp<SkPicture>,
173
- const SkMatrix*, const SkPaint*,
174
- SkImage::BitDepth,
175
- sk_sp<SkColorSpace>,
176
- SkSurfaceProps props = {});
177
-
178
136
  protected:
179
137
  static constexpr int kNeedNewImageUniqueID = 0;
180
138
 
@@ -187,30 +145,17 @@ protected:
187
145
  virtual bool onQueryYUVAInfo(const SkYUVAPixmapInfo::SupportedDataTypes&,
188
146
  SkYUVAPixmapInfo*) const { return false; }
189
147
  virtual bool onGetYUVAPlanes(const SkYUVAPixmaps&) { return false; }
190
- #if SK_SUPPORT_GPU
191
- // returns nullptr
192
- virtual GrSurfaceProxyView onGenerateTexture(GrRecordingContext*, const SkImageInfo&,
193
- GrMipmapped, GrImageTexGenPolicy);
194
-
195
- // Most internal SkImageGenerators produce textures and views that use kTopLeft_GrSurfaceOrigin.
196
- // If the generator may produce textures with different origins (e.g.
197
- // GrAHardwareBufferImageGenerator) it should override this function to return the correct
198
- // origin.
199
- virtual GrSurfaceOrigin origin() const { return kTopLeft_GrSurfaceOrigin; }
200
- #endif
201
148
 
202
- #if SK_GRAPHITE_ENABLED
149
+ #if defined(SK_GRAPHITE)
203
150
  virtual sk_sp<SkImage> onMakeTextureImage(skgpu::graphite::Recorder*,
204
151
  const SkImageInfo&,
205
- skgpu::graphite::Mipmapped);
152
+ skgpu::Mipmapped);
206
153
  #endif
154
+ const SkImageInfo fInfo;
207
155
 
208
156
  private:
209
- const SkImageInfo fInfo;
210
157
  const uint32_t fUniqueID;
211
158
 
212
- friend class SkImage_Lazy;
213
-
214
159
  // This is our default impl, which may be different on different platforms.
215
160
  // It is called from NewFromEncoded() after it has checked for any runtime factory.
216
161
  // The SkData will never be NULL, as that will have been checked by NewFromEncoded.
@@ -10,16 +10,18 @@
10
10
 
11
11
  #include "include/core/SkAlphaType.h"
12
12
  #include "include/core/SkColorType.h"
13
- #include "include/core/SkMath.h"
14
13
  #include "include/core/SkRect.h"
15
14
  #include "include/core/SkRefCnt.h"
16
15
  #include "include/core/SkSize.h"
16
+ #include "include/private/base/SkAPI.h"
17
+ #include "include/private/base/SkDebug.h"
18
+ #include "include/private/base/SkMath.h"
19
+ #include "include/private/base/SkTFitsIn.h"
17
20
 
18
- #include "include/private/SkTFitsIn.h"
19
- #include "include/private/SkTo.h"
21
+ #include <cstddef>
22
+ #include <cstdint>
23
+ #include <utility>
20
24
 
21
- class SkReadBuffer;
22
- class SkWriteBuffer;
23
25
  class SkColorSpace;
24
26
 
25
27
  /** Returns the number of bytes required to store a pixel, including unused padding.
@@ -99,6 +99,11 @@ struct SK_API SkV4 {
99
99
  }
100
100
  bool operator!=(const SkV4& v) const { return !(*this == v); }
101
101
 
102
+ static SkScalar Dot(const SkV4& a, const SkV4& b) {
103
+ return a.x*b.x + a.y*b.y + a.z*b.z + a.w*b.w;
104
+ }
105
+ static SkV4 Normalize(const SkV4& v) { return v * (1.0f / v.length()); }
106
+
102
107
  SkV4 operator-() const { return {-x, -y, -z, -w}; }
103
108
  SkV4 operator+(const SkV4& v) const { return { x + v.x, y + v.y, z + v.z, w + v.w }; }
104
109
  SkV4 operator-(const SkV4& v) const { return { x - v.x, y - v.y, z - v.z, w - v.w }; }
@@ -111,6 +116,12 @@ struct SK_API SkV4 {
111
116
  }
112
117
  friend SkV4 operator*(SkScalar s, const SkV4& v) { return v*s; }
113
118
 
119
+ SkScalar lengthSquared() const { return Dot(*this, *this); }
120
+ SkScalar length() const { return SkScalarSqrt(Dot(*this, *this)); }
121
+
122
+ SkScalar dot(const SkV4& v) const { return Dot(*this, v); }
123
+ SkV4 normalize() const { return Normalize(*this); }
124
+
114
125
  const float* ptr() const { return &x; }
115
126
  float* ptr() { return &x; }
116
127
 
@@ -8,12 +8,15 @@
8
8
  #ifndef SkMaskFilter_DEFINED
9
9
  #define SkMaskFilter_DEFINED
10
10
 
11
- #include "include/core/SkBlurTypes.h"
12
- #include "include/core/SkCoverageMode.h"
13
11
  #include "include/core/SkFlattenable.h"
12
+ #include "include/core/SkRefCnt.h"
14
13
  #include "include/core/SkScalar.h"
14
+ #include "include/core/SkTypes.h"
15
15
 
16
- class SkMatrix;
16
+ #include <cstddef>
17
+
18
+ enum SkBlurStyle : int;
19
+ struct SkDeserialProcs;
17
20
  struct SkRect;
18
21
 
19
22
  /** \class SkMaskFilter
@@ -8,12 +8,19 @@
8
8
  #ifndef SkMatrix_DEFINED
9
9
  #define SkMatrix_DEFINED
10
10
 
11
+ #include "include/core/SkPoint.h"
11
12
  #include "include/core/SkRect.h"
12
- #include "include/private/SkMacros.h"
13
- #include "include/private/SkTo.h"
13
+ #include "include/core/SkScalar.h"
14
+ #include "include/core/SkTypes.h"
15
+ #include "include/private/base/SkMacros.h"
16
+ #include "include/private/base/SkTo.h"
17
+
18
+ #include <cstdint>
19
+ #include <cstring>
14
20
 
15
- struct SkRSXform;
16
21
  struct SkPoint3;
22
+ struct SkRSXform;
23
+ struct SkSize;
17
24
 
18
25
  // Remove when clients are updated to live without this
19
26
  #define SK_SUPPORT_LEGACY_MATRIX_RECTTORECT
@@ -1812,7 +1819,10 @@ public:
1812
1819
  if (tx != 0.0f || ty != 0.0f) {
1813
1820
  mask |= kTranslate_Mask;
1814
1821
  }
1815
- this->setTypeMask(mask | kRectStaysRect_Mask);
1822
+ if (sx != 0 && sy != 0) {
1823
+ mask |= kRectStaysRect_Mask;
1824
+ }
1825
+ this->setTypeMask(mask);
1816
1826
  }
1817
1827
 
1818
1828
  /** Returns true if all elements of the matrix are finite. Returns false if any
@@ -19,6 +19,7 @@
19
19
  #include "include/effects/SkRuntimeEffect.h"
20
20
 
21
21
  #include <memory>
22
+ #include <tuple>
22
23
  #include <vector>
23
24
 
24
25
  class GrDirectContext;
@@ -29,22 +30,31 @@ namespace SkSL { struct Program; }
29
30
 
30
31
  /**
31
32
  * A specification for custom meshes. Specifies the vertex buffer attributes and stride, the
32
- * vertex program that produces a user-defined set of varyings, a fragment program that ingests
33
- * the interpolated varyings and produces local coordinates and optionally a color.
33
+ * vertex program that produces a user-defined set of varyings, and a fragment program that ingests
34
+ * the interpolated varyings and produces local coordinates for shading and optionally a color.
35
+ *
36
+ * The varyings must include a float2 named "position". If the passed varyings does not
37
+ * contain such a varying then one is implicitly added to the final specification and the SkSL
38
+ * Varyings struct described below. It is an error to have a varying named "position" that has a
39
+ * type other than float2.
40
+ *
41
+ * The provided attributes and varyings are used to create Attributes and Varyings structs in SkSL
42
+ * that are used by the shaders. Each attribute from the Attribute span becomes a member of the
43
+ * SkSL Attributes struct and likewise for the varyings.
34
44
  *
35
45
  * The signature of the vertex program must be:
36
- * float2 main(Attributes, out Varyings)
37
- * where the return value is a local position that will be transformed by SkCanvas's matrix.
46
+ * Varyings main(const Attributes).
38
47
  *
39
48
  * The signature of the fragment program must be either:
40
- * (float2|void) main(Varyings)
49
+ * float2 main(const Varyings)
41
50
  * or
42
- * (float2|void) main(Varyings, out (half4|float4) color)
51
+ * float2 main(const Varyings, out (half4|float4) color)
43
52
  *
44
53
  * where the return value is the local coordinates that will be used to access SkShader. If the
45
- * return type is void then the interpolated position from vertex shader return is used as the local
46
- * coordinate. If the color variant is used it will be blended with SkShader (or SkPaint color in
47
- * absence of a shader) using the SkBlender provided to the SkCanvas draw call.
54
+ * color variant is used, the returned color will be blended with SkPaint's SkShader (or SkPaint
55
+ * color in absence of a SkShader) using the SkBlender passed to SkCanvas drawMesh(). To use
56
+ * interpolated local space positions as the shader coordinates, equivalent to how SkPaths are
57
+ * shaded, return the position field from the Varying struct as the coordinates.
48
58
  *
49
59
  * The vertex and fragment programs may both contain uniforms. Uniforms with the same name are
50
60
  * assumed to be shared between stages. It is an error to specify uniforms in the vertex and
@@ -187,11 +197,12 @@ private:
187
197
  SkMeshSpecification(SkSpan<const Attribute>,
188
198
  size_t,
189
199
  SkSpan<const Varying>,
200
+ int passthroughLocalCoordsVaryingIndex,
201
+ uint32_t deadVaryingMask,
190
202
  std::vector<Uniform> uniforms,
191
203
  std::unique_ptr<const SkSL::Program>,
192
204
  std::unique_ptr<const SkSL::Program>,
193
205
  ColorType,
194
- bool hasLocalCoords,
195
206
  sk_sp<SkColorSpace>,
196
207
  SkAlphaType);
197
208
 
@@ -208,8 +219,9 @@ private:
208
219
  const std::unique_ptr<const SkSL::Program> fFS;
209
220
  const size_t fStride;
210
221
  uint32_t fHash;
222
+ const int fPassthroughLocalCoordsVaryingIndex;
223
+ const uint32_t fDeadVaryingMask;
211
224
  const ColorType fColorType;
212
- const bool fHasLocalCoords;
213
225
  const sk_sp<SkColorSpace> fColorSpace;
214
226
  const SkAlphaType fAlphaType;
215
227
  };
@@ -295,8 +307,11 @@ public:
295
307
  */
296
308
  static sk_sp<IndexBuffer> MakeIndexBuffer(GrDirectContext*, const void* data, size_t size);
297
309
 
298
- /** Deprecated in favor of const void* and size_t version above. */
299
- static sk_sp<IndexBuffer> MakeIndexBuffer(GrDirectContext*, sk_sp<const SkData>);
310
+ /**
311
+ * Makes a copy of an index buffer. The implementation currently only supports a CPU-backed
312
+ * source buffer.
313
+ */
314
+ static sk_sp<IndexBuffer> CopyIndexBuffer(GrDirectContext*, sk_sp<IndexBuffer>);
300
315
 
301
316
  /**
302
317
  * Makes a vertex buffer to be used with SkMeshes. The buffer may be CPU- or GPU-backed
@@ -313,12 +328,23 @@ public:
313
328
  */
314
329
  static sk_sp<VertexBuffer> MakeVertexBuffer(GrDirectContext*, const void*, size_t size);
315
330
 
316
- /** Deprecated in favor of const void* and size_t version above. */
317
- static sk_sp<VertexBuffer> MakeVertexBuffer(GrDirectContext*, sk_sp<const SkData>);
331
+ /**
332
+ * Makes a copy of a vertex buffer. The implementation currently only supports a CPU-backed
333
+ * source buffer.
334
+ */
335
+ static sk_sp<VertexBuffer> CopyVertexBuffer(GrDirectContext*, sk_sp<VertexBuffer>);
318
336
 
319
337
  enum class Mode { kTriangles, kTriangleStrip };
320
338
 
321
- static SkMesh Make(sk_sp<SkMeshSpecification>,
339
+ struct Result;
340
+
341
+ /**
342
+ * Creates a non-indexed SkMesh. The returned SkMesh can be tested for validity using
343
+ * SkMesh::isValid(). An invalid mesh simply fails to draws if passed to SkCanvas::drawMesh().
344
+ * If the mesh is invalid the returned string give contain the reason for the failure (e.g. the
345
+ * vertex buffer was null or uniform data too small).
346
+ */
347
+ static Result Make(sk_sp<SkMeshSpecification>,
322
348
  Mode,
323
349
  sk_sp<VertexBuffer>,
324
350
  size_t vertexCount,
@@ -326,7 +352,13 @@ public:
326
352
  sk_sp<const SkData> uniforms,
327
353
  const SkRect& bounds);
328
354
 
329
- static SkMesh MakeIndexed(sk_sp<SkMeshSpecification>,
355
+ /**
356
+ * Creates an indexed SkMesh. The returned SkMesh can be tested for validity using
357
+ * SkMesh::isValid(). A invalid mesh simply fails to draw if passed to SkCanvas::drawMesh().
358
+ * If the mesh is invalid the returned string give contain the reason for the failure (e.g. the
359
+ * index buffer was null or uniform data too small).
360
+ */
361
+ static Result MakeIndexed(sk_sp<SkMeshSpecification>,
330
362
  Mode,
331
363
  sk_sp<VertexBuffer>,
332
364
  size_t vertexCount,
@@ -364,7 +396,7 @@ public:
364
396
  private:
365
397
  friend struct SkMeshPriv;
366
398
 
367
- bool validate() const;
399
+ std::tuple<bool, SkString> validate() const;
368
400
 
369
401
  sk_sp<SkMeshSpecification> fSpec;
370
402
 
@@ -384,6 +416,8 @@ private:
384
416
  SkRect fBounds = SkRect::MakeEmpty();
385
417
  };
386
418
 
419
+ struct SkMesh::Result { SkMesh mesh; SkString error; };
420
+
387
421
  #endif // SK_ENABLE_SKSL
388
422
 
389
423
  #endif
@@ -5,5 +5,5 @@
5
5
  * found in the LICENSE file.
6
6
  */
7
7
  #ifndef SK_MILESTONE
8
- #define SK_MILESTONE 108
8
+ #define SK_MILESTONE 114
9
9
  #endif
@@ -8,23 +8,28 @@
8
8
  #ifndef SkPaint_DEFINED
9
9
  #define SkPaint_DEFINED
10
10
 
11
- #include "include/core/SkBlendMode.h"
12
11
  #include "include/core/SkColor.h"
13
12
  #include "include/core/SkRefCnt.h"
14
- #include "include/private/SkTo.h"
15
-
13
+ #include "include/core/SkScalar.h"
14
+ #include "include/core/SkTypes.h"
15
+ #include "include/private/base/SkCPUTypes.h"
16
+ #include "include/private/base/SkFloatingPoint.h"
17
+ #include "include/private/base/SkTo.h"
18
+ #include "include/private/base/SkTypeTraits.h"
19
+
20
+ #include <cstdint>
16
21
  #include <optional>
22
+ #include <type_traits>
17
23
 
18
24
  class SkBlender;
19
25
  class SkColorFilter;
20
26
  class SkColorSpace;
21
- struct SkRect;
22
27
  class SkImageFilter;
23
28
  class SkMaskFilter;
24
- class SkMatrix;
25
- class SkPath;
26
29
  class SkPathEffect;
27
30
  class SkShader;
31
+ enum class SkBlendMode;
32
+ struct SkRect;
28
33
 
29
34
  /** \class SkPaint
30
35
  SkPaint controls options applied when drawing. SkPaint collects all
@@ -383,34 +388,6 @@ public:
383
388
  */
384
389
  void setStrokeJoin(Join join);
385
390
 
386
- /** Returns the filled equivalent of the stroked path.
387
-
388
- @param src SkPath read to create a filled version
389
- @param dst resulting SkPath; may be the same as src, but may not be nullptr
390
- @param cullRect optional limit passed to SkPathEffect
391
- @param resScale if > 1, increase precision, else if (0 < resScale < 1) reduce precision
392
- to favor speed and size
393
- @return true if the path represents style fill, or false if it represents hairline
394
- */
395
- bool getFillPath(const SkPath& src, SkPath* dst, const SkRect* cullRect,
396
- SkScalar resScale = 1) const;
397
-
398
- bool getFillPath(const SkPath& src, SkPath* dst, const SkRect* cullRect,
399
- const SkMatrix& ctm) const;
400
-
401
- /** Returns the filled equivalent of the stroked path.
402
-
403
- Replaces dst with the src path modified by SkPathEffect and style stroke.
404
- SkPathEffect, if any, is not culled. stroke width is created with default precision.
405
-
406
- @param src SkPath read to create a filled version
407
- @param dst resulting SkPath dst may be the same as src, but may not be nullptr
408
- @return true if the path represents style fill, or false if it represents hairline
409
- */
410
- bool getFillPath(const SkPath& src, SkPath* dst) const {
411
- return this->getFillPath(src, dst, nullptr, 1);
412
- }
413
-
414
391
  /** Returns optional colors used when filling a path, such as a gradient.
415
392
 
416
393
  Does not alter SkShader SkRefCnt.
@@ -10,20 +10,29 @@
10
10
 
11
11
  #include "include/core/SkMatrix.h"
12
12
  #include "include/core/SkPathTypes.h"
13
+ #include "include/core/SkPoint.h"
14
+ #include "include/core/SkRect.h"
13
15
  #include "include/core/SkRefCnt.h"
14
- #include "include/private/SkTo.h"
15
-
16
+ #include "include/core/SkScalar.h"
17
+ #include "include/core/SkTypes.h"
18
+ #include "include/private/base/SkDebug.h"
19
+ #include "include/private/base/SkTo.h"
20
+ #include "include/private/base/SkTypeTraits.h"
21
+
22
+ #include <atomic>
23
+ #include <cstddef>
24
+ #include <cstdint>
16
25
  #include <initializer_list>
17
26
  #include <tuple>
27
+ #include <type_traits>
18
28
 
19
- class SkAutoPathBoundsUpdate;
20
29
  class SkData;
21
30
  class SkPathRef;
22
31
  class SkRRect;
23
32
  class SkWStream;
24
-
25
33
  enum class SkPathConvexity;
26
34
  enum class SkPathFirstDirection;
35
+ struct SkPathVerbAnalysis;
27
36
 
28
37
  // WIP -- define this locally, and fix call-sites to use SkPathBuilder (skbug.com/9000)
29
38
  //#define SK_HIDE_PATH_EDIT_METHODS
@@ -1866,6 +1875,16 @@ private:
1866
1875
  */
1867
1876
  void shrinkToFit();
1868
1877
 
1878
+ // Creates a new Path after the supplied arguments have been validated by
1879
+ // sk_path_analyze_verbs().
1880
+ static SkPath MakeInternal(const SkPathVerbAnalysis& analsis,
1881
+ const SkPoint points[],
1882
+ const uint8_t verbs[],
1883
+ int verbCount,
1884
+ const SkScalar conics[],
1885
+ SkPathFillType fillType,
1886
+ bool isVolatile);
1887
+
1869
1888
  friend class SkAutoPathBoundsUpdate;
1870
1889
  friend class SkAutoDisableOvalCheck;
1871
1890
  friend class SkAutoDisableDirectionCheck;
@@ -8,11 +8,19 @@
8
8
  #ifndef SkPathBuilder_DEFINED
9
9
  #define SkPathBuilder_DEFINED
10
10
 
11
- #include "include/core/SkMatrix.h"
12
11
  #include "include/core/SkPath.h"
13
12
  #include "include/core/SkPathTypes.h"
13
+ #include "include/core/SkPoint.h"
14
+ #include "include/core/SkRect.h"
14
15
  #include "include/core/SkRefCnt.h"
15
- #include "include/private/SkTDArray.h"
16
+ #include "include/core/SkScalar.h"
17
+ #include "include/core/SkTypes.h"
18
+ #include "include/private/SkPathRef.h"
19
+ #include "include/private/base/SkTo.h"
20
+
21
+ #include <initializer_list>
22
+
23
+ class SkRRect;
16
24
 
17
25
  class SK_API SkPathBuilder {
18
26
  public:
@@ -220,9 +228,9 @@ public:
220
228
  }
221
229
 
222
230
  private:
223
- SkTDArray<SkPoint> fPts;
224
- SkTDArray<uint8_t> fVerbs;
225
- SkTDArray<SkScalar> fConicWeights;
231
+ SkPathRef::PointsArray fPts;
232
+ SkPathRef::VerbsArray fVerbs;
233
+ SkPathRef::ConicWeightsArray fConicWeights;
226
234
 
227
235
  SkPathFillType fFillType;
228
236
  bool fIsVolatile;
@@ -10,7 +10,7 @@
10
10
 
11
11
  #include "include/core/SkContourMeasure.h"
12
12
  #include "include/core/SkPath.h"
13
- #include "include/private/SkTDArray.h"
13
+ #include "include/private/base/SkTDArray.h"
14
14
 
15
15
  class SK_API SkPathMeasure {
16
16
  public:
@@ -8,8 +8,6 @@
8
8
  #ifndef SkPathTypes_DEFINED
9
9
  #define SkPathTypes_DEFINED
10
10
 
11
- #include "include/core/SkTypes.h"
12
-
13
11
  enum class SkPathFillType {
14
12
  /** Specifies that "inside" is computed by a non-zero sum of signed edge crossings */
15
13
  kWinding,
@@ -0,0 +1,42 @@
1
+ /*
2
+ * Copyright 2022 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
+ #ifndef SkPathUtils_DEFINED
8
+ #define SkPathUtils_DEFINED
9
+
10
+ #include "include/core/SkScalar.h"
11
+ #include "include/core/SkTypes.h"
12
+
13
+ class SkMatrix;
14
+ class SkPaint;
15
+ class SkPath;
16
+ struct SkRect;
17
+
18
+ namespace skpathutils {
19
+
20
+ /** Returns the filled equivalent of the stroked path.
21
+
22
+ @param src SkPath read to create a filled version
23
+ @param paint SkPaint, from which attributes such as stroke cap, width, miter, and join,
24
+ as well as pathEffect will be used.
25
+ @param dst resulting SkPath; may be the same as src, but may not be nullptr
26
+ @param cullRect optional limit passed to SkPathEffect
27
+ @param resScale if > 1, increase precision, else if (0 < resScale < 1) reduce precision
28
+ to favor speed and size
29
+ @return true if the dst path was updated, false if it was not (e.g. if the path
30
+ represents hairline and cannot be filled).
31
+ */
32
+ SK_API bool FillPathWithPaint(const SkPath &src, const SkPaint &paint, SkPath *dst,
33
+ const SkRect *cullRect, SkScalar resScale = 1);
34
+
35
+ SK_API bool FillPathWithPaint(const SkPath &src, const SkPaint &paint, SkPath *dst,
36
+ const SkRect *cullRect, const SkMatrix &ctm);
37
+
38
+ SK_API bool FillPathWithPaint(const SkPath &src, const SkPaint &paint, SkPath *dst);
39
+
40
+ }
41
+
42
+ #endif
@@ -243,8 +243,9 @@ private:
243
243
 
244
244
  void serialize(SkWStream*, const SkSerialProcs*, class SkRefCntSet* typefaces,
245
245
  bool textBlobsOnly=false) const;
246
- static sk_sp<SkPicture> MakeFromStream(SkStream*, const SkDeserialProcs*,
247
- class SkTypefacePlayback*);
246
+ static sk_sp<SkPicture> MakeFromStreamPriv(SkStream*, const SkDeserialProcs*,
247
+ class SkTypefacePlayback*,
248
+ int recursionLimit);
248
249
  friend class SkPictureData;
249
250
 
250
251
  /** Return true if the SkStream/Buffer represents a serialized picture, and
@@ -12,6 +12,8 @@
12
12
  #include "include/core/SkPicture.h"
13
13
  #include "include/core/SkRefCnt.h"
14
14
 
15
+ #include <memory>
16
+
15
17
  #ifdef SK_BUILD_FOR_ANDROID_FRAMEWORK
16
18
  namespace android {
17
19
  class Picture;
@@ -8,20 +8,16 @@
8
8
  #ifndef SkPixelRef_DEFINED
9
9
  #define SkPixelRef_DEFINED
10
10
 
11
- #include "include/core/SkBitmap.h"
12
- #include "include/core/SkImageInfo.h"
13
- #include "include/core/SkPixmap.h"
14
11
  #include "include/core/SkRefCnt.h"
15
12
  #include "include/core/SkSize.h"
16
13
  #include "include/private/SkIDChangeListener.h"
17
- #include "include/private/SkMutex.h"
18
- #include "include/private/SkTDArray.h"
14
+ #include "include/private/base/SkAPI.h"
15
+ #include "include/private/base/SkTo.h"
19
16
 
20
17
  #include <atomic>
18
+ #include <cstddef>
19
+ #include <cstdint>
21
20
 
22
- struct SkIRect;
23
-
24
- class GrTexture;
25
21
  class SkDiscardableMemory;
26
22
 
27
23
  /** \class SkPixelRef