@shopify/react-native-skia 0.1.234 → 0.1.237

Sign up to get free protection for your applications and to get access to all the features.
Files changed (425) hide show
  1. package/cpp/api/JsiSkApi.h +2 -0
  2. package/cpp/api/JsiSkCanvas.h +36 -0
  3. package/cpp/api/JsiSkRSXform.h +35 -7
  4. package/cpp/api/JsiSkTypefaceFactory.h +2 -1
  5. package/cpp/rnskia/dom/JsiDomApi.h +2 -0
  6. package/cpp/rnskia/dom/nodes/JsiAtlasNode.h +60 -0
  7. package/cpp/rnskia/dom/props/RSXformProp.h +52 -0
  8. package/cpp/rnskia/dom/props/RectProp.h +31 -0
  9. package/cpp/skia/include/android/AHardwareBufferUtils.h +23 -0
  10. package/cpp/skia/include/android/GrAHardwareBufferUtils.h +2 -0
  11. package/cpp/skia/include/android/graphite/SurfaceAndroid.h +59 -0
  12. package/cpp/skia/include/codec/SkAvifDecoder.h +1 -1
  13. package/cpp/skia/include/codec/SkBmpDecoder.h +1 -1
  14. package/cpp/skia/include/codec/SkCodec.h +21 -3
  15. package/cpp/skia/include/codec/SkGifDecoder.h +1 -1
  16. package/cpp/skia/include/codec/SkIcoDecoder.h +1 -1
  17. package/cpp/skia/include/codec/SkJpegDecoder.h +1 -1
  18. package/cpp/skia/include/codec/SkJpegxlDecoder.h +1 -1
  19. package/cpp/skia/include/codec/SkPngDecoder.h +1 -1
  20. package/cpp/skia/include/codec/SkRawDecoder.h +1 -1
  21. package/cpp/skia/include/codec/SkWbmpDecoder.h +1 -1
  22. package/cpp/skia/include/codec/SkWebpDecoder.h +1 -1
  23. package/cpp/skia/include/config/SkUserConfig.h +3 -1
  24. package/cpp/skia/include/core/SkCanvas.h +66 -37
  25. package/cpp/skia/include/core/SkColorFilter.h +5 -2
  26. package/cpp/skia/include/core/SkContourMeasure.h +1 -0
  27. package/cpp/skia/include/core/SkDocument.h +1 -0
  28. package/cpp/skia/include/core/SkFont.h +14 -24
  29. package/cpp/skia/include/core/SkFontArguments.h +1 -1
  30. package/cpp/skia/include/core/SkFontMetrics.h +1 -1
  31. package/cpp/skia/include/core/SkFontMgr.h +0 -7
  32. package/cpp/skia/include/core/SkGraphics.h +13 -0
  33. package/cpp/skia/include/core/SkMesh.h +9 -13
  34. package/cpp/skia/include/core/SkMilestone.h +1 -1
  35. package/cpp/skia/include/core/SkPathMeasure.h +2 -0
  36. package/cpp/skia/include/core/SkSerialProcs.h +29 -11
  37. package/cpp/skia/include/core/SkSize.h +3 -3
  38. package/cpp/skia/include/core/SkStream.h +3 -13
  39. package/cpp/skia/include/core/SkSurface.h +6 -3
  40. package/cpp/skia/include/core/SkSurfaceProps.h +2 -4
  41. package/cpp/skia/include/core/SkTraceMemoryDump.h +15 -0
  42. package/cpp/skia/include/core/SkTypeface.h +8 -56
  43. package/cpp/skia/include/core/SkTypes.h +8 -0
  44. package/cpp/skia/include/core/SkVertices.h +1 -1
  45. package/cpp/skia/include/docs/SkMultiPictureDocument.h +53 -0
  46. package/cpp/skia/include/docs/SkPDFDocument.h +11 -0
  47. package/cpp/skia/include/effects/SkGradientShader.h +9 -0
  48. package/cpp/skia/include/effects/SkRuntimeEffect.h +3 -7
  49. package/cpp/skia/include/gpu/GrBackendSemaphore.h +33 -47
  50. package/cpp/skia/include/gpu/GrBackendSurface.h +2 -3
  51. package/cpp/skia/include/gpu/GrContextOptions.h +0 -6
  52. package/cpp/skia/include/gpu/GrContextThreadSafeProxy.h +44 -28
  53. package/cpp/skia/include/gpu/GrDirectContext.h +12 -31
  54. package/cpp/skia/include/gpu/GrTypes.h +1 -16
  55. package/cpp/skia/include/gpu/MutableTextureState.h +35 -80
  56. package/cpp/skia/include/gpu/ShaderErrorHandler.h +11 -1
  57. package/cpp/skia/include/gpu/ganesh/SkImageGanesh.h +2 -2
  58. package/cpp/skia/include/gpu/ganesh/SkSurfaceGanesh.h +1 -1
  59. package/cpp/skia/include/gpu/ganesh/gl/GrGLDirectContext.h +3 -2
  60. package/cpp/skia/include/gpu/ganesh/vk/GrVkBackendSemaphore.h +20 -0
  61. package/cpp/skia/include/gpu/ganesh/vk/GrVkDirectContext.h +30 -0
  62. package/cpp/skia/include/gpu/gl/GrGLFunctions.h +1 -1
  63. package/cpp/skia/include/gpu/gl/GrGLInterface.h +2 -0
  64. package/cpp/skia/include/gpu/gl/glx/GrGLMakeGLXInterface.h +6 -0
  65. package/cpp/skia/include/gpu/graphite/BackendSemaphore.h +3 -3
  66. package/cpp/skia/include/gpu/graphite/BackendTexture.h +39 -27
  67. package/cpp/skia/include/gpu/graphite/Context.h +39 -13
  68. package/cpp/skia/include/gpu/graphite/ContextOptions.h +2 -0
  69. package/cpp/skia/include/gpu/graphite/GraphiteTypes.h +2 -1
  70. package/cpp/skia/include/gpu/graphite/Image.h +106 -87
  71. package/cpp/skia/include/gpu/graphite/Recorder.h +24 -3
  72. package/cpp/skia/include/gpu/graphite/Surface.h +7 -2
  73. package/cpp/skia/include/gpu/graphite/dawn/DawnBackendContext.h +41 -2
  74. package/cpp/skia/include/gpu/graphite/dawn/DawnTypes.h +11 -6
  75. package/cpp/skia/include/gpu/graphite/mtl/MtlGraphiteTypes.h +1 -2
  76. package/cpp/skia/include/gpu/graphite/vk/VulkanGraphiteTypes.h +6 -6
  77. package/cpp/skia/include/gpu/mock/GrMockTypes.h +1 -0
  78. package/cpp/skia/include/gpu/vk/GrVkBackendContext.h +1 -1
  79. package/cpp/skia/include/gpu/vk/GrVkTypes.h +1 -44
  80. package/cpp/skia/include/gpu/vk/VulkanExtensions.h +1 -1
  81. package/cpp/skia/include/gpu/vk/VulkanMutableTextureState.h +25 -0
  82. package/cpp/skia/include/gpu/vk/VulkanTypes.h +44 -0
  83. package/cpp/skia/include/ports/SkFontConfigInterface.h +3 -6
  84. package/cpp/skia/include/private/SkEncodedInfo.h +5 -0
  85. package/cpp/skia/include/private/SkExif.h +102 -0
  86. package/cpp/skia/include/private/SkGainmapInfo.h +11 -1
  87. package/cpp/skia/include/private/base/SkAssert.h +16 -0
  88. package/cpp/skia/include/private/base/SkDeque.h +2 -7
  89. package/cpp/skia/include/private/base/SkLoadUserConfig.h +1 -1
  90. package/cpp/skia/include/private/base/SkTArray.h +69 -28
  91. package/cpp/skia/include/private/base/SkThreadAnnotations.h +18 -5
  92. package/cpp/skia/include/private/chromium/GrSurfaceCharacterization.h +26 -30
  93. package/cpp/skia/include/private/chromium/GrVkSecondaryCBDrawContext.h +4 -3
  94. package/cpp/skia/include/private/chromium/SkImageChromium.h +1 -1
  95. package/cpp/skia/include/private/gpu/ganesh/GrTypesPriv.h +8 -6
  96. package/cpp/skia/include/private/gpu/graphite/ContextOptionsPriv.h +29 -0
  97. package/cpp/skia/include/private/gpu/graphite/DawnTypesPriv.h +12 -9
  98. package/cpp/skia/include/private/gpu/graphite/VulkanGraphiteTypesPriv.h +16 -11
  99. package/cpp/skia/include/third_party/vulkan/vulkan/vk_platform.h +2 -2
  100. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h264std.h +312 -0
  101. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h264std_decode.h +77 -0
  102. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h265std.h +446 -0
  103. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h265std_decode.h +67 -0
  104. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codecs_common.h +36 -0
  105. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan.h +9 -2
  106. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_android.h +31 -3
  107. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_core.h +10624 -5716
  108. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_ios.h +2 -1
  109. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_macos.h +2 -1
  110. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_win32.h +28 -1
  111. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_xcb.h +2 -1
  112. package/cpp/skia/include/utils/mac/SkCGUtils.h +23 -11
  113. package/cpp/skia/modules/skcms/skcms.h +2 -410
  114. package/cpp/skia/modules/skcms/src/Transform_inl.h +831 -704
  115. package/cpp/skia/modules/skcms/src/skcms_Transform.h +161 -0
  116. package/cpp/skia/modules/skcms/src/skcms_internals.h +136 -0
  117. package/cpp/skia/modules/skcms/src/skcms_public.h +404 -0
  118. package/cpp/skia/modules/skparagraph/include/FontArguments.h +1 -1
  119. package/cpp/skia/modules/skparagraph/include/FontCollection.h +2 -0
  120. package/cpp/skia/modules/skparagraph/include/Paragraph.h +2 -2
  121. package/cpp/skia/modules/skparagraph/include/TextStyle.h +4 -3
  122. package/cpp/skia/modules/skparagraph/include/TypefaceFontProvider.h +1 -3
  123. package/cpp/skia/modules/skresources/include/SkResources.h +28 -17
  124. package/cpp/skia/modules/skunicode/include/SkUnicode.h +12 -0
  125. package/cpp/skia/modules/svg/include/SkSVGDOM.h +4 -1
  126. package/cpp/skia/modules/svg/include/SkSVGRenderContext.h +4 -1
  127. package/cpp/skia/src/base/SkUTF.h +7 -0
  128. package/cpp/skia/src/core/SkTHash.h +20 -8
  129. package/lib/commonjs/dom/nodes/JsiSkDOM.d.ts +5 -3
  130. package/lib/commonjs/dom/nodes/JsiSkDOM.js +60 -57
  131. package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -1
  132. package/lib/commonjs/dom/nodes/drawings/AtlasNode.d.ts +8 -0
  133. package/lib/commonjs/dom/nodes/drawings/AtlasNode.js +47 -0
  134. package/lib/commonjs/dom/nodes/drawings/AtlasNode.js.map +1 -0
  135. package/lib/commonjs/dom/nodes/drawings/index.d.ts +1 -0
  136. package/lib/commonjs/dom/nodes/drawings/index.js +13 -0
  137. package/lib/commonjs/dom/nodes/drawings/index.js.map +1 -1
  138. package/lib/commonjs/dom/types/Drawings.d.ts +7 -1
  139. package/lib/commonjs/dom/types/Drawings.js.map +1 -1
  140. package/lib/commonjs/dom/types/NodeType.d.ts +1 -0
  141. package/lib/commonjs/dom/types/NodeType.js +1 -0
  142. package/lib/commonjs/dom/types/NodeType.js.map +1 -1
  143. package/lib/commonjs/dom/types/SkDOM.d.ts +2 -1
  144. package/lib/commonjs/dom/types/SkDOM.js.map +1 -1
  145. package/lib/commonjs/external/reanimated/buffers.d.ts +5 -0
  146. package/lib/commonjs/external/reanimated/buffers.js +48 -0
  147. package/lib/commonjs/external/reanimated/buffers.js.map +1 -0
  148. package/lib/commonjs/external/reanimated/index.d.ts +2 -0
  149. package/lib/commonjs/external/reanimated/index.js +26 -0
  150. package/lib/commonjs/external/reanimated/index.js.map +1 -1
  151. package/lib/commonjs/external/reanimated/interpolators.js +13 -1
  152. package/lib/commonjs/external/reanimated/interpolators.js.map +1 -1
  153. package/lib/commonjs/external/reanimated/moduleWrapper.d.ts +1 -0
  154. package/lib/commonjs/external/reanimated/moduleWrapper.js +5 -3
  155. package/lib/commonjs/external/reanimated/moduleWrapper.js.map +1 -1
  156. package/lib/commonjs/external/reanimated/textures.d.ts +5 -0
  157. package/lib/commonjs/external/reanimated/textures.js +38 -0
  158. package/lib/commonjs/external/reanimated/textures.js.map +1 -0
  159. package/lib/commonjs/external/reanimated/useAnimatedImageValue.js +8 -1
  160. package/lib/commonjs/external/reanimated/useAnimatedImageValue.js.map +1 -1
  161. package/lib/commonjs/headless/index.js +1 -1
  162. package/lib/commonjs/headless/index.js.map +1 -1
  163. package/lib/commonjs/mock/index.js +8 -0
  164. package/lib/commonjs/mock/index.js.map +1 -1
  165. package/lib/commonjs/renderer/Canvas.js +1 -1
  166. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  167. package/lib/commonjs/renderer/Container.d.ts +1 -1
  168. package/lib/commonjs/renderer/Container.js +2 -1
  169. package/lib/commonjs/renderer/Container.js.map +1 -1
  170. package/lib/commonjs/renderer/HostComponents.d.ts +3 -1
  171. package/lib/commonjs/renderer/HostComponents.js +3 -0
  172. package/lib/commonjs/renderer/HostComponents.js.map +1 -1
  173. package/lib/commonjs/renderer/Offscreen.d.ts +4 -1
  174. package/lib/commonjs/renderer/Offscreen.js +28 -10
  175. package/lib/commonjs/renderer/Offscreen.js.map +1 -1
  176. package/lib/commonjs/renderer/Reconciler.d.ts +1 -1
  177. package/lib/commonjs/renderer/Reconciler.js +7 -4
  178. package/lib/commonjs/renderer/Reconciler.js.map +1 -1
  179. package/lib/commonjs/renderer/components/shapes/Atlas.d.ts +4 -0
  180. package/lib/commonjs/renderer/components/shapes/Atlas.js +17 -0
  181. package/lib/commonjs/renderer/components/shapes/Atlas.js.map +1 -0
  182. package/lib/commonjs/renderer/components/shapes/index.d.ts +1 -0
  183. package/lib/commonjs/renderer/components/shapes/index.js +13 -0
  184. package/lib/commonjs/renderer/components/shapes/index.js.map +1 -1
  185. package/lib/commonjs/skia/core/AnimatedImage.d.ts +1 -1
  186. package/lib/commonjs/skia/core/AnimatedImage.js +4 -1
  187. package/lib/commonjs/skia/core/AnimatedImage.js.map +1 -1
  188. package/lib/commonjs/skia/core/Data.d.ts +1 -1
  189. package/lib/commonjs/skia/core/Data.js +11 -4
  190. package/lib/commonjs/skia/core/Data.js.map +1 -1
  191. package/lib/commonjs/skia/core/Rect.d.ts +2 -2
  192. package/lib/commonjs/skia/types/Canvas.d.ts +16 -1
  193. package/lib/commonjs/skia/types/Canvas.js.map +1 -1
  194. package/lib/commonjs/skia/types/Image/Image.d.ts +8 -0
  195. package/lib/commonjs/skia/types/Image/Image.js.map +1 -1
  196. package/lib/commonjs/skia/types/Matrix4.d.ts +2 -2
  197. package/lib/commonjs/skia/types/Matrix4.js.map +1 -1
  198. package/lib/commonjs/skia/types/RSXform.d.ts +7 -1
  199. package/lib/commonjs/skia/types/RSXform.js.map +1 -1
  200. package/lib/commonjs/skia/types/Rect.d.ts +4 -0
  201. package/lib/commonjs/skia/types/Rect.js.map +1 -1
  202. package/lib/commonjs/skia/types/Shader/Shader.d.ts +1 -1
  203. package/lib/commonjs/skia/types/Shader/Shader.js.map +1 -1
  204. package/lib/commonjs/skia/types/Skia.d.ts +3 -2
  205. package/lib/commonjs/skia/types/Skia.js.map +1 -1
  206. package/lib/commonjs/skia/web/JsiSkCanvas.d.ts +2 -1
  207. package/lib/commonjs/skia/web/JsiSkCanvas.js +19 -0
  208. package/lib/commonjs/skia/web/JsiSkCanvas.js.map +1 -1
  209. package/lib/commonjs/skia/web/JsiSkRSXform.d.ts +8 -2
  210. package/lib/commonjs/skia/web/JsiSkRSXform.js +33 -2
  211. package/lib/commonjs/skia/web/JsiSkRSXform.js.map +1 -1
  212. package/lib/commonjs/skia/web/JsiSkRect.d.ts +3 -2
  213. package/lib/commonjs/skia/web/JsiSkRect.js +7 -0
  214. package/lib/commonjs/skia/web/JsiSkRect.js.map +1 -1
  215. package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js +2 -1
  216. package/lib/commonjs/skia/web/JsiSkTextBlobFactory.js.map +1 -1
  217. package/lib/commonjs/skia/web/JsiSkia.js +5 -0
  218. package/lib/commonjs/skia/web/JsiSkia.js.map +1 -1
  219. package/lib/module/dom/nodes/JsiSkDOM.d.ts +5 -3
  220. package/lib/module/dom/nodes/JsiSkDOM.js +61 -57
  221. package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -1
  222. package/lib/module/dom/nodes/drawings/AtlasNode.d.ts +8 -0
  223. package/lib/module/dom/nodes/drawings/AtlasNode.js +34 -0
  224. package/lib/module/dom/nodes/drawings/AtlasNode.js.map +1 -0
  225. package/lib/module/dom/nodes/drawings/index.d.ts +1 -0
  226. package/lib/module/dom/nodes/drawings/index.js +1 -0
  227. package/lib/module/dom/nodes/drawings/index.js.map +1 -1
  228. package/lib/module/dom/types/Drawings.d.ts +7 -1
  229. package/lib/module/dom/types/Drawings.js.map +1 -1
  230. package/lib/module/dom/types/NodeType.d.ts +1 -0
  231. package/lib/module/dom/types/NodeType.js +1 -0
  232. package/lib/module/dom/types/NodeType.js.map +1 -1
  233. package/lib/module/dom/types/SkDOM.d.ts +2 -1
  234. package/lib/module/dom/types/SkDOM.js.map +1 -1
  235. package/lib/module/external/reanimated/buffers.d.ts +5 -0
  236. package/lib/module/external/reanimated/buffers.js +27 -0
  237. package/lib/module/external/reanimated/buffers.js.map +1 -0
  238. package/lib/module/external/reanimated/index.d.ts +2 -0
  239. package/lib/module/external/reanimated/index.js +2 -0
  240. package/lib/module/external/reanimated/index.js.map +1 -1
  241. package/lib/module/external/reanimated/interpolators.js +13 -1
  242. package/lib/module/external/reanimated/interpolators.js.map +1 -1
  243. package/lib/module/external/reanimated/moduleWrapper.d.ts +1 -0
  244. package/lib/module/external/reanimated/moduleWrapper.js +3 -2
  245. package/lib/module/external/reanimated/moduleWrapper.js.map +1 -1
  246. package/lib/module/external/reanimated/textures.d.ts +5 -0
  247. package/lib/module/external/reanimated/textures.js +24 -0
  248. package/lib/module/external/reanimated/textures.js.map +1 -0
  249. package/lib/module/external/reanimated/useAnimatedImageValue.js +7 -1
  250. package/lib/module/external/reanimated/useAnimatedImageValue.js.map +1 -1
  251. package/lib/module/headless/index.js +1 -1
  252. package/lib/module/headless/index.js.map +1 -1
  253. package/lib/module/mock/index.js +8 -0
  254. package/lib/module/mock/index.js.map +1 -1
  255. package/lib/module/renderer/Canvas.js +1 -1
  256. package/lib/module/renderer/Canvas.js.map +1 -1
  257. package/lib/module/renderer/Container.d.ts +1 -1
  258. package/lib/module/renderer/Container.js +2 -1
  259. package/lib/module/renderer/Container.js.map +1 -1
  260. package/lib/module/renderer/HostComponents.d.ts +3 -1
  261. package/lib/module/renderer/HostComponents.js +3 -0
  262. package/lib/module/renderer/HostComponents.js.map +1 -1
  263. package/lib/module/renderer/Offscreen.d.ts +4 -1
  264. package/lib/module/renderer/Offscreen.js +19 -9
  265. package/lib/module/renderer/Offscreen.js.map +1 -1
  266. package/lib/module/renderer/Reconciler.d.ts +1 -1
  267. package/lib/module/renderer/Reconciler.js +7 -4
  268. package/lib/module/renderer/Reconciler.js.map +1 -1
  269. package/lib/module/renderer/components/shapes/Atlas.d.ts +4 -0
  270. package/lib/module/renderer/components/shapes/Atlas.js +5 -0
  271. package/lib/module/renderer/components/shapes/Atlas.js.map +1 -0
  272. package/lib/module/renderer/components/shapes/index.d.ts +1 -0
  273. package/lib/module/renderer/components/shapes/index.js +1 -0
  274. package/lib/module/renderer/components/shapes/index.js.map +1 -1
  275. package/lib/module/skia/core/AnimatedImage.d.ts +1 -1
  276. package/lib/module/skia/core/AnimatedImage.js +4 -1
  277. package/lib/module/skia/core/AnimatedImage.js.map +1 -1
  278. package/lib/module/skia/core/Data.d.ts +1 -1
  279. package/lib/module/skia/core/Data.js +11 -4
  280. package/lib/module/skia/core/Data.js.map +1 -1
  281. package/lib/module/skia/core/Rect.d.ts +2 -2
  282. package/lib/module/skia/types/Canvas.d.ts +16 -1
  283. package/lib/module/skia/types/Canvas.js.map +1 -1
  284. package/lib/module/skia/types/Image/Image.d.ts +8 -0
  285. package/lib/module/skia/types/Image/Image.js.map +1 -1
  286. package/lib/module/skia/types/Matrix4.d.ts +2 -2
  287. package/lib/module/skia/types/Matrix4.js.map +1 -1
  288. package/lib/module/skia/types/RSXform.d.ts +7 -1
  289. package/lib/module/skia/types/RSXform.js.map +1 -1
  290. package/lib/module/skia/types/Rect.d.ts +4 -0
  291. package/lib/module/skia/types/Rect.js.map +1 -1
  292. package/lib/module/skia/types/Shader/Shader.d.ts +1 -1
  293. package/lib/module/skia/types/Shader/Shader.js.map +1 -1
  294. package/lib/module/skia/types/Skia.d.ts +3 -2
  295. package/lib/module/skia/types/Skia.js.map +1 -1
  296. package/lib/module/skia/web/JsiSkCanvas.d.ts +2 -1
  297. package/lib/module/skia/web/JsiSkCanvas.js +18 -0
  298. package/lib/module/skia/web/JsiSkCanvas.js.map +1 -1
  299. package/lib/module/skia/web/JsiSkRSXform.d.ts +8 -2
  300. package/lib/module/skia/web/JsiSkRSXform.js +34 -3
  301. package/lib/module/skia/web/JsiSkRSXform.js.map +1 -1
  302. package/lib/module/skia/web/JsiSkRect.d.ts +3 -2
  303. package/lib/module/skia/web/JsiSkRect.js +7 -0
  304. package/lib/module/skia/web/JsiSkRect.js.map +1 -1
  305. package/lib/module/skia/web/JsiSkTextBlobFactory.js +2 -1
  306. package/lib/module/skia/web/JsiSkTextBlobFactory.js.map +1 -1
  307. package/lib/module/skia/web/JsiSkia.js +5 -0
  308. package/lib/module/skia/web/JsiSkia.js.map +1 -1
  309. package/lib/typescript/src/dom/nodes/JsiSkDOM.d.ts +5 -3
  310. package/lib/typescript/src/dom/nodes/drawings/AtlasNode.d.ts +8 -0
  311. package/lib/typescript/src/dom/nodes/drawings/index.d.ts +1 -0
  312. package/lib/typescript/src/dom/types/Drawings.d.ts +7 -1
  313. package/lib/typescript/src/dom/types/NodeType.d.ts +1 -0
  314. package/lib/typescript/src/dom/types/SkDOM.d.ts +2 -1
  315. package/lib/typescript/src/external/reanimated/buffers.d.ts +5 -0
  316. package/lib/typescript/src/external/reanimated/index.d.ts +2 -0
  317. package/lib/typescript/src/external/reanimated/moduleWrapper.d.ts +1 -0
  318. package/lib/typescript/src/external/reanimated/textures.d.ts +5 -0
  319. package/lib/typescript/src/renderer/Container.d.ts +1 -1
  320. package/lib/typescript/src/renderer/HostComponents.d.ts +3 -1
  321. package/lib/typescript/src/renderer/Offscreen.d.ts +4 -1
  322. package/lib/typescript/src/renderer/Reconciler.d.ts +1 -1
  323. package/lib/typescript/src/renderer/components/shapes/Atlas.d.ts +4 -0
  324. package/lib/typescript/src/renderer/components/shapes/index.d.ts +1 -0
  325. package/lib/typescript/src/skia/core/AnimatedImage.d.ts +1 -1
  326. package/lib/typescript/src/skia/core/Data.d.ts +1 -1
  327. package/lib/typescript/src/skia/core/Rect.d.ts +2 -2
  328. package/lib/typescript/src/skia/types/Canvas.d.ts +16 -1
  329. package/lib/typescript/src/skia/types/Image/Image.d.ts +8 -0
  330. package/lib/typescript/src/skia/types/Matrix4.d.ts +2 -2
  331. package/lib/typescript/src/skia/types/RSXform.d.ts +7 -1
  332. package/lib/typescript/src/skia/types/Rect.d.ts +4 -0
  333. package/lib/typescript/src/skia/types/Shader/Shader.d.ts +1 -1
  334. package/lib/typescript/src/skia/types/Skia.d.ts +3 -2
  335. package/lib/typescript/src/skia/web/JsiSkCanvas.d.ts +2 -1
  336. package/lib/typescript/src/skia/web/JsiSkRSXform.d.ts +8 -2
  337. package/lib/typescript/src/skia/web/JsiSkRect.d.ts +3 -2
  338. package/libs/android/arm64-v8a/libskia.a +0 -0
  339. package/libs/android/arm64-v8a/libskottie.a +0 -0
  340. package/libs/android/arm64-v8a/libskparagraph.a +0 -0
  341. package/libs/android/arm64-v8a/libsksg.a +0 -0
  342. package/libs/android/arm64-v8a/libskshaper.a +0 -0
  343. package/libs/android/arm64-v8a/libskunicode.a +0 -0
  344. package/libs/android/arm64-v8a/libsvg.a +0 -0
  345. package/libs/android/armeabi-v7a/libskia.a +0 -0
  346. package/libs/android/armeabi-v7a/libskottie.a +0 -0
  347. package/libs/android/armeabi-v7a/libskparagraph.a +0 -0
  348. package/libs/android/armeabi-v7a/libsksg.a +0 -0
  349. package/libs/android/armeabi-v7a/libskshaper.a +0 -0
  350. package/libs/android/armeabi-v7a/libskunicode.a +0 -0
  351. package/libs/android/armeabi-v7a/libsvg.a +0 -0
  352. package/libs/android/x86/libskia.a +0 -0
  353. package/libs/android/x86/libskottie.a +0 -0
  354. package/libs/android/x86/libskparagraph.a +0 -0
  355. package/libs/android/x86/libsksg.a +0 -0
  356. package/libs/android/x86/libskshaper.a +0 -0
  357. package/libs/android/x86/libskunicode.a +0 -0
  358. package/libs/android/x86/libsvg.a +0 -0
  359. package/libs/android/x86_64/libskia.a +0 -0
  360. package/libs/android/x86_64/libskottie.a +0 -0
  361. package/libs/android/x86_64/libskparagraph.a +0 -0
  362. package/libs/android/x86_64/libsksg.a +0 -0
  363. package/libs/android/x86_64/libskshaper.a +0 -0
  364. package/libs/android/x86_64/libskunicode.a +0 -0
  365. package/libs/android/x86_64/libsvg.a +0 -0
  366. package/libs/ios/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
  367. package/libs/ios/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
  368. package/libs/ios/libskottie.xcframework/ios-arm64_arm64e/libskottie.a +0 -0
  369. package/libs/ios/libskottie.xcframework/ios-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
  370. package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e/libskparagraph.a +0 -0
  371. package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e_x86_64-simulator/libskparagraph.a +0 -0
  372. package/libs/ios/libsksg.xcframework/ios-arm64_arm64e/libsksg.a +0 -0
  373. package/libs/ios/libsksg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
  374. package/libs/ios/libskshaper.xcframework/Info.plist +5 -5
  375. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
  376. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
  377. package/libs/ios/libskunicode.xcframework/ios-arm64_arm64e/libskunicode.a +0 -0
  378. package/libs/ios/libskunicode.xcframework/ios-arm64_arm64e_x86_64-simulator/libskunicode.a +0 -0
  379. package/libs/ios/libsvg.xcframework/Info.plist +5 -5
  380. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
  381. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
  382. package/package.json +1 -1
  383. package/src/dom/nodes/JsiSkDOM.ts +63 -56
  384. package/src/dom/nodes/drawings/AtlasNode.ts +24 -0
  385. package/src/dom/nodes/drawings/index.ts +1 -0
  386. package/src/dom/types/Drawings.ts +9 -0
  387. package/src/dom/types/NodeType.ts +1 -0
  388. package/src/dom/types/SkDOM.ts +2 -0
  389. package/src/external/reanimated/buffers.ts +53 -0
  390. package/src/external/reanimated/index.ts +2 -0
  391. package/src/external/reanimated/interpolators.ts +15 -2
  392. package/src/external/reanimated/moduleWrapper.ts +1 -0
  393. package/src/external/reanimated/textures.tsx +38 -0
  394. package/src/external/reanimated/useAnimatedImageValue.ts +15 -4
  395. package/src/headless/index.ts +1 -1
  396. package/src/mock/index.ts +8 -0
  397. package/src/renderer/Canvas.tsx +1 -1
  398. package/src/renderer/Container.tsx +3 -2
  399. package/src/renderer/HostComponents.ts +6 -1
  400. package/src/renderer/Offscreen.tsx +24 -11
  401. package/src/renderer/Reconciler.tsx +5 -2
  402. package/src/renderer/components/shapes/Atlas.tsx +8 -0
  403. package/src/renderer/components/shapes/index.ts +1 -0
  404. package/src/skia/core/AnimatedImage.ts +3 -2
  405. package/src/skia/core/Data.ts +8 -4
  406. package/src/skia/types/Canvas.ts +32 -1
  407. package/src/skia/types/Image/Image.ts +10 -0
  408. package/src/skia/types/Matrix4.ts +2 -2
  409. package/src/skia/types/RSXform.ts +7 -1
  410. package/src/skia/types/Rect.ts +6 -0
  411. package/src/skia/types/Shader/Shader.ts +6 -1
  412. package/src/skia/types/Skia.ts +10 -2
  413. package/src/skia/web/JsiSkCanvas.ts +60 -23
  414. package/src/skia/web/JsiSkRSXform.ts +28 -4
  415. package/src/skia/web/JsiSkRect.ts +12 -2
  416. package/src/skia/web/JsiSkTextBlobFactory.ts +5 -5
  417. package/src/skia/web/JsiSkia.ts +15 -0
  418. package/cpp/skia/include/gpu/GrSurfaceInfo.h +0 -142
  419. package/cpp/skia/include/private/gpu/ganesh/GrGLTypesPriv.h +0 -107
  420. package/cpp/skia/include/private/gpu/ganesh/GrMockTypesPriv.h +0 -32
  421. package/cpp/skia/include/private/gpu/ganesh/GrMtlTypesPriv.h +0 -83
  422. package/cpp/skia/include/private/gpu/ganesh/GrVkTypesPriv.h +0 -47
  423. package/cpp/skia/include/private/gpu/vk/VulkanTypesPriv.h +0 -57
  424. package/cpp/skia/include/utils/SkBase64.h +0 -53
  425. package/cpp/skia/modules/skcms/skcms_internal.h +0 -56
@@ -69,6 +69,8 @@ public:
69
69
  installFunction("Font", JsiSkFont::createCtor(context));
70
70
  installFunction("Paint", JsiSkPaint::createCtor(context));
71
71
  installFunction("RSXform", JsiSkRSXform::createCtor(context));
72
+ installFunction("RSXformFromRadians",
73
+ JsiSkRSXform::createCtorFromRadians(context));
72
74
  installFunction("Matrix", JsiSkMatrix::createCtor(context));
73
75
  installFunction("XYWHRect", JsiSkRect::createCtor(context));
74
76
  installFunction("RRectXY", JsiSkRRect::createCtor(context));
@@ -14,6 +14,7 @@
14
14
  #include "JsiSkPicture.h"
15
15
  #include "JsiSkPoint.h"
16
16
  #include "JsiSkRRect.h"
17
+ #include "JsiSkRSXform.h"
17
18
  #include "JsiSkSVG.h"
18
19
  #include "JsiSkTextBlob.h"
19
20
  #include "JsiSkVertices.h"
@@ -495,6 +496,40 @@ public:
495
496
  return jsi::Value::undefined();
496
497
  }
497
498
 
499
+ JSI_HOST_FUNCTION(drawAtlas) {
500
+ auto atlas = JsiSkImage::fromValue(runtime, arguments[0]);
501
+ auto rects = arguments[1].asObject(runtime).asArray(runtime);
502
+ auto transforms = arguments[2].asObject(runtime).asArray(runtime);
503
+ auto paint = JsiSkPaint::fromValue(runtime, arguments[3]);
504
+ auto blendMode = count > 5 && !arguments[4].isUndefined()
505
+ ? static_cast<SkBlendMode>(arguments[4].asNumber())
506
+ : SkBlendMode::kSrcOver;
507
+
508
+ std::vector<SkRSXform> xforms;
509
+ int xformsSize = static_cast<int>(transforms.size(runtime));
510
+ xforms.reserve(xformsSize);
511
+ for (int i = 0; i < xformsSize; i++) {
512
+ auto xform = JsiSkRSXform::fromValue(
513
+ runtime, transforms.getValueAtIndex(runtime, i).asObject(runtime));
514
+ xforms.push_back(*xform.get());
515
+ }
516
+
517
+ std::vector<SkRect> skRects;
518
+ int rectsSize = static_cast<int>(rects.size(runtime));
519
+ skRects.reserve(rectsSize);
520
+ for (int i = 0; i < rectsSize; i++) {
521
+ auto rect = JsiSkRect::fromValue(
522
+ runtime, rects.getValueAtIndex(runtime, i).asObject(runtime));
523
+ skRects.push_back(*rect.get());
524
+ }
525
+ SkSamplingOptions sampling;
526
+ _canvas->drawAtlas(atlas.get(), xforms.data(), skRects.data(), nullptr,
527
+ skRects.size(), blendMode, sampling, nullptr,
528
+ paint.get());
529
+
530
+ return jsi::Value::undefined();
531
+ }
532
+
498
533
  JSI_HOST_FUNCTION(readPixels) {
499
534
  auto srcX = static_cast<int>(arguments[0].asNumber());
500
535
  auto srcY = static_cast<int>(arguments[1].asNumber());
@@ -567,6 +602,7 @@ public:
567
602
  JSI_EXPORT_FUNC(JsiSkCanvas, clear),
568
603
  JSI_EXPORT_FUNC(JsiSkCanvas, concat),
569
604
  JSI_EXPORT_FUNC(JsiSkCanvas, drawPicture),
605
+ JSI_EXPORT_FUNC(JsiSkCanvas, drawAtlas),
570
606
  JSI_EXPORT_FUNC(JsiSkCanvas, readPixels))
571
607
 
572
608
  explicit JsiSkCanvas(std::shared_ptr<RNSkPlatformContext> context)
@@ -40,13 +40,23 @@ public:
40
40
  return jsi::Value(SkScalarToDouble(getObject()->fTy));
41
41
  }
42
42
 
43
+ JSI_HOST_FUNCTION(set) {
44
+ auto scos = arguments[0].asNumber();
45
+ auto ssin = arguments[1].asNumber();
46
+ auto tx = arguments[2].asNumber();
47
+ auto ty = arguments[3].asNumber();
48
+ getObject()->set(scos, ssin, tx, ty);
49
+ return jsi::Value::undefined();
50
+ }
51
+
43
52
  JSI_EXPORT_PROPERTY_GETTERS(JSI_EXPORT_PROP_GET(JsiSkRSXform, __typename__),
44
53
  JSI_EXPORT_PROP_GET(JsiSkRSXform, scos),
45
54
  JSI_EXPORT_PROP_GET(JsiSkRSXform, ssin),
46
55
  JSI_EXPORT_PROP_GET(JsiSkRSXform, tx),
47
56
  JSI_EXPORT_PROP_GET(JsiSkRSXform, ty))
48
57
 
49
- JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkRSXform, dispose))
58
+ JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkRSXform, set),
59
+ JSI_EXPORT_FUNC(JsiSkRSXform, dispose))
50
60
 
51
61
  /**
52
62
  Returns the underlying object from a host object of this type
@@ -57,12 +67,10 @@ public:
57
67
  if (object.isHostObject(runtime)) {
58
68
  return object.asHostObject<JsiSkRSXform>(runtime)->getObject();
59
69
  } else {
60
- auto scos =
61
- object.getArray(runtime).getValueAtIndex(runtime, 0).asNumber();
62
- auto ssin =
63
- object.getArray(runtime).getValueAtIndex(runtime, 1).asNumber();
64
- auto tx = object.getArray(runtime).getValueAtIndex(runtime, 2).asNumber();
65
- auto ty = object.getArray(runtime).getValueAtIndex(runtime, 3).asNumber();
70
+ auto scos = object.getProperty(runtime, "scos").asNumber();
71
+ auto ssin = object.getProperty(runtime, "ssin").asNumber();
72
+ auto tx = object.getProperty(runtime, "tx").asNumber();
73
+ auto ty = object.getProperty(runtime, "ty").asNumber();
66
74
  return std::make_shared<SkRSXform>(SkRSXform::Make(scos, ssin, tx, ty));
67
75
  }
68
76
  }
@@ -77,6 +85,26 @@ public:
77
85
  runtime, std::make_shared<JsiSkRSXform>(std::move(context), rsxform));
78
86
  }
79
87
 
88
+ /**
89
+ * Creates the function for construction a new instance of the SkRSXform
90
+ * wrapper
91
+ * @param context platform context
92
+ * @return A function for creating a new host object wrapper for the SkRSXform
93
+ * class
94
+ */
95
+ static const jsi::HostFunctionType
96
+ createCtorFromRadians(std::shared_ptr<RNSkPlatformContext> context) {
97
+ return JSI_HOST_FUNCTION_LAMBDA {
98
+ auto rsxform = SkRSXform::MakeFromRadians(
99
+ arguments[0].asNumber(), arguments[1].asNumber(),
100
+ arguments[2].asNumber(), arguments[3].asNumber(),
101
+ arguments[4].asNumber(), arguments[5].asNumber());
102
+ // Return the newly constructed object
103
+ return jsi::Object::createFromHostObject(
104
+ runtime, std::make_shared<JsiSkRSXform>(std::move(context),
105
+ std::move(rsxform)));
106
+ };
107
+ }
80
108
  /**
81
109
  * Creates the function for construction a new instance of the SkRSXform
82
110
  * wrapper
@@ -17,7 +17,8 @@ class JsiSkTypefaceFactory : public JsiSkHostObject {
17
17
  public:
18
18
  JSI_HOST_FUNCTION(MakeFreeTypeFaceFromData) {
19
19
  auto data = JsiSkData::fromValue(runtime, arguments[0]);
20
- auto typeface = SkFontMgr::RefDefault()->makeFromData(std::move(data));
20
+ auto fontMgr = JsiSkFontMgrFactory::getFontMgr(getContext());
21
+ auto typeface = fontMgr->makeFromData(std::move(data));
21
22
  if (typeface == nullptr) {
22
23
  return jsi::Value::null();
23
24
  }
@@ -8,6 +8,7 @@
8
8
 
9
9
  #include "JsiHostObject.h"
10
10
 
11
+ #include "nodes/JsiAtlasNode.h"
11
12
  #include "nodes/JsiCircleNode.h"
12
13
  #include "nodes/JsiDiffRectNode.h"
13
14
  #include "nodes/JsiFillNode.h"
@@ -66,6 +67,7 @@ public:
66
67
  installFunction("PatchNode", JsiPatchNode::createCtor(context));
67
68
  installFunction("PointsNode", JsiPointsNode::createCtor(context));
68
69
  installFunction("DiffRectNode", JsiDiffRectNode::createCtor(context));
70
+ installFunction("AtlasNode", JsiAtlasNode::createCtor(context));
69
71
 
70
72
  installFunction("FillNode", JsiFillNode::createCtor(context));
71
73
 
@@ -0,0 +1,60 @@
1
+ #pragma once
2
+
3
+ #include "JsiDomDrawingNode.h"
4
+ #include "RSXformProp.h"
5
+ #include "RectProp.h"
6
+ #include "SkImageProps.h"
7
+
8
+ #include <memory>
9
+ #include <tuple>
10
+
11
+ namespace RNSkia {
12
+
13
+ class JsiAtlasNode : public JsiDomDrawingNode,
14
+ public JsiDomNodeCtor<JsiAtlasNode> {
15
+ public:
16
+ explicit JsiAtlasNode(std::shared_ptr<RNSkPlatformContext> context)
17
+ : JsiDomDrawingNode(context, "skAtlas") {}
18
+
19
+ protected:
20
+ void draw(DrawingContext *context) override {
21
+ if (_rectsProp->isSet() && _imageProp->isSet() && _rsxFormsProp->isSet()) {
22
+ const auto image = _imageProp->getDerivedValue();
23
+ const auto sprites = _rectsProp->getDerivedValue();
24
+ const auto transforms = _rsxFormsProp->getDerivedValue();
25
+ const auto colors =
26
+ _colorsProp->isSet() ? _colorsProp->getDerivedValue() : nullptr;
27
+ const auto blendMode = _blendModeProp->isSet()
28
+ ? *_blendModeProp->getDerivedValue()
29
+ : SkBlendMode::kDstOver;
30
+ auto paint = *context->getPaint();
31
+ SkSamplingOptions sampling(SkFilterMode::kLinear, SkMipmapMode::kNone);
32
+ context->getCanvas()->drawAtlas(
33
+ image.get(), transforms->data(), sprites->data(),
34
+ colors == nullptr ? nullptr : colors->data(), sprites->size(),
35
+ blendMode, sampling, nullptr, &paint);
36
+ }
37
+ }
38
+
39
+ void defineProperties(NodePropsContainer *container) override {
40
+ JsiDomDrawingNode::defineProperties(container);
41
+ _rectsProp = container->defineProperty<RectsProp>("sprites");
42
+ _rsxFormsProp = container->defineProperty<RSXFormsProp>("transforms");
43
+ _imageProp = container->defineProperty<ImageProp>("image");
44
+ _colorsProp = container->defineProperty<ColorsProp>("colors");
45
+ _blendModeProp = container->defineProperty<BlendModeProp>("blendMode");
46
+
47
+ _rectsProp->require();
48
+ _rsxFormsProp->require();
49
+ _imageProp->require();
50
+ }
51
+
52
+ private:
53
+ ImageProp *_imageProp;
54
+ RectsProp *_rectsProp;
55
+ RSXFormsProp *_rsxFormsProp;
56
+ ColorsProp *_colorsProp;
57
+ BlendModeProp *_blendModeProp;
58
+ };
59
+
60
+ } // namespace RNSkia
@@ -0,0 +1,52 @@
1
+ #pragma once
2
+
3
+ #include "JsiSkRSXform.h"
4
+ #include "NodeProp.h"
5
+
6
+ #include <memory>
7
+ #include <utility>
8
+ #include <vector>
9
+
10
+ #pragma clang diagnostic push
11
+ #pragma clang diagnostic ignored "-Wdocumentation"
12
+
13
+ #include "SkRSXform.h"
14
+
15
+ #pragma clang diagnostic pop
16
+
17
+ namespace RNSkia {
18
+
19
+ // TODO: Factorize these array classes
20
+ class RSXFormsProp : public DerivedProp<std::vector<SkRSXform>> {
21
+ public:
22
+ explicit RSXFormsProp(PropId name,
23
+ const std::function<void(BaseNodeProp *)> &onChange)
24
+ : DerivedProp<std::vector<SkRSXform>>(onChange) {
25
+ _rsxFormsProp = defineProperty<NodeProp>(name);
26
+ }
27
+
28
+ void updateDerivedValue() override {
29
+ if (_rsxFormsProp->isSet()) {
30
+ auto rsxforms = _rsxFormsProp->value().getAsArray();
31
+ std::vector<SkRSXform> derivedRSXForms;
32
+ derivedRSXForms.reserve(rsxforms.size());
33
+
34
+ for (size_t i = 0; i < rsxforms.size(); ++i) {
35
+ auto val = rsxforms[i];
36
+ if (val.getType() == PropType::HostObject) {
37
+ auto rsx =
38
+ std::dynamic_pointer_cast<JsiSkRSXform>(val.getAsHostObject())
39
+ ->getObject();
40
+ derivedRSXForms.push_back(*rsx);
41
+ }
42
+ }
43
+ setDerivedValue(std::move(derivedRSXForms));
44
+ } else {
45
+ setDerivedValue(nullptr);
46
+ }
47
+ }
48
+
49
+ private:
50
+ NodeProp *_rsxFormsProp;
51
+ };
52
+ } // namespace RNSkia
@@ -1,9 +1,12 @@
1
1
  #pragma once
2
2
 
3
+ #include "JsiSkRSXform.h"
3
4
  #include "NodeProp.h"
4
5
  #include "PointProp.h"
5
6
 
6
7
  #include <memory>
8
+ #include <utility>
9
+ #include <vector>
7
10
 
8
11
  #pragma clang diagnostic push
9
12
  #pragma clang diagnostic ignored "-Wdocumentation"
@@ -130,4 +133,32 @@ private:
130
133
  RectProp *_rectProp;
131
134
  RectPropFromProps *_rectPropFromProps;
132
135
  };
136
+
137
+ class RectsProp : public DerivedProp<std::vector<SkRect>> {
138
+ public:
139
+ explicit RectsProp(PropId name,
140
+ const std::function<void(BaseNodeProp *)> &onChange)
141
+ : DerivedProp<std::vector<SkRect>>(onChange) {
142
+ _rectsProp = defineProperty<NodeProp>(name);
143
+ }
144
+
145
+ void updateDerivedValue() override {
146
+ if (_rectsProp->isSet()) {
147
+ auto rects = _rectsProp->value().getAsArray();
148
+ std::vector<SkRect> derivedRects;
149
+ derivedRects.reserve(rects.size());
150
+
151
+ for (size_t i = 0; i < rects.size(); ++i) {
152
+ derivedRects.push_back(*RectProp::processRect(rects[i]));
153
+ }
154
+ setDerivedValue(std::move(derivedRects));
155
+ } else {
156
+ setDerivedValue(nullptr);
157
+ }
158
+ }
159
+
160
+ private:
161
+ NodeProp *_rectsProp;
162
+ };
163
+
133
164
  } // namespace RNSkia
@@ -0,0 +1,23 @@
1
+ /*
2
+ * Copyright 2023 Google LLC
3
+ *
4
+ * Use of this source code is governed by a BSD-style license that can be
5
+ * found in the LICENSE file.
6
+ */
7
+ #ifndef AHardwareBufferUtils_DEFINED
8
+ #define AHardwareBufferUtils_DEFINED
9
+
10
+ #include "include/core/SkColorType.h"
11
+ #include "include/core/SkTypes.h"
12
+
13
+ #if __ANDROID_API__ >= 26
14
+
15
+ namespace AHardwareBufferUtils {
16
+
17
+ SkColorType GetSkColorTypeFromBufferFormat(uint32_t bufferFormat);
18
+
19
+ } // namespace AHardwareBufferUtils
20
+
21
+ #endif
22
+
23
+ #endif // AHardwareBufferUtils_DEFINED
@@ -22,6 +22,8 @@ extern "C" {
22
22
 
23
23
  namespace GrAHardwareBufferUtils {
24
24
 
25
+ // TODO: remove this function once Android has been updated to call the AHardwareBufferUtils
26
+ // version
25
27
  SkColorType GetSkColorTypeFromBufferFormat(uint32_t bufferFormat);
26
28
 
27
29
  #if !defined(SK_DISABLE_LEGACY_ANDROID_HW_UTILS)
@@ -0,0 +1,59 @@
1
+ /*
2
+ * Copyright 2023 Google LLC
3
+ *
4
+ * Use of this source code is governed by a BSD-style license that can be
5
+ * found in the LICENSE file.
6
+ */
7
+
8
+ #ifndef SurfaceAndroid_DEFINED
9
+ #define SurfaceAndroid_DEFINED
10
+
11
+ #include "include/core/SkRefCnt.h"
12
+
13
+ struct AHardwareBuffer;
14
+ class SkColorSpace;
15
+ class SkSurface;
16
+ class SkSurfaceProps;
17
+
18
+ namespace skgpu::graphite {
19
+ class Recorder;
20
+ }
21
+
22
+ namespace SkSurfaces {
23
+
24
+ using ReleaseContext = void*;
25
+ using BufferReleaseProc = void (*)(ReleaseContext);
26
+
27
+ /** Private; only to be used by Android Framework.
28
+ Creates an SkSurface from an Android hardware buffer.
29
+
30
+ Upon success bufferReleaseProc is called when it is safe to delete the buffer in the
31
+ backend API (accounting only for use of the buffer by this surface). If SkSurface creation
32
+ fails bufferReleaseProc is called before this function returns.
33
+
34
+ Currently this is only supported for buffers that can be textured as well as rendered to.
35
+ In other words the buffer must have both AHARDWAREBUFFER_USAGE_GPU_COLOR_OUTPUT and
36
+ AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE usage bits.
37
+
38
+ @param recorder the applicable Graphite recorder
39
+ @param hardwareBuffer an Android hardware buffer
40
+ @param colorSpace range of colors; may be nullptr
41
+ @param surfaceProps LCD striping orientation and setting for device independent
42
+ fonts; may be nullptr
43
+ @param bufferReleaseProc function called when the buffer can be released
44
+ @param ReleaseContext state passed to bufferReleaseProc
45
+ @param fromWindow Whether or not the AHardwareBuffer is part of an Android Window.
46
+ Currently only used with Vulkan backend.
47
+ @return created SkSurface, or nullptr
48
+ */
49
+ SK_API sk_sp<SkSurface> WrapAndroidHardwareBuffer(skgpu::graphite::Recorder* recorder,
50
+ AHardwareBuffer* hardwareBuffer,
51
+ sk_sp<SkColorSpace> colorSpace,
52
+ const SkSurfaceProps* surfaceProps,
53
+ BufferReleaseProc = nullptr,
54
+ ReleaseContext = nullptr,
55
+ bool fromWindow = false);
56
+
57
+ } // namespace SkSurfaces
58
+
59
+ #endif // SurfaceAndroid_DEFINED
@@ -35,7 +35,7 @@ SK_API std::unique_ptr<SkCodec> Decode(sk_sp<SkData>,
35
35
  SkCodec::Result*,
36
36
  SkCodecs::DecodeContext = nullptr);
37
37
 
38
- inline SkCodecs::Decoder Decoder() {
38
+ inline constexpr SkCodecs::Decoder Decoder() {
39
39
  return { "avif", IsAvif, Decode };
40
40
  }
41
41
 
@@ -35,7 +35,7 @@ SK_API std::unique_ptr<SkCodec> Decode(sk_sp<SkData>,
35
35
  SkCodec::Result*,
36
36
  SkCodecs::DecodeContext = nullptr);
37
37
 
38
- inline SkCodecs::Decoder Decoder() {
38
+ inline constexpr SkCodecs::Decoder Decoder() {
39
39
  return { "bmp", IsBmp, Decode };
40
40
  }
41
41
 
@@ -14,6 +14,7 @@
14
14
  #include "include/core/SkRect.h"
15
15
  #include "include/core/SkRefCnt.h"
16
16
  #include "include/core/SkSize.h"
17
+ #include "include/core/SkSpan.h"
17
18
  #include "include/core/SkTypes.h"
18
19
  #include "include/core/SkYUVAPixmaps.h"
19
20
  #include "include/private/SkEncodedInfo.h"
@@ -23,7 +24,7 @@
23
24
  #include <cstddef>
24
25
  #include <functional>
25
26
  #include <memory>
26
- #include <string>
27
+ #include <string_view>
27
28
  #include <tuple>
28
29
  #include <vector>
29
30
 
@@ -46,6 +47,10 @@ namespace DM {
46
47
  class CodecSrc;
47
48
  } // namespace DM
48
49
 
50
+ namespace SkCodecs {
51
+ struct Decoder;
52
+ }
53
+
49
54
  /**
50
55
  * Abstraction layer directly on top of an image codec.
51
56
  */
@@ -175,7 +180,15 @@ public:
175
180
  * SkCodec takes ownership of it, and will delete it when done with it.
176
181
  */
177
182
  static std::unique_ptr<SkCodec> MakeFromStream(
178
- std::unique_ptr<SkStream>, Result* = nullptr,
183
+ std::unique_ptr<SkStream>,
184
+ SkSpan<const SkCodecs::Decoder> decoders,
185
+ Result* = nullptr,
186
+ SkPngChunkReader* = nullptr,
187
+ SelectionPolicy selectionPolicy = SelectionPolicy::kPreferStillImage);
188
+ // deprecated
189
+ static std::unique_ptr<SkCodec> MakeFromStream(
190
+ std::unique_ptr<SkStream>,
191
+ Result* = nullptr,
179
192
  SkPngChunkReader* = nullptr,
180
193
  SelectionPolicy selectionPolicy = SelectionPolicy::kPreferStillImage);
181
194
 
@@ -195,6 +208,10 @@ public:
195
208
  * If the PNG does not contain unknown chunks, the SkPngChunkReader
196
209
  * will not be used or modified.
197
210
  */
211
+ static std::unique_ptr<SkCodec> MakeFromData(sk_sp<SkData>,
212
+ SkSpan<const SkCodecs::Decoder> decoders,
213
+ SkPngChunkReader* = nullptr);
214
+ // deprecated
198
215
  static std::unique_ptr<SkCodec> MakeFromData(sk_sp<SkData>, SkPngChunkReader* = nullptr);
199
216
 
200
217
  virtual ~SkCodec();
@@ -1012,6 +1029,7 @@ private:
1012
1029
  friend class SkSampledCodec;
1013
1030
  friend class SkIcoCodec;
1014
1031
  friend class SkAndroidCodec; // for fEncodedInfo
1032
+ friend class SkPDFBitmap; // for fEncodedInfo
1015
1033
  };
1016
1034
 
1017
1035
  namespace SkCodecs {
@@ -1025,7 +1043,7 @@ using MakeFromStreamCallback = std::unique_ptr<SkCodec> (*)(std::unique_ptr<SkSt
1025
1043
  struct SK_API Decoder {
1026
1044
  // By convention, we use all lowercase letters and go with the primary filename extension.
1027
1045
  // For example "png", "jpg", "ico", "webp", etc
1028
- std::string id;
1046
+ std::string_view id;
1029
1047
  IsFormatCallback isFormat;
1030
1048
  MakeFromStreamCallback makeFromStream;
1031
1049
  };
@@ -35,7 +35,7 @@ SK_API std::unique_ptr<SkCodec> Decode(sk_sp<SkData>,
35
35
  SkCodec::Result*,
36
36
  SkCodecs::DecodeContext = nullptr);
37
37
 
38
- inline SkCodecs::Decoder Decoder() {
38
+ inline constexpr SkCodecs::Decoder Decoder() {
39
39
  return { "gif", IsGif, Decode };
40
40
  }
41
41
 
@@ -35,7 +35,7 @@ SK_API std::unique_ptr<SkCodec> Decode(sk_sp<SkData>,
35
35
  SkCodec::Result*,
36
36
  SkCodecs::DecodeContext = nullptr);
37
37
 
38
- inline SkCodecs::Decoder Decoder() {
38
+ inline constexpr SkCodecs::Decoder Decoder() {
39
39
  return { "ico", IsIco, Decode };
40
40
  }
41
41
 
@@ -35,7 +35,7 @@ SK_API std::unique_ptr<SkCodec> Decode(sk_sp<SkData>,
35
35
  SkCodec::Result*,
36
36
  SkCodecs::DecodeContext = nullptr);
37
37
 
38
- inline SkCodecs::Decoder Decoder() {
38
+ inline constexpr SkCodecs::Decoder Decoder() {
39
39
  return { "jpeg", IsJpeg, Decode };
40
40
  }
41
41
 
@@ -35,7 +35,7 @@ SK_API std::unique_ptr<SkCodec> Decode(sk_sp<SkData>,
35
35
  SkCodec::Result*,
36
36
  SkCodecs::DecodeContext = nullptr);
37
37
 
38
- inline SkCodecs::Decoder Decoder() {
38
+ inline constexpr SkCodecs::Decoder Decoder() {
39
39
  return { "jpegxl", IsJpegxl, Decode };
40
40
  }
41
41
 
@@ -35,7 +35,7 @@ SK_API std::unique_ptr<SkCodec> Decode(sk_sp<SkData>,
35
35
  SkCodec::Result*,
36
36
  SkCodecs::DecodeContext = nullptr);
37
37
 
38
- inline SkCodecs::Decoder Decoder() {
38
+ inline constexpr SkCodecs::Decoder Decoder() {
39
39
  return { "png", IsPng, Decode };
40
40
  }
41
41
 
@@ -41,7 +41,7 @@ SK_API std::unique_ptr<SkCodec> Decode(sk_sp<SkData>,
41
41
  SkCodecs::DecodeContext = nullptr);
42
42
 
43
43
  // This decoder will always be checked last, no matter when it is registered.
44
- inline SkCodecs::Decoder Decoder() {
44
+ inline constexpr SkCodecs::Decoder Decoder() {
45
45
  return { "raw", IsRaw, Decode };
46
46
  }
47
47
 
@@ -35,7 +35,7 @@ SK_API std::unique_ptr<SkCodec> Decode(sk_sp<SkData>,
35
35
  SkCodec::Result*,
36
36
  SkCodecs::DecodeContext = nullptr);
37
37
 
38
- inline SkCodecs::Decoder Decoder() {
38
+ inline constexpr SkCodecs::Decoder Decoder() {
39
39
  return { "wbmp", IsWbmp, Decode };
40
40
  }
41
41
 
@@ -35,7 +35,7 @@ SK_API std::unique_ptr<SkCodec> Decode(sk_sp<SkData>,
35
35
  SkCodec::Result*,
36
36
  SkCodecs::DecodeContext = nullptr);
37
37
 
38
- inline SkCodecs::Decoder Decoder() {
38
+ inline constexpr SkCodecs::Decoder Decoder() {
39
39
  return { "webp", IsWebp, Decode };
40
40
  }
41
41
 
@@ -94,6 +94,9 @@
94
94
  //#define SK_HISTOGRAM_EXACT_LINEAR(name, sample, value_max)
95
95
  //#define SK_HISTOGRAM_MEMORY_KB(name, sample)
96
96
 
97
+ // To use smaller but slower mipmap builder
98
+ //#define SK_USE_DRAWING_MIPMAP_DOWNSAMPLER
99
+
97
100
  /* Skia tries to make use of some non-standard C++ language extensions.
98
101
  By default, Skia provides msvc and clang/gcc versions of these macros.
99
102
  Skia consumers can provide their own definitions of these macros to
@@ -115,5 +118,4 @@
115
118
  */
116
119
  //#define SK_API __declspec(dllexport)
117
120
 
118
-
119
121
  #endif