@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
@@ -24,6 +24,7 @@
24
24
 
25
25
  class SkData;
26
26
  class SkDescriptor;
27
+ class SkFontMgr;
27
28
  class SkFontDescriptor;
28
29
  class SkScalerContext;
29
30
  class SkStream;
@@ -36,10 +37,6 @@ struct SkScalerContextRec;
36
37
 
37
38
  using SkTypefaceID = uint32_t;
38
39
 
39
- // SkFontID is deprecated, please use SkTypefaceID.
40
- using SkFontID = SkTypefaceID;
41
-
42
-
43
40
  /** Machine endian. */
44
41
  typedef uint32_t SkFontTableTag;
45
42
 
@@ -103,46 +100,13 @@ public:
103
100
  */
104
101
  SkTypefaceID uniqueID() const { return fUniqueID; }
105
102
 
106
- /** Return the uniqueID for the specified typeface. If the face is null,
107
- resolve it to the default font and return its uniqueID. Will never
108
- return 0.
109
- */
110
- static SkTypefaceID UniqueID(const SkTypeface* face);
111
-
112
103
  /** Returns true if the two typefaces reference the same underlying font,
113
- handling either being null (treating null as the default font)
104
+ handling either being null (treating null as not equal to any font).
114
105
  */
115
106
  static bool Equal(const SkTypeface* facea, const SkTypeface* faceb);
116
107
 
117
- /** Returns the default normal typeface, which is never nullptr. */
118
- static sk_sp<SkTypeface> MakeDefault();
119
-
120
- /** Creates a new reference to the typeface that most closely matches the
121
- requested familyName and fontStyle. This method allows extended font
122
- face specifiers as in the SkFontStyle type. Will never return null.
123
-
124
- @param familyName May be NULL. The name of the font family.
125
- @param fontStyle The style of the typeface.
126
- @return reference to the closest-matching typeface. Call must call
127
- unref() when they are done.
128
- */
129
- static sk_sp<SkTypeface> MakeFromName(const char familyName[], SkFontStyle fontStyle);
130
-
131
- /** Return a new typeface given a file. If the file does not exist, or is
132
- not a valid font file, returns nullptr.
133
- */
134
- static sk_sp<SkTypeface> MakeFromFile(const char path[], int index = 0);
135
-
136
- /** Return a new typeface given a stream. If the stream is
137
- not a valid font file, returns nullptr. Ownership of the stream is
138
- transferred, so the caller must not reference it again.
139
- */
140
- static sk_sp<SkTypeface> MakeFromStream(std::unique_ptr<SkStreamAsset> stream, int index = 0);
141
-
142
- /** Return a new typeface given a SkData. If the data is null, or is not a valid font file,
143
- * returns nullptr.
144
- */
145
- static sk_sp<SkTypeface> MakeFromData(sk_sp<SkData>, int index = 0);
108
+ /** Returns a non-null typeface which contains no glyphs. */
109
+ static sk_sp<SkTypeface> MakeEmpty();
146
110
 
147
111
  /** Return a new typeface based on this typeface but parameterized as specified in the
148
112
  SkFontArguments. If the SkFontArguments does not supply an argument for a parameter
@@ -177,9 +141,11 @@ public:
177
141
  /** Given the data previously written by serialize(), return a new instance
178
142
  of a typeface referring to the same font. If that font is not available,
179
143
  return nullptr.
144
+ Goes through all registered typeface factories and lastResortMgr (if non-null).
180
145
  Does not affect ownership of SkStream.
181
146
  */
182
- static sk_sp<SkTypeface> MakeDeserialize(SkStream*);
147
+
148
+ static sk_sp<SkTypeface> MakeDeserialize(SkStream*, sk_sp<SkFontMgr> lastResortMgr);
183
149
 
184
150
  /**
185
151
  * Given an array of UTF32 character codes, return their corresponding glyph IDs.
@@ -454,21 +420,7 @@ private:
454
420
  friend class SkRandomTypeface; // getAdvancedMetrics
455
421
  friend class SkPDFFont; // getAdvancedMetrics
456
422
 
457
- /** Style specifies the intrinsic style attributes of a given typeface */
458
- enum Style {
459
- kNormal = 0,
460
- kBold = 0x01,
461
- kItalic = 0x02,
462
-
463
- // helpers
464
- kBoldItalic = 0x03
465
- };
466
- static SkFontStyle FromOldStyle(Style oldStyle);
467
- static SkTypeface* GetDefaultTypeface(Style style = SkTypeface::kNormal);
468
-
469
- friend class SkFontPriv; // GetDefaultTypeface
470
- friend class SkPaintPriv; // GetDefaultTypeface
471
- friend class SkFont; // getGlyphToUnicodeMap
423
+ friend class SkFontPriv; // getGlyphToUnicodeMap
472
424
 
473
425
  private:
474
426
  SkTypefaceID fUniqueID;
@@ -86,6 +86,14 @@
86
86
  #define SK_GAMMA_EXPONENT (0.0f) // SRGB
87
87
  #endif
88
88
 
89
+ #if !defined(SK_GAMMA_CONTRAST)
90
+ // A value of 0.5 for SK_GAMMA_CONTRAST appears to be a good compromise.
91
+ // With lower values small text appears washed out (though correctly so).
92
+ // With higher values lcd fringing is worse and the smoothing effect of
93
+ // partial coverage is diminished.
94
+ #define SK_GAMMA_CONTRAST (0.5f)
95
+ #endif
96
+
89
97
  #if defined(SK_HISTOGRAM_ENUMERATION) || \
90
98
  defined(SK_HISTOGRAM_BOOLEAN) || \
91
99
  defined(SK_HISTOGRAM_EXACT_LINEAR) || \
@@ -61,7 +61,7 @@ public:
61
61
  kHasTexCoords_BuilderFlag = 1 << 0,
62
62
  kHasColors_BuilderFlag = 1 << 1,
63
63
  };
64
- class Builder {
64
+ class SK_API Builder {
65
65
  public:
66
66
  Builder(VertexMode mode, int vertexCount, int indexCount, uint32_t flags);
67
67
 
@@ -0,0 +1,53 @@
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 SkMultiPictureDocument_DEFINED
9
+ #define SkMultiPictureDocument_DEFINED
10
+
11
+ #include "include/core/SkPicture.h"
12
+ #include "include/core/SkRefCnt.h"
13
+ #include "include/core/SkSize.h"
14
+ #include "include/core/SkTypes.h"
15
+
16
+ #include <functional>
17
+
18
+ class SkDocument;
19
+ class SkStreamSeekable;
20
+ class SkWStream;
21
+ struct SkDeserialProcs;
22
+ struct SkSerialProcs;
23
+
24
+ struct SkDocumentPage {
25
+ sk_sp<SkPicture> fPicture;
26
+ SkSize fSize;
27
+ };
28
+
29
+ namespace SkMultiPictureDocument {
30
+ /**
31
+ * Writes into a file format that is similar to SkPicture::serialize()
32
+ * Accepts a callback for endPage behavior
33
+ */
34
+ SK_API sk_sp<SkDocument> Make(SkWStream* dst, const SkSerialProcs* = nullptr,
35
+ std::function<void(const SkPicture*)> onEndPage = nullptr);
36
+
37
+ /**
38
+ * Returns the number of pages in the SkMultiPictureDocument.
39
+ */
40
+ SK_API int ReadPageCount(SkStreamSeekable* src);
41
+
42
+ /**
43
+ * Read the SkMultiPictureDocument into the provided array of pages.
44
+ * dstArrayCount must equal SkMultiPictureDocumentReadPageCount().
45
+ * Return false on error.
46
+ */
47
+ SK_API bool Read(SkStreamSeekable* src,
48
+ SkDocumentPage* dstArray,
49
+ int dstArrayCount,
50
+ const SkDeserialProcs* = nullptr);
51
+ } // namespace SkMultiPictureDocument
52
+
53
+ #endif // SkMultiPictureDocument_DEFINED
@@ -117,6 +117,12 @@ struct Metadata {
117
117
  */
118
118
  DateTime fModified = {0, 0, 0, 0, 0, 0, 0, 0};
119
119
 
120
+ /** The natural language of the text in the PDF. If fLang is empty, the root
121
+ StructureElementNode::fLang will be used (if not empty). Text not in
122
+ this language should be marked with StructureElementNode::fLang.
123
+ */
124
+ SkString fLang;
125
+
120
126
  /** The DPI (pixels-per-inch) at which features without native PDF support
121
127
  will be rasterized (e.g. draw image with perspective, draw text with
122
128
  perspective, ...) A larger DPI would create a PDF that reflects the
@@ -145,6 +151,11 @@ struct Metadata {
145
151
  */
146
152
  StructureElementNode* fStructureElementTreeRoot = nullptr;
147
153
 
154
+ enum class Outline : int {
155
+ None = 0,
156
+ StructureElementHeaders = 1,
157
+ } fOutline = Outline::None;
158
+
148
159
  /** Executor to handle threaded work within PDF Backend. If this is nullptr,
149
160
  then all work will be done serially on the main thread. To have worker
150
161
  threads assist with various tasks, set this to a valid SkExecutor
@@ -79,8 +79,17 @@ public:
79
79
  kSRGBLinear,
80
80
  kLab,
81
81
  kOKLab,
82
+ // This is the same as kOKLab, except it has a simplified version of the CSS gamut
83
+ // mapping algorithm (https://www.w3.org/TR/css-color-4/#css-gamut-mapping)
84
+ // into Rec2020 space applied to it.
85
+ // Warning: This space is experimental and should not be used in production.
86
+ kOKLabGamutMap,
82
87
  kLCH,
83
88
  kOKLCH,
89
+ // This is the same as kOKLCH, except it has the same gamut mapping applied to it
90
+ // as kOKLabGamutMap does.
91
+ // Warning: This space is experimental and should not be used in production.
92
+ kOKLCHGamutMap,
84
93
  kSRGB,
85
94
  kHSL,
86
95
  kHWB,
@@ -59,7 +59,7 @@ class Program;
59
59
  class SK_API SkRuntimeEffect : public SkRefCnt {
60
60
  public:
61
61
  // Reflected description of a uniform variable in the effect's SkSL
62
- struct Uniform {
62
+ struct SK_API Uniform {
63
63
  enum class Type {
64
64
  kFloat,
65
65
  kFloat2,
@@ -180,7 +180,7 @@ public:
180
180
  }
181
181
 
182
182
  // Object that allows passing a SkShader, SkColorFilter or SkBlender as a child
183
- class ChildPtr {
183
+ class SK_API ChildPtr {
184
184
  public:
185
185
  ChildPtr() = default;
186
186
  ChildPtr(sk_sp<SkShader> s) : fChild(std::move(s)) {}
@@ -305,11 +305,7 @@ private:
305
305
 
306
306
  const SkSL::RP::Program* getRPProgram(SkSL::DebugTracePriv* debugTrace) const;
307
307
 
308
- #if defined(SK_GANESH)
309
- friend class GrSkSLFP; // fBaseProgram, fSampleUsages
310
- friend class GrGLSLSkSLFP; //
311
- #endif
312
-
308
+ friend class GrSkSLFP; // usesColorTransform
313
309
  friend class SkRuntimeShader; // fBaseProgram, fMain, fSampleUsages, getRPProgram()
314
310
  friend class SkRuntimeBlender; //
315
311
  friend class SkRuntimeColorFilter; //
@@ -8,60 +8,41 @@
8
8
  #ifndef GrBackendSemaphore_DEFINED
9
9
  #define GrBackendSemaphore_DEFINED
10
10
 
11
- #include "include/gpu/GrTypes.h"
12
-
13
- #include "include/gpu/gl/GrGLTypes.h"
11
+ #include "include/gpu/GrTypes.h" // IWYU pragma: keep
12
+ #include "include/private/base/SkAPI.h"
13
+ #include "include/private/base/SkAnySubclass.h"
14
14
 
15
15
  #ifdef SK_METAL
16
16
  #include "include/gpu/mtl/GrMtlTypes.h"
17
17
  #endif
18
18
 
19
- #ifdef SK_VULKAN
20
- #include "include/gpu/vk/GrVkTypes.h"
19
+ #if defined(SK_VULKAN) && !defined(SK_DISABLE_LEGACY_VULKAN_BACKENDSEMAPHORE)
20
+ #include "include/private/gpu/vk/SkiaVulkan.h"
21
21
  #endif
22
22
 
23
23
  #ifdef SK_DIRECT3D
24
24
  #include "include/private/gpu/ganesh/GrD3DTypesMinimal.h"
25
25
  #endif
26
26
 
27
+ #include <cstddef>
28
+
29
+ class GrBackendSemaphoreData;
30
+
27
31
  /**
28
32
  * Wrapper class for passing into and receiving data from Ganesh about a backend semaphore object.
29
33
  */
30
- class GrBackendSemaphore {
34
+ class SK_API GrBackendSemaphore {
31
35
  public:
32
- // For convenience we just set the backend here to OpenGL. The GrBackendSemaphore cannot be used
33
- // until either init* is called, which will set the appropriate GrBackend.
34
- GrBackendSemaphore()
35
- : fBackend(GrBackendApi::kOpenGL), fGLSync(nullptr), fIsInitialized(false) {}
36
-
37
- #ifdef SK_DIRECT3D
38
- // We only need to specify these if Direct3D is enabled, because it requires special copy
39
- // characteristics.
36
+ // The GrBackendSemaphore cannot be used until either init* is called, which will set the
37
+ // appropriate GrBackend.
38
+ GrBackendSemaphore();
40
39
  ~GrBackendSemaphore();
41
40
  GrBackendSemaphore(const GrBackendSemaphore&);
42
41
  GrBackendSemaphore& operator=(const GrBackendSemaphore&);
43
- #endif
44
-
45
- void initGL(GrGLsync sync) {
46
- fBackend = GrBackendApi::kOpenGL;
47
- fGLSync = sync;
48
- fIsInitialized = true;
49
- }
50
-
51
- #ifdef SK_VULKAN
52
- void initVulkan(VkSemaphore semaphore) {
53
- fBackend = GrBackendApi::kVulkan;
54
- fVkSemaphore = semaphore;
55
-
56
- fIsInitialized = true;
57
- }
58
42
 
59
- VkSemaphore vkSemaphore() const {
60
- if (!fIsInitialized || GrBackendApi::kVulkan != fBackend) {
61
- return VK_NULL_HANDLE;
62
- }
63
- return fVkSemaphore;
64
- }
43
+ #if defined(SK_VULKAN) && !defined(SK_DISABLE_LEGACY_VULKAN_BACKENDSEMAPHORE)
44
+ void initVulkan(VkSemaphore semaphore);
45
+ VkSemaphore vkSemaphore() const;
65
46
  #endif
66
47
 
67
48
  #ifdef SK_METAL
@@ -100,30 +81,35 @@ public:
100
81
  #endif
101
82
 
102
83
  bool isInitialized() const { return fIsInitialized; }
103
-
104
- GrGLsync glSync() const {
105
- if (!fIsInitialized || GrBackendApi::kOpenGL != fBackend) {
106
- return nullptr;
107
- }
108
- return fGLSync;
109
- }
110
-
84
+ GrBackendApi backend() const { return fBackend; }
111
85
 
112
86
  #ifdef SK_DIRECT3D
113
87
  bool getD3DFenceInfo(GrD3DFenceInfo* outInfo) const;
114
88
  #endif
115
89
 
116
90
  private:
91
+ friend class GrBackendSemaphorePriv;
92
+ friend class GrBackendSemaphoreData;
93
+ // Size determined by looking at the GrBackendSemaphoreData subclasses, then
94
+ // guessing-and-checking. Compiler will complain if this is too small - in that case,
95
+ // just increase the number.
96
+ inline constexpr static size_t kMaxSubclassSize = 16;
97
+ using AnySemaphoreData = SkAnySubclass<GrBackendSemaphoreData, kMaxSubclassSize>;
98
+
99
+ template <typename SemaphoreData>
100
+ GrBackendSemaphore(GrBackendApi api, SemaphoreData data) : fBackend(api), fIsInitialized(true) {
101
+ fSemaphoreData.emplace<SemaphoreData>(data);
102
+ }
103
+
117
104
  #ifdef SK_DIRECT3D
118
105
  void assignD3DFenceInfo(const GrD3DFenceInfo& info);
119
106
  #endif
120
107
 
121
108
  GrBackendApi fBackend;
109
+ AnySemaphoreData fSemaphoreData;
110
+
122
111
  union {
123
- GrGLsync fGLSync;
124
- #ifdef SK_VULKAN
125
- VkSemaphore fVkSemaphore;
126
- #endif
112
+ void* fPlaceholder; // TODO(293490566)
127
113
  #ifdef SK_METAL
128
114
  GrMTLHandle fMtlEvent; // Expected to be an id<MTLEvent>
129
115
  #endif
@@ -25,7 +25,6 @@ class GrBackendRenderTargetData;
25
25
 
26
26
  namespace skgpu {
27
27
  class MutableTextureState;
28
- class MutableTextureStateRef;
29
28
  }
30
29
 
31
30
  #ifdef SK_METAL
@@ -290,7 +289,7 @@ private:
290
289
  }
291
290
 
292
291
  friend class GrVkGpu; // for getMutableState
293
- sk_sp<skgpu::MutableTextureStateRef> getMutableState() const;
292
+ sk_sp<skgpu::MutableTextureState> getMutableState() const;
294
293
 
295
294
  #ifdef SK_DIRECT3D
296
295
  friend class GrD3DTexture;
@@ -433,7 +432,7 @@ private:
433
432
  }
434
433
 
435
434
  friend class GrVkGpu; // for getMutableState
436
- sk_sp<skgpu::MutableTextureStateRef> getMutableState() const;
435
+ sk_sp<skgpu::MutableTextureState> getMutableState() const;
437
436
 
438
437
  #ifdef SK_DIRECT3D
439
438
  friend class GrD3DGpu;
@@ -20,7 +20,6 @@
20
20
 
21
21
  class SkExecutor;
22
22
 
23
- #if defined(SK_GANESH)
24
23
  struct SK_API GrContextOptions {
25
24
  enum class Enable {
26
25
  /** Forces an option to be disabled. */
@@ -371,10 +370,5 @@ struct SK_API GrContextOptions {
371
370
 
372
371
  GrDriverBugWorkarounds fDriverBugWorkarounds;
373
372
  };
374
- #else
375
- struct GrContextOptions {
376
- struct PersistentCache {};
377
- };
378
- #endif
379
373
 
380
374
  #endif
@@ -8,11 +8,8 @@
8
8
  #ifndef GrContextThreadSafeProxy_DEFINED
9
9
  #define GrContextThreadSafeProxy_DEFINED
10
10
 
11
- #include "include/core/SkRefCnt.h"
12
-
13
- #if defined(SK_GANESH)
14
-
15
11
  #include "include/core/SkImageInfo.h"
12
+ #include "include/core/SkRefCnt.h"
16
13
  #include "include/gpu/GpuTypes.h"
17
14
  #include "include/gpu/GrContextOptions.h"
18
15
  #include "include/gpu/GrTypes.h"
@@ -34,9 +31,9 @@ namespace sktext::gpu { class TextBlobRedrawCoordinator; }
34
31
  * Can be used to perform actions related to the generating GrContext in a thread safe manner. The
35
32
  * proxy does not access the 3D API (e.g. OpenGL) that backs the generating GrContext.
36
33
  */
37
- class SK_API GrContextThreadSafeProxy final : public SkNVRefCnt<GrContextThreadSafeProxy> {
34
+ class SK_API GrContextThreadSafeProxy : public SkNVRefCnt<GrContextThreadSafeProxy> {
38
35
  public:
39
- ~GrContextThreadSafeProxy();
36
+ virtual ~GrContextThreadSafeProxy();
40
37
 
41
38
  /**
42
39
  * Create a surface characterization for a DDL that will be replayed into the GrContext
@@ -68,7 +65,7 @@ public:
68
65
  * @param surfaceProps The surface properties of the SkSurface that the DDL
69
66
  * created with this characterization will be replayed
70
67
  * into
71
- * @param isMipMapped Will the surface the DDL will be replayed into have
68
+ * @param isMipmapped Will the surface the DDL will be replayed into have
72
69
  * space allocated for mipmaps?
73
70
  * @param willUseGLFBO0 Will the surface the DDL will be replayed into be
74
71
  * backed by GL FBO 0. This flag is only valid if using
@@ -81,24 +78,39 @@ public:
81
78
  * command buffer via a GrVkSecondaryCBDrawContext? If
82
79
  * this is true then the following is required:
83
80
  * isTexureable = false
84
- * isMipMapped = false
81
+ * isMipmapped = false
85
82
  * willUseGLFBO0 = false
86
83
  * vkRTSupportsInputAttachment = false
87
84
  */
88
85
  GrSurfaceCharacterization createCharacterization(
89
- size_t cacheMaxResourceBytes,
90
- const SkImageInfo& ii,
91
- const GrBackendFormat& backendFormat,
92
- int sampleCount,
93
- GrSurfaceOrigin origin,
94
- const SkSurfaceProps& surfaceProps,
95
- bool isMipMapped,
96
- bool willUseGLFBO0 = false,
97
- bool isTextureable = true,
98
- GrProtected isProtected = GrProtected::kNo,
99
- bool vkRTSupportsInputAttachment = false,
100
- bool forVulkanSecondaryCommandBuffer = false);
101
-
86
+ size_t cacheMaxResourceBytes,
87
+ const SkImageInfo& ii,
88
+ const GrBackendFormat& backendFormat,
89
+ int sampleCount,
90
+ GrSurfaceOrigin origin,
91
+ const SkSurfaceProps& surfaceProps,
92
+ skgpu::Mipmapped isMipmapped,
93
+ bool willUseGLFBO0 = false,
94
+ bool isTextureable = true,
95
+ skgpu::Protected isProtected = GrProtected::kNo,
96
+ bool vkRTSupportsInputAttachment = false,
97
+ bool forVulkanSecondaryCommandBuffer = false);
98
+
99
+ #if !defined(SK_DISABLE_LEGACY_CREATE_CHARACTERIZATION)
100
+ GrSurfaceCharacterization createCharacterization(
101
+ size_t cacheMaxResourceBytes,
102
+ const SkImageInfo& ii,
103
+ const GrBackendFormat& backendFormat,
104
+ int sampleCount,
105
+ GrSurfaceOrigin origin,
106
+ const SkSurfaceProps& surfaceProps,
107
+ bool isMipmapped,
108
+ bool willUseGLFBO0 = false,
109
+ bool isTextureable = true,
110
+ skgpu::Protected isProtected = GrProtected::kNo,
111
+ bool vkRTSupportsInputAttachment = false,
112
+ bool forVulkanSecondaryCommandBuffer = false);
113
+ #endif
102
114
  /*
103
115
  * Retrieve the default GrBackendFormat for a given SkColorType and renderability.
104
116
  * It is guaranteed that this backend format will be the one used by the following
@@ -138,12 +150,13 @@ public:
138
150
  GrContextThreadSafeProxyPriv priv();
139
151
  const GrContextThreadSafeProxyPriv priv() const; // NOLINT(readability-const-return-type)
140
152
 
141
- private:
142
- friend class GrContextThreadSafeProxyPriv; // for ctor and hidden methods
143
-
153
+ protected:
144
154
  // DDL TODO: need to add unit tests for backend & maybe options
145
155
  GrContextThreadSafeProxy(GrBackendApi, const GrContextOptions&);
146
156
 
157
+ private:
158
+ friend class GrContextThreadSafeProxyPriv; // for ctor and hidden methods
159
+
147
160
  void abandonContext();
148
161
  bool abandoned() const;
149
162
 
@@ -152,6 +165,13 @@ private:
152
165
  // `init` method on GrContext_Base).
153
166
  void init(sk_sp<const GrCaps>, sk_sp<GrThreadSafePipelineBuilder>);
154
167
 
168
+ virtual bool isValidCharacterizationForVulkan(sk_sp<const GrCaps>,
169
+ bool isTextureable,
170
+ skgpu::Mipmapped isMipmapped,
171
+ skgpu::Protected isProtected,
172
+ bool vkRTSupportsInputAttachment,
173
+ bool forVulkanSecondaryCommandBuffer);
174
+
155
175
  const GrBackendApi fBackend;
156
176
  const GrContextOptions fOptions;
157
177
  const uint32_t fContextID;
@@ -162,8 +182,4 @@ private:
162
182
  std::atomic<bool> fAbandoned{false};
163
183
  };
164
184
 
165
- #else // !defined(SK_GANESH)
166
- class SK_API GrContextThreadSafeProxy final : public SkNVRefCnt<GrContextThreadSafeProxy> {};
167
- #endif
168
-
169
185
  #endif
@@ -41,9 +41,7 @@ class SkTaskGroup;
41
41
  class SkTraceMemoryDump;
42
42
  enum SkColorType : int;
43
43
  enum class SkTextureCompressionType;
44
- struct GrGLInterface;
45
44
  struct GrMockOptions;
46
- struct GrVkBackendContext; // IWYU pragma: keep
47
45
  struct GrD3DBackendContext; // IWYU pragma: keep
48
46
  struct GrMtlBackendContext; // IWYU pragma: keep
49
47
 
@@ -62,28 +60,6 @@ enum class BackendSurfaceAccess;
62
60
 
63
61
  class SK_API GrDirectContext : public GrRecordingContext {
64
62
  public:
65
- #if defined(SK_GL) && !defined(SK_DISABLE_LEGACY_GL_GRDIRECTCONTEXT_FACTORIES)
66
- /**
67
- * Creates a GrDirectContext for a backend context. If no GrGLInterface is provided then the
68
- * result of GrGLMakeNativeInterface() is used if it succeeds.
69
- */
70
- static sk_sp<GrDirectContext> MakeGL(sk_sp<const GrGLInterface>, const GrContextOptions&);
71
- static sk_sp<GrDirectContext> MakeGL(sk_sp<const GrGLInterface>);
72
- static sk_sp<GrDirectContext> MakeGL(const GrContextOptions&);
73
- static sk_sp<GrDirectContext> MakeGL();
74
- #endif
75
-
76
- #ifdef SK_VULKAN
77
- /**
78
- * The Vulkan context (VkQueue, VkDevice, VkInstance) must be kept alive until the returned
79
- * GrDirectContext is destroyed. This also means that any objects created with this
80
- * GrDirectContext (e.g. SkSurfaces, SkImages, etc.) must also be released as they may hold
81
- * refs on the GrDirectContext. Once all these objects and the GrDirectContext are released,
82
- * then it is safe to delete the vulkan objects.
83
- */
84
- static sk_sp<GrDirectContext> MakeVulkan(const GrVkBackendContext&, const GrContextOptions&);
85
- static sk_sp<GrDirectContext> MakeVulkan(const GrVkBackendContext&);
86
- #endif
87
63
 
88
64
  #ifdef SK_METAL
89
65
  /**
@@ -357,14 +333,17 @@ public:
357
333
 
358
334
  /**
359
335
  * Inserts a list of GPU semaphores that the current GPU-backed API must wait on before
360
- * executing any more commands on the GPU. If this call returns false, then the GPU back-end
361
- * will not wait on any passed in semaphores, and the client will still own the semaphores,
362
- * regardless of the value of deleteSemaphoresAfterWait.
336
+ * executing any more commands on the GPU. We only guarantee blocking transfer and fragment
337
+ * shader work, but may block earlier stages as well depending on the backend.If this call
338
+ * returns false, then the GPU back-end will not wait on any passed in semaphores, and the
339
+ * client will still own the semaphores, regardless of the value of deleteSemaphoresAfterWait.
363
340
  *
364
341
  * If deleteSemaphoresAfterWait is false then Skia will not delete the semaphores. In this case
365
342
  * it is the client's responsibility to not destroy or attempt to reuse the semaphores until it
366
343
  * knows that Skia has finished waiting on them. This can be done by using finishedProcs on
367
344
  * flush calls.
345
+ *
346
+ * This is not supported on the GL backend.
368
347
  */
369
348
  bool wait(int numSemaphores, const GrBackendSemaphore* waitSemaphores,
370
349
  bool deleteSemaphoresAfterWait = true);
@@ -416,13 +395,13 @@ public:
416
395
  * @param image the non-null image to flush.
417
396
  * @param info flush options
418
397
  */
419
- GrSemaphoresSubmitted flush(sk_sp<const SkImage> image, const GrFlushInfo& info);
420
- void flush(sk_sp<const SkImage> image);
398
+ GrSemaphoresSubmitted flush(const sk_sp<const SkImage>& image, const GrFlushInfo& info);
399
+ void flush(const sk_sp<const SkImage>& image);
421
400
 
422
401
  /** Version of flush() that uses a default GrFlushInfo. Also submits the flushed work to the
423
402
  * GPU.
424
403
  */
425
- void flushAndSubmit(sk_sp<const SkImage> image);
404
+ void flushAndSubmit(const sk_sp<const SkImage>& image);
426
405
 
427
406
  /** Issues pending SkSurface commands to the GPU-backed API objects and resolves any SkSurface
428
407
  * MSAA. A call to GrDirectContext::submit is always required to ensure work is actually sent
@@ -952,7 +931,9 @@ public:
952
931
  const GrDirectContextPriv priv() const; // NOLINT(readability-const-return-type)
953
932
 
954
933
  protected:
955
- GrDirectContext(GrBackendApi backend, const GrContextOptions& options);
934
+ GrDirectContext(GrBackendApi backend,
935
+ const GrContextOptions& options,
936
+ sk_sp<GrContextThreadSafeProxy> proxy);
956
937
 
957
938
  bool init() override;
958
939