@shopify/react-native-skia 2.11.0-next.2 → 2.11.1

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.
Files changed (414) hide show
  1. package/android/cpp/rnskia-android/RNSkAndroidPlatformContext.h +0 -10
  2. package/android/src/main/java/com/shopify/reactnative/skia/ViewScreenshotService.java +9 -12
  3. package/apple/RNSkApplePlatformContext.h +0 -3
  4. package/apple/RNSkApplePlatformContext.mm +0 -11
  5. package/cpp/api/JsiSkApi.h +0 -6
  6. package/cpp/api/JsiSkFont.h +2 -8
  7. package/cpp/api/JsiSkMatrix.h +4 -2
  8. package/cpp/api/recorder/Convertor.h +62 -11
  9. package/cpp/api/recorder/Drawings.h +13 -3
  10. package/cpp/api/recorder/ImageFilters.h +15 -1
  11. package/cpp/api/recorder/Paint.h +5 -2
  12. package/cpp/api/third_party/SkottieUtils.cpp +1 -1
  13. package/cpp/rnskia/RNSkPlatformContext.h +0 -3
  14. package/cpp/skia/include/android/SkAndroidFrameworkUtils.h +0 -2
  15. package/cpp/skia/include/android/vk/AndroidVulkanMemoryAllocator.h +1 -1
  16. package/cpp/skia/include/codec/SkAndroidCodec.h +1 -1
  17. package/cpp/skia/include/codec/SkAvifDecoder.h +1 -1
  18. package/cpp/skia/include/codec/SkBmpDecoder.h +1 -1
  19. package/cpp/skia/include/codec/SkBmpRustDecoder.h +42 -0
  20. package/cpp/skia/include/codec/SkCodec.h +3 -2
  21. package/cpp/skia/include/codec/SkGifDecoder.h +1 -1
  22. package/cpp/skia/include/codec/SkIcoDecoder.h +1 -1
  23. package/cpp/skia/include/codec/SkJpegDecoder.h +1 -1
  24. package/cpp/skia/include/codec/SkJpegxlDecoder.h +1 -1
  25. package/cpp/skia/include/codec/SkPixmapUtils.h +1 -1
  26. package/cpp/skia/include/codec/SkPngDecoder.h +1 -1
  27. package/cpp/skia/include/codec/SkPngRustDecoder.h +1 -1
  28. package/cpp/skia/include/codec/SkRawDecoder.h +1 -1
  29. package/cpp/skia/include/codec/SkWbmpDecoder.h +1 -1
  30. package/cpp/skia/include/codec/SkWebpDecoder.h +1 -1
  31. package/cpp/skia/include/core/SkBitmap.h +3 -3
  32. package/cpp/skia/include/core/SkCPUContext.h +1 -1
  33. package/cpp/skia/include/core/SkCPURecorder.h +2 -3
  34. package/cpp/skia/include/core/SkCanvas.h +23 -15
  35. package/cpp/skia/include/core/SkColor.h +2 -2
  36. package/cpp/skia/include/core/SkColorFilter.h +1 -1
  37. package/cpp/skia/include/core/SkColorSpace.h +2 -2
  38. package/cpp/skia/include/core/SkColorTable.h +1 -1
  39. package/cpp/skia/include/core/SkContourMeasure.h +1 -1
  40. package/cpp/skia/include/core/SkData.h +1 -1
  41. package/cpp/skia/include/core/SkDataTable.h +2 -2
  42. package/cpp/skia/include/core/SkDocument.h +1 -1
  43. package/cpp/skia/include/core/SkDrawable.h +1 -1
  44. package/cpp/skia/include/core/SkFont.h +2 -2
  45. package/cpp/skia/include/core/SkFontMetrics.h +1 -1
  46. package/cpp/skia/include/core/SkFontMgr.h +1 -1
  47. package/cpp/skia/include/core/SkFontScanner.h +3 -3
  48. package/cpp/skia/include/core/SkFontStyle.h +1 -1
  49. package/cpp/skia/include/core/SkGraphics.h +1 -1
  50. package/cpp/skia/include/core/SkImage.h +1 -1
  51. package/cpp/skia/include/core/SkImageFilter.h +1 -1
  52. package/cpp/skia/include/core/SkImageGenerator.h +1 -1
  53. package/cpp/skia/include/core/SkImageInfo.h +4 -4
  54. package/cpp/skia/include/core/SkMatrix.h +3 -3
  55. package/cpp/skia/include/core/SkMesh.h +2 -2
  56. package/cpp/skia/include/core/SkMilestone.h +1 -1
  57. package/cpp/skia/include/core/SkOverdrawCanvas.h +1 -1
  58. package/cpp/skia/include/core/SkPaint.h +4 -4
  59. package/cpp/skia/include/core/SkPath.h +5 -23
  60. package/cpp/skia/include/core/SkPathBuilder.h +4 -2
  61. package/cpp/skia/include/core/SkPathMeasure.h +1 -1
  62. package/cpp/skia/include/core/SkPictureRecorder.h +1 -1
  63. package/cpp/skia/include/core/SkPixelRef.h +3 -5
  64. package/cpp/skia/include/core/SkPixmap.h +7 -2
  65. package/cpp/skia/include/core/SkPoint.h +555 -5
  66. package/cpp/skia/include/core/SkPoint3.h +2 -2
  67. package/cpp/skia/include/core/SkRRect.h +9 -1
  68. package/cpp/skia/include/core/SkRSXform.h +1 -1
  69. package/cpp/skia/include/core/SkRecorder.h +2 -3
  70. package/cpp/skia/include/core/SkRect.h +3 -3
  71. package/cpp/skia/include/core/SkRefCnt.h +1 -1
  72. package/cpp/skia/include/core/SkRegion.h +4 -4
  73. package/cpp/skia/include/core/SkScalar.h +2 -3
  74. package/cpp/skia/include/core/SkSerialProcs.h +1 -1
  75. package/cpp/skia/include/core/SkShader.h +1 -1
  76. package/cpp/skia/include/core/SkSize.h +1 -1
  77. package/cpp/skia/include/core/SkSpan.h +165 -4
  78. package/cpp/skia/include/core/SkStream.h +2 -2
  79. package/cpp/skia/include/core/SkStrikeRef.h +16 -0
  80. package/cpp/skia/include/core/SkString.h +2 -2
  81. package/cpp/skia/include/core/SkStrokeRec.h +1 -1
  82. package/cpp/skia/include/core/SkSurfaceProps.h +1 -1
  83. package/cpp/skia/include/core/SkSwizzle.h +1 -1
  84. package/cpp/skia/include/core/SkTextBlob.h +2 -2
  85. package/cpp/skia/include/core/SkTiledImageUtils.h +1 -1
  86. package/cpp/skia/include/core/SkTypeface.h +8 -2
  87. package/cpp/skia/include/core/SkTypes.h +6 -6
  88. package/cpp/skia/include/core/SkUnPreMultiply.h +1 -1
  89. package/cpp/skia/include/core/SkVertices.h +1 -1
  90. package/cpp/skia/include/core/SkYUVAPixmaps.h +1 -1
  91. package/cpp/skia/include/docs/SkPDFDocument.h +9 -3
  92. package/cpp/skia/include/effects/SkGradient.h +1 -1
  93. package/cpp/skia/include/effects/SkPerlinNoiseShader.h +1 -1
  94. package/cpp/skia/include/effects/SkRuntimeEffect.h +4 -4
  95. package/cpp/skia/include/encode/SkEncoder.h +3 -3
  96. package/cpp/skia/include/encode/SkICC.h +1 -1
  97. package/cpp/skia/include/encode/SkJpegEncoder.h +1 -1
  98. package/cpp/skia/include/encode/SkPngEncoder.h +1 -1
  99. package/cpp/skia/include/encode/SkPngRustEncoder.h +16 -1
  100. package/cpp/skia/include/encode/SkWebpEncoder.h +1 -1
  101. package/cpp/skia/include/gpu/GpuTypes.h +1 -1
  102. package/cpp/skia/include/gpu/MutableTextureState.h +1 -1
  103. package/cpp/skia/include/gpu/ganesh/GrBackendSemaphore.h +2 -2
  104. package/cpp/skia/include/gpu/ganesh/GrBackendSurface.h +3 -3
  105. package/cpp/skia/include/gpu/ganesh/GrDriverBugWorkaroundsAutogen.h +39 -37
  106. package/cpp/skia/include/gpu/ganesh/GrExternalTextureGenerator.h +1 -1
  107. package/cpp/skia/include/gpu/ganesh/GrRecordingContext.h +3 -2
  108. package/cpp/skia/include/gpu/ganesh/GrTypes.h +1 -1
  109. package/cpp/skia/include/gpu/ganesh/SkImageGanesh.h +1 -1
  110. package/cpp/skia/include/gpu/ganesh/SkMeshGanesh.h +1 -1
  111. package/cpp/skia/include/gpu/ganesh/SkSurfaceGanesh.h +1 -1
  112. package/cpp/skia/include/gpu/ganesh/d3d/GrD3DBackendSemaphore.h +1 -1
  113. package/cpp/skia/include/gpu/ganesh/d3d/GrD3DBackendSurface.h +1 -1
  114. package/cpp/skia/include/gpu/ganesh/d3d/GrD3DDirectContext.h +1 -1
  115. package/cpp/skia/include/gpu/ganesh/gl/GrGLAssembleInterface.h +1 -1
  116. package/cpp/skia/include/gpu/ganesh/gl/GrGLBackendSurface.h +1 -1
  117. package/cpp/skia/include/gpu/ganesh/gl/GrGLConfig.h +1 -1
  118. package/cpp/skia/include/gpu/ganesh/gl/GrGLDirectContext.h +1 -1
  119. package/cpp/skia/include/gpu/ganesh/gl/GrGLExtensions.h +2 -2
  120. package/cpp/skia/include/gpu/ganesh/gl/GrGLFunctions.h +1 -1
  121. package/cpp/skia/include/gpu/ganesh/gl/GrGLMakeWebGLInterface.h +1 -1
  122. package/cpp/skia/include/gpu/ganesh/gl/epoxy/GrGLMakeEpoxyEGLInterface.h +1 -1
  123. package/cpp/skia/include/gpu/ganesh/gl/glx/GrGLMakeGLXInterface.h +1 -1
  124. package/cpp/skia/include/gpu/ganesh/gl/ios/GrGLMakeIOSInterface.h +1 -1
  125. package/cpp/skia/include/gpu/ganesh/gl/mac/GrGLMakeMacInterface.h +1 -1
  126. package/cpp/skia/include/gpu/ganesh/gl/win/GrGLMakeWinInterface.h +1 -1
  127. package/cpp/skia/include/gpu/ganesh/mock/GrMockBackendSurface.h +1 -1
  128. package/cpp/skia/include/gpu/ganesh/mock/GrMockTypes.h +1 -1
  129. package/cpp/skia/include/gpu/ganesh/mtl/GrMtlBackendSemaphore.h +1 -1
  130. package/cpp/skia/include/gpu/ganesh/mtl/GrMtlBackendSurface.h +1 -1
  131. package/cpp/skia/include/gpu/ganesh/mtl/GrMtlDirectContext.h +1 -1
  132. package/cpp/skia/include/gpu/ganesh/vk/GrVkBackendSemaphore.h +1 -1
  133. package/cpp/skia/include/gpu/ganesh/vk/GrVkBackendSurface.h +1 -1
  134. package/cpp/skia/include/gpu/ganesh/vk/GrVkDirectContext.h +1 -1
  135. package/cpp/skia/include/gpu/graphite/BackendSemaphore.h +2 -2
  136. package/cpp/skia/include/gpu/graphite/BackendTexture.h +2 -2
  137. package/cpp/skia/include/gpu/graphite/Context.h +3 -3
  138. package/cpp/skia/include/gpu/graphite/ContextOptions.h +8 -2
  139. package/cpp/skia/include/gpu/graphite/PersistentPipelineStorage.h +1 -1
  140. package/cpp/skia/include/gpu/graphite/PrecompileContext.h +16 -2
  141. package/cpp/skia/include/gpu/graphite/Recorder.h +8 -7
  142. package/cpp/skia/include/gpu/graphite/Recording.h +6 -4
  143. package/cpp/skia/include/gpu/graphite/TextureInfo.h +2 -2
  144. package/cpp/skia/include/gpu/graphite/dawn/DawnGraphiteTypes.h +1 -1
  145. package/cpp/skia/include/gpu/graphite/mtl/MtlBackendContext.h +1 -1
  146. package/cpp/skia/include/gpu/graphite/mtl/MtlGraphiteTypes.h +1 -1
  147. package/cpp/skia/include/gpu/graphite/mtl/MtlGraphiteTypes_cpp.h +1 -1
  148. package/cpp/skia/include/gpu/graphite/precompile/PaintOptions.h +2 -2
  149. package/cpp/skia/include/gpu/graphite/precompile/PrecompileImageFilter.h +1 -1
  150. package/cpp/skia/include/gpu/graphite/vk/VulkanGraphiteContext.h +1 -1
  151. package/cpp/skia/include/gpu/vk/VulkanBackendContext.h +1 -1
  152. package/cpp/skia/include/gpu/vk/VulkanExtensions.h +3 -3
  153. package/cpp/skia/include/gpu/vk/VulkanMutableTextureState.h +1 -1
  154. package/cpp/skia/include/gpu/vk/VulkanPreferredFeatures.h +1 -1
  155. package/cpp/skia/include/gpu/vk/VulkanTypes.h +1 -1
  156. package/cpp/skia/include/pathops/SkPathOps.h +2 -2
  157. package/cpp/skia/include/ports/SkImageGeneratorCG.h +2 -2
  158. package/cpp/skia/include/ports/SkImageGeneratorWIC.h +2 -2
  159. package/cpp/skia/include/private/{base/SingleOwner.h → SingleOwner.h} +5 -5
  160. package/cpp/skia/include/private/{base/SkAPI.h → SkAPI.h} +1 -1
  161. package/cpp/skia/include/private/{base/SkAlign.h → SkAlign.h} +1 -1
  162. package/cpp/skia/include/private/{base/SkAnySubclass.h → SkAnySubclass.h} +1 -1
  163. package/cpp/skia/include/private/{base/SkAssert.h → SkAssert.h} +4 -4
  164. package/cpp/skia/include/private/{base/SkAttributes.h → SkAttributes.h} +2 -2
  165. package/cpp/skia/include/private/{base/SkContainers.h → SkContainers.h} +3 -3
  166. package/cpp/skia/include/private/{base/SkDebug.h → SkDebug.h} +3 -3
  167. package/cpp/skia/include/private/{base/SkDeque.h → SkDeque.h} +1 -1
  168. package/cpp/skia/include/private/SkEncodedInfo.h +2 -2
  169. package/cpp/skia/include/private/SkEnumBitMask.h +92 -0
  170. package/cpp/skia/include/private/SkExif.h +1 -1
  171. package/cpp/skia/include/private/{base/SkFixed.h → SkFixed.h} +4 -4
  172. package/cpp/skia/include/private/{base/SkFloatingPoint.h → SkFloatingPoint.h} +2 -2
  173. package/cpp/skia/include/private/SkGainmapShader.h +1 -1
  174. package/cpp/skia/include/private/SkHdrMetadata.h +1 -1
  175. package/cpp/skia/include/private/SkIDChangeListener.h +3 -3
  176. package/cpp/skia/include/private/{base/SkLoadUserConfig.h → SkLoadUserConfig.h} +2 -2
  177. package/cpp/skia/include/private/{base/SkLog.h → SkLog.h} +4 -4
  178. package/cpp/skia/include/private/{base/SkMacros.h → SkMacros.h} +1 -1
  179. package/cpp/skia/include/private/{base/SkMalloc.h → SkMalloc.h} +1 -1
  180. package/cpp/skia/include/private/{base/SkMath.h → SkMath.h} +2 -2
  181. package/cpp/skia/include/private/{base/SkMutex.h → SkMutex.h} +5 -5
  182. package/cpp/skia/include/private/{base/SkNoncopyable.h → SkNoncopyable.h} +1 -1
  183. package/cpp/skia/include/private/{base/SkOnce.h → SkOnce.h} +1 -1
  184. package/cpp/skia/include/private/SkPathRef.h +4 -4
  185. package/cpp/skia/include/private/SkPixelStorage.h +20 -5
  186. package/cpp/skia/include/private/{base/SkSafe32.h → SkSafe32.h} +2 -2
  187. package/cpp/skia/include/private/{base/SkSemaphore.h → SkSemaphore.h} +3 -3
  188. package/cpp/skia/include/private/{base/SkTArray.h → SkTArray.h} +10 -11
  189. package/cpp/skia/include/private/{base/SkTDArray.h → SkTDArray.h} +4 -4
  190. package/cpp/skia/include/private/{base/SkTFitsIn.h → SkTFitsIn.h} +0 -2
  191. package/cpp/skia/include/private/{base/SkTLogic.h → SkTLogic.h} +1 -1
  192. package/cpp/skia/include/private/{base/SkTemplates.h → SkTemplates.h} +5 -6
  193. package/cpp/skia/include/private/{base/SkThreadAnnotations.h → SkThreadAnnotations.h} +1 -1
  194. package/cpp/skia/include/private/{base/SkThreadID.h → SkThreadID.h} +2 -2
  195. package/cpp/skia/include/private/{base/SkTo.h → SkTo.h} +2 -2
  196. package/cpp/skia/include/private/{base/SkTypeTraits.h → SkTypeTraits.h} +20 -0
  197. package/cpp/skia/include/private/SkXmp.h +1 -1
  198. package/cpp/skia/include/private/chromium/GrDeferredDisplayList.h +1 -1
  199. package/cpp/skia/include/private/chromium/GrSurfaceCharacterization.h +1 -1
  200. package/cpp/skia/include/private/chromium/SkChromeRemoteGlyphCache.h +1 -1
  201. package/cpp/skia/include/private/chromium/SkCodecsICCProfileChromium.h +1 -1
  202. package/cpp/skia/include/private/chromium/SkExifChromium.h +1 -1
  203. package/cpp/skia/include/private/chromium/SkImageChromium.h +1 -1
  204. package/cpp/skia/include/private/chromium/SkPMColor.h +1 -1
  205. package/cpp/skia/include/private/chromium/Slug.h +1 -1
  206. package/cpp/skia/include/private/gpu/ganesh/GrContext_Base.h +1 -1
  207. package/cpp/skia/include/private/gpu/ganesh/GrImageContext.h +2 -2
  208. package/cpp/skia/include/private/gpu/ganesh/GrTextureGenerator.h +1 -1
  209. package/cpp/skia/include/private/gpu/ganesh/GrTypesPriv.h +4 -4
  210. package/cpp/skia/include/utils/SkCamera.h +1 -1
  211. package/cpp/skia/include/utils/SkNWayCanvas.h +1 -1
  212. package/cpp/skia/include/utils/SkPaintFilterCanvas.h +1 -1
  213. package/cpp/skia/modules/jsonreader/SkJSONReader.cpp +6 -6
  214. package/cpp/skia/modules/jsonreader/SkJSONReader.h +2 -2
  215. package/cpp/skia/modules/skottie/include/SkottieProperty.h +1 -1
  216. package/cpp/skia/modules/skottie/include/SlotManager.h +2 -2
  217. package/cpp/skia/modules/skottie/include/TextShaper.h +1 -1
  218. package/cpp/skia/modules/skottie/src/text/Font.h +1 -1
  219. package/cpp/skia/modules/skparagraph/include/ParagraphCache.h +1 -1
  220. package/cpp/skia/modules/skparagraph/include/TypefaceFontProvider.h +1 -1
  221. package/cpp/skia/modules/skresources/include/SkResources.h +1 -1
  222. package/cpp/skia/modules/sksg/include/SkSGNode.h +1 -1
  223. package/cpp/skia/modules/sksg/include/SkSGRect.h +1 -1
  224. package/cpp/skia/modules/sksg/include/SkSGRenderEffect.h +1 -1
  225. package/cpp/skia/modules/skunicode/include/SkUnicode.h +3 -3
  226. package/cpp/skia/modules/svg/include/SkSVGAttributeParser.h +1 -1
  227. package/cpp/skia/modules/svg/include/SkSVGCircle.h +1 -1
  228. package/cpp/skia/modules/svg/include/SkSVGClipPath.h +1 -1
  229. package/cpp/skia/modules/svg/include/SkSVGContainer.h +2 -2
  230. package/cpp/skia/modules/svg/include/SkSVGDOM.h +1 -1
  231. package/cpp/skia/modules/svg/include/SkSVGEllipse.h +1 -1
  232. package/cpp/skia/modules/svg/include/SkSVGFe.h +1 -1
  233. package/cpp/skia/modules/svg/include/SkSVGFeBlend.h +1 -1
  234. package/cpp/skia/modules/svg/include/SkSVGFeColorMatrix.h +1 -1
  235. package/cpp/skia/modules/svg/include/SkSVGFeComponentTransfer.h +1 -1
  236. package/cpp/skia/modules/svg/include/SkSVGFeComposite.h +1 -1
  237. package/cpp/skia/modules/svg/include/SkSVGFeDisplacementMap.h +1 -1
  238. package/cpp/skia/modules/svg/include/SkSVGFeFlood.h +1 -1
  239. package/cpp/skia/modules/svg/include/SkSVGFeGaussianBlur.h +1 -1
  240. package/cpp/skia/modules/svg/include/SkSVGFeImage.h +1 -1
  241. package/cpp/skia/modules/svg/include/SkSVGFeLightSource.h +2 -2
  242. package/cpp/skia/modules/svg/include/SkSVGFeLighting.h +1 -1
  243. package/cpp/skia/modules/svg/include/SkSVGFeMerge.h +1 -1
  244. package/cpp/skia/modules/svg/include/SkSVGFeOffset.h +1 -1
  245. package/cpp/skia/modules/svg/include/SkSVGFeTurbulence.h +1 -1
  246. package/cpp/skia/modules/svg/include/SkSVGFilter.h +1 -1
  247. package/cpp/skia/modules/svg/include/SkSVGGradient.h +2 -2
  248. package/cpp/skia/modules/svg/include/SkSVGImage.h +2 -2
  249. package/cpp/skia/modules/svg/include/SkSVGLine.h +1 -1
  250. package/cpp/skia/modules/svg/include/SkSVGLinearGradient.h +1 -1
  251. package/cpp/skia/modules/svg/include/SkSVGMask.h +1 -1
  252. package/cpp/skia/modules/svg/include/SkSVGNode.h +1 -1
  253. package/cpp/skia/modules/svg/include/SkSVGPath.h +1 -1
  254. package/cpp/skia/modules/svg/include/SkSVGPattern.h +1 -1
  255. package/cpp/skia/modules/svg/include/SkSVGPoly.h +1 -1
  256. package/cpp/skia/modules/svg/include/SkSVGRadialGradient.h +1 -1
  257. package/cpp/skia/modules/svg/include/SkSVGRect.h +1 -1
  258. package/cpp/skia/modules/svg/include/SkSVGRenderContext.h +1 -1
  259. package/cpp/skia/modules/svg/include/SkSVGSVG.h +1 -1
  260. package/cpp/skia/modules/svg/include/SkSVGShape.h +1 -1
  261. package/cpp/skia/modules/svg/include/SkSVGStop.h +1 -1
  262. package/cpp/skia/modules/svg/include/SkSVGText.h +1 -1
  263. package/cpp/skia/modules/svg/include/SkSVGTransformableNode.h +1 -1
  264. package/cpp/skia/modules/svg/include/SkSVGUse.h +1 -1
  265. package/cpp/skia/modules/svg/include/SkSVGValue.h +1 -1
  266. package/cpp/skia/src/{base → core}/SkArenaAlloc.h +5 -5
  267. package/cpp/skia/src/{base → core}/SkAutoLocaleSetter.h +1 -1
  268. package/cpp/skia/src/core/SkChecksum.h +1 -1
  269. package/cpp/skia/src/core/SkLRUCache.h +1 -1
  270. package/cpp/skia/src/{base → core}/SkMathPriv.h +3 -3
  271. package/cpp/skia/src/core/SkTHash.h +1 -1
  272. package/cpp/skia/src/{base → core}/SkTInternalLList.h +3 -3
  273. package/cpp/skia/src/{base → core}/SkTLazy.h +1 -1
  274. package/cpp/skia/src/{base → core}/SkUTF.h +1 -1
  275. package/lib/commonjs/renderer/components/Mask.js +3 -9
  276. package/lib/commonjs/renderer/components/Mask.js.map +1 -1
  277. package/lib/commonjs/renderer/processors/Animations/Animations.d.ts +27 -1
  278. package/lib/commonjs/renderer/processors/Animations/Animations.js +28 -0
  279. package/lib/commonjs/renderer/processors/Animations/Animations.js.map +1 -1
  280. package/lib/commonjs/skia/types/Matrix4.js +7 -2
  281. package/lib/commonjs/skia/types/Matrix4.js.map +1 -1
  282. package/lib/commonjs/skia/types/Skia.d.ts +1 -6
  283. package/lib/commonjs/skia/types/Skia.js.map +1 -1
  284. package/lib/commonjs/skia/web/JsiSkia.js +0 -3
  285. package/lib/commonjs/skia/web/JsiSkia.js.map +1 -1
  286. package/lib/commonjs/sksg/Recorder/Core.js +8 -1
  287. package/lib/commonjs/sksg/Recorder/Core.js.map +1 -1
  288. package/lib/commonjs/sksg/Recorder/DrawingContext.d.ts +1 -0
  289. package/lib/commonjs/sksg/Recorder/DrawingContext.js +10 -0
  290. package/lib/commonjs/sksg/Recorder/DrawingContext.js.map +1 -1
  291. package/lib/commonjs/sksg/Recorder/Player.js +1 -1
  292. package/lib/commonjs/sksg/Recorder/Player.js.map +1 -1
  293. package/lib/commonjs/sksg/Recorder/ReanimatedRecorder.js +8 -0
  294. package/lib/commonjs/sksg/Recorder/ReanimatedRecorder.js.map +1 -1
  295. package/lib/commonjs/sksg/Recorder/Recorder.d.ts +1 -1
  296. package/lib/commonjs/sksg/Recorder/Recorder.js +4 -0
  297. package/lib/commonjs/sksg/Recorder/Recorder.js.map +1 -1
  298. package/lib/commonjs/sksg/Recorder/Visitor.js +6 -1
  299. package/lib/commonjs/sksg/Recorder/Visitor.js.map +1 -1
  300. package/lib/commonjs/sksg/Recorder/commands/Drawing.js +10 -8
  301. package/lib/commonjs/sksg/Recorder/commands/Drawing.js.map +1 -1
  302. package/lib/commonjs/sksg/Recorder/commands/ImageFilters.js +15 -1
  303. package/lib/commonjs/sksg/Recorder/commands/ImageFilters.js.map +1 -1
  304. package/lib/commonjs/sksg/Recorder/commands/Shaders.js +1 -1
  305. package/lib/commonjs/sksg/Recorder/commands/Shaders.js.map +1 -1
  306. package/lib/commonjs/sksg/utils.d.ts +4 -0
  307. package/lib/commonjs/sksg/utils.js +14 -1
  308. package/lib/commonjs/sksg/utils.js.map +1 -1
  309. package/lib/module/renderer/components/Mask.js +3 -9
  310. package/lib/module/renderer/components/Mask.js.map +1 -1
  311. package/lib/module/renderer/processors/Animations/Animations.d.ts +27 -1
  312. package/lib/module/renderer/processors/Animations/Animations.js +21 -0
  313. package/lib/module/renderer/processors/Animations/Animations.js.map +1 -1
  314. package/lib/module/skia/types/Matrix4.js +7 -2
  315. package/lib/module/skia/types/Matrix4.js.map +1 -1
  316. package/lib/module/skia/types/Skia.d.ts +1 -6
  317. package/lib/module/skia/types/Skia.js.map +1 -1
  318. package/lib/module/skia/web/JsiSkia.js +0 -3
  319. package/lib/module/skia/web/JsiSkia.js.map +1 -1
  320. package/lib/module/sksg/Recorder/Core.js +8 -1
  321. package/lib/module/sksg/Recorder/Core.js.map +1 -1
  322. package/lib/module/sksg/Recorder/DrawingContext.d.ts +1 -0
  323. package/lib/module/sksg/Recorder/DrawingContext.js +10 -0
  324. package/lib/module/sksg/Recorder/DrawingContext.js.map +1 -1
  325. package/lib/module/sksg/Recorder/Player.js +1 -1
  326. package/lib/module/sksg/Recorder/Player.js.map +1 -1
  327. package/lib/module/sksg/Recorder/ReanimatedRecorder.js +9 -1
  328. package/lib/module/sksg/Recorder/ReanimatedRecorder.js.map +1 -1
  329. package/lib/module/sksg/Recorder/Recorder.d.ts +1 -1
  330. package/lib/module/sksg/Recorder/Recorder.js +5 -1
  331. package/lib/module/sksg/Recorder/Recorder.js.map +1 -1
  332. package/lib/module/sksg/Recorder/Visitor.js +6 -1
  333. package/lib/module/sksg/Recorder/Visitor.js.map +1 -1
  334. package/lib/module/sksg/Recorder/commands/Drawing.js +10 -8
  335. package/lib/module/sksg/Recorder/commands/Drawing.js.map +1 -1
  336. package/lib/module/sksg/Recorder/commands/ImageFilters.js +15 -1
  337. package/lib/module/sksg/Recorder/commands/ImageFilters.js.map +1 -1
  338. package/lib/module/sksg/Recorder/commands/Shaders.js +1 -1
  339. package/lib/module/sksg/Recorder/commands/Shaders.js.map +1 -1
  340. package/lib/module/sksg/utils.d.ts +4 -0
  341. package/lib/module/sksg/utils.js +12 -0
  342. package/lib/module/sksg/utils.js.map +1 -1
  343. package/lib/typescript/lib/commonjs/renderer/processors/Animations/Animations.d.ts +22 -0
  344. package/lib/typescript/lib/commonjs/skia/web/JsiSkia.d.ts +0 -1
  345. package/lib/typescript/lib/commonjs/sksg/Recorder/DrawingContext.d.ts +1 -0
  346. package/lib/typescript/lib/commonjs/sksg/utils.d.ts +1 -0
  347. package/lib/typescript/lib/module/mock/index.d.ts +4 -0
  348. package/lib/typescript/lib/module/renderer/processors/Animations/Animations.d.ts +4 -0
  349. package/lib/typescript/lib/module/renderer/processors/Animations/index.d.ts +1 -1
  350. package/lib/typescript/lib/module/skia/Skia.web.d.ts +0 -1
  351. package/lib/typescript/lib/module/skia/web/JsiSkia.d.ts +0 -1
  352. package/lib/typescript/lib/module/sksg/Recorder/DrawingContext.d.ts +1 -0
  353. package/lib/typescript/lib/module/sksg/utils.d.ts +1 -0
  354. package/lib/typescript/src/renderer/processors/Animations/Animations.d.ts +27 -1
  355. package/lib/typescript/src/skia/types/Skia.d.ts +1 -6
  356. package/lib/typescript/src/sksg/Recorder/DrawingContext.d.ts +1 -0
  357. package/lib/typescript/src/sksg/Recorder/Recorder.d.ts +1 -1
  358. package/lib/typescript/src/sksg/utils.d.ts +4 -0
  359. package/package.json +9 -9
  360. package/src/renderer/components/Mask.tsx +10 -3
  361. package/src/renderer/processors/Animations/Animations.ts +34 -1
  362. package/src/skia/types/Matrix4.ts +6 -2
  363. package/src/skia/types/Skia.ts +1 -7
  364. package/src/skia/web/JsiSkia.ts +0 -4
  365. package/src/sksg/Recorder/Core.ts +11 -1
  366. package/src/sksg/Recorder/DrawingContext.ts +10 -0
  367. package/src/sksg/Recorder/Player.ts +1 -1
  368. package/src/sksg/Recorder/ReanimatedRecorder.ts +10 -1
  369. package/src/sksg/Recorder/Recorder.ts +7 -3
  370. package/src/sksg/Recorder/Visitor.ts +9 -6
  371. package/src/sksg/Recorder/commands/Drawing.ts +10 -8
  372. package/src/sksg/Recorder/commands/ImageFilters.ts +20 -1
  373. package/src/sksg/Recorder/commands/Shaders.ts +1 -1
  374. package/src/sksg/utils.ts +18 -0
  375. package/cpp/api/JsiSkiaContext.h +0 -94
  376. package/cpp/dawn/include/dawn/dawn_proc.h +0 -53
  377. package/cpp/dawn/include/dawn/dawn_proc_table.h +0 -330
  378. package/cpp/dawn/include/dawn/dawn_thread_dispatch_proc.h +0 -47
  379. package/cpp/dawn/include/dawn/dawn_version.h +0 -41
  380. package/cpp/dawn/include/dawn/native/D3D11Backend.h +0 -65
  381. package/cpp/dawn/include/dawn/native/D3D12Backend.h +0 -86
  382. package/cpp/dawn/include/dawn/native/D3DBackend.h +0 -56
  383. package/cpp/dawn/include/dawn/native/DawnNative.h +0 -369
  384. package/cpp/dawn/include/dawn/native/MetalBackend.h +0 -56
  385. package/cpp/dawn/include/dawn/native/NullBackend.h +0 -39
  386. package/cpp/dawn/include/dawn/native/OpenGLBackend.h +0 -89
  387. package/cpp/dawn/include/dawn/native/VulkanBackend.h +0 -183
  388. package/cpp/dawn/include/dawn/native/WebGPUBackend.h +0 -49
  389. package/cpp/dawn/include/dawn/native/dawn_native_export.h +0 -49
  390. package/cpp/dawn/include/dawn/platform/DawnPlatform.h +0 -210
  391. package/cpp/dawn/include/dawn/platform/dawn_platform_export.h +0 -49
  392. package/cpp/dawn/include/dawn/replay/Replay.h +0 -99
  393. package/cpp/dawn/include/dawn/replay/dawn_replay_export.h +0 -49
  394. package/cpp/dawn/include/dawn/webgpu_cpp_print.h +0 -2844
  395. package/cpp/dawn/include/tint/tint.h +0 -90
  396. package/cpp/dawn/include/webgpu/webgpu.h +0 -4987
  397. package/cpp/dawn/include/webgpu/webgpu_cpp.h +0 -10080
  398. package/cpp/dawn/include/webgpu/webgpu_cpp_chained_struct.h +0 -57
  399. package/cpp/dawn/include/webgpu/webgpu_enum_class_bitmasks.h +0 -161
  400. package/cpp/dawn/include/webgpu/webgpu_glfw.h +0 -88
  401. package/cpp/skia/include/gpu/graphite/vk/VulkanGraphiteUtils.h +0 -10
  402. package/cpp/skia/include/private/base/README.md +0 -4
  403. package/cpp/skia/include/private/base/SkPoint_impl.h +0 -560
  404. package/cpp/skia/include/private/base/SkSpan_impl.h +0 -158
  405. package/cpp/skia/src/gpu/graphite/ContextOptionsPriv.h +0 -45
  406. package/cpp/skia/src/gpu/graphite/ResourceTypes.h +0 -360
  407. package/cpp/skia/src/gpu/graphite/TextureProxyView.h +0 -105
  408. package/libs/.graphite +0 -1
  409. /package/cpp/skia/include/private/{base/SkASAN.h → SkASAN.h} +0 -0
  410. /package/cpp/skia/include/private/{base/SkAlignedStorage.h → SkAlignedStorage.h} +0 -0
  411. /package/cpp/skia/include/private/{base/SkCPUTypes.h → SkCPUTypes.h} +0 -0
  412. /package/cpp/skia/include/private/{base/SkFeatures.h → SkFeatures.h} +0 -0
  413. /package/cpp/skia/include/private/{base/SkLogPriority.h → SkLogPriority.h} +0 -0
  414. /package/cpp/skia/include/private/{base/SkTPin.h → SkTPin.h} +0 -0
@@ -1,10 +1,560 @@
1
1
  /*
2
- * Copyright 2023 Google LLC
2
+ * Copyright 2006 The Android Open Source Project
3
3
  *
4
- * Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
4
+ * Use of this source code is governed by a BSD-style license that can be
5
+ * found in the LICENSE file.
5
6
  */
6
7
 
7
- // SkPoint is part of the public API, but is also required by code in base. The following include
8
- // forwarding allows SkPoint to participate in the API and for use by code in base.
8
+ #ifndef SkPoint_DEFINED
9
+ #define SkPoint_DEFINED
9
10
 
10
- #include "include/private/base/SkPoint_impl.h" // IWYU pragma: export
11
+ #include "include/private/SkAPI.h"
12
+ #include "include/private/SkFloatingPoint.h"
13
+ #include "include/private/SkSafe32.h"
14
+
15
+ #include <cmath>
16
+ #include <cstdint>
17
+
18
+ struct SkIPoint;
19
+
20
+ /** SkIVector provides an alternative name for SkIPoint. SkIVector and SkIPoint
21
+ can be used interchangeably for all purposes.
22
+ */
23
+ typedef SkIPoint SkIVector;
24
+
25
+ /** \struct SkIPoint
26
+ SkIPoint holds two 32-bit integer coordinates.
27
+ */
28
+ struct SkIPoint {
29
+ int32_t fX; //!< x-axis value
30
+ int32_t fY; //!< y-axis value
31
+
32
+ /** Sets fX to x, fY to y.
33
+
34
+ @param x integer x-axis value of constructed SkIPoint
35
+ @param y integer y-axis value of constructed SkIPoint
36
+ @return SkIPoint (x, y)
37
+ */
38
+ static constexpr SkIPoint Make(int32_t x, int32_t y) {
39
+ return {x, y};
40
+ }
41
+
42
+ /** Returns x-axis value of SkIPoint.
43
+
44
+ @return fX
45
+ */
46
+ constexpr int32_t x() const { return fX; }
47
+
48
+ /** Returns y-axis value of SkIPoint.
49
+
50
+ @return fY
51
+ */
52
+ constexpr int32_t y() const { return fY; }
53
+
54
+ /** Returns true if fX and fY are both zero.
55
+
56
+ @return true if fX is zero and fY is zero
57
+ */
58
+ bool isZero() const { return (fX | fY) == 0; }
59
+
60
+ /** Sets fX to x and fY to y.
61
+
62
+ @param x new value for fX
63
+ @param y new value for fY
64
+ */
65
+ void set(int32_t x, int32_t y) {
66
+ fX = x;
67
+ fY = y;
68
+ }
69
+
70
+ /** Returns SkIPoint changing the signs of fX and fY.
71
+
72
+ @return SkIPoint as (-fX, -fY)
73
+ */
74
+ SkIPoint operator-() const {
75
+ return {-fX, -fY};
76
+ }
77
+
78
+ /** Offsets SkIPoint by ivector v. Sets SkIPoint to (fX + v.fX, fY + v.fY).
79
+
80
+ @param v ivector to add
81
+ */
82
+ void operator+=(const SkIVector& v) {
83
+ fX = Sk32_sat_add(fX, v.fX);
84
+ fY = Sk32_sat_add(fY, v.fY);
85
+ }
86
+
87
+ /** Subtracts ivector v from SkIPoint. Sets SkIPoint to: (fX - v.fX, fY - v.fY).
88
+
89
+ @param v ivector to subtract
90
+ */
91
+ void operator-=(const SkIVector& v) {
92
+ fX = Sk32_sat_sub(fX, v.fX);
93
+ fY = Sk32_sat_sub(fY, v.fY);
94
+ }
95
+
96
+ /** Returns true if SkIPoint is equivalent to SkIPoint constructed from (x, y).
97
+
98
+ @param x value compared with fX
99
+ @param y value compared with fY
100
+ @return true if SkIPoint equals (x, y)
101
+ */
102
+ bool equals(int32_t x, int32_t y) const {
103
+ return fX == x && fY == y;
104
+ }
105
+
106
+ /** Returns true if a is equivalent to b.
107
+
108
+ @param a SkIPoint to compare
109
+ @param b SkIPoint to compare
110
+ @return true if a.fX == b.fX and a.fY == b.fY
111
+ */
112
+ friend bool operator==(const SkIPoint& a, const SkIPoint& b) {
113
+ return a.fX == b.fX && a.fY == b.fY;
114
+ }
115
+
116
+ /** Returns true if a is not equivalent to b.
117
+
118
+ @param a SkIPoint to compare
119
+ @param b SkIPoint to compare
120
+ @return true if a.fX != b.fX or a.fY != b.fY
121
+ */
122
+ friend bool operator!=(const SkIPoint& a, const SkIPoint& b) {
123
+ return a.fX != b.fX || a.fY != b.fY;
124
+ }
125
+
126
+ /** Returns ivector from b to a; computed as (a.fX - b.fX, a.fY - b.fY).
127
+
128
+ Can also be used to subtract ivector from ivector, returning ivector.
129
+
130
+ @param a SkIPoint or ivector to subtract from
131
+ @param b ivector to subtract
132
+ @return ivector from b to a
133
+ */
134
+ friend SkIVector operator-(const SkIPoint& a, const SkIPoint& b) {
135
+ return { Sk32_sat_sub(a.fX, b.fX), Sk32_sat_sub(a.fY, b.fY) };
136
+ }
137
+
138
+ /** Returns SkIPoint resulting from SkIPoint a offset by ivector b, computed as:
139
+ (a.fX + b.fX, a.fY + b.fY).
140
+
141
+ Can also be used to offset SkIPoint b by ivector a, returning SkIPoint.
142
+ Can also be used to add ivector to ivector, returning ivector.
143
+
144
+ @param a SkIPoint or ivector to add to
145
+ @param b SkIPoint or ivector to add
146
+ @return SkIPoint equal to a offset by b
147
+ */
148
+ friend SkIPoint operator+(const SkIPoint& a, const SkIVector& b) {
149
+ return { Sk32_sat_add(a.fX, b.fX), Sk32_sat_add(a.fY, b.fY) };
150
+ }
151
+ };
152
+
153
+ struct SkPoint;
154
+
155
+ /** SkVector provides an alternative name for SkPoint. SkVector and SkPoint can
156
+ be used interchangeably for all purposes.
157
+ */
158
+ typedef SkPoint SkVector;
159
+
160
+ /** \struct SkPoint
161
+ SkPoint holds two 32-bit floating point coordinates.
162
+ */
163
+ struct SK_API SkPoint {
164
+ float fX; //!< x-axis value
165
+ float fY; //!< y-axis value
166
+
167
+ /** Sets fX to x, fY to y. Used both to set SkPoint and vector.
168
+
169
+ @param x float x-axis value of constructed SkPoint or vector
170
+ @param y float y-axis value of constructed SkPoint or vector
171
+ @return SkPoint (x, y)
172
+ */
173
+ static constexpr SkPoint Make(float x, float y) {
174
+ return {x, y};
175
+ }
176
+
177
+ /** Returns x-axis value of SkPoint or vector.
178
+
179
+ @return fX
180
+ */
181
+ constexpr float x() const { return fX; }
182
+
183
+ /** Returns y-axis value of SkPoint or vector.
184
+
185
+ @return fY
186
+ */
187
+ constexpr float y() const { return fY; }
188
+
189
+ /** Returns true if fX and fY are both zero.
190
+
191
+ @return true if fX is zero and fY is zero
192
+ */
193
+ bool isZero() const { return (0 == fX) & (0 == fY); }
194
+
195
+ /** Sets fX to x and fY to y.
196
+
197
+ @param x new value for fX
198
+ @param y new value for fY
199
+ */
200
+ void set(float x, float y) {
201
+ fX = x;
202
+ fY = y;
203
+ }
204
+
205
+ /** Sets fX to x and fY to y, promoting integers to float values.
206
+
207
+ Assigning a large integer value directly to fX or fY may cause a compiler
208
+ error, triggered by narrowing conversion of int to float. This safely
209
+ casts x and y to avoid the error.
210
+
211
+ @param x new value for fX
212
+ @param y new value for fY
213
+ */
214
+ void iset(int32_t x, int32_t y) {
215
+ fX = static_cast<float>(x);
216
+ fY = static_cast<float>(y);
217
+ }
218
+
219
+ /** Sets fX to p.fX and fY to p.fY, promoting integers to float values.
220
+
221
+ Assigning an SkIPoint containing a large integer value directly to fX or fY may
222
+ cause a compiler error, triggered by narrowing conversion of int to float.
223
+ This safely casts p.fX and p.fY to avoid the error.
224
+
225
+ @param p SkIPoint members promoted to float
226
+ */
227
+ void iset(const SkIPoint& p) {
228
+ fX = static_cast<float>(p.fX);
229
+ fY = static_cast<float>(p.fY);
230
+ }
231
+
232
+ /** Sets fX to absolute value of pt.fX; and fY to absolute value of pt.fY.
233
+
234
+ @param pt members providing magnitude for fX and fY
235
+ */
236
+ void setAbs(const SkPoint& pt) {
237
+ fX = std::abs(pt.fX);
238
+ fY = std::abs(pt.fY);
239
+ }
240
+
241
+ /** Adds offset to each SkPoint in points array with count entries.
242
+
243
+ @param points SkPoint array
244
+ @param count entries in array
245
+ @param offset vector added to points
246
+ */
247
+ static void Offset(SkPoint points[], int count, const SkVector& offset) {
248
+ Offset(points, count, offset.fX, offset.fY);
249
+ }
250
+
251
+ /** Adds offset (dx, dy) to each SkPoint in points array of length count.
252
+
253
+ @param points SkPoint array
254
+ @param count entries in array
255
+ @param dx added to fX in points
256
+ @param dy added to fY in points
257
+ */
258
+ static void Offset(SkPoint points[], int count, float dx, float dy) {
259
+ for (int i = 0; i < count; ++i) {
260
+ points[i].offset(dx, dy);
261
+ }
262
+ }
263
+
264
+ /** Adds offset (dx, dy) to SkPoint.
265
+
266
+ @param dx added to fX
267
+ @param dy added to fY
268
+ */
269
+ void offset(float dx, float dy) {
270
+ fX += dx;
271
+ fY += dy;
272
+ }
273
+
274
+ /** Returns the Euclidean distance from origin, computed as:
275
+
276
+ sqrt(fX * fX + fY * fY)
277
+
278
+ .
279
+
280
+ @return straight-line distance to origin
281
+ */
282
+ float length() const { return SkPoint::Length(fX, fY); }
283
+
284
+ /** Returns the Euclidean distance from origin, computed as:
285
+
286
+ sqrt(fX * fX + fY * fY)
287
+
288
+ .
289
+
290
+ @return straight-line distance to origin
291
+ */
292
+ float distanceToOrigin() const { return this->length(); }
293
+
294
+ /** Scales (fX, fY) so that length() returns one, while preserving ratio of fX to fY,
295
+ if possible. If prior length is nearly zero, sets vector to (0, 0) and returns
296
+ false; otherwise returns true.
297
+
298
+ @return true if former length is not zero or nearly zero
299
+
300
+ example: https://fiddle.skia.org/c/@Point_normalize_2
301
+ */
302
+ bool normalize();
303
+
304
+ /** Sets vector to (x, y) scaled so length() returns one, and so that
305
+ (fX, fY) is proportional to (x, y). If (x, y) length is nearly zero,
306
+ sets vector to (0, 0) and returns false; otherwise returns true.
307
+
308
+ @param x proportional value for fX
309
+ @param y proportional value for fY
310
+ @return true if (x, y) length is not zero or nearly zero
311
+
312
+ example: https://fiddle.skia.org/c/@Point_setNormalize
313
+ */
314
+ bool setNormalize(float x, float y);
315
+
316
+ /** Scales vector so that distanceToOrigin() returns length, if possible. If former
317
+ length is nearly zero, sets vector to (0, 0) and return false; otherwise returns
318
+ true.
319
+
320
+ @param length straight-line distance to origin
321
+ @return true if former length is not zero or nearly zero
322
+
323
+ example: https://fiddle.skia.org/c/@Point_setLength
324
+ */
325
+ bool setLength(float length);
326
+
327
+ /** Sets vector to (x, y) scaled to length, if possible. If former
328
+ length is nearly zero, sets vector to (0, 0) and return false; otherwise returns
329
+ true.
330
+
331
+ @param x proportional value for fX
332
+ @param y proportional value for fY
333
+ @param length straight-line distance to origin
334
+ @return true if (x, y) length is not zero or nearly zero
335
+
336
+ example: https://fiddle.skia.org/c/@Point_setLength_2
337
+ */
338
+ bool setLength(float x, float y, float length);
339
+
340
+ /** Sets dst to SkPoint times scale. dst may be SkPoint to modify SkPoint in place.
341
+
342
+ @param scale factor to multiply SkPoint by
343
+ @param dst storage for scaled SkPoint
344
+
345
+ example: https://fiddle.skia.org/c/@Point_scale
346
+ */
347
+ void scale(float scale, SkPoint* dst) const;
348
+
349
+ /** Scales SkPoint in place by scale.
350
+
351
+ @param value factor to multiply SkPoint by
352
+ */
353
+ void scale(float value) { this->scale(value, this); }
354
+
355
+ /** Changes the sign of fX and fY.
356
+ */
357
+ void negate() {
358
+ fX = -fX;
359
+ fY = -fY;
360
+ }
361
+
362
+ /** Returns SkPoint changing the signs of fX and fY.
363
+
364
+ @return SkPoint as (-fX, -fY)
365
+ */
366
+ SkPoint operator-() const {
367
+ return {-fX, -fY};
368
+ }
369
+
370
+ /** Adds vector v to SkPoint. Sets SkPoint to: (fX + v.fX, fY + v.fY).
371
+
372
+ @param v vector to add
373
+ */
374
+ void operator+=(const SkVector& v) {
375
+ fX += v.fX;
376
+ fY += v.fY;
377
+ }
378
+
379
+ /** Subtracts vector v from SkPoint. Sets SkPoint to: (fX - v.fX, fY - v.fY).
380
+
381
+ @param v vector to subtract
382
+ */
383
+ void operator-=(const SkVector& v) {
384
+ fX -= v.fX;
385
+ fY -= v.fY;
386
+ }
387
+
388
+ /** Returns SkPoint multiplied by scale.
389
+
390
+ @param scale float to multiply by
391
+ @return SkPoint as (fX * scale, fY * scale)
392
+ */
393
+ SkPoint operator*(float scale) const {
394
+ return {fX * scale, fY * scale};
395
+ }
396
+
397
+ /** Multiplies SkPoint by scale. Sets SkPoint to: (fX * scale, fY * scale).
398
+
399
+ @param scale float to multiply by
400
+ @return reference to SkPoint
401
+ */
402
+ SkPoint& operator*=(float scale) {
403
+ fX *= scale;
404
+ fY *= scale;
405
+ return *this;
406
+ }
407
+
408
+ /** Returns true if both fX and fY are measurable values.
409
+
410
+ @return true for values other than infinities and NaN
411
+ */
412
+ bool isFinite() const {
413
+ return SkIsFinite(fX, fY);
414
+ }
415
+
416
+ /** Returns true if SkPoint is equivalent to SkPoint constructed from (x, y).
417
+
418
+ @param x value compared with fX
419
+ @param y value compared with fY
420
+ @return true if SkPoint equals (x, y)
421
+ */
422
+ bool equals(float x, float y) const {
423
+ return fX == x && fY == y;
424
+ }
425
+
426
+ /** Returns true if a is equivalent to b.
427
+
428
+ @param a SkPoint to compare
429
+ @param b SkPoint to compare
430
+ @return true if a.fX == b.fX and a.fY == b.fY
431
+ */
432
+ friend bool operator==(const SkPoint& a, const SkPoint& b) {
433
+ return a.fX == b.fX && a.fY == b.fY;
434
+ }
435
+
436
+ /** Returns true if a is not equivalent to b.
437
+
438
+ @param a SkPoint to compare
439
+ @param b SkPoint to compare
440
+ @return true if a.fX != b.fX or a.fY != b.fY
441
+ */
442
+ friend bool operator!=(const SkPoint& a, const SkPoint& b) {
443
+ return a.fX != b.fX || a.fY != b.fY;
444
+ }
445
+
446
+ /** Returns vector from b to a, computed as (a.fX - b.fX, a.fY - b.fY).
447
+
448
+ Can also be used to subtract vector from SkPoint, returning SkPoint.
449
+ Can also be used to subtract vector from vector, returning vector.
450
+
451
+ @param a SkPoint to subtract from
452
+ @param b SkPoint to subtract
453
+ @return vector from b to a
454
+ */
455
+ friend SkVector operator-(const SkPoint& a, const SkPoint& b) {
456
+ return {a.fX - b.fX, a.fY - b.fY};
457
+ }
458
+
459
+ /** Returns SkPoint resulting from SkPoint a offset by vector b, computed as:
460
+ (a.fX + b.fX, a.fY + b.fY).
461
+
462
+ Can also be used to offset SkPoint b by vector a, returning SkPoint.
463
+ Can also be used to add vector to vector, returning vector.
464
+
465
+ @param a SkPoint or vector to add to
466
+ @param b SkPoint or vector to add
467
+ @return SkPoint equal to a offset by b
468
+ */
469
+ friend SkPoint operator+(const SkPoint& a, const SkVector& b) {
470
+ return {a.fX + b.fX, a.fY + b.fY};
471
+ }
472
+
473
+ /** Returns the Euclidean distance from origin, computed as:
474
+
475
+ sqrt(x * x + y * y)
476
+
477
+ .
478
+
479
+ @param x component of length
480
+ @param y component of length
481
+ @return straight-line distance to origin
482
+
483
+ example: https://fiddle.skia.org/c/@Point_Length
484
+ */
485
+ static float Length(float x, float y);
486
+
487
+ /** Scales (vec->fX, vec->fY) so that length() returns one, while preserving ratio of vec->fX
488
+ to vec->fY, if possible. If original length is nearly zero, sets vec to (0, 0) and returns
489
+ zero; otherwise, returns length of vec before vec is scaled.
490
+
491
+ Returned prior length may be INFINITY if it can not be represented by float.
492
+
493
+ Note that normalize() is faster if prior length is not required.
494
+
495
+ @param vec normalized to unit length
496
+ @return original vec length
497
+
498
+ example: https://fiddle.skia.org/c/@Point_Normalize
499
+ */
500
+ static float Normalize(SkVector* vec);
501
+
502
+ /** Returns the Euclidean distance between a and b.
503
+
504
+ @param a line end point
505
+ @param b line end point
506
+ @return straight-line distance from a to b
507
+ */
508
+ static float Distance(const SkPoint& a, const SkPoint& b) {
509
+ return Length(a.fX - b.fX, a.fY - b.fY);
510
+ }
511
+
512
+ /** Returns the dot product of vector a and vector b.
513
+
514
+ @param a left side of dot product
515
+ @param b right side of dot product
516
+ @return product of input magnitudes and cosine of the angle between them
517
+ */
518
+ static float DotProduct(const SkVector& a, const SkVector& b) {
519
+ return a.fX * b.fX + a.fY * b.fY;
520
+ }
521
+
522
+ /** Returns the cross product of vector a and vector b.
523
+
524
+ a and b form three-dimensional vectors with z-axis value equal to zero. The
525
+ cross product is a three-dimensional vector with x-axis and y-axis values equal
526
+ to zero. The cross product z-axis component is returned.
527
+
528
+ @param a left side of cross product
529
+ @param b right side of cross product
530
+ @return area spanned by vectors signed by angle direction
531
+ */
532
+ static float CrossProduct(const SkVector& a, const SkVector& b) {
533
+ return a.fX * b.fY - a.fY * b.fX;
534
+ }
535
+
536
+ /** Returns the cross product of vector and vec.
537
+
538
+ Vector and vec form three-dimensional vectors with z-axis value equal to zero.
539
+ The cross product is a three-dimensional vector with x-axis and y-axis values
540
+ equal to zero. The cross product z-axis component is returned.
541
+
542
+ @param vec right side of cross product
543
+ @return area spanned by vectors signed by angle direction
544
+ */
545
+ float cross(const SkVector& vec) const {
546
+ return CrossProduct(*this, vec);
547
+ }
548
+
549
+ /** Returns the dot product of vector and vector vec.
550
+
551
+ @param vec right side of dot product
552
+ @return product of input magnitudes and cosine of the angle between them
553
+ */
554
+ float dot(const SkVector& vec) const {
555
+ return DotProduct(*this, vec);
556
+ }
557
+
558
+ };
559
+
560
+ #endif
@@ -9,8 +9,8 @@
9
9
  #define SkPoint3_DEFINED
10
10
 
11
11
  #include "include/core/SkScalar.h"
12
- #include "include/private/base/SkAPI.h"
13
- #include "include/private/base/SkFloatingPoint.h"
12
+ #include "include/private/SkAPI.h"
13
+ #include "include/private/SkFloatingPoint.h"
14
14
 
15
15
  struct SK_API SkPoint3 {
16
16
  SkScalar fX, fY, fZ;
@@ -13,7 +13,7 @@
13
13
  #include "include/core/SkScalar.h"
14
14
  #include "include/core/SkSpan.h"
15
15
  #include "include/core/SkTypes.h"
16
- #include "include/private/base/SkMacros.h"
16
+ #include "include/private/SkMacros.h"
17
17
 
18
18
  #include <cstdint>
19
19
  #include <cstring>
@@ -427,6 +427,14 @@ public:
427
427
  return SkRRect(fRect.makeOffset(dx, dy), fRadii, fType);
428
428
  }
429
429
 
430
+ /** Returns true if point is inside the bounds and corner radii, and if
431
+ SkRRect is not empty.
432
+
433
+ @param point position tested for containment
434
+ @return true if SkRRect contains point
435
+ */
436
+ bool contains(const SkPoint& point) const;
437
+
430
438
  /** Returns true if rect is inside the bounds and corner radii, and if
431
439
  SkRRect and rect are not empty.
432
440
 
@@ -11,7 +11,7 @@
11
11
  #include "include/core/SkPoint.h"
12
12
  #include "include/core/SkScalar.h"
13
13
  #include "include/core/SkSize.h"
14
- #include "include/private/base/SkAPI.h"
14
+ #include "include/private/SkAPI.h"
15
15
 
16
16
  /**
17
17
  * A compressed form of a rotation+scale matrix.
@@ -7,10 +7,9 @@
7
7
  #ifndef SkRecorder_DEFINED
8
8
  #define SkRecorder_DEFINED
9
9
 
10
- #include "include/private/base/SkAPI.h"
10
+ #include "include/private/SkAPI.h"
11
11
 
12
12
  class SkCanvas;
13
- class SkContentID;
14
13
  class SkSurface;
15
14
 
16
15
  namespace skcpu {
@@ -42,7 +41,7 @@ private:
42
41
  * Returns nullptr if capture is not enabled.
43
42
  */
44
43
  virtual SkCanvas* makeCaptureCanvas(SkCanvas*) = 0;
45
- virtual SkContentID createCaptureBreakpoint(SkSurface*) = 0;
44
+ virtual void createCaptureBreakpoint(SkSurface*) = 0;
46
45
 
47
46
  friend class SkSurface_Base; // for capture functionality
48
47
  };
@@ -13,9 +13,9 @@
13
13
  #include "include/core/SkSize.h"
14
14
  #include "include/core/SkSpan.h"
15
15
  #include "include/core/SkTypes.h"
16
- #include "include/private/base/SkFloatingPoint.h"
17
- #include "include/private/base/SkSafe32.h"
18
- #include "include/private/base/SkTFitsIn.h"
16
+ #include "include/private/SkFloatingPoint.h"
17
+ #include "include/private/SkSafe32.h"
18
+ #include "include/private/SkTFitsIn.h"
19
19
 
20
20
  #include <algorithm>
21
21
  #include <array>
@@ -9,7 +9,7 @@
9
9
  #define SkRefCnt_DEFINED
10
10
 
11
11
  #include "include/core/SkTypes.h"
12
- #include "include/private/base/SkDebug.h"
12
+ #include "include/private/SkDebug.h"
13
13
 
14
14
  #include <atomic>
15
15
  #include <cstddef>
@@ -11,10 +11,10 @@
11
11
  #include "include/core/SkPath.h"
12
12
  #include "include/core/SkRect.h"
13
13
  #include "include/core/SkSpan.h"
14
- #include "include/private/base/SkAPI.h"
15
- #include "include/private/base/SkAssert.h"
16
- #include "include/private/base/SkDebug.h"
17
- #include "include/private/base/SkTypeTraits.h"
14
+ #include "include/private/SkAPI.h"
15
+ #include "include/private/SkAssert.h"
16
+ #include "include/private/SkDebug.h"
17
+ #include "include/private/SkTypeTraits.h"
18
18
 
19
19
  #include <cstddef>
20
20
  #include <cstdint>
@@ -8,8 +8,8 @@
8
8
  #ifndef SkScalar_DEFINED
9
9
  #define SkScalar_DEFINED
10
10
 
11
- #include "include/private/base/SkAssert.h"
12
- #include "include/private/base/SkFloatingPoint.h"
11
+ #include "include/private/SkAssert.h"
12
+ #include "include/private/SkFloatingPoint.h"
13
13
 
14
14
  #include <cmath>
15
15
 
@@ -71,7 +71,6 @@ static inline SkScalar SkScalarFraction(SkScalar x) {
71
71
  static inline SkScalar SkScalarSquare(SkScalar x) { return x * x; }
72
72
 
73
73
  #define SkScalarInvert(x) (SK_Scalar1 / (x))
74
- #define SkScalarHalf(a) ((a) * SK_ScalarHalf)
75
74
  #define SkScalarAve(a, b) sk_float_midpoint(a, b)
76
75
 
77
76
  #define SkDegreesToRadians(degrees) ((degrees) * (SK_ScalarPI / 180))
@@ -10,7 +10,7 @@
10
10
 
11
11
  #include "include/core/SkFourByteTag.h"
12
12
  #include "include/core/SkRefCnt.h"
13
- #include "include/private/base/SkAPI.h"
13
+ #include "include/private/SkAPI.h"
14
14
 
15
15
  #include <cstddef>
16
16
  #include <optional>