@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
@@ -8,6 +8,7 @@
8
8
  #ifndef skgpu_graphite_Image_DEFINED
9
9
  #define skgpu_graphite_Image_DEFINED
10
10
 
11
+ #include "include/core/SkColorSpace.h"
11
12
  #include "include/core/SkImage.h"
12
13
  #include "include/core/SkRefCnt.h"
13
14
  #include "include/core/SkSpan.h"
@@ -45,7 +46,8 @@ using GraphitePromiseImageYUVAFulfillProc =
45
46
  using GraphitePromiseImageReleaseProc = void (*)(GraphitePromiseImageContext);
46
47
  using GraphitePromiseTextureReleaseProc = void (*)(GraphitePromiseTextureReleaseContext);
47
48
 
48
- /** Creates an SkImage from a GPU texture associated with the recorder.
49
+ /** Creates an SkImage from a GPU texture associated with the recorder. The client is still
50
+ responsible for managing the backend texture's lifetime.
49
51
 
50
52
  SkImage is returned if the format of backendTexture is recognized and supported.
51
53
  Recognized formats vary by GPU back-end.
@@ -63,57 +65,77 @@ using GraphitePromiseTextureReleaseProc = void (*)(GraphitePromiseTextureRelease
63
65
  BottomLeft
64
66
  @return created SkImage, or nullptr
65
67
  */
66
- SK_API sk_sp<SkImage> AdoptTextureFrom(skgpu::graphite::Recorder*,
67
- const skgpu::graphite::BackendTexture&,
68
+ SK_API sk_sp<SkImage> WrapTexture(skgpu::graphite::Recorder*,
69
+ const skgpu::graphite::BackendTexture&,
70
+ SkColorType colorType,
71
+ SkAlphaType alphaType,
72
+ sk_sp<SkColorSpace> colorSpace,
73
+ skgpu::Origin origin,
74
+ TextureReleaseProc = nullptr,
75
+ ReleaseContext = nullptr);
76
+
77
+ SK_API sk_sp<SkImage> WrapTexture(skgpu::graphite::Recorder*,
78
+ const skgpu::graphite::BackendTexture&,
79
+ SkColorType colorType,
80
+ SkAlphaType alphaType,
81
+ sk_sp<SkColorSpace> colorSpace,
82
+ TextureReleaseProc = nullptr,
83
+ ReleaseContext = nullptr);
84
+
85
+ #if !defined(SK_DISABLE_LEGACY_GRAPHITE_IMAGES)
86
+ inline sk_sp<SkImage> AdoptTextureFrom(skgpu::graphite::Recorder* recorder,
87
+ const skgpu::graphite::BackendTexture& tex,
68
88
  SkColorType colorType,
69
89
  SkAlphaType alphaType,
70
90
  sk_sp<SkColorSpace> colorSpace,
71
91
  skgpu::Origin origin,
72
- TextureReleaseProc = nullptr,
73
- ReleaseContext = nullptr);
92
+ TextureReleaseProc trProc = nullptr,
93
+ ReleaseContext ctx = nullptr) {
94
+ return WrapTexture(recorder, tex, colorType, alphaType, colorSpace, origin, trProc, ctx);
95
+ }
74
96
 
75
- SK_API sk_sp<SkImage> AdoptTextureFrom(skgpu::graphite::Recorder*,
76
- const skgpu::graphite::BackendTexture&,
97
+ inline sk_sp<SkImage> AdoptTextureFrom(skgpu::graphite::Recorder* recorder,
98
+ const skgpu::graphite::BackendTexture& tex,
77
99
  SkColorType colorType,
78
100
  SkAlphaType alphaType,
79
101
  sk_sp<SkColorSpace> colorSpace,
80
- TextureReleaseProc = nullptr,
81
- ReleaseContext = nullptr);
82
-
83
- /** Create a new SkImage that is very similar to an SkImage created by
84
- AdoptTextureFrom. The difference is that the caller need not have created the
85
- backend texture nor populated it with data when creating the image. Instead of passing a
86
- BackendTexture to the factory the client supplies a description of the texture consisting
87
- of dimensions, TextureInfo, SkColorInfo and Volatility.
88
-
89
- In general, 'fulfill' must return a BackendTexture that matches the properties
90
- provided at SkImage creation time. The BackendTexture must refer to a valid existing
91
- texture in the backend API context/device, and already be populated with data.
92
- The texture cannot be deleted until 'textureRelease' is called. 'textureRelease' will
93
- be called with the textureReleaseContext returned by 'fulfill'.
94
-
95
- Wrt when and how often the fulfill, imageRelease, and textureRelease callbacks will
96
- be called:
97
-
98
- For non-volatile promise images, 'fulfill' will be called at Context::insertRecording
99
- time. Regardless of whether 'fulfill' succeeded or failed, 'imageRelease' will always be
100
- called only once - when Skia will no longer try calling 'fulfill' to get a backend
101
- texture. If 'fulfill' failed (i.e., it didn't return a valid backend texture) then
102
- 'textureRelease' will never be called. If 'fulfill' was successful then
103
- 'textureRelease' will be called only once when the GPU is done with the contents of the
104
- promise image. This will usually occur during a Context::submit call but it could occur
105
- earlier due to error conditions. 'fulfill' can be called multiple times if the promise
106
- image is used in multiple recordings. If 'fulfill' fails, the insertRecording itself will
107
- fail. Subsequent insertRecording calls (with Recordings that use the promise image) will
108
- keep calling 'fulfill' until it succeeds.
109
-
110
- For volatile promise images, 'fulfill' will be called each time the Recording is inserted
111
- into a Context. Regardless of whether 'fulfill' succeeded or failed, 'imageRelease'
112
- will always be called only once just like the non-volatile case. If 'fulfill' fails at
113
- insertRecording-time, 'textureRelease' will never be called. If 'fulfill' was successful
114
- then a 'textureRelease' matching that 'fulfill' will be called when the GPU is done with
115
- the contents of the promise image. This will usually occur during a Context::submit call
116
- but it could occur earlier due to error conditions.
102
+ TextureReleaseProc trProc = nullptr,
103
+ ReleaseContext ctx = nullptr) {
104
+ return WrapTexture(recorder, tex, colorType, alphaType, colorSpace, trProc, ctx);
105
+ }
106
+ #endif
107
+
108
+ /** Create a new SkImage that is very similar to an SkImage created by WrapTexture. The difference
109
+ is that the caller need not have created the backend texture nor populated it with data when
110
+ creating the image. Instead of passing a BackendTexture to the factory the client supplies a
111
+ description of the texture consisting of dimensions, TextureInfo, SkColorInfo and Volatility.
112
+
113
+ In general, 'fulfill' must return a BackendTexture that matches the properties provided at
114
+ SkImage creation time. The BackendTexture must refer to a valid existing texture in the backend
115
+ API context/device, and already be populated with data. The texture cannot be deleted until
116
+ 'textureRelease' is called. 'textureRelease' will be called with the textureReleaseContext
117
+ returned by 'fulfill'.
118
+
119
+ Wrt when and how often the fulfill, imageRelease, and textureRelease callbacks will be called:
120
+
121
+ For non-volatile promise images, 'fulfill' will be called at Context::insertRecording time.
122
+ Regardless of whether 'fulfill' succeeded or failed, 'imageRelease' will always be called only
123
+ once - when Skia will no longer try calling 'fulfill' to get a backend texture. If 'fulfill'
124
+ failed (i.e., it didn't return a valid backend texture) then 'textureRelease' will never be
125
+ called. If 'fulfill' was successful then 'textureRelease' will be called only once when the GPU
126
+ is done with the contents of the promise image. This will usually occur during a Context::submit
127
+ call but it could occur earlier due to error conditions. 'fulfill' can be called multiple times
128
+ if the promise image is used in multiple recordings. If 'fulfill' fails, the insertRecording
129
+ itself will fail. Subsequent insertRecording calls (with Recordings that use the promise image)
130
+ will keep calling 'fulfill' until it succeeds.
131
+
132
+ For volatile promise images, 'fulfill' will be called each time the Recording is inserted into a
133
+ Context. Regardless of whether 'fulfill' succeeded or failed, 'imageRelease' will always be
134
+ called only once just like the non-volatile case. If 'fulfill' fails at insertRecording-time,
135
+ 'textureRelease' will never be called. If 'fulfill' was successful then a 'textureRelease'
136
+ matching that 'fulfill' will be called when the GPU is done with the contents of the promise
137
+ image. This will usually occur during a Context::submit call but it could occur earlier due to
138
+ error conditions.
117
139
 
118
140
  @param recorder the recorder that will capture the commands creating the image
119
141
  @param dimensions width & height of promised gpu texture
@@ -150,16 +172,16 @@ SK_API sk_sp<SkImage> PromiseTextureFrom(skgpu::graphite::Recorder*,
150
172
  GraphitePromiseImageContext);
151
173
 
152
174
  /** This is similar to 'PromiseTextureFrom' but it creates a GPU-backed SkImage from YUV[A] data.
153
- The source data may be planar (i.e. spread across multiple textures). In
154
- the extreme Y, U, V, and A are all in different planes and thus the image is specified by
155
- four textures. 'backendTextureInfo' describes the planar arrangement, texture formats,
156
- and conversion to RGB. Separate 'fulfill' and 'textureRelease' calls are made for each texture.
157
- Each texture has its own GraphitePromiseTextureContext. The GraphitePromiseImageReleaseProc
158
- will be made even on failure. 'textureContexts' has one entry for each of the up to four
159
- textures, as indicated by 'backendTextureInfo'. Currently the mipmapped property of
160
- 'backendTextureInfo' is ignored. However, in the near future it will be required that if it is
161
- kYes then the fulfillProc must return a mip mapped texture for each plane in order to
162
- successfully draw the image.
175
+ The source data may be planar (i.e. spread across multiple textures). In the extreme Y, U, V,
176
+ and A are all in different planes and thus the image is specified by four textures.
177
+ 'backendTextureInfo' describes the planar arrangement, texture formats, and conversion to RGB.
178
+ Separate 'fulfill' and 'textureRelease' calls are made for each texture. Each texture has its
179
+ own GraphitePromiseTextureContext. The GraphitePromiseImageReleaseProc will be made even on
180
+ failure. 'textureContexts' has one entry for each of the up to four textures, as indicated by
181
+ 'backendTextureInfo'. Currently the mipmapped property of 'backendTextureInfo' is ignored.
182
+ However, in the near future it will be required that if it is kYes then the fulfillProc must
183
+ return a mip mapped texture for each plane in order to successfully draw the image.
184
+
163
185
  @param recorder the recorder that will capture the commands creating the image
164
186
  @param backendTextureInfo info about the promised yuva gpu texture(s)
165
187
  @param imageColorSpace range of colors; may be nullptr
@@ -184,19 +206,19 @@ SK_API sk_sp<SkImage> PromiseTextureFromYUVA(skgpu::graphite::Recorder*,
184
206
  GraphitePromiseTextureContext textureContexts[]);
185
207
 
186
208
 
187
- /** Returns an SkImage backed by a Graphite texture, using the provided Recorder for creation
188
- and uploads if necessary. The returned SkImage respects the required image properties'
189
- mipmap setting for non-Graphite SkImages; i.e., if mipmapping is required, the backing
190
- Graphite texture will have allocated mip map levels.
209
+ /** Returns an SkImage backed by a Graphite texture, using the provided Recorder for creation and
210
+ uploads if necessary. The returned SkImage respects the required image properties' mipmap
211
+ setting for non-Graphite SkImages; i.e., if mipmapping is required, the backing Graphite texture
212
+ will have allocated mip map levels.
191
213
 
192
214
  It is assumed that MIP maps are always supported by the GPU.
193
215
 
194
- Returns original SkImage if the image is already Graphite-backed and the required mipmapping
195
- is compatible with the backing Graphite texture. If the required mipmapping is not
196
- compatible, nullptr will be returned.
216
+ Returns original SkImage if the image is already Graphite-backed and the required mipmapping is
217
+ compatible with the backing Graphite texture. If the required mipmapping is not compatible,
218
+ nullptr will be returned.
197
219
 
198
- Returns nullptr if no Recorder is provided, or if SkImage was created with another
199
- Recorder and work on that Recorder has not been submitted.
220
+ Returns nullptr if no Recorder is provided, or if SkImage was created with another Recorder and
221
+ work on that Recorder has not been submitted.
200
222
 
201
223
  @param Recorder the Recorder to use for storing commands
202
224
  @param RequiredProperties properties the returned SkImage must possess (e.g. mipmaps)
@@ -207,20 +229,19 @@ SK_API sk_sp<SkImage> TextureFromImage(skgpu::graphite::Recorder*,
207
229
  SkImage::RequiredProperties = {});
208
230
 
209
231
  inline sk_sp<SkImage> TextureFromImage(skgpu::graphite::Recorder* r,
210
- sk_sp<const SkImage> img,
232
+ const sk_sp<const SkImage>& img,
211
233
  SkImage::RequiredProperties props = {}) {
212
234
  return TextureFromImage(r, img.get(), props);
213
235
  }
214
236
 
215
237
  /** Creates SkImage from SkYUVAPixmaps.
216
238
 
217
- The image will remain planar with each plane converted to a texture using the passed
218
- Recorder.
239
+ The image will remain planar with each plane converted to a texture using the passed Recorder.
219
240
 
220
- SkYUVAPixmaps has a SkYUVAInfo which specifies the transformation from YUV to RGB.
221
- The SkColorSpace of the resulting RGB values is specified by imgColorSpace. This will
222
- be the SkColorSpace reported by the image and when drawn the RGB values will be converted
223
- from this space into the destination space (if the destination is tagged).
241
+ SkYUVAPixmaps has a SkYUVAInfo which specifies the transformation from YUV to RGB. The
242
+ SkColorSpace of the resulting RGB values is specified by imgColorSpace. This will be the
243
+ SkColorSpace reported by the image and when drawn the RGB values will be converted from this
244
+ space into the destination space (if the destination is tagged).
224
245
 
225
246
  This is only supported using the GPU backend and will fail if recorder is nullptr.
226
247
 
@@ -259,10 +280,10 @@ SK_API sk_sp<SkImage> TextureFromYUVATextures(
259
280
 
260
281
  /** Creates an SkImage from YUV[A] planar SkImages associated with the recorder.
261
282
 
262
- The images should have kGraphite type, and the result will be nullptr if any are not.
263
- The resulting SkImage will not take a ref on the given SkImages but will take a ref on
264
- the underlying TextureProxies. The releaseProcs, if any, for those Textures will be the
265
- ones set when the given SkImages were created.
283
+ The images should have kGraphite type, and the result will be nullptr if any are not. The
284
+ resulting SkImage will not take a ref on the given SkImages but will take a ref on the
285
+ underlying TextureProxies. The releaseProcs, if any, for those Textures will be the ones set
286
+ when the given SkImages were created.
266
287
 
267
288
  @param recorder The recorder.
268
289
  @param yuvaInfo Structure describing the YUVA format
@@ -297,19 +318,17 @@ SK_API sk_sp<SkImage> SubsetTextureFrom(skgpu::graphite::Recorder* recorder,
297
318
  SkImage::RequiredProperties props = {});
298
319
 
299
320
  /** Creates a filtered SkImage on the GPU. filter processes the src image, potentially changing
300
- color, position, and size. subset is the bounds of src that are processed
301
- by filter. clipBounds is the expected bounds of the filtered SkImage. outSubset
302
- is required storage for the actual bounds of the filtered SkImage. offset is
303
- required storage for translation of returned SkImage.
304
-
305
- Returns nullptr if SkImage could not be created. If nullptr is returned, outSubset
306
- and offset are undefined.
307
-
308
- Useful for animation of SkImageFilter that varies size from frame to frame.
309
- Returned SkImage is created larger than required by filter so that GPU texture
310
- can be reused with different sized effects. outSubset describes the valid bounds
311
- of GPU texture returned. offset translates the returned SkImage to keep subsequent
312
- animation frames aligned with respect to each other.
321
+ color, position, and size. subset is the bounds of src that are processed by filter. clipBounds
322
+ is the expected bounds of the filtered SkImage. outSubset is required storage for the actual
323
+ bounds of the filtered SkImage. offset is required storage for translation of returned SkImage.
324
+
325
+ Returns nullptr if SkImage could not be created. If nullptr is returned, outSubset and offset
326
+ are undefined.
327
+
328
+ Useful for animation of SkImageFilter that varies size from frame to frame. Returned SkImage is
329
+ created larger than required by filter so that GPU texture can be reused with different sized
330
+ effects. outSubset describes the valid bounds of GPU texture returned. offset translates the
331
+ returned SkImage to keep subsequent animation frames aligned with respect to each other.
313
332
 
314
333
  @param recorder the recorder in which the filtering operation is to be performed
315
334
  @param filter how SkImage is sampled when transformed
@@ -18,9 +18,11 @@
18
18
  #include <chrono>
19
19
  #include <vector>
20
20
 
21
+ struct AHardwareBuffer;
21
22
  class SkCanvas;
22
23
  struct SkImageInfo;
23
24
  class SkPixmap;
25
+ class SkTraceMemoryDump;
24
26
 
25
27
  namespace skgpu {
26
28
  class RefCntedCallback;
@@ -65,7 +67,7 @@ struct SK_API RecorderOptions final {
65
67
 
66
68
  sk_sp<ImageProvider> fImageProvider;
67
69
 
68
- const size_t kDefaultRecorderBudget = 256 * (1 << 20);
70
+ static constexpr size_t kDefaultRecorderBudget = 256 * (1 << 20);
69
71
  // What is the budget for GPU resources allocated and held by this Recorder.
70
72
  size_t fGpuBudgetInBytes = kDefaultRecorderBudget;
71
73
  };
@@ -79,6 +81,8 @@ public:
79
81
 
80
82
  ~Recorder();
81
83
 
84
+ BackendApi backend() const;
85
+
82
86
  std::unique_ptr<Recording> snap();
83
87
 
84
88
  ImageProvider* clientImageProvider() { return fClientImageProvider.get(); }
@@ -97,6 +101,14 @@ public:
97
101
  */
98
102
  BackendTexture createBackendTexture(SkISize dimensions, const TextureInfo&);
99
103
 
104
+ #ifdef SK_BUILD_FOR_ANDROID
105
+ BackendTexture createBackendTexture(AHardwareBuffer*,
106
+ bool isRenderable,
107
+ bool isProtectedContent,
108
+ SkISize dimensions,
109
+ bool fromAndroidWindow = false) const;
110
+ #endif
111
+
100
112
  /**
101
113
  * If possible, updates a backend texture with the provided pixmap data. The client
102
114
  * should check the return value to see if the update was successful. The client is required
@@ -154,6 +166,17 @@ public:
154
166
  */
155
167
  void performDeferredCleanup(std::chrono::milliseconds msNotUsed);
156
168
 
169
+ /**
170
+ * Returns the number of bytes of gpu memory currently budgeted in the Recorder's cache.
171
+ */
172
+ size_t currentBudgetedBytes() const;
173
+
174
+ /**
175
+ * Enumerates all cached GPU resources owned by the Recorder and dumps their memory to
176
+ * traceMemoryDump.
177
+ */
178
+ void dumpMemoryStatistics(SkTraceMemoryDump* traceMemoryDump) const;
179
+
157
180
  // Provides access to functions that aren't part of the public API.
158
181
  RecorderPriv priv();
159
182
  const RecorderPriv priv() const; // NOLINT(readability-const-return-type)
@@ -167,8 +190,6 @@ private:
167
190
 
168
191
  SingleOwner* singleOwner() const { return &fSingleOwner; }
169
192
 
170
- BackendApi backend() const;
171
-
172
193
  // We keep track of all Devices that are connected to a Recorder. This allows the client to
173
194
  // safely delete an SkSurface or a Recorder in any order. If the client deletes the Recorder
174
195
  // we need to notify all Devices that the Recorder is no longer valid. If we delete the
@@ -21,8 +21,11 @@ class Recorder;
21
21
  } // namespace skgpu::graphite
22
22
 
23
23
  namespace SkSurfaces {
24
+ using ReleaseContext = void*;
25
+ using TextureReleaseProc = void (*)(ReleaseContext);
26
+
24
27
  /**
25
- * The 'asImage' and 'makeImageCopy' API/entry points are currently only available for
28
+ * The 'AsImage' and 'AsImageCopy' API/entry points are currently only available for
26
29
  * Graphite.
27
30
  *
28
31
  * In this API, SkSurface no longer supports copy-on-write behavior. Instead, when creating
@@ -75,7 +78,9 @@ SK_API sk_sp<SkSurface> WrapBackendTexture(skgpu::graphite::Recorder*,
75
78
  const skgpu::graphite::BackendTexture&,
76
79
  SkColorType colorType,
77
80
  sk_sp<SkColorSpace> colorSpace,
78
- const SkSurfaceProps* props);
81
+ const SkSurfaceProps* props,
82
+ TextureReleaseProc = nullptr,
83
+ ReleaseContext = nullptr);
79
84
  } // namespace SkSurfaces
80
85
 
81
86
  #endif // skgpu_graphite_Surface_DEFINED
@@ -8,16 +8,55 @@
8
8
  #ifndef skgpu_graphite_DawnBackendContext_DEFINED
9
9
  #define skgpu_graphite_DawnBackendContext_DEFINED
10
10
 
11
- #include "webgpu/webgpu_cpp.h"
11
+ #include "include/core/SkTypes.h"
12
+ #include "webgpu/webgpu_cpp.h" // NO_G3_REWRITE
12
13
 
13
14
  namespace skgpu::graphite {
14
15
 
16
+ /**
17
+ * WebGPU needs to allow the main thread loop to run to detect GPU progress. Dawn native has a
18
+ * function wgpu::Dawn::Tick(), not present in WebGPU, that can be used to detect GPU progress.
19
+ *
20
+ * When compiling using Emscripten/WASM the -s ASYNCIFY option can be used to yield. E.g.:
21
+ *
22
+ * EM_ASYNC_JS(void, asyncSleep, (), {
23
+ * await new Promise((resolve, _) = > {
24
+ * setTimeout(resolve, 0);
25
+ * })
26
+ * });
27
+ *
28
+ * WebGPUTickFunction(wgpu::Device&) { asyncSleep(); }
29
+ *
30
+ * If no DawnTickFunction is provided then the graphite::Context will be "non-yielding". This
31
+ * implies the following restrictions on the Context:
32
+ *
33
+ * 1) SyncToCpu::kYes is disallowed as a parameter to Context::submit.
34
+ * 2) The client must guarantee that GPU work has completed before destroying Context as Context
35
+ * cannot await the work completion in its destructor. Context reports whether it is awaiting
36
+ * GPU work completion via Context::hasUnfinishedGpuWork().
37
+ *
38
+ * Using a non-yielding Context makes it possible to build and run Graphite/Dawn on WebGPU without
39
+ * -s ASYNCIFY.
40
+ */
41
+ using DawnTickFunction = void(const wgpu::Device& device);
42
+
43
+ #if !defined(__EMSCRIPTEN__)
44
+ SK_API inline void DawnNativeTickFunction(const wgpu::Device& device) { device.Tick(); }
45
+ #endif
46
+
15
47
  // The DawnBackendContext contains all of the base Dawn objects needed by the graphite Dawn
16
48
  // backend. The client will create this object and pass it into the Context::MakeDawn factory call
17
49
  // when setting up Skia.
18
50
  struct SK_API DawnBackendContext {
19
51
  wgpu::Device fDevice;
20
- wgpu::Queue fQueue;
52
+ wgpu::Queue fQueue;
53
+ // See comment on DawnTickFunction.
54
+ DawnTickFunction* fTick =
55
+ #if defined(__EMSCRIPTEN__)
56
+ nullptr;
57
+ #else
58
+ DawnNativeTickFunction;
59
+ #endif
21
60
  };
22
61
 
23
62
  } // namespace skgpu::graphite
@@ -9,7 +9,7 @@
9
9
  #define skgpu_graphite_DawnTypes_DEFINED
10
10
 
11
11
  #include "include/gpu/graphite/GraphiteTypes.h"
12
- #include "webgpu/webgpu_cpp.h"
12
+ #include "webgpu/webgpu_cpp.h" // NO_G3_REWRITE
13
13
 
14
14
  namespace skgpu::graphite {
15
15
 
@@ -18,19 +18,24 @@ struct DawnTextureInfo {
18
18
  Mipmapped fMipmapped = Mipmapped::kNo;
19
19
 
20
20
  // wgpu::TextureDescriptor properties
21
+ // `fFormat` for multiplanar formats corresponds to the plane TextureView's format.
21
22
  wgpu::TextureFormat fFormat = wgpu::TextureFormat::Undefined;
22
- wgpu::TextureUsage fUsage = wgpu::TextureUsage::None;
23
+ wgpu::TextureUsage fUsage = wgpu::TextureUsage::None;
24
+ // TODO(b/308944094): Migrate aspect information to BackendTextureViews.
25
+ wgpu::TextureAspect fAspect = wgpu::TextureAspect::All;
23
26
 
24
27
  DawnTextureInfo() = default;
25
28
  DawnTextureInfo(const wgpu::Texture& texture);
26
29
  DawnTextureInfo(uint32_t sampleCount,
27
30
  Mipmapped mipmapped,
28
- wgpu::TextureFormat format,
29
- wgpu::TextureUsage usage)
31
+ wgpu::TextureFormat viewFormat,
32
+ wgpu::TextureUsage usage,
33
+ wgpu::TextureAspect aspect)
30
34
  : fSampleCount(sampleCount)
31
35
  , fMipmapped(mipmapped)
32
- , fFormat(format)
33
- , fUsage(usage) {}
36
+ , fFormat(viewFormat)
37
+ , fUsage(usage)
38
+ , fAspect(aspect) {}
34
39
  };
35
40
 
36
41
  } // namespace skgpu::graphite
@@ -35,7 +35,6 @@ namespace skgpu::graphite {
35
35
  using MtlPixelFormat = unsigned int;
36
36
  using MtlTextureUsage = unsigned int;
37
37
  using MtlStorageMode = unsigned int;
38
- using MtlHandle = const void*;
39
38
 
40
39
  struct MtlTextureInfo {
41
40
  uint32_t fSampleCount = 1;
@@ -49,7 +48,7 @@ struct MtlTextureInfo {
49
48
  bool fFramebufferOnly = false;
50
49
 
51
50
  MtlTextureInfo() = default;
52
- MtlTextureInfo(MtlHandle mtlTexture);
51
+ MtlTextureInfo(CFTypeRef mtlTexture);
53
52
  MtlTextureInfo(uint32_t sampleCount,
54
53
  skgpu::Mipmapped mipmapped,
55
54
  MtlPixelFormat format,
@@ -33,10 +33,8 @@ struct VulkanTextureInfo {
33
33
  // However, if the VkImage is a Ycbcr format, the client can pass a specific plan here to have
34
34
  // Skia directly sample a plane. In that case the client should also pass in a VkFormat that is
35
35
  // compatible with the plane as described by the Vulkan spec.
36
- VkImageAspectFlags fAspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
37
- // TODO: Either Make the ycbcr conversion info shareable with Ganesh or add a version for
38
- // Graphite.
39
- // GrVkYcbcrConversionInfo fYcbcrConversionInfo;
36
+ VkImageAspectFlags fAspectMask = VK_IMAGE_ASPECT_COLOR_BIT;
37
+ VulkanYcbcrConversionInfo fYcbcrConversionInfo;
40
38
 
41
39
  VulkanTextureInfo() = default;
42
40
  VulkanTextureInfo(uint32_t sampleCount,
@@ -46,7 +44,8 @@ struct VulkanTextureInfo {
46
44
  VkImageTiling imageTiling,
47
45
  VkImageUsageFlags imageUsageFlags,
48
46
  VkSharingMode sharingMode,
49
- VkImageAspectFlags aspectMask)
47
+ VkImageAspectFlags aspectMask,
48
+ VulkanYcbcrConversionInfo ycbcrConversionInfo)
50
49
  : fSampleCount(sampleCount)
51
50
  , fMipmapped(mipmapped)
52
51
  , fFlags(flags)
@@ -54,7 +53,8 @@ struct VulkanTextureInfo {
54
53
  , fImageTiling(imageTiling)
55
54
  , fImageUsageFlags(imageUsageFlags)
56
55
  , fSharingMode(sharingMode)
57
- , fAspectMask(aspectMask) {}
56
+ , fAspectMask(aspectMask)
57
+ , fYcbcrConversionInfo(ycbcrConversionInfo) {}
58
58
  };
59
59
 
60
60
  } // namespace skgpu::graphite
@@ -121,6 +121,7 @@ struct GrMockOptions {
121
121
  fConfigOptions[(int)GrColorType::kRGBA_8888].fTexturable = true;
122
122
  fConfigOptions[(int)GrColorType::kAlpha_8].fTexturable = true;
123
123
  fConfigOptions[(int)GrColorType::kBGR_565].fTexturable = true;
124
+ fConfigOptions[(int)GrColorType::kRGB_565].fTexturable = true;
124
125
 
125
126
  fConfigOptions[(int)GrColorType::kBGRA_8888] = fConfigOptions[(int)GrColorType::kRGBA_8888];
126
127
 
@@ -30,7 +30,7 @@ enum GrVkFeatureFlags {
30
30
  kSampleRateShading_GrVkFeatureFlag = 0x0004,
31
31
  };
32
32
 
33
- // It is not guarenteed VkPhysicalDeviceProperties2 will be in the client's header so we forward
33
+ // It is not guaranteed VkPhysicalDeviceProperties2 will be in the client's header so we forward
34
34
  // declare it here to be safe.
35
35
  struct VkPhysicalDeviceFeatures2;
36
36
 
@@ -14,50 +14,7 @@
14
14
 
15
15
  using GrVkBackendMemory = skgpu::VulkanBackendMemory;
16
16
  using GrVkAlloc = skgpu::VulkanAlloc;
17
-
18
- // This struct is used to pass in the necessary information to create a VkSamplerYcbcrConversion
19
- // object for an VkExternalFormatANDROID.
20
- struct GrVkYcbcrConversionInfo {
21
- bool operator==(const GrVkYcbcrConversionInfo& that) const {
22
- // Invalid objects are not required to have all other fields initialized or matching.
23
- if (!this->isValid() && !that.isValid()) {
24
- return true;
25
- }
26
- return this->fFormat == that.fFormat &&
27
- this->fExternalFormat == that.fExternalFormat &&
28
- this->fYcbcrModel == that.fYcbcrModel &&
29
- this->fYcbcrRange == that.fYcbcrRange &&
30
- this->fXChromaOffset == that.fXChromaOffset &&
31
- this->fYChromaOffset == that.fYChromaOffset &&
32
- this->fChromaFilter == that.fChromaFilter &&
33
- this->fForceExplicitReconstruction == that.fForceExplicitReconstruction;
34
- }
35
- bool operator!=(const GrVkYcbcrConversionInfo& that) const { return !(*this == that); }
36
-
37
- bool isValid() const {
38
- return fYcbcrModel != VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY ||
39
- fExternalFormat != 0;
40
- }
41
-
42
- // Format of the source image. Must be set to VK_FORMAT_UNDEFINED for external images or
43
- // a valid image format otherwise.
44
- VkFormat fFormat = VK_FORMAT_UNDEFINED;
45
-
46
- // The external format. Must be non-zero for external images, zero otherwise.
47
- // Should be compatible to be used in a VkExternalFormatANDROID struct.
48
- uint64_t fExternalFormat = 0;
49
-
50
- VkSamplerYcbcrModelConversion fYcbcrModel = VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY;
51
- VkSamplerYcbcrRange fYcbcrRange = VK_SAMPLER_YCBCR_RANGE_ITU_FULL;
52
- VkChromaLocation fXChromaOffset = VK_CHROMA_LOCATION_COSITED_EVEN;
53
- VkChromaLocation fYChromaOffset = VK_CHROMA_LOCATION_COSITED_EVEN;
54
- VkFilter fChromaFilter = VK_FILTER_NEAREST;
55
- VkBool32 fForceExplicitReconstruction = false;
56
-
57
- // For external images format features here should be those returned by a call to
58
- // vkAndroidHardwareBufferFormatPropertiesANDROID
59
- VkFormatFeatureFlags fFormatFeatures = 0;
60
- };
17
+ using GrVkYcbcrConversionInfo = skgpu::VulkanYcbcrConversionInfo;
61
18
 
62
19
  /*
63
20
  * When wrapping a GrBackendTexture or GrBackendRendenderTarget, the fCurrentQueueFamily should
@@ -57,7 +57,7 @@ public:
57
57
  #endif
58
58
 
59
59
  private:
60
- void getSpecVersions(VulkanGetProc getProc, VkInstance, VkPhysicalDevice);
60
+ void getSpecVersions(const VulkanGetProc& getProc, VkInstance, VkPhysicalDevice);
61
61
 
62
62
  skia_private::TArray<Info> fExtensions;
63
63
  };
@@ -0,0 +1,25 @@
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 skgpu_VulkanMutableTextureState_DEFINED
9
+ #define skgpu_VulkanMutableTextureState_DEFINED
10
+
11
+ #include "include/gpu/MutableTextureState.h"
12
+ #include "include/private/gpu/vk/SkiaVulkan.h"
13
+
14
+ #include <cstdint>
15
+
16
+ namespace skgpu::MutableTextureStates {
17
+ MutableTextureState MakeVulkan(VkImageLayout layout, uint32_t queueFamilyIndex);
18
+
19
+ VkImageLayout GetVkImageLayout(const MutableTextureState& state);
20
+ VkImageLayout GetVkImageLayout(const MutableTextureState* state);
21
+ uint32_t GetVkQueueFamilyIndex(const MutableTextureState& state);
22
+ uint32_t GetVkQueueFamilyIndex(const MutableTextureState* state);
23
+ }
24
+
25
+ #endif