@shopify/react-native-skia 2.6.2 → 2.6.3-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (346) hide show
  1. package/android/CMakeLists.txt +8 -4
  2. package/android/build.gradle +22 -3
  3. package/android/cpp/rnskia-android/RNSkAndroidPlatformContext.h +62 -0
  4. package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaWebGPUViewManagerDelegate.java +35 -0
  5. package/android/src/paper/java/com/facebook/react/viewmanagers/SkiaWebGPUViewManagerInterface.java +17 -0
  6. package/apple/RNSkApplePlatformContext.h +2 -0
  7. package/apple/RNSkApplePlatformContext.mm +71 -0
  8. package/apple/RNWebGPUAppleNativeBuffer.mm +33 -0
  9. package/cpp/api/JsiNativeBuffer.h +9 -1
  10. package/cpp/api/JsiSkAnimatedImage.h +1 -1
  11. package/cpp/api/JsiSkAnimatedImageFactory.h +1 -1
  12. package/cpp/api/JsiSkApi.h +3 -3
  13. package/cpp/api/JsiSkCanvas.h +34 -1
  14. package/cpp/api/JsiSkColor.h +1 -1
  15. package/cpp/api/JsiSkDataFactory.h +2 -2
  16. package/cpp/api/JsiSkFont.h +1 -1
  17. package/cpp/api/JsiSkFontMgr.h +1 -1
  18. package/cpp/api/JsiSkHostObjects.h +3 -3
  19. package/cpp/api/JsiSkImage.h +15 -7
  20. package/cpp/api/JsiSkImageFactory.h +2 -2
  21. package/cpp/api/JsiSkPath.h +1 -1
  22. package/cpp/api/JsiSkPathFactory.h +1 -1
  23. package/cpp/api/JsiSkSkottie.h +1 -1
  24. package/cpp/api/JsiSkSurface.h +18 -6
  25. package/cpp/api/JsiSkTypeface.h +1 -1
  26. package/cpp/api/JsiSkTypefaceFontProvider.h +1 -1
  27. package/cpp/api/JsiSkiaContext.h +2 -2
  28. package/cpp/api/JsiTextureInfo.h +1 -1
  29. package/cpp/api/JsiVideo.h +2 -2
  30. package/cpp/api/recorder/Convertor.h +1 -1
  31. package/cpp/api/recorder/Drawings.h +1 -1
  32. package/cpp/api/recorder/JsiRecorder.h +4 -4
  33. package/cpp/api/recorder/RNRecorder.h +1 -1
  34. package/cpp/api/third_party/SkottieUtils.cpp +1 -1
  35. package/cpp/api/third_party/base64.cpp +1 -1
  36. package/cpp/jsi/JsiHostObject.cpp +5 -7
  37. package/cpp/jsi/JsiPromises.h +1 -1
  38. package/cpp/jsi/ViewProperty.h +1 -1
  39. package/cpp/rnskia/RNDawnContext.h +13 -0
  40. package/cpp/rnskia/RNDawnUtils.h +11 -1
  41. package/cpp/rnskia/RNSkJsiViewApi.h +2 -2
  42. package/cpp/rnskia/RNSkManager.cpp +88 -2
  43. package/cpp/rnskia/RNSkPictureView.h +4 -4
  44. package/cpp/rnskia/RNSkPlatformContext.h +7 -0
  45. package/cpp/rnskia/RNSkView.h +9 -6
  46. package/cpp/rnwgpu/ArrayBuffer.h +51 -7
  47. package/cpp/rnwgpu/api/AppleNativeBuffer.h +22 -0
  48. package/cpp/rnwgpu/api/Convertors.h +33 -11
  49. package/cpp/rnwgpu/api/GPU.cpp +0 -3
  50. package/cpp/rnwgpu/api/GPUAdapter.cpp +37 -7
  51. package/cpp/rnwgpu/api/GPUBuffer.h +1 -1
  52. package/cpp/rnwgpu/api/GPUDevice.cpp +84 -6
  53. package/cpp/rnwgpu/api/GPUDevice.h +12 -0
  54. package/cpp/rnwgpu/api/GPUExternalTexture.cpp +139 -0
  55. package/cpp/rnwgpu/api/GPUExternalTexture.h +52 -2
  56. package/cpp/rnwgpu/api/GPUQueue.cpp +50 -45
  57. package/cpp/rnwgpu/api/GPUShaderModule.cpp +1 -1
  58. package/cpp/rnwgpu/api/GPUSharedFence.cpp +80 -0
  59. package/cpp/rnwgpu/api/GPUSharedFence.h +53 -0
  60. package/cpp/rnwgpu/api/GPUSharedTextureMemory.cpp +135 -0
  61. package/cpp/rnwgpu/api/GPUSharedTextureMemory.h +75 -0
  62. package/cpp/rnwgpu/api/ImageBitmap.h +62 -0
  63. package/cpp/rnwgpu/api/NativeBufferUtils.h +87 -0
  64. package/cpp/rnwgpu/api/descriptors/GPUBindGroupEntry.h +4 -1
  65. package/cpp/rnwgpu/api/descriptors/GPUCanvasConfiguration.h +1 -1
  66. package/cpp/rnwgpu/api/descriptors/GPUDawnTogglesDescriptor.h +56 -0
  67. package/cpp/rnwgpu/api/descriptors/GPUDeviceDescriptor.h +10 -0
  68. package/cpp/rnwgpu/api/descriptors/GPUExternalTextureDescriptor.h +43 -24
  69. package/cpp/rnwgpu/api/descriptors/GPUImageCopyExternalImage.h +9 -9
  70. package/cpp/rnwgpu/api/descriptors/GPUImageCopyTexture.h +1 -1
  71. package/cpp/rnwgpu/api/descriptors/GPUImageCopyTextureTagged.h +2 -2
  72. package/cpp/rnwgpu/api/descriptors/GPUSharedFenceDescriptor.h +58 -0
  73. package/cpp/rnwgpu/api/descriptors/GPUSharedFenceState.h +51 -0
  74. package/cpp/rnwgpu/api/descriptors/GPUSharedTextureMemoryDescriptor.h +73 -0
  75. package/cpp/rnwgpu/api/descriptors/GPUTextureDescriptor.h +1 -1
  76. package/cpp/rnwgpu/api/descriptors/GPUUncapturedErrorEventInit.h +1 -1
  77. package/cpp/skia/include/android/GrAHardwareBufferUtils.h +1 -1
  78. package/cpp/skia/include/android/SkAndroidFrameworkUtils.h +1 -1
  79. package/cpp/skia/include/android/SkAnimatedImage.h +1 -1
  80. package/cpp/skia/include/codec/SkCodec.h +0 -8
  81. package/cpp/skia/include/codec/SkEncodedOrigin.h +1 -1
  82. package/cpp/skia/include/codec/SkPngRustDecoder.h +1 -1
  83. package/cpp/skia/include/core/SkBitmap.h +2 -8
  84. package/cpp/skia/include/core/SkCPURecorder.h +3 -1
  85. package/cpp/skia/include/core/SkCanvasVirtualEnforcer.h +1 -1
  86. package/cpp/skia/include/core/SkColorType.h +5 -3
  87. package/cpp/skia/include/core/SkContourMeasure.h +1 -1
  88. package/cpp/skia/include/core/SkCoverageMode.h +1 -1
  89. package/cpp/skia/include/core/SkCubicMap.h +1 -1
  90. package/cpp/skia/include/core/SkExecutor.h +1 -1
  91. package/cpp/skia/include/core/SkFont.h +15 -0
  92. package/cpp/skia/include/core/SkFontArguments.h +6 -1
  93. package/cpp/skia/include/core/SkFontMetrics.h +1 -1
  94. package/cpp/skia/include/core/SkFontMgr.h +36 -1
  95. package/cpp/skia/include/core/SkFontParameters.h +1 -1
  96. package/cpp/skia/include/core/SkFontScanner.h +1 -1
  97. package/cpp/skia/include/core/SkFontTypes.h +1 -1
  98. package/cpp/skia/include/core/SkM44.h +1 -1
  99. package/cpp/skia/include/core/SkMilestone.h +1 -1
  100. package/cpp/skia/include/core/SkOpenTypeSVGDecoder.h +1 -1
  101. package/cpp/skia/include/core/SkPathBuilder.h +10 -4
  102. package/cpp/skia/include/core/SkPathIter.h +1 -1
  103. package/cpp/skia/include/core/SkPathTypes.h +1 -1
  104. package/cpp/skia/include/core/SkPixelRef.h +4 -1
  105. package/cpp/skia/include/core/SkRecorder.h +2 -1
  106. package/cpp/skia/include/core/SkRegion.h +17 -6
  107. package/cpp/skia/include/core/SkSamplingOptions.h +1 -1
  108. package/cpp/skia/include/core/SkSerialProcs.h +8 -1
  109. package/cpp/skia/include/core/SkShader.h +3 -5
  110. package/cpp/skia/include/core/SkSpan.h +1 -1
  111. package/cpp/skia/include/core/SkStream.h +1 -1
  112. package/cpp/skia/include/core/SkStrikeRef.h +80 -0
  113. package/cpp/skia/include/core/SkTileMode.h +1 -1
  114. package/cpp/skia/include/core/SkVertices.h +1 -1
  115. package/cpp/skia/include/core/SkYUVAPixmaps.h +3 -5
  116. package/cpp/skia/include/docs/SkPDFDocument.h +1 -1
  117. package/cpp/skia/include/docs/SkXPSDocument.h +1 -1
  118. package/cpp/skia/include/effects/SkGradient.h +1 -1
  119. package/cpp/skia/include/effects/SkHighContrastFilter.h +1 -1
  120. package/cpp/skia/include/effects/SkRuntimeEffect.h +2 -2
  121. package/cpp/skia/include/effects/SkShaderMaskFilter.h +1 -1
  122. package/cpp/skia/include/effects/SkTrimPathEffect.h +1 -1
  123. package/cpp/skia/include/encode/SkEncoder.h +1 -1
  124. package/cpp/skia/include/encode/SkJpegEncoder.h +1 -1
  125. package/cpp/skia/include/encode/SkPngEncoder.h +1 -1
  126. package/cpp/skia/include/encode/SkPngRustEncoder.h +1 -1
  127. package/cpp/skia/include/encode/SkWebpEncoder.h +1 -1
  128. package/cpp/skia/include/gpu/GpuTypes.h +2 -0
  129. package/cpp/skia/include/gpu/MutableTextureState.h +1 -1
  130. package/cpp/skia/include/gpu/ganesh/GrBackendSemaphore.h +1 -1
  131. package/cpp/skia/include/gpu/ganesh/GrBackendSurface.h +6 -62
  132. package/cpp/skia/include/gpu/ganesh/GrContextThreadSafeProxy.h +1 -1
  133. package/cpp/skia/include/gpu/ganesh/GrDirectContext.h +1 -1
  134. package/cpp/skia/include/gpu/ganesh/GrDriverBugWorkarounds.h +1 -1
  135. package/cpp/skia/include/gpu/ganesh/GrRecordingContext.h +2 -1
  136. package/cpp/skia/include/gpu/ganesh/mock/GrMockBackendSurface.h +59 -0
  137. package/cpp/skia/include/gpu/ganesh/mock/GrMockTypes.h +1 -1
  138. package/cpp/skia/include/gpu/ganesh/mtl/GrMtlBackendContext.h +1 -1
  139. package/cpp/skia/include/gpu/ganesh/mtl/GrMtlTypes.h +1 -1
  140. package/cpp/skia/include/gpu/ganesh/vk/GrBackendDrawableInfo.h +1 -1
  141. package/cpp/skia/include/gpu/graphite/Context.h +12 -5
  142. package/cpp/skia/include/gpu/graphite/GraphiteTypes.h +6 -0
  143. package/cpp/skia/include/gpu/graphite/Image.h +82 -9
  144. package/cpp/skia/include/gpu/graphite/PrecompileContext.h +7 -2
  145. package/cpp/skia/include/gpu/graphite/Recorder.h +6 -4
  146. package/cpp/skia/include/gpu/graphite/precompile/PrecompileColorFilter.h +11 -1
  147. package/cpp/skia/include/gpu/graphite/precompile/PrecompileShader.h +1 -0
  148. package/cpp/skia/include/gpu/graphite/vk/VulkanGraphiteTypes.h +1 -1
  149. package/cpp/skia/include/gpu/mtl/MtlMemoryAllocator.h +1 -1
  150. package/cpp/skia/include/gpu/vk/VulkanExtensions.h +1 -1
  151. package/cpp/skia/include/gpu/vk/VulkanMemoryAllocator.h +1 -1
  152. package/cpp/skia/include/gpu/vk/VulkanTypes.h +1 -1
  153. package/cpp/skia/include/ports/SkCFObject.h +1 -1
  154. package/cpp/skia/include/ports/SkFontMgr_Fontations.h +1 -1
  155. package/cpp/skia/include/ports/SkFontMgr_android_ndk.h +1 -1
  156. package/cpp/skia/include/ports/SkFontMgr_data.h +1 -1
  157. package/cpp/skia/include/ports/SkFontMgr_fuchsia.h +1 -1
  158. package/cpp/skia/include/ports/SkFontMgr_mac_ct.h +1 -1
  159. package/cpp/skia/include/ports/SkFontScanner_Fontations.h +1 -1
  160. package/cpp/skia/include/ports/SkFontScanner_FreeType.h +1 -1
  161. package/cpp/skia/include/ports/SkTypeface_fontations.h +1 -1
  162. package/cpp/skia/include/private/SkExif.h +1 -1
  163. package/cpp/skia/include/private/SkGainmapInfo.h +1 -1
  164. package/cpp/skia/include/private/SkGainmapShader.h +1 -1
  165. package/cpp/skia/include/private/SkHdrMetadata.h +21 -0
  166. package/cpp/skia/include/private/SkJpegGainmapEncoder.h +1 -1
  167. package/cpp/skia/include/private/SkPixelStorage.h +37 -0
  168. package/cpp/skia/include/private/SkXmp.h +1 -1
  169. package/cpp/skia/include/private/base/SkAssert.h +6 -5
  170. package/cpp/skia/include/private/base/SkContainers.h +1 -1
  171. package/cpp/skia/include/private/base/SkFeatures.h +30 -30
  172. package/cpp/skia/include/private/base/SkLog.h +1 -7
  173. package/cpp/skia/include/private/base/SkLogPriority.h +4 -5
  174. package/cpp/skia/include/private/base/SkMacros.h +1 -1
  175. package/cpp/skia/include/private/base/SkMalloc.h +1 -1
  176. package/cpp/skia/include/private/base/SkSafe32.h +1 -1
  177. package/cpp/skia/include/private/base/SkSpan_impl.h +1 -1
  178. package/cpp/skia/include/private/base/SkTDArray.h +13 -1
  179. package/cpp/skia/include/private/base/SkTPin.h +1 -1
  180. package/cpp/skia/include/private/base/SkTo.h +1 -1
  181. package/cpp/skia/include/private/chromium/GrVkSecondaryCBDrawContext.h +1 -1
  182. package/cpp/skia/include/private/chromium/SkChromeRemoteGlyphCache.h +1 -1
  183. package/cpp/skia/include/private/chromium/SkCodecsICCProfileChromium.h +52 -0
  184. package/cpp/skia/include/private/chromium/SkExifChromium.h +26 -0
  185. package/cpp/skia/include/private/gpu/ganesh/GrContext_Base.h +1 -1
  186. package/cpp/skia/include/private/gpu/ganesh/GrImageContext.h +1 -1
  187. package/cpp/skia/include/private/gpu/ganesh/GrTypesPriv.h +2 -1
  188. package/cpp/skia/include/private/gpu/vk/SkiaVulkan.h +1 -1
  189. package/cpp/skia/include/sksl/SkSLDebugTrace.h +1 -1
  190. package/cpp/skia/include/third_party/vulkan/vulkan/vk_icd.h +41 -51
  191. package/cpp/skia/include/third_party/vulkan/vulkan/vk_layer.h +42 -53
  192. package/cpp/skia/include/third_party/vulkan/vulkan/vk_platform.h +2 -1
  193. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_av1std.h +158 -154
  194. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_av1std_decode.h +68 -65
  195. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_av1std_encode.h +90 -87
  196. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h264std.h +9 -9
  197. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h264std_decode.h +2 -2
  198. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h264std_encode.h +82 -79
  199. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h265std.h +24 -24
  200. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h265std_decode.h +2 -2
  201. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_h265std_encode.h +95 -96
  202. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_vp9std.h +151 -0
  203. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codec_vp9std_decode.h +68 -0
  204. package/cpp/skia/include/third_party/vulkan/vulkan/vk_video/vulkan_video_codecs_common.h +1 -1
  205. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan.h +5 -1
  206. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_android.h +7 -1
  207. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_beta.h +291 -158
  208. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_core.h +13174 -10113
  209. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_directfb.h +23 -19
  210. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_fuchsia.h +159 -165
  211. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_ggp.h +22 -19
  212. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_ios.h +3 -1
  213. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_macos.h +3 -1
  214. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_metal.h +94 -88
  215. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_ohos.h +120 -0
  216. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_screen.h +55 -51
  217. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_vi.h +18 -15
  218. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_wayland.h +23 -19
  219. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_win32.h +31 -1
  220. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_xcb.h +5 -1
  221. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_xlib.h +27 -27
  222. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_xlib_xrandr.h +20 -16
  223. package/cpp/skia/include/utils/SkEventTracer.h +6 -1
  224. package/cpp/skia/include/utils/SkOrderedFontMgr.h +1 -1
  225. package/cpp/skia/include/utils/SkShadowUtils.h +1 -1
  226. package/cpp/skia/include/utils/SkTextUtils.h +1 -1
  227. package/cpp/skia/modules/jsonreader/SkJSONReader.cpp +20 -4
  228. package/cpp/skia/modules/skcms/src/Transform_inl.h +11 -15
  229. package/cpp/skia/modules/skcms/src/skcms_public.h +2 -0
  230. package/cpp/skia/modules/skottie/include/ExternalLayer.h +1 -1
  231. package/cpp/skia/modules/skottie/include/Skottie.h +1 -1
  232. package/cpp/skia/modules/skottie/include/SkottieProperty.h +1 -1
  233. package/cpp/skia/modules/skottie/include/SlotManager.h +1 -1
  234. package/cpp/skia/modules/skottie/include/TextShaper.h +1 -1
  235. package/cpp/skia/modules/skottie/src/SkottieValue.h +1 -1
  236. package/cpp/skia/modules/skottie/src/animator/Animator.h +1 -1
  237. package/cpp/skia/modules/skottie/src/text/Font.h +1 -1
  238. package/cpp/skia/modules/skottie/src/text/TextAdapter.h +1 -1
  239. package/cpp/skia/modules/skottie/src/text/TextAnimator.h +3 -2
  240. package/cpp/skia/modules/skottie/src/text/TextValue.h +1 -1
  241. package/cpp/skia/modules/skparagraph/include/DartTypes.h +1 -1
  242. package/cpp/skia/modules/skparagraph/include/FontArguments.h +1 -1
  243. package/cpp/skia/modules/skparagraph/include/FontCollection.h +5 -1
  244. package/cpp/skia/modules/skparagraph/include/Metrics.h +1 -1
  245. package/cpp/skia/modules/skparagraph/include/Paragraph.h +1 -1
  246. package/cpp/skia/modules/skparagraph/include/ParagraphBuilder.h +1 -1
  247. package/cpp/skia/modules/skparagraph/include/ParagraphCache.h +1 -1
  248. package/cpp/skia/modules/skparagraph/include/ParagraphPainter.h +1 -1
  249. package/cpp/skia/modules/skparagraph/include/ParagraphStyle.h +12 -5
  250. package/cpp/skia/modules/skparagraph/include/TextShadow.h +1 -1
  251. package/cpp/skia/modules/skparagraph/include/TextStyle.h +1 -1
  252. package/cpp/skia/modules/skparagraph/include/TypefaceFontProvider.h +1 -1
  253. package/cpp/skia/modules/sksg/include/SkSGClipEffect.h +1 -1
  254. package/cpp/skia/modules/sksg/include/SkSGColorFilter.h +1 -1
  255. package/cpp/skia/modules/sksg/include/SkSGDraw.h +1 -1
  256. package/cpp/skia/modules/sksg/include/SkSGEffectNode.h +1 -1
  257. package/cpp/skia/modules/sksg/include/SkSGGeometryEffect.h +1 -1
  258. package/cpp/skia/modules/sksg/include/SkSGGeometryNode.h +1 -1
  259. package/cpp/skia/modules/sksg/include/SkSGGradient.h +1 -1
  260. package/cpp/skia/modules/sksg/include/SkSGGroup.h +1 -1
  261. package/cpp/skia/modules/sksg/include/SkSGImage.h +1 -1
  262. package/cpp/skia/modules/sksg/include/SkSGInvalidationController.h +1 -1
  263. package/cpp/skia/modules/sksg/include/SkSGMaskEffect.h +1 -1
  264. package/cpp/skia/modules/sksg/include/SkSGMerge.h +1 -1
  265. package/cpp/skia/modules/sksg/include/SkSGNode.h +1 -1
  266. package/cpp/skia/modules/sksg/include/SkSGOpacityEffect.h +1 -1
  267. package/cpp/skia/modules/sksg/include/SkSGPaint.h +1 -1
  268. package/cpp/skia/modules/sksg/include/SkSGPath.h +1 -1
  269. package/cpp/skia/modules/sksg/include/SkSGPlane.h +1 -1
  270. package/cpp/skia/modules/sksg/include/SkSGRect.h +1 -1
  271. package/cpp/skia/modules/sksg/include/SkSGRenderEffect.h +1 -1
  272. package/cpp/skia/modules/sksg/include/SkSGRenderNode.h +1 -1
  273. package/cpp/skia/modules/sksg/include/SkSGScene.h +1 -1
  274. package/cpp/skia/modules/sksg/include/SkSGText.h +1 -1
  275. package/cpp/skia/modules/sksg/include/SkSGTransform.h +1 -1
  276. package/cpp/skia/modules/skshaper/include/SkShaper_coretext.h +8 -1
  277. package/cpp/skia/modules/svg/include/SkSVGFe.h +1 -1
  278. package/cpp/skia/modules/svg/include/SkSVGFeBlend.h +1 -1
  279. package/cpp/skia/modules/svg/include/SkSVGFeColorMatrix.h +1 -1
  280. package/cpp/skia/modules/svg/include/SkSVGFeComponentTransfer.h +1 -1
  281. package/cpp/skia/modules/svg/include/SkSVGFeComposite.h +1 -1
  282. package/cpp/skia/modules/svg/include/SkSVGFeDisplacementMap.h +1 -1
  283. package/cpp/skia/modules/svg/include/SkSVGFeFlood.h +1 -1
  284. package/cpp/skia/modules/svg/include/SkSVGFeGaussianBlur.h +1 -1
  285. package/cpp/skia/modules/svg/include/SkSVGFeImage.h +1 -1
  286. package/cpp/skia/modules/svg/include/SkSVGFeLightSource.h +1 -1
  287. package/cpp/skia/modules/svg/include/SkSVGFeLighting.h +1 -1
  288. package/cpp/skia/modules/svg/include/SkSVGFeMerge.h +1 -1
  289. package/cpp/skia/modules/svg/include/SkSVGFeMorphology.h +1 -1
  290. package/cpp/skia/modules/svg/include/SkSVGFeOffset.h +1 -1
  291. package/cpp/skia/modules/svg/include/SkSVGFeTurbulence.h +1 -1
  292. package/cpp/skia/modules/svg/include/SkSVGFilter.h +1 -1
  293. package/cpp/skia/modules/svg/include/SkSVGFilterContext.h +1 -1
  294. package/cpp/skia/modules/svg/include/SkSVGGradient.h +1 -1
  295. package/cpp/skia/modules/svg/include/SkSVGImage.h +1 -1
  296. package/cpp/skia/modules/svg/include/SkSVGMask.h +1 -1
  297. package/cpp/skia/modules/svg/include/SkSVGOpenTypeSVGDecoder.h +1 -1
  298. package/cpp/skia/modules/svg/include/SkSVGPattern.h +1 -1
  299. package/cpp/skia/modules/svg/include/SkSVGRadialGradient.h +1 -1
  300. package/cpp/skia/modules/svg/include/SkSVGText.h +1 -1
  301. package/cpp/skia/modules/svg/include/SkSVGUse.h +1 -1
  302. package/cpp/skia/src/base/SkAutoLocaleSetter.h +94 -0
  303. package/cpp/skia/src/base/SkUTF.h +1 -1
  304. package/lib/commonjs/skia/types/NativeBuffer/NativeBufferFactory.d.ts +10 -1
  305. package/lib/commonjs/skia/types/NativeBuffer/NativeBufferFactory.js.map +1 -1
  306. package/lib/commonjs/skia/types/WebGPU.d.ts +153 -0
  307. package/lib/commonjs/skia/types/WebGPU.js +6 -0
  308. package/lib/commonjs/skia/types/WebGPU.js.map +1 -0
  309. package/lib/commonjs/skia/types/index.d.ts +1 -0
  310. package/lib/commonjs/skia/types/index.js +11 -0
  311. package/lib/commonjs/skia/types/index.js.map +1 -1
  312. package/lib/commonjs/skia/web/JsiSkNativeBufferFactory.d.ts +1 -0
  313. package/lib/commonjs/skia/web/JsiSkNativeBufferFactory.js +19 -0
  314. package/lib/commonjs/skia/web/JsiSkNativeBufferFactory.js.map +1 -1
  315. package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
  316. package/lib/module/skia/types/NativeBuffer/NativeBufferFactory.d.ts +10 -1
  317. package/lib/module/skia/types/NativeBuffer/NativeBufferFactory.js.map +1 -1
  318. package/lib/module/skia/types/WebGPU.d.ts +153 -0
  319. package/lib/module/skia/types/WebGPU.js +2 -0
  320. package/lib/module/skia/types/WebGPU.js.map +1 -0
  321. package/lib/module/skia/types/index.d.ts +1 -0
  322. package/lib/module/skia/types/index.js +1 -0
  323. package/lib/module/skia/types/index.js.map +1 -1
  324. package/lib/module/skia/web/JsiSkNativeBufferFactory.d.ts +1 -0
  325. package/lib/module/skia/web/JsiSkNativeBufferFactory.js +19 -0
  326. package/lib/module/skia/web/JsiSkNativeBufferFactory.js.map +1 -1
  327. package/lib/module/skia/web/JsiSkPath.js.map +1 -1
  328. package/lib/module/web/LoadSkiaWeb.js +1 -2
  329. package/lib/module/web/LoadSkiaWeb.js.map +1 -1
  330. package/lib/typescript/lib/commonjs/skia/types/WebGPU.d.ts +1 -0
  331. package/lib/typescript/lib/commonjs/skia/web/JsiSkNativeBufferFactory.d.ts +1 -0
  332. package/lib/typescript/lib/module/skia/types/WebGPU.d.ts +1 -0
  333. package/lib/typescript/lib/module/skia/types/index.d.ts +1 -0
  334. package/lib/typescript/lib/module/skia/web/JsiSkNativeBufferFactory.d.ts +1 -0
  335. package/lib/typescript/src/skia/types/NativeBuffer/NativeBufferFactory.d.ts +10 -1
  336. package/lib/typescript/src/skia/types/WebGPU.d.ts +153 -0
  337. package/lib/typescript/src/skia/types/index.d.ts +1 -0
  338. package/lib/typescript/src/skia/web/JsiSkNativeBufferFactory.d.ts +1 -0
  339. package/package.json +18 -15
  340. package/react-native-skia.podspec +59 -7
  341. package/src/skia/types/NativeBuffer/NativeBufferFactory.ts +10 -1
  342. package/src/skia/types/WebGPU.ts +186 -0
  343. package/src/skia/types/index.ts +1 -0
  344. package/src/skia/web/JsiSkNativeBufferFactory.ts +20 -0
  345. package/src/skia/web/JsiSkPath.ts +8 -2
  346. package/scripts/install-libs.js +0 -133
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2017 Google Inc.
2
+ * Copyright 2017 Google LLC
3
3
  *
4
4
  * Use of this source code is governed by a BSD-style license that can be
5
5
  * found in the LICENSE file.
@@ -12,13 +12,11 @@
12
12
  #include "include/core/SkSize.h"
13
13
  #include "include/gpu/GpuTypes.h"
14
14
  #include "include/gpu/ganesh/GrTypes.h"
15
- #include "include/gpu/ganesh/mock/GrMockTypes.h"
16
15
  #include "include/private/base/SkAPI.h"
17
16
  #include "include/private/base/SkAnySubclass.h"
18
17
  #include "include/private/base/SkDebug.h"
19
18
  #include "include/private/gpu/ganesh/GrTypesPriv.h"
20
19
 
21
- enum class SkTextureCompressionType;
22
20
  class GrBackendFormatData;
23
21
  class GrBackendTextureData;
24
22
  class GrBackendRenderTargetData;
@@ -44,10 +42,6 @@ public:
44
42
  GrBackendFormat& operator=(const GrBackendFormat&);
45
43
  ~GrBackendFormat();
46
44
 
47
- static GrBackendFormat MakeMock(GrColorType colorType,
48
- SkTextureCompressionType compression,
49
- bool isStencilFormat = false);
50
-
51
45
  bool operator==(const GrBackendFormat& that) const;
52
46
  bool operator!=(const GrBackendFormat& that) const { return !(*this == that); }
53
47
 
@@ -62,15 +56,6 @@ public:
62
56
 
63
57
  GrColorFormatDesc desc() const;
64
58
 
65
- /**
66
- * If the backend API is not Mock these three calls will return kUnknown, kNone or false,
67
- * respectively. Otherwise, only one of the following can be true. The GrColorType is not
68
- * kUnknown, the compression type is not kNone, or this is a mock stencil format.
69
- */
70
- GrColorType asMockColorType() const;
71
- SkTextureCompressionType asMockCompressionType() const;
72
- bool isMockStencilFormat() const;
73
-
74
59
  // If possible, copies the GrBackendFormat and forces the texture type to be Texture2D. If the
75
60
  // GrBackendFormat was for Vulkan and it originally had a skgpu::VulkanYcbcrConversionInfo,
76
61
  // we will remove the conversion and set the format to be VK_FORMAT_R8G8B8A8_UNORM.
@@ -96,43 +81,22 @@ private:
96
81
  // GrBackendFormats::MakeGL instead.
97
82
  template <typename FormatData>
98
83
  GrBackendFormat(GrTextureType textureType, GrBackendApi api, const FormatData& formatData)
99
- : fBackend(api), fValid(true), fTextureType(textureType) {
84
+ : fBackend(api), fTextureType(textureType), fValid(true) {
100
85
  fFormatData.emplace<FormatData>(formatData);
101
86
  }
102
87
 
103
- GrBackendFormat(GrColorType, SkTextureCompressionType, bool isStencilFormat);
104
-
105
- #ifdef SK_DEBUG
106
- bool validateMock() const;
107
- #endif
108
-
109
- GrBackendApi fBackend = GrBackendApi::kMock;
110
- bool fValid = false;
111
88
  AnyFormatData fFormatData;
112
-
113
- struct {
114
- GrColorType fColorType;
115
- SkTextureCompressionType fCompressionType;
116
- bool fIsStencilFormat;
117
- } fMock;
89
+ GrBackendApi fBackend = GrBackendApi::kUnsupported;
118
90
  GrTextureType fTextureType = GrTextureType::kNone;
91
+ bool fValid = false;
119
92
  };
120
93
 
121
94
  class SK_API GrBackendTexture {
122
95
  public:
123
96
  // Creates an invalid backend texture.
124
97
  GrBackendTexture();
125
-
126
- GrBackendTexture(int width,
127
- int height,
128
- skgpu::Mipmapped,
129
- const GrMockTextureInfo& mockInfo,
130
- std::string_view label = {});
131
-
132
98
  GrBackendTexture(const GrBackendTexture& that);
133
-
134
99
  ~GrBackendTexture();
135
-
136
100
  GrBackendTexture& operator=(const GrBackendTexture& that);
137
101
 
138
102
  SkISize dimensions() const { return {fWidth, fHeight}; }
@@ -147,10 +111,6 @@ public:
147
111
  // Get the GrBackendFormat for this texture (or an invalid format if this is not valid).
148
112
  GrBackendFormat getBackendFormat() const;
149
113
 
150
- // If the backend API is Mock, copies a snapshot of the GrMockTextureInfo struct into the passed
151
- // in pointer and returns true. Otherwise returns false if the backend API is not Mock.
152
- bool getMockTextureInfo(GrMockTextureInfo*) const;
153
-
154
114
  // If the client changes any of the mutable backend of the GrBackendTexture they should call
155
115
  // this function to inform Skia that those values have changed. The backend API specific state
156
116
  // that can be set from this function are:
@@ -208,26 +168,16 @@ private:
208
168
  int fHeight; //<! height in pixels
209
169
  const std::string fLabel;
210
170
  skgpu::Mipmapped fMipmapped;
211
- GrBackendApi fBackend;
171
+ GrBackendApi fBackend = GrBackendApi::kUnsupported;
212
172
  GrTextureType fTextureType;
213
173
  AnyTextureData fTextureData;
214
-
215
- GrMockTextureInfo fMockInfo;
216
174
  };
217
175
 
218
176
  class SK_API GrBackendRenderTarget {
219
177
  public:
220
178
  // Creates an invalid backend texture.
221
179
  GrBackendRenderTarget();
222
-
223
- GrBackendRenderTarget(int width,
224
- int height,
225
- int sampleCnt,
226
- int stencilBits,
227
- const GrMockRenderTargetInfo& mockInfo);
228
-
229
180
  ~GrBackendRenderTarget();
230
-
231
181
  GrBackendRenderTarget(const GrBackendRenderTarget& that);
232
182
  GrBackendRenderTarget& operator=(const GrBackendRenderTarget&);
233
183
 
@@ -242,10 +192,6 @@ public:
242
192
  // Get the GrBackendFormat for this render target (or an invalid format if this is not valid).
243
193
  GrBackendFormat getBackendFormat() const;
244
194
 
245
- // If the backend API is Mock, copies a snapshot of the GrMockTextureInfo struct into the passed
246
- // in pointer and returns true. Otherwise returns false if the backend API is not Mock.
247
- bool getMockRenderTargetInfo(GrMockRenderTargetInfo*) const;
248
-
249
195
  // If the client changes any of the mutable backend of the GrBackendTexture they should call
250
196
  // this function to inform Skia that those values have changed. The backend API specific state
251
197
  // that can be set from this function are:
@@ -304,10 +250,8 @@ private:
304
250
  int fSampleCnt;
305
251
  int fStencilBits;
306
252
 
307
- GrBackendApi fBackend;
253
+ GrBackendApi fBackend = GrBackendApi::kUnsupported;
308
254
  AnyRenderTargetData fRTData;
309
-
310
- GrMockRenderTargetInfo fMockInfo;
311
255
  };
312
256
 
313
257
  #endif
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2019 Google Inc.
2
+ * Copyright 2019 Google LLC
3
3
  *
4
4
  * Use of this source code is governed by a BSD-style license that can be
5
5
  * found in the LICENSE file.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2020 Google Inc.
2
+ * Copyright 2020 Google LLC
3
3
  *
4
4
  * Use of this source code is governed by a BSD-style license that can be
5
5
  * found in the LICENSE file.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2018 Google Inc.
2
+ * Copyright 2018 Google LLC
3
3
  *
4
4
  * Use of this source code is governed by a BSD-style license that can be
5
5
  * found in the LICENSE file.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2019 Google Inc.
2
+ * Copyright 2019 Google LLC
3
3
  *
4
4
  * Use of this source code is governed by a BSD-style license that can be
5
5
  * found in the LICENSE file.
@@ -67,6 +67,7 @@ public:
67
67
  colorType == kA16_unorm_SkColorType ||
68
68
  colorType == kA16_float_SkColorType ||
69
69
  colorType == kR16_unorm_SkColorType ||
70
+ colorType == kR16_float_SkColorType ||
70
71
  colorType == kR16G16_float_SkColorType ||
71
72
  colorType == kR16G16B16A16_unorm_SkColorType ||
72
73
  colorType == kGray_8_SkColorType) {
@@ -0,0 +1,59 @@
1
+ /*
2
+ * Copyright 2026 Google LLC
3
+ *
4
+ * Use of this source code is governed by a BSD-style license that can be
5
+ * found in the LICENSE file.
6
+ */
7
+ #ifndef GrMockBackendSurface_DEFINED
8
+ #define GrMockBackendSurface_DEFINED
9
+
10
+ #include "include/gpu/ganesh/GrTypes.h"
11
+ #include "include/gpu/ganesh/mock/GrMockTypes.h"
12
+ #include "include/private/base/SkAPI.h"
13
+
14
+ #include <string_view>
15
+
16
+ class GrBackendFormat;
17
+ class GrBackendTexture;
18
+ class GrBackendRenderTarget;
19
+ enum class SkTextureCompressionType;
20
+ enum class GrColorType;
21
+
22
+ namespace GrBackendFormats {
23
+
24
+ SK_API GrBackendFormat MakeMockColorType(GrColorType colorType);
25
+ SK_API GrBackendFormat MakeMockCompressionType(SkTextureCompressionType compression);
26
+ SK_API GrBackendFormat MakeMockStencilFormat();
27
+
28
+ // Only one of these getters will return a non-unknown, non-false value
29
+ SK_API GrColorType AsMockColorType(const GrBackendFormat&);
30
+ SK_API SkTextureCompressionType AsMockCompressionType(const GrBackendFormat&);
31
+ SK_API bool IsMockStencilFormat(const GrBackendFormat&);
32
+
33
+ } // namespace GrBackendFormats
34
+
35
+ namespace GrBackendTextures {
36
+
37
+ SK_API GrBackendTexture MakeMock(int width,
38
+ int height,
39
+ skgpu::Mipmapped,
40
+ const GrMockTextureInfo& mockInfo,
41
+ std::string_view label = {});
42
+
43
+ SK_API GrMockTextureInfo GetMockTextureInfo(const GrBackendTexture&);
44
+
45
+ } // namespace GrBackendTextures
46
+
47
+ namespace GrBackendRenderTargets {
48
+
49
+ SK_API GrBackendRenderTarget MakeMock(int width,
50
+ int height,
51
+ int sampleCnt,
52
+ int stencilBits,
53
+ const GrMockRenderTargetInfo& mockInfo);
54
+
55
+ SK_API GrMockRenderTargetInfo GetMockRenderTargetInfo(const GrBackendRenderTarget&);
56
+
57
+ } // namespace GrBackendRenderTargets
58
+
59
+ #endif
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2017 Google Inc.
2
+ * Copyright 2017 Google LLC
3
3
  *
4
4
  * Use of this source code is governed by a BSD-style license that can be
5
5
  * found in the LICENSE file.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2020 Google Inc.
2
+ * Copyright 2020 Google LLC
3
3
  *
4
4
  * Use of this source code is governed by a BSD-style license that can be
5
5
  * found in the LICENSE file.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2017 Google Inc.
2
+ * Copyright 2017 Google LLC
3
3
  *
4
4
  * Use of this source code is governed by a BSD-style license that can be
5
5
  * found in the LICENSE file.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2018 Google Inc.
2
+ * Copyright 2018 Google LLC
3
3
  *
4
4
  * Use of this source code is governed by a BSD-style license that can be
5
5
  * found in the LICENSE file.
@@ -61,6 +61,7 @@ class QueueManager;
61
61
  class ResourceProvider;
62
62
  class SharedContext;
63
63
  class TextureProxy;
64
+ class TextureProxyView;
64
65
 
65
66
  class SK_API Context final {
66
67
  public:
@@ -87,6 +88,9 @@ public:
87
88
  /** Returns true if there is work that was submitted to the GPU that has not finished. */
88
89
  bool hasUnfinishedGpuWork() const;
89
90
 
91
+ /** Returns true if there is pending GPU work that needs to be submitted. */
92
+ bool hasPendingGPUWork() const;
93
+
90
94
  /** Makes image pixel data available to caller, possibly asynchronously. It can also rescale
91
95
  the image pixels.
92
96
 
@@ -226,9 +230,12 @@ public:
226
230
  /**
227
231
  * Purge GPU resources on the Context that haven't been used in the past 'msNotUsed'
228
232
  * milliseconds or are otherwise marked for deletion, regardless of whether the context is under
229
- * budget.
233
+ * budget. Optionally provide a `microsMaxPurgingDur` after which Skia should stop purging
234
+ * resources.
230
235
  */
231
- void performDeferredCleanup(std::chrono::milliseconds msNotUsed);
236
+ void performDeferredCleanup(
237
+ std::chrono::milliseconds msNotUsed,
238
+ std::optional<std::chrono::microseconds> microsMaxPurgingDur = std::nullopt);
232
239
 
233
240
  /**
234
241
  * Returns the number of bytes of the Context's gpu memory cache budget that are currently in
@@ -382,14 +389,14 @@ private:
382
389
  // Like asyncReadPixels() except it performs no fallbacks, and requires that the texture be
383
390
  // readable. However, the texture does not need to be sampleable.
384
391
  void asyncReadTexture(std::unique_ptr<Recorder>,
385
- const AsyncParams<TextureProxy>&,
392
+ const AsyncParams<TextureProxyView>&,
386
393
  const SkColorInfo& srcColorInfo);
387
394
 
388
395
  // Inserts a texture to buffer transfer task, used by asyncReadPixels methods. If the
389
396
  // Recorder is non-null, tasks will be added to the Recorder's list; otherwise the transfer
390
397
  // tasks will be added to the queue manager directly.
391
398
  PixelTransferResult transferPixels(Recorder*,
392
- const TextureProxy* srcProxy,
399
+ const TextureProxyView& srcView,
393
400
  const SkColorInfo& srcColorInfo,
394
401
  const SkColorInfo& dstColorInfo,
395
402
  const SkIRect& srcRect);
@@ -403,8 +410,8 @@ private:
403
410
 
404
411
  sk_sp<SharedContext> fSharedContext;
405
412
  std::unique_ptr<ResourceProvider> fResourceProvider;
406
- std::unique_ptr<QueueManager> fQueueManager;
407
413
  std::unique_ptr<ClientMappedBufferManager> fMappedBufferManager;
414
+ std::unique_ptr<QueueManager> fQueueManager;
408
415
  std::unique_ptr<const skcpu::ContextImpl> fCPUContext;
409
416
 
410
417
  PersistentPipelineStorage* fPersistentPipelineStorage;
@@ -190,6 +190,12 @@ struct SubmitInfo {
190
190
  MarkFrameBoundary fMarkBoundary = MarkFrameBoundary::kNo;
191
191
  uint64_t fFrameID = 0;
192
192
 
193
+ // Optional finish proc that is invoked when all GPU work submitted by this call has
194
+ // completed. If there is no pending work to submit, the proc is attached to the most
195
+ // recently outstanding GPU submission, or invoked immediately if the GPU is idle.
196
+ GpuFinishedProc fFinishedProc = nullptr;
197
+ GpuFinishedContext fFinishedContext = nullptr;
198
+
193
199
  constexpr SubmitInfo() = default;
194
200
 
195
201
  constexpr SubmitInfo(SyncToCpu sync)
@@ -52,18 +52,56 @@ using GraphitePromiseTextureReleaseProc = void (*)(GraphitePromiseTextureRelease
52
52
  /** Creates an SkImage from a GPU texture associated with the recorder. The client is still
53
53
  responsible for managing the backend texture's lifetime.
54
54
 
55
- SkImage is returned if the format of backendTexture is recognized and supported.
56
- Recognized formats vary by GPU back-end.
55
+ SkImage is returned if the format of backendTexture is recognized and supported. Recognized
56
+ formats vary by GPU back-end.
57
+
58
+ The provided `alphaType` determines how the wrapped texture is sampled:
59
+ - kUnknown_SkAlphaType: Sampled as RGB1, ignoring any alpha data. G and B are automatically
60
+ treated as 0 if the format does not provide them. Single channel
61
+ texture formats are interpretd as the "red" SkColorTypes instead of
62
+ the "alpha-only" SkColorTypes.
63
+ - kOpaque_SkAlphaType: Sampled as RGBA but higher-level logic *assumes* that all A values are
64
+ equal to 1. Single channel texture formats are interpeted as "red"
65
+ instead of "alpha-only" for disambiguating SkColorTypes.
66
+ - kPremul_SkAlphaType: Sampled as RGBA and higher-level logic assumes the RGB values have
67
+ been premultiplied with the A value. Single channel texture formats
68
+ are interpreted as "alpha-only" color types (e.g. 000A or 000R
69
+ swizzles depending on the texture format).
70
+ - kUnpremul_SkAlphaType: Sampled as RGBA and higher-level logic assumes the RGB values have not
71
+ been multiplied with A yet. Single channel texture formats are
72
+ interpreted as "alpha-only" color types the same as
73
+ kPremul_SkAlphaType.
74
+
75
+ The SkColorType of the returned SkImage is selected to best match the bit depth and
76
+ representation of the texture format of the backend texture. This is not necessarily an exact
77
+ match since texture formats may have more options than SkColorType. Any mismatch between the
78
+ format and the SkColorType is handled automatically for read/write operations on the image (the
79
+ SkColorType represents how the image data will be made available on the CPU).
80
+
81
+ If possible, the color type will also take into account the behavior of `alphaType`, such as
82
+ using kRGB_888x_SkColorType for an RGBA8 texture with kUnknown_SkAlphaType. For single-channel
83
+ textures with kUnknown|kOpaque_SkAlphaType, the best "red-only" color type is chosen, e.g.
84
+ kR8_unorm_SkColorType. For single-channel textures with kPremul|kUnpremul_SkAlphaType, the best
85
+ "alpha-only" color type is chosen, e.g. kAlpha_8_SkColorType. This preserves the semantic
86
+ behaviors in Skia's high-level shading logic that treats red formats as color data, and
87
+ automatically colorizes alpha formats based on the paint's color or shader.
88
+
89
+ When using such a single-channel texture in a runtime effect, this semantic distinction defines
90
+ which channel of the float4 shader value has the interesting data (R001 vs 000A). When combining
91
+ multiple single-channel textures into a multiplaner YUV[A] SkImage, either colortype behaves the
92
+ same. The most significant distinction occurs when the SkImage is used in
93
+ SkCanvas::drawImageRect() or combined into a non-runtime SkShader.
57
94
 
58
95
  @param recorder The recorder
59
96
  @param backendTexture texture residing on GPU
60
- @param colorSpace This describes the color space of this image's contents, as
61
- seen after sampling. In general, if the format of the backend
62
- texture is SRGB, some linear colorSpace should be supplied
63
- (e.g., SkColorSpace::MakeSRGBLinear()). If the format of the
64
- backend texture is linear, then the colorSpace should include
65
- a description of the transfer function as
66
- well (e.g., SkColorSpace::MakeSRGB()).
97
+ @param alphaType The nature of alpha channel data provided in the texture.
98
+ @param colorSpace This describes the color space of this image's contents, as seen
99
+ after sampling. In general, if the format of the backend texture
100
+ is SRGB, some linear colorSpace should be supplied (e.g.,
101
+ SkColorSpace::MakeSRGBLinear()). If the format of the backend
102
+ texture is linear, then the colorSpace should include a
103
+ description of the transfer function as well (e.g.,
104
+ SkColorSpace::MakeSRGB()).
67
105
  @param origin Whether the Texture logically treats the origin as TopLeft or
68
106
  BottomLeft
69
107
  @param generateMipmapsFromBase If kYes then the pixel contents of the textures upper mipmap
@@ -74,6 +112,41 @@ using GraphitePromiseTextureReleaseProc = void (*)(GraphitePromiseTextureRelease
74
112
  valid.
75
113
  @return created SkImage, or nullptr
76
114
  */
115
+ SK_API sk_sp<SkImage> WrapTexture(skgpu::graphite::Recorder*,
116
+ const skgpu::graphite::BackendTexture&,
117
+ SkAlphaType alphaType,
118
+ sk_sp<SkColorSpace> colorSpace,
119
+ skgpu::Origin origin,
120
+ GenerateMipmapsFromBase genMipmaps,
121
+ TextureReleaseProc = nullptr,
122
+ ReleaseContext = nullptr,
123
+ std::string_view label = {});
124
+
125
+ SK_API inline sk_sp<SkImage> WrapTexture(skgpu::graphite::Recorder* recorder,
126
+ const skgpu::graphite::BackendTexture& backendTex,
127
+ SkAlphaType alphaType,
128
+ sk_sp<SkColorSpace> colorSpace,
129
+ skgpu::Origin origin,
130
+ TextureReleaseProc releaseP = nullptr,
131
+ ReleaseContext releaseC = nullptr,
132
+ std::string_view label = {}) {
133
+ return WrapTexture(recorder, backendTex, alphaType, std::move(colorSpace), origin,
134
+ GenerateMipmapsFromBase::kNo, releaseP, releaseC, label);
135
+ }
136
+
137
+ SK_API inline sk_sp<SkImage> WrapTexture(skgpu::graphite::Recorder* recorder,
138
+ const skgpu::graphite::BackendTexture& backendTex,
139
+ SkAlphaType alphaType,
140
+ sk_sp<SkColorSpace> colorSpace,
141
+ TextureReleaseProc releaseP = nullptr,
142
+ ReleaseContext releaseC = nullptr,
143
+ std::string_view label = {}) {
144
+ return WrapTexture(recorder, backendTex, alphaType, std::move(colorSpace),
145
+ skgpu::Origin::kTopLeft, releaseP, releaseC, label);
146
+ }
147
+
148
+ // DEPRECATED: The WrapTexture calls that take an SkColorType are deprecated. Use the new versions
149
+ // that automatically pick a compatible color type from the texture's format.
77
150
  SK_API sk_sp<SkImage> WrapTexture(skgpu::graphite::Recorder*,
78
151
  const skgpu::graphite::BackendTexture&,
79
152
  SkColorType colorType,
@@ -63,12 +63,17 @@ public:
63
63
  bool precompile(sk_sp<SkData> serializedPipelineKey);
64
64
 
65
65
  /**
66
- * Get a human-readable version of a serialized pipeline key.
66
+ * Get a human-readable version of a serialized pipeline key and, optionally, the unique
67
+ * hash of the Pipeline.
67
68
  *
68
69
  * @param serializedPipelineKey serialized Pipeline key.
70
+ * @param uniqueHash If non-null, this will be filled in with the unique hash.
71
+ * Note that the uniqueHash is only valid for the lifetime
72
+ * of the Context used to create this PrecompileContext.
69
73
  * @return A human-readable version of the provided key; "" on failure.
70
74
  */
71
- std::string getPipelineLabel(sk_sp<SkData> serializedPipelineKey);
75
+ std::string getPipelineLabel(sk_sp<SkData> serializedPipelineKey,
76
+ uint32_t* uniqueHash = nullptr);
72
77
 
73
78
  // Provides access to functions that aren't part of the public API.
74
79
  PrecompileContextPriv priv();
@@ -17,7 +17,6 @@
17
17
  #include "include/private/base/SingleOwner.h"
18
18
  #include "include/private/base/SkAPI.h"
19
19
  #include "include/private/base/SkTArray.h"
20
- #include "include/private/base/SkTDArray.h"
21
20
 
22
21
  #include <chrono>
23
22
  #include <cstddef>
@@ -210,9 +209,12 @@ public:
210
209
  /**
211
210
  * Purge GPU resources on the Recorder that haven't been used in the past 'msNotUsed'
212
211
  * milliseconds or are otherwise marked for deletion, regardless of whether the context is under
213
- * budget.
212
+ * budget. Optionally provide a `microsMaxPurgingDur` after which Skia should stop purging
213
+ * resources.
214
214
  */
215
- void performDeferredCleanup(std::chrono::milliseconds msNotUsed);
215
+ void performDeferredCleanup(
216
+ std::chrono::milliseconds msNotUsed,
217
+ std::optional<std::chrono::microseconds> microsMaxPurgingDur = std::nullopt);
216
218
 
217
219
  /**
218
220
  * Returns the number of bytes of the Recorder's gpu memory cache budget that are currently in
@@ -281,7 +283,7 @@ private:
281
283
  void deregisterDevice(const Device*);
282
284
 
283
285
  SkCanvas* makeCaptureCanvas(SkCanvas*) override;
284
- void createCaptureBreakpoint(SkSurface*) override;
286
+ SkContentID createCaptureBreakpoint(SkSurface*) override;
285
287
 
286
288
  sk_sp<SharedContext> fSharedContext;
287
289
  ResourceProvider* fResourceProvider; // May point to the Context's resource provider
@@ -14,6 +14,8 @@ enum class SkBlendMode;
14
14
 
15
15
  namespace skgpu::graphite {
16
16
 
17
+ class PrecompileColorFilterPriv;
18
+
17
19
  /** \class PrecompileColorFilter
18
20
  This class corresponds to the SkColorFilter class in the main API.
19
21
  */
@@ -36,9 +38,17 @@ public:
36
38
  */
37
39
  sk_sp<PrecompileColorFilter> makeComposed(sk_sp<PrecompileColorFilter> inner) const;
38
40
 
41
+ // Provides access to functions that aren't part of the public API.
42
+ PrecompileColorFilterPriv priv();
43
+ const PrecompileColorFilterPriv priv() const; // NOLINT(readability-const-return-type)
44
+
39
45
  protected:
46
+ friend class PrecompileColorFilterPriv;
47
+
40
48
  PrecompileColorFilter() : PrecompileBase(Type::kColorFilter) {}
41
49
  ~PrecompileColorFilter() override;
50
+
51
+ virtual bool isAlphaUnchanged(int /*desiredCombination*/) const = 0;
42
52
  };
43
53
 
44
54
  //--------------------------------------------------------------------------------------------------
@@ -54,7 +64,7 @@ namespace PrecompileColorFilters {
54
64
  SK_API sk_sp<PrecompileColorFilter> Blend(); // Prefer the explicit blend mode variant
55
65
 
56
66
  // This encompasses both variants of SkColorFilters::Matrix
57
- SK_API sk_sp<PrecompileColorFilter> Matrix();
67
+ SK_API sk_sp<PrecompileColorFilter> Matrix(bool clamp=true);
58
68
 
59
69
  // This encompasses both variants of SkColorFilters::HSLAMatrix
60
70
  SK_API sk_sp<PrecompileColorFilter> HSLAMatrix();
@@ -86,6 +86,7 @@ protected:
86
86
  ~PrecompileShader() override;
87
87
 
88
88
  virtual bool isConstant(int /* desiredCombination */) const { return false; }
89
+ virtual bool isOpaque(int /* desiredCombination */) const = 0;
89
90
 
90
91
  virtual bool isALocalMatrixShader() const { return false; }
91
92
  };
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2022 Google LLC.
2
+ * Copyright 2022 Google LLC
3
3
  *
4
4
  * Use of this source code is governed by a BSD-style license that can be
5
5
  * found in the LICENSE file.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2022 Google Inc.
2
+ * Copyright 2022 Google LLC
3
3
  *
4
4
  * Use of this source code is governed by a BSD-style license that can be
5
5
  * found in the LICENSE file.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2022 Google LLC.
2
+ * Copyright 2022 Google LLC
3
3
  *
4
4
  * Use of this source code is governed by a BSD-style license that can be
5
5
  * found in the LICENSE file.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2022 Google LLC.
2
+ * Copyright 2022 Google LLC
3
3
  *
4
4
  * Use of this source code is governed by a BSD-style license that can be
5
5
  * found in the LICENSE file.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2022 Google LLC.
2
+ * Copyright 2022 Google LLC
3
3
  *
4
4
  * Use of this source code is governed by a BSD-style license that can be
5
5
  * found in the LICENSE file.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2019 Google Inc.
2
+ * Copyright 2019 Google LLC
3
3
  *
4
4
  * Use of this source code is governed by a BSD-style license that can be
5
5
  * found in the LICENSE file.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2024 Google Inc.
2
+ * Copyright 2024 Google LLC
3
3
  *
4
4
  * Use of this source code is governed by a BSD-style license that can be
5
5
  * found in the LICENSE file.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2024 Google LLC.
2
+ * Copyright 2024 Google LLC
3
3
  *
4
4
  * Use of this source code is governed by a BSD-style license that can be
5
5
  * found in the LICENSE file.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2023 Google Inc.
2
+ * Copyright 2023 Google LLC
3
3
  *
4
4
  * Use of this source code is governed by a BSD-style license that can be
5
5
  * found in the LICENSE file.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2018 Google Inc.
2
+ * Copyright 2018 Google LLC
3
3
  *
4
4
  * Use of this source code is governed by a BSD-style license that can be
5
5
  * found in the LICENSE file.
@@ -1,5 +1,5 @@
1
1
  /*
2
- * Copyright 2017 Google Inc.
2
+ * Copyright 2017 Google LLC
3
3
  *
4
4
  * Use of this source code is governed by a BSD-style license that can be
5
5
  * found in the LICENSE file.