@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
@@ -42,7 +42,7 @@ export declare class Recorder implements BaseRecorder {
42
42
  saveBackdropFilter(): void;
43
43
  drawBox(boxProps: AnimatedProps<BoxProps>, shadows: {
44
44
  props: BoxShadowProps;
45
- animatedProps?: Record<string, SharedValue<unknown>>;
45
+ animatedProps?: Record<string, unknown>;
46
46
  }[]): void;
47
47
  drawImage(props: AnimatedProps<ImageProps>): void;
48
48
  drawCircle(props: AnimatedProps<CircleProps>): void;
@@ -1,5 +1,9 @@
1
1
  import type { SharedValue } from "react-native-reanimated";
2
2
  export declare const isSharedValue: <T = unknown>(value: unknown) => value is SharedValue<T>;
3
+ export declare const isSharedValueSelector: (value: unknown) => value is {
4
+ __sv: SharedValue<unknown>;
5
+ __key: string;
6
+ };
3
7
  export declare const materialize: <T extends object>(props: T) => T;
4
8
  type Composer<T> = (outer: T, inner: T) => T;
5
9
  export declare const composeDeclarations: <T>(filters: T[], composer: Composer<T>) => T;
package/package.json CHANGED
@@ -8,7 +8,7 @@
8
8
  "setup-skia-web": "scripts/setup-canvaskit.js"
9
9
  },
10
10
  "title": "React Native Skia",
11
- "version": "2.11.0-next.2",
11
+ "version": "2.11.1",
12
12
  "description": "High-performance React Native Graphics using Skia",
13
13
  "main": "lib/module/index.js",
14
14
  "react-native": "src/index.ts",
@@ -139,15 +139,16 @@
139
139
  },
140
140
  "dependencies": {
141
141
  "canvaskit-wasm": "0.41.0",
142
- "react-native-skia-graphite-android": "150.0.0",
143
- "react-native-skia-graphite-apple-ios": "150.0.0",
144
- "react-native-skia-graphite-apple-macos": "150.0.0",
142
+ "react-native-skia-android": "152.0.0",
143
+ "react-native-skia-apple-ios": "152.0.0",
144
+ "react-native-skia-apple-macos": "152.0.0",
145
+ "react-native-skia-apple-tvos": "152.0.0",
145
146
  "react-reconciler": "0.31.0"
146
147
  },
147
148
  "graphiteDependencies": {
148
- "react-native-skia-graphite-android": "150.0.0",
149
- "react-native-skia-graphite-apple-ios": "150.0.0",
150
- "react-native-skia-graphite-apple-macos": "150.0.0"
149
+ "react-native-skia-graphite-android": "152.0.0",
150
+ "react-native-skia-graphite-apple-ios": "152.0.0",
151
+ "react-native-skia-graphite-apple-macos": "152.0.0"
151
152
  },
152
153
  "eslintIgnore": [
153
154
  "node_modules/",
@@ -184,6 +185,5 @@
184
185
  }
185
186
  ]
186
187
  ]
187
- },
188
- "stableVersion": "0.0.0"
188
+ }
189
189
  }
@@ -20,17 +20,24 @@ export const Mask = ({
20
20
  }: MaskProps) => {
21
21
  return (
22
22
  <Group layer>
23
+ {children}
24
+ {/* The children composite against each other in the layer above; the
25
+ mask is then applied once, when its own layer is restored. A blend
26
+ mode attached to a <Group> without a layer would instead be applied
27
+ per draw call, compositing every child after the first against the
28
+ previous child rather than against the mask (issue #3254).
29
+ dstIn keeps the children where the mask is opaque and erases them
30
+ where it is transparent. Without clip, dstATop additionally keeps
31
+ the mask artwork itself wherever the children leave it uncovered. */}
23
32
  <Group
24
33
  layer={
25
- <Paint blendMode="src">
34
+ <Paint blendMode={clip ? "dstIn" : "dstATop"}>
26
35
  {mode === "luminance" && <LumaColorFilter />}
27
36
  </Paint>
28
37
  }
29
38
  >
30
39
  {mask}
31
- {clip && <Group layer={<Paint blendMode="dstIn" />}>{children}</Group>}
32
40
  </Group>
33
- <Group blendMode="srcIn">{children}</Group>
34
41
  </Group>
35
42
  );
36
43
  };
@@ -1,4 +1,37 @@
1
- export type AnimatedProp<T> = T | { value: T };
1
+ import type { SharedValue } from "react-native-reanimated";
2
+
3
+ /**
4
+ * Binds a prop to a single key of a "grouped" shared value: one shared value
5
+ * whose `.value` is an object can drive many props (one key each) instead of
6
+ * requiring a separate shared value per prop.
7
+ *
8
+ * Created via {@link select}. `T` is the type of the selected value; `__type`
9
+ * is a phantom marker carrying that type and is never present at runtime.
10
+ */
11
+ export type SharedValueSelector<T> = {
12
+ __sv: { value: Record<string, unknown> };
13
+ __key: string;
14
+ readonly __type?: T;
15
+ };
16
+
17
+ export type AnimatedProp<T> = T | { value: T } | SharedValueSelector<T>;
18
+
19
+ /**
20
+ * Selects a single key of a shared value so it can drive an animated prop.
21
+ * This lets one shared value (whose value is an object) drive multiple props
22
+ * — one per key — instead of using a separate shared value for each.
23
+ *
24
+ * @example
25
+ * const data = useSharedValue({ x: 0, y: 0, r: 10 });
26
+ * <Circle cx={select(data, "x")} cy={select(data, "y")} r={select(data, "r")} />
27
+ */
28
+ export const select = <T extends object, K extends keyof T & string>(
29
+ value: SharedValue<T>,
30
+ key: K
31
+ ): SharedValueSelector<T[K]> => ({
32
+ __sv: value as unknown as { value: Record<string, unknown> },
33
+ __key: key,
34
+ });
2
35
 
3
36
  export type AnimatedProps<T, O extends keyof T | never = never> = {
4
37
  [K in keyof T]: K extends "children"
@@ -190,12 +190,16 @@ export const multiply4 = (a: Matrix4, b: Matrix4): Matrix4 => {
190
190
  return result as unknown as Matrix4;
191
191
  };
192
192
 
193
- const skewY = (angle: number): Matrix4 => {
193
+ // These matrices are row-major, so the shear factor of skewX - which offsets x
194
+ // in proportion to y - belongs in row 0, column 1, and skewY's in row 1,
195
+ // column 0. React Native's MatrixMath stores the same transforms column-major,
196
+ // and porting its indices verbatim is what swapped the two axes here.
197
+ const skewX = (angle: number): Matrix4 => {
194
198
  "worklet";
195
199
  return [1, Math.tan(angle), 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
196
200
  };
197
201
 
198
- const skewX = (angle: number): Matrix4 => {
202
+ const skewY = (angle: number): Matrix4 => {
199
203
  "worklet";
200
204
  return [1, 0, 0, 0, Math.tan(angle), 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];
201
205
  };
@@ -21,7 +21,7 @@ import type { SkVertices, VertexMode } from "./Vertices/Vertices";
21
21
  import type { DataFactory } from "./Data";
22
22
  import type { SVGFactory } from "./SVG";
23
23
  import type { TextBlobFactory } from "./TextBlob";
24
- import type { SkSurface, SurfaceFactory } from "./Surface";
24
+ import type { SurfaceFactory } from "./Surface";
25
25
  import type { SkRSXform } from "./RSXform";
26
26
  import type { SkPath } from "./Path/Path";
27
27
  import type { SkContourMeasureIter } from "./ContourMeasure";
@@ -35,11 +35,6 @@ import type { NativeBufferFactory } from "./NativeBuffer";
35
35
  import type { JsiRecorder } from "./Recorder";
36
36
  import type { SkottieFactory } from "./Skottie";
37
37
 
38
- export interface SkiaContext {
39
- getSurface(): SkSurface;
40
- present(): void;
41
- }
42
-
43
38
  /**
44
39
  * Declares the interface for the native Skia API
45
40
  */
@@ -106,7 +101,6 @@ export interface Skia {
106
101
  ParagraphBuilder: ParagraphBuilderFactory;
107
102
  Skottie: SkottieFactory;
108
103
  Video: (url: string) => Promise<Video> | Video;
109
- Context(surface: bigint, width: number, height: number): SkiaContext;
110
104
  NativeBuffer: NativeBufferFactory;
111
105
  Recorder(): JsiRecorder;
112
106
  /**
@@ -4,7 +4,6 @@ import type {
4
4
  JsiRecorder,
5
5
  SkContourMeasureIter,
6
6
  Skia,
7
- SkiaContext,
8
7
  SkPath,
9
8
  SkRect,
10
9
  SkRuntimeEffect,
@@ -137,9 +136,6 @@ export const JsiSkApi = (CanvasKit: CanvasKit): Skia => ({
137
136
  NativeBuffer: new JsiSkNativeBufferFactory(CanvasKit),
138
137
  Skottie: new JsiSkottieFactory(CanvasKit),
139
138
  Video: createVideo.bind(null, CanvasKit),
140
- Context: (_surface: bigint, _width: number, _height: number) => {
141
- return throwNotImplementedOnRNWeb<SkiaContext>();
142
- },
143
139
  Recorder: () => {
144
140
  return throwNotImplementedOnRNWeb<JsiRecorder>();
145
141
  },
@@ -23,6 +23,7 @@ import type {
23
23
  DrawingNodeProps,
24
24
  SkottieProps,
25
25
  } from "../../dom/types";
26
+ import { isSharedValueSelector } from "../utils";
26
27
 
27
28
  export enum CommandType {
28
29
  // Context
@@ -79,7 +80,16 @@ export const materializeCommand = (command: any) => {
79
80
  const newProps = { ...command.props };
80
81
  if (command.animatedProps) {
81
82
  for (const key in command.animatedProps) {
82
- newProps[key] = command.animatedProps[key].value;
83
+ const entry = command.animatedProps[key];
84
+ if (isSharedValueSelector(entry)) {
85
+ const group = entry.__sv.value;
86
+ newProps[key] =
87
+ group && typeof group === "object"
88
+ ? (group as Record<string, unknown>)[entry.__key]
89
+ : undefined;
90
+ } else {
91
+ newProps[key] = entry.value;
92
+ }
83
93
  }
84
94
  }
85
95
  return { ...command, props: newProps };
@@ -56,6 +56,15 @@ export const createDrawingContext = (
56
56
  nextPaintIndex++;
57
57
  };
58
58
 
59
+ // Pushes an externally owned paint (the `paint` prop) onto the stack. It must
60
+ // push an opacity alongside it: restorePaint() pops both, so pushing only the
61
+ // paint would underflow the opacity stack and leak the enclosing group's
62
+ // opacity onto everything drawn afterwards.
63
+ const pushPaint = (paint: SkPaint) => {
64
+ paints.push(paint);
65
+ opacities.push(opacities[opacities.length - 1]);
66
+ };
67
+
59
68
  const getOpacity = () => {
60
69
  return opacities[opacities.length - 1];
61
70
  };
@@ -144,6 +153,7 @@ export const createDrawingContext = (
144
153
 
145
154
  // Public methods
146
155
  savePaint,
156
+ pushPaint,
147
157
  saveBackdropFilter,
148
158
  get paint() {
149
159
  return paints[paints.length - 1];
@@ -123,7 +123,7 @@ const play = (ctx: DrawingContext, _command: Command) => {
123
123
  ctx.canvas.saveLayer(paint);
124
124
  } else if (isDrawCommand(command, CommandType.SavePaint)) {
125
125
  if (command.props.paint) {
126
- ctx.paints.push(command.props.paint);
126
+ ctx.pushPaint(command.props.paint);
127
127
  } else {
128
128
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
129
129
  const { standalone } = command as any;
@@ -31,7 +31,7 @@ import type {
31
31
  DrawingNodeProps,
32
32
  } from "../../dom/types";
33
33
  import type { AnimatedProps } from "../../renderer";
34
- import { isSharedValue } from "../utils";
34
+ import { isSharedValue, isSharedValueSelector } from "../utils";
35
35
 
36
36
  /**
37
37
  * Currently the recorder only work if the GPU resources (e.g Images) are owned by the main thread.
@@ -55,6 +55,15 @@ export class ReanimatedRecorder implements BaseRecorder {
55
55
  return;
56
56
  }
57
57
  Object.values(props).forEach((value) => {
58
+ if (isSharedValueSelector(value) && !this.values.has(value.__sv)) {
59
+ const sv = value.__sv;
60
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
61
+ // @ts-expect-error
62
+ sv.name = `variable${this.values.size}`;
63
+ this.values.add(sv as SharedValue<unknown>);
64
+ return;
65
+ }
66
+
58
67
  if (isSharedValue(value) && !this.values.has(value)) {
59
68
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
60
69
  // @ts-expect-error
@@ -30,7 +30,7 @@ import type {
30
30
  DrawingNodeProps,
31
31
  } from "../../dom/types";
32
32
  import type { AnimatedProps } from "../../renderer";
33
- import { isSharedValue } from "../utils";
33
+ import { isSharedValue, isSharedValueSelector } from "../utils";
34
34
  import { isColorFilter, isImageFilter, isPathEffect, isShader } from "../Node";
35
35
  import type { SkPaint, SkPicture, BaseRecorder } from "../../skia/types";
36
36
 
@@ -78,7 +78,7 @@ export class Recorder implements BaseRecorder {
78
78
  }
79
79
 
80
80
  private processProps(props: Record<string, unknown>) {
81
- const animatedProps: Record<string, SharedValue<unknown>> = {};
81
+ const animatedProps: Record<string, unknown> = {};
82
82
  let hasAnimatedProps = false;
83
83
 
84
84
  for (const key in props) {
@@ -87,6 +87,10 @@ export class Recorder implements BaseRecorder {
87
87
  this.animationValues.add(prop);
88
88
  animatedProps[key] = prop;
89
89
  hasAnimatedProps = true;
90
+ } else if (isSharedValueSelector(prop)) {
91
+ this.animationValues.add(prop.__sv);
92
+ animatedProps[key] = prop;
93
+ hasAnimatedProps = true;
90
94
  }
91
95
  }
92
96
 
@@ -222,7 +226,7 @@ export class Recorder implements BaseRecorder {
222
226
  boxProps: AnimatedProps<BoxProps>,
223
227
  shadows: {
224
228
  props: BoxShadowProps;
225
- animatedProps?: Record<string, SharedValue<unknown>>;
229
+ animatedProps?: Record<string, unknown>;
226
230
  }[]
227
231
  ) {
228
232
  shadows.forEach((shadow) => {
@@ -104,13 +104,16 @@ const processCTM = ({
104
104
  if (layer) {
105
105
  ctm.layer = layer;
106
106
  }
107
+ // Only record a CTM command when saveCTM() will actually save the canvas.
108
+ // saveCTM() saves on transform/matrix, clip or layer; restoreCTM() always
109
+ // restores, so recording a CTM that saves nothing - `origin` with no
110
+ // transform, `clip={false}` from a conditional, a bare `invertClip` - pops
111
+ // an enclosing save that belongs to an ancestor.
107
112
  if (
108
- clip !== undefined ||
109
- invertClip !== undefined ||
110
- transform !== undefined ||
111
- origin !== undefined ||
112
- matrix !== undefined ||
113
- layer !== undefined
113
+ ctm.clip !== undefined ||
114
+ ctm.transform !== undefined ||
115
+ ctm.matrix !== undefined ||
116
+ ctm.layer !== undefined
114
117
  ) {
115
118
  return ctm;
116
119
  }
@@ -217,6 +217,16 @@ export const drawPath = (ctx: DrawingContext, props: PathProps) => {
217
217
 
218
218
  let path = processPath(ctx.Skia, pathProps.path);
219
219
 
220
+ // Trim runs first, so start/end address the path the caller drew. Stroking
221
+ // first would replace it with its outline and leave the offsets walking that
222
+ // outline's perimeter instead. The native recorder orders these the same way.
223
+ if (hasStartOffset || hasEndOffset) {
224
+ const trimmed = ctx.Skia.Path.Trim(path, start, end, false);
225
+ if (trimmed) {
226
+ path = trimmed;
227
+ }
228
+ }
229
+
220
230
  // Apply fill type using PathBuilder
221
231
  if (hasFillType) {
222
232
  const builder = ctx.Skia.PathBuilder.MakeFromPath(path);
@@ -232,14 +242,6 @@ export const drawPath = (ctx: DrawingContext, props: PathProps) => {
232
242
  }
233
243
  }
234
244
 
235
- // Apply trim using static Path.Trim
236
- if (hasStartOffset || hasEndOffset) {
237
- const trimmed = ctx.Skia.Path.Trim(path, start, end, false);
238
- if (trimmed) {
239
- path = trimmed;
240
- }
241
- }
242
-
243
245
  ctx.canvas.drawPath(path, ctx.paint);
244
246
  };
245
247
 
@@ -31,6 +31,14 @@ export enum MorphologyOperator {
31
31
 
32
32
  const Black = Float32Array.of(0, 0, 0, 1);
33
33
 
34
+ // Turns the source graphic into a hard silhouette: alpha is multiplied by 255
35
+ // and clamped, so any pixel the shape covers at all becomes fully opaque, and
36
+ // the colour channels are dropped. 255 is the saturation point of an 8-bit
37
+ // alpha channel, so one unit of coverage is enough to reach 1.
38
+ const AlphaSaturate = [
39
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 0,
40
+ ];
41
+
34
42
  const MakeInnerShadow = (
35
43
  Skia: Skia,
36
44
  shadowOnly: boolean | undefined,
@@ -50,9 +58,20 @@ const MakeInnerShadow = (
50
58
  Skia.ColorFilter.MakeBlend(Black, BlendMode.SrcIn),
51
59
  null
52
60
  );
61
+ // The shadow is generated outside the shape and then clipped back into it, so
62
+ // "outside" has to be the complement of the shape's silhouette. Taking SrcOut
63
+ // against the source graphic itself makes it the complement of the source's
64
+ // *alpha*: inside a translucent shape 1 - alpha is non-zero, so the shadow is
65
+ // generated across the whole interior and tints it, no matter how small the
66
+ // blur and the offset are (issue #2990). Saturating alpha first keeps the
67
+ // shadow tied to the shape's outline instead of to its opacity.
68
+ const coverage = Skia.ImageFilter.MakeColorFilter(
69
+ Skia.ColorFilter.MakeMatrix(AlphaSaturate),
70
+ null
71
+ );
53
72
  const f1 = Skia.ImageFilter.MakeColorFilter(
54
73
  Skia.ColorFilter.MakeBlend(color, BlendMode.SrcOut),
55
- null
74
+ coverage
56
75
  );
57
76
  const f2 = Skia.ImageFilter.MakeOffset(dx, dy, f1);
58
77
  const f3 = Skia.ImageFilter.MakeBlur(sigmaX, sigmaY, TileMode.Decal, f2);
@@ -221,7 +221,7 @@ const declareImageShader = (ctx: DrawingContext, props: ImageShaderProps) => {
221
221
  );
222
222
  } else {
223
223
  shader = ctx.track(
224
- image.makeShaderCubic(
224
+ image.makeShaderOptions(
225
225
  TileMode[enumKey(tx)],
226
226
  TileMode[enumKey(ty)],
227
227
  sampling?.filter ?? FilterMode.Linear,
package/src/sksg/utils.ts CHANGED
@@ -10,6 +10,17 @@ export const isSharedValue = <T = unknown>(
10
10
  return (value as Record<string, unknown>)?._isReanimatedSharedValue === true;
11
11
  };
12
12
 
13
+ export const isSharedValueSelector = (
14
+ value: unknown
15
+ ): value is { __sv: SharedValue<unknown>; __key: string } => {
16
+ "worklet";
17
+ if (!value || typeof value !== "object") {
18
+ return false;
19
+ }
20
+ const obj = value as Record<string, unknown>;
21
+ return isSharedValue(obj.__sv) && typeof obj.__key === "string";
22
+ };
23
+
13
24
  export const materialize = <T extends object>(props: T) => {
14
25
  "worklet";
15
26
  const result: T = Object.assign({}, props);
@@ -17,6 +28,13 @@ export const materialize = <T extends object>(props: T) => {
17
28
  const value = result[key];
18
29
  if (isSharedValue(value)) {
19
30
  result[key] = value.value as never;
31
+ } else if (isSharedValueSelector(value)) {
32
+ const group = value.__sv.value;
33
+ result[key] = (
34
+ group && typeof group === "object"
35
+ ? (group as Record<string, unknown>)[value.__key]
36
+ : undefined
37
+ ) as never;
20
38
  }
21
39
  });
22
40
  return result;
@@ -1,94 +0,0 @@
1
- #pragma once
2
-
3
- #include <memory>
4
- #include <numeric>
5
- #include <utility>
6
- #include <variant>
7
- #include <vector>
8
-
9
- #include "JsiSkConverters.h"
10
- #include "JsiSkNativeObjects.h"
11
- #include "utils/RNSkLog.h"
12
- #include <jsi/jsi.h>
13
-
14
- #include "JsiSkPaint.h"
15
- #include "JsiSkPoint.h"
16
- #include "JsiSkRect.h"
17
- #include "JsiSkSurface.h"
18
- #include "JsiSkTypeface.h"
19
-
20
- #include "rnskia/RNWindowContext.h"
21
-
22
- #pragma clang diagnostic push
23
- #pragma clang diagnostic ignored "-Wdocumentation"
24
-
25
- #include "include/core/SkFont.h"
26
- #include "include/core/SkFontMetrics.h"
27
-
28
- #pragma clang diagnostic pop
29
-
30
- namespace RNSkia {
31
-
32
- namespace jsi = facebook::jsi;
33
-
34
- class JsiSkiaContext
35
- : public JsiSkWrappingSharedPtrNativeObject<JsiSkiaContext, WindowContext> {
36
- public:
37
- static constexpr const char *CLASS_NAME = "SkiaContext";
38
-
39
- std::variant<std::nullptr_t, std::shared_ptr<JsiSkSurface>> getSurface() {
40
- auto surface = getObject()->getSurface();
41
- if (surface == nullptr) {
42
- return nullptr;
43
- }
44
- return std::make_shared<JsiSkSurface>(getContext(), std::move(surface));
45
- }
46
-
47
- void present() { getObject()->present(); }
48
-
49
- static void definePrototype(jsi::Runtime &runtime, jsi::Object &prototype) {
50
- installCommon(runtime, prototype);
51
- installMethod(runtime, prototype, "getSurface",
52
- &JsiSkiaContext::getSurface);
53
- installMethod(runtime, prototype, "present", &JsiSkiaContext::present);
54
- }
55
-
56
- JsiSkiaContext(std::shared_ptr<RNSkPlatformContext> context,
57
- std::shared_ptr<WindowContext> ctx)
58
- : JsiSkWrappingSharedPtrNativeObject<JsiSkiaContext, WindowContext>(
59
- std::move(context), std::move(ctx)) {}
60
-
61
- size_t getMemoryPressure() override { return 10 * 1024 * 1024; }
62
-
63
- /**
64
- * Creates the function for construction a new instance of the SkFont
65
- * wrapper
66
- * @param context Platform context
67
- * @return A function for creating a new host object wrapper for the SkFont
68
- * class
69
- */
70
- static const jsi::HostFunctionType
71
- createCtor(std::shared_ptr<RNSkPlatformContext> context) {
72
- return JSI_HOST_FUNCTION_LAMBDA {
73
- jsi::BigInt pointer = arguments[0].asBigInt(runtime);
74
- const uintptr_t nativeBufferPointer = pointer.asUint64(runtime);
75
- void *surface = reinterpret_cast<void *>(nativeBufferPointer);
76
- auto width = static_cast<int>(arguments[1].asNumber());
77
- auto height = static_cast<int>(arguments[2].asNumber());
78
- if (surface == nullptr) {
79
- throw std::runtime_error("Surface is null");
80
- }
81
- auto result =
82
- context->makeContextFromNativeSurface(surface, width, height);
83
- if (result == nullptr) {
84
- throw std::runtime_error(
85
- "Couldn't create a Skia context from the native surface");
86
- }
87
- // Return the newly constructed object
88
- return makeJsiObject(runtime, std::make_shared<JsiSkiaContext>(
89
- context, std::move(result)));
90
- };
91
- }
92
- };
93
-
94
- } // namespace RNSkia
@@ -1,53 +0,0 @@
1
- // Copyright 2019 The Dawn & Tint Authors
2
- //
3
- // Redistribution and use in source and binary forms, with or without
4
- // modification, are permitted provided that the following conditions are met:
5
- //
6
- // 1. Redistributions of source code must retain the above copyright notice, this
7
- // list of conditions and the following disclaimer.
8
- //
9
- // 2. Redistributions in binary form must reproduce the above copyright notice,
10
- // this list of conditions and the following disclaimer in the documentation
11
- // and/or other materials provided with the distribution.
12
- //
13
- // 3. Neither the name of the copyright holder nor the names of its
14
- // contributors may be used to endorse or promote products derived from
15
- // this software without specific prior written permission.
16
- //
17
- // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18
- // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19
- // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20
- // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
21
- // FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
- // DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23
- // SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24
- // CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
25
- // OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26
- // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27
-
28
- #ifndef INCLUDE_DAWN_DAWN_PROC_H_
29
- #define INCLUDE_DAWN_DAWN_PROC_H_
30
-
31
- #include <webgpu/webgpu.h>
32
-
33
- #include "dawn/dawn_proc_table.h"
34
-
35
- #ifdef __cplusplus
36
- extern "C" {
37
- #endif
38
-
39
- // Sets the static proctable used by libdawn_proc to implement the Dawn entrypoints. Passing NULL
40
- // for `procs` sets up the null proctable that contains only null function pointers. It is the
41
- // default value of the proctable. Setting the proctable back to null is good practice when you
42
- // are done using libdawn_proc since further usage will cause a segfault instead of calling an
43
- // unexpected function.
44
- WGPU_EXPORT void dawnProcSetProcs(const DawnProcTable* procs);
45
-
46
- // Returns the static array of uint8_t of size 20 representing the Dawn version.
47
- WGPU_EXPORT const uint8_t* dawnProcGetVersion();
48
-
49
- #ifdef __cplusplus
50
- } // extern "C"
51
- #endif
52
-
53
- #endif // INCLUDE_DAWN_DAWN_PROC_H_