@shopify/react-native-skia 0.1.192 → 0.1.194

Sign up to get free protection for your applications and to get access to all the features.
Files changed (304) hide show
  1. package/android/CMakeLists.txt +1 -1
  2. package/android/build.gradle +1 -0
  3. package/android/cpp/jni/JniPlatformContext.cpp +1 -1
  4. package/android/src/main/java/com/shopify/reactnative/skia/ViewScreenshotService.java +104 -103
  5. package/cpp/api/JsiSkImage.h +25 -4
  6. package/cpp/api/JsiSkImageFactory.h +2 -2
  7. package/cpp/api/JsiSkPath.h +8 -6
  8. package/cpp/rnskia/dom/base/Declaration.h +5 -7
  9. package/cpp/rnskia/dom/base/JsiDomDrawingNode.h +3 -1
  10. package/cpp/rnskia/dom/nodes/JsiBlurMaskNode.h +1 -0
  11. package/cpp/rnskia/dom/nodes/JsiPathNode.h +2 -2
  12. package/cpp/rnskia/dom/props/BoxShadowProps.h +2 -0
  13. package/cpp/skia/include/android/SkAndroidFrameworkUtils.h +2 -8
  14. package/cpp/skia/include/android/SkImageAndroid.h +101 -0
  15. package/cpp/skia/include/codec/SkAndroidCodec.h +26 -8
  16. package/cpp/skia/include/codec/SkCodec.h +31 -17
  17. package/cpp/skia/include/codec/SkEncodedImageFormat.h +36 -0
  18. package/cpp/skia/include/codec/SkPixmapUtils.h +31 -0
  19. package/cpp/skia/include/config/SkUserConfig.h +61 -29
  20. package/cpp/skia/include/core/SkBitmap.h +25 -25
  21. package/cpp/skia/include/core/SkBlurTypes.h +0 -2
  22. package/cpp/skia/include/core/SkCanvas.h +32 -15
  23. package/cpp/skia/include/core/SkCapabilities.h +2 -2
  24. package/cpp/skia/include/core/SkColor.h +2 -0
  25. package/cpp/skia/include/core/SkColorPriv.h +19 -4
  26. package/cpp/skia/include/core/SkColorSpace.h +14 -17
  27. package/cpp/skia/include/core/SkColorType.h +1 -0
  28. package/cpp/skia/include/core/SkContourMeasure.h +1 -1
  29. package/cpp/skia/include/core/SkCoverageMode.h +0 -2
  30. package/cpp/skia/include/core/SkCubicMap.h +2 -0
  31. package/cpp/skia/include/core/SkData.h +5 -2
  32. package/cpp/skia/include/core/SkDataTable.h +6 -2
  33. package/cpp/skia/include/core/SkDeferredDisplayList.h +11 -10
  34. package/cpp/skia/include/core/SkDeferredDisplayListRecorder.h +9 -8
  35. package/cpp/skia/include/core/SkDrawable.h +10 -2
  36. package/cpp/skia/include/core/SkEncodedImageFormat.h +3 -30
  37. package/cpp/skia/include/core/SkFlattenable.h +4 -2
  38. package/cpp/skia/include/core/SkFont.h +1 -0
  39. package/cpp/skia/include/core/SkFontMetrics.h +1 -0
  40. package/cpp/skia/include/core/SkFontMgr.h +20 -29
  41. package/cpp/skia/include/core/SkFontStyle.h +4 -1
  42. package/cpp/skia/include/core/SkGraphics.h +21 -18
  43. package/cpp/skia/include/core/SkICC.h +3 -13
  44. package/cpp/skia/include/core/SkImage.h +395 -717
  45. package/cpp/skia/include/core/SkImageGenerator.h +19 -74
  46. package/cpp/skia/include/core/SkImageInfo.h +7 -5
  47. package/cpp/skia/include/core/SkM44.h +11 -0
  48. package/cpp/skia/include/core/SkMaskFilter.h +6 -3
  49. package/cpp/skia/include/core/SkMatrix.h +14 -4
  50. package/cpp/skia/include/core/SkMesh.h +52 -18
  51. package/cpp/skia/include/core/SkMilestone.h +1 -1
  52. package/cpp/skia/include/core/SkPaint.h +11 -34
  53. package/cpp/skia/include/core/SkPath.h +23 -4
  54. package/cpp/skia/include/core/SkPathBuilder.h +13 -5
  55. package/cpp/skia/include/core/SkPathMeasure.h +1 -1
  56. package/cpp/skia/include/core/SkPathTypes.h +0 -2
  57. package/cpp/skia/include/core/SkPathUtils.h +42 -0
  58. package/cpp/skia/include/core/SkPicture.h +3 -2
  59. package/cpp/skia/include/core/SkPictureRecorder.h +2 -0
  60. package/cpp/skia/include/core/SkPixelRef.h +4 -8
  61. package/cpp/skia/include/core/SkPixmap.h +12 -20
  62. package/cpp/skia/include/core/SkPoint.h +4 -2
  63. package/cpp/skia/include/core/SkPromiseImageTexture.h +2 -2
  64. package/cpp/skia/include/core/SkRRect.h +5 -1
  65. package/cpp/skia/include/core/SkRect.h +6 -3
  66. package/cpp/skia/include/core/SkRefCnt.h +9 -14
  67. package/cpp/skia/include/core/SkRegion.h +1 -1
  68. package/cpp/skia/include/core/SkScalar.h +2 -4
  69. package/cpp/skia/include/core/SkSerialProcs.h +18 -10
  70. package/cpp/skia/include/core/SkShader.h +1 -64
  71. package/cpp/skia/include/core/SkSize.h +2 -0
  72. package/cpp/skia/include/core/SkSpan.h +4 -112
  73. package/cpp/skia/include/core/SkStream.h +11 -12
  74. package/cpp/skia/include/core/SkString.h +9 -25
  75. package/cpp/skia/include/core/SkStrokeRec.h +1 -1
  76. package/cpp/skia/include/core/SkSurface.h +83 -61
  77. package/cpp/skia/include/core/SkSurfaceCharacterization.h +3 -3
  78. package/cpp/skia/include/core/SkSurfaceProps.h +9 -1
  79. package/cpp/skia/include/core/SkTextBlob.h +2 -2
  80. package/cpp/skia/include/core/SkTextureCompressionType.h +30 -0
  81. package/cpp/skia/include/core/SkTime.h +1 -1
  82. package/cpp/skia/include/core/SkTypeface.h +9 -2
  83. package/cpp/skia/include/core/SkTypes.h +37 -466
  84. package/cpp/skia/include/core/SkVertices.h +2 -0
  85. package/cpp/skia/include/core/SkYUVAInfo.h +4 -0
  86. package/cpp/skia/include/core/SkYUVAPixmaps.h +7 -1
  87. package/cpp/skia/include/docs/SkPDFDocument.h +12 -1
  88. package/cpp/skia/include/effects/SkColorMatrix.h +2 -1
  89. package/cpp/skia/include/effects/SkGradientShader.h +65 -14
  90. package/cpp/skia/include/effects/SkImageFilters.h +0 -11
  91. package/cpp/skia/include/effects/SkRuntimeEffect.h +41 -11
  92. package/cpp/skia/include/encode/SkEncoder.h +7 -3
  93. package/cpp/skia/include/encode/SkICC.h +36 -0
  94. package/cpp/skia/include/encode/SkJpegEncoder.h +102 -71
  95. package/cpp/skia/include/encode/SkPngEncoder.h +89 -71
  96. package/cpp/skia/include/encode/SkWebpEncoder.h +65 -38
  97. package/cpp/skia/include/gpu/GpuTypes.h +23 -1
  98. package/cpp/skia/include/gpu/GrBackendSurface.h +9 -7
  99. package/cpp/skia/include/gpu/GrContextOptions.h +28 -9
  100. package/cpp/skia/include/gpu/GrContextThreadSafeProxy.h +6 -4
  101. package/cpp/skia/include/gpu/GrDirectContext.h +84 -63
  102. package/cpp/skia/include/gpu/GrDriverBugWorkarounds.h +2 -1
  103. package/cpp/skia/include/gpu/GrRecordingContext.h +9 -5
  104. package/cpp/skia/include/gpu/GrTypes.h +18 -18
  105. package/cpp/skia/include/gpu/d3d/GrD3DTypes.h +4 -4
  106. package/cpp/skia/include/gpu/dawn/GrDawnTypes.h +3 -3
  107. package/cpp/skia/include/gpu/ganesh/GrTextureGenerator.h +77 -0
  108. package/cpp/skia/include/gpu/ganesh/SkImageGanesh.h +385 -0
  109. package/cpp/skia/include/gpu/gl/GrGLExtensions.h +3 -3
  110. package/cpp/skia/include/gpu/gl/GrGLFunctions.h +1 -1
  111. package/cpp/skia/include/gpu/gl/GrGLInterface.h +0 -3
  112. package/cpp/skia/include/gpu/gl/GrGLTypes.h +2 -1
  113. package/cpp/skia/include/gpu/graphite/BackendTexture.h +72 -3
  114. package/cpp/skia/include/gpu/graphite/Context.h +85 -32
  115. package/cpp/skia/include/gpu/graphite/ContextOptions.h +15 -11
  116. package/cpp/skia/include/gpu/graphite/GraphiteTypes.h +55 -5
  117. package/cpp/skia/include/gpu/graphite/ImageProvider.h +6 -4
  118. package/cpp/skia/include/gpu/graphite/Recorder.h +41 -11
  119. package/cpp/skia/include/gpu/graphite/Recording.h +50 -3
  120. package/cpp/skia/include/gpu/graphite/TextureInfo.h +47 -8
  121. package/cpp/skia/include/gpu/graphite/YUVABackendTextures.h +139 -0
  122. package/cpp/skia/include/gpu/graphite/dawn/DawnTypes.h +40 -0
  123. package/cpp/skia/include/gpu/graphite/dawn/DawnUtils.h +28 -0
  124. package/cpp/skia/include/gpu/graphite/mtl/MtlBackendContext.h +1 -1
  125. package/cpp/skia/include/gpu/graphite/mtl/{MtlTypes.h → MtlGraphiteTypes.h} +7 -6
  126. package/cpp/skia/include/gpu/graphite/mtl/MtlGraphiteUtils.h +27 -0
  127. package/cpp/skia/include/gpu/graphite/vk/VulkanGraphiteTypes.h +4 -9
  128. package/cpp/skia/include/gpu/graphite/vk/VulkanGraphiteUtils.h +28 -0
  129. package/cpp/skia/include/gpu/mock/GrMockTypes.h +17 -13
  130. package/cpp/skia/include/gpu/mtl/GrMtlTypes.h +2 -2
  131. package/cpp/skia/include/gpu/vk/GrVkBackendContext.h +1 -1
  132. package/cpp/skia/include/gpu/vk/GrVkTypes.h +3 -3
  133. package/cpp/skia/include/gpu/vk/VulkanExtensions.h +3 -3
  134. package/cpp/skia/include/gpu/vk/VulkanMemoryAllocator.h +5 -7
  135. package/cpp/skia/include/pathops/SkPathOps.h +3 -3
  136. package/cpp/skia/include/ports/SkFontMgr_data.h +22 -0
  137. package/cpp/skia/include/ports/SkFontMgr_indirect.h +14 -14
  138. package/cpp/skia/include/ports/SkRemotableFontMgr.h +2 -2
  139. package/cpp/skia/include/ports/SkTypeface_win.h +2 -1
  140. package/cpp/skia/include/private/SkChecksum.h +32 -7
  141. package/cpp/skia/include/private/SkColorData.h +1 -26
  142. package/cpp/skia/include/private/SkGainmapInfo.h +97 -0
  143. package/cpp/skia/include/private/SkGainmapShader.h +53 -0
  144. package/cpp/skia/include/private/SkIDChangeListener.h +4 -3
  145. package/cpp/skia/include/private/SkJpegGainmapEncoder.h +71 -0
  146. package/cpp/skia/include/private/SkJpegMetadataDecoder.h +61 -0
  147. package/cpp/skia/include/private/SkOpts_spi.h +3 -1
  148. package/cpp/skia/include/private/SkPathRef.h +64 -47
  149. package/cpp/skia/include/private/SkSLDefines.h +5 -5
  150. package/cpp/skia/include/private/SkSLSampleUsage.h +0 -4
  151. package/cpp/skia/include/private/SkSpinlock.h +1 -1
  152. package/cpp/skia/include/private/SkWeakRefCnt.h +3 -0
  153. package/cpp/skia/include/private/{SingleOwner.h → base/SingleOwner.h} +8 -5
  154. package/cpp/skia/include/private/base/SkAPI.h +52 -0
  155. package/cpp/skia/include/private/base/SkAlign.h +39 -0
  156. package/cpp/skia/include/private/base/SkAlignedStorage.h +32 -0
  157. package/cpp/skia/include/private/base/SkAssert.h +92 -0
  158. package/cpp/skia/include/private/base/SkAttributes.h +102 -0
  159. package/cpp/skia/include/private/base/SkCPUTypes.h +25 -0
  160. package/cpp/skia/include/private/base/SkContainers.h +46 -0
  161. package/cpp/skia/include/private/base/SkDebug.h +27 -0
  162. package/cpp/skia/include/private/{SkDeque.h → base/SkDeque.h} +3 -1
  163. package/cpp/skia/include/private/base/SkFeatures.h +151 -0
  164. package/cpp/skia/include/private/{SkFixed.h → base/SkFixed.h} +9 -7
  165. package/cpp/skia/include/private/{SkFloatBits.h → base/SkFloatBits.h} +2 -3
  166. package/cpp/skia/include/private/{SkFloatingPoint.h → base/SkFloatingPoint.h} +18 -9
  167. package/cpp/skia/include/private/base/SkLoadUserConfig.h +63 -0
  168. package/cpp/skia/include/private/{SkMacros.h → base/SkMacros.h} +17 -2
  169. package/cpp/skia/include/private/{SkMalloc.h → base/SkMalloc.h} +4 -7
  170. package/cpp/skia/include/{core → private/base}/SkMath.h +25 -2
  171. package/cpp/skia/include/private/{SkMutex.h → base/SkMutex.h} +5 -5
  172. package/cpp/skia/include/private/{SkNoncopyable.h → base/SkNoncopyable.h} +2 -2
  173. package/cpp/skia/include/private/{SkOnce.h → base/SkOnce.h} +3 -1
  174. package/cpp/skia/include/private/base/SkPathEnums.h +25 -0
  175. package/cpp/skia/include/private/{SkSafe32.h → base/SkSafe32.h} +16 -1
  176. package/cpp/skia/include/private/{SkSemaphore.h → base/SkSemaphore.h} +4 -3
  177. package/cpp/skia/include/private/base/SkSpan_impl.h +129 -0
  178. package/cpp/skia/include/private/base/SkTArray.h +694 -0
  179. package/cpp/skia/include/private/{SkTDArray.h → base/SkTDArray.h} +17 -54
  180. package/cpp/skia/include/private/{SkTFitsIn.h → base/SkTFitsIn.h} +14 -8
  181. package/cpp/skia/include/private/{SkTLogic.h → base/SkTLogic.h} +1 -1
  182. package/cpp/skia/include/private/{SkTemplates.h → base/SkTemplates.h} +63 -88
  183. package/cpp/skia/include/private/{SkThreadID.h → base/SkThreadID.h} +5 -2
  184. package/cpp/skia/include/private/{SkTo.h → base/SkTo.h} +13 -2
  185. package/cpp/skia/include/private/base/SkTypeTraits.h +33 -0
  186. package/cpp/skia/include/private/chromium/GrVkSecondaryCBDrawContext.h +130 -0
  187. package/cpp/skia/include/private/chromium/SkChromeRemoteGlyphCache.h +5 -9
  188. package/cpp/skia/include/private/chromium/SkDiscardableMemory.h +70 -0
  189. package/cpp/skia/include/private/chromium/Slug.h +0 -9
  190. package/cpp/skia/include/private/gpu/ganesh/GrContext_Base.h +2 -1
  191. package/cpp/skia/include/private/gpu/ganesh/GrD3DTypesMinimal.h +1 -1
  192. package/cpp/skia/include/private/gpu/ganesh/GrDawnTypesPriv.h +1 -1
  193. package/cpp/skia/include/private/gpu/ganesh/GrGLTypesPriv.h +1 -1
  194. package/cpp/skia/include/private/gpu/ganesh/GrImageContext.h +1 -1
  195. package/cpp/skia/include/private/gpu/ganesh/GrMockTypesPriv.h +3 -2
  196. package/cpp/skia/include/private/gpu/ganesh/GrMtlTypesPriv.h +1 -1
  197. package/cpp/skia/include/private/gpu/ganesh/GrTypesPriv.h +17 -23
  198. package/cpp/skia/include/private/gpu/ganesh/GrVkTypesPriv.h +2 -2
  199. package/cpp/skia/include/private/gpu/graphite/DawnTypesPriv.h +38 -0
  200. package/cpp/skia/include/private/gpu/graphite/{MtlTypesPriv.h → MtlGraphiteTypesPriv.h} +5 -5
  201. package/cpp/skia/include/private/gpu/graphite/VulkanGraphiteTypesPriv.h +1 -9
  202. package/cpp/skia/include/private/gpu/vk/SkiaVulkan.h +4 -0
  203. package/cpp/skia/include/utils/SkCamera.h +1 -1
  204. package/cpp/skia/include/utils/SkCustomTypeface.h +7 -1
  205. package/cpp/skia/include/utils/SkNWayCanvas.h +6 -6
  206. package/cpp/skia/include/utils/SkOrderedFontMgr.h +7 -6
  207. package/cpp/skia/include/utils/SkPaintFilterCanvas.h +2 -2
  208. package/cpp/skia/include/utils/SkParsePath.h +1 -1
  209. package/cpp/skia/modules/skcms/skcms.h +14 -0
  210. package/cpp/skia/modules/skcms/src/Transform_inl.h +19 -0
  211. package/cpp/skia/modules/skparagraph/include/FontCollection.h +2 -2
  212. package/cpp/skia/modules/skparagraph/include/Paragraph.h +72 -2
  213. package/cpp/skia/modules/skparagraph/include/ParagraphCache.h +1 -11
  214. package/cpp/skia/modules/skparagraph/include/ParagraphPainter.h +63 -0
  215. package/cpp/skia/modules/skparagraph/include/TextStyle.h +27 -4
  216. package/cpp/skia/modules/skparagraph/include/TypefaceFontProvider.h +13 -13
  217. package/cpp/skia/modules/skresources/include/SkResources.h +18 -4
  218. package/cpp/skia/modules/svg/include/SkSVGAttribute.h +1 -1
  219. package/cpp/skia/modules/svg/include/SkSVGAttributeParser.h +2 -2
  220. package/cpp/skia/modules/svg/include/SkSVGContainer.h +2 -2
  221. package/cpp/skia/modules/svg/include/SkSVGDOM.h +1 -1
  222. package/cpp/skia/modules/svg/include/SkSVGFilterContext.h +2 -2
  223. package/cpp/skia/modules/svg/include/SkSVGGradient.h +2 -2
  224. package/cpp/skia/modules/svg/include/SkSVGIDMapper.h +2 -2
  225. package/cpp/skia/modules/svg/include/SkSVGRenderContext.h +3 -3
  226. package/cpp/skia/modules/svg/include/SkSVGSVG.h +1 -1
  227. package/cpp/skia/modules/svg/include/SkSVGTypes.h +22 -21
  228. package/cpp/skia/modules/svg/include/SkSVGValue.h +1 -1
  229. package/cpp/skia/{include/private → src/core}/SkTHash.h +41 -37
  230. package/ios/RNSkia-iOS/RNSkMetalCanvasProvider.mm +1 -2
  231. package/ios/RNSkia-iOS/ViewScreenshotService.mm +1 -1
  232. package/libs/android/arm64-v8a/libskia.a +0 -0
  233. package/libs/android/arm64-v8a/libskottie.a +0 -0
  234. package/libs/android/arm64-v8a/libsksg.a +0 -0
  235. package/libs/android/arm64-v8a/libskshaper.a +0 -0
  236. package/libs/android/arm64-v8a/libsvg.a +0 -0
  237. package/libs/android/armeabi-v7a/libskia.a +0 -0
  238. package/libs/android/armeabi-v7a/libskottie.a +0 -0
  239. package/libs/android/armeabi-v7a/libsksg.a +0 -0
  240. package/libs/android/armeabi-v7a/libskshaper.a +0 -0
  241. package/libs/android/armeabi-v7a/libsvg.a +0 -0
  242. package/libs/android/x86/libskia.a +0 -0
  243. package/libs/android/x86/libskottie.a +0 -0
  244. package/libs/android/x86/libsksg.a +0 -0
  245. package/libs/android/x86/libskshaper.a +0 -0
  246. package/libs/android/x86/libsvg.a +0 -0
  247. package/libs/android/x86_64/libskia.a +0 -0
  248. package/libs/android/x86_64/libskottie.a +0 -0
  249. package/libs/android/x86_64/libsksg.a +0 -0
  250. package/libs/android/x86_64/libskshaper.a +0 -0
  251. package/libs/android/x86_64/libsvg.a +0 -0
  252. package/libs/ios/libskia.xcframework/Info.plist +5 -5
  253. package/libs/ios/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
  254. package/libs/ios/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
  255. package/libs/ios/libskottie.xcframework/ios-arm64_arm64e/libskottie.a +0 -0
  256. package/libs/ios/libskottie.xcframework/ios-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
  257. package/libs/ios/libsksg.xcframework/ios-arm64_arm64e/libsksg.a +0 -0
  258. package/libs/ios/libsksg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
  259. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
  260. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
  261. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
  262. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
  263. package/package.json +1 -1
  264. package/react-native-skia.podspec +1 -1
  265. package/scripts/install-npm.js +11 -1
  266. package/cpp/skia/include/core/SkImageEncoder.h +0 -71
  267. package/cpp/skia/include/gpu/GrConfig.h +0 -53
  268. package/cpp/skia/include/gpu/graphite/CombinationBuilder.h +0 -195
  269. package/cpp/skia/include/private/SkHalf.h +0 -38
  270. package/cpp/skia/include/private/SkImageInfoPriv.h +0 -199
  271. package/cpp/skia/include/private/SkSLIRNode.h +0 -64
  272. package/cpp/skia/include/private/SkSLLayout.h +0 -144
  273. package/cpp/skia/include/private/SkSLModifiers.h +0 -178
  274. package/cpp/skia/include/private/SkSLProgramElement.h +0 -77
  275. package/cpp/skia/include/private/SkSLProgramKind.h +0 -35
  276. package/cpp/skia/include/private/SkSLStatement.h +0 -86
  277. package/cpp/skia/include/private/SkSLString.h +0 -41
  278. package/cpp/skia/include/private/SkSLSymbol.h +0 -94
  279. package/cpp/skia/include/private/SkSafe_math.h +0 -52
  280. package/cpp/skia/include/private/SkStringView.h +0 -51
  281. package/cpp/skia/include/private/SkTArray.h +0 -655
  282. package/cpp/skia/include/private/SkUniquePaintParamsID.h +0 -35
  283. package/cpp/skia/include/private/SkVx.h +0 -1026
  284. package/cpp/skia/include/sksl/DSL.h +0 -37
  285. package/cpp/skia/include/sksl/DSLBlock.h +0 -58
  286. package/cpp/skia/include/sksl/DSLCase.h +0 -62
  287. package/cpp/skia/include/sksl/DSLCore.h +0 -492
  288. package/cpp/skia/include/sksl/DSLExpression.h +0 -241
  289. package/cpp/skia/include/sksl/DSLFunction.h +0 -113
  290. package/cpp/skia/include/sksl/DSLLayout.h +0 -92
  291. package/cpp/skia/include/sksl/DSLModifiers.h +0 -69
  292. package/cpp/skia/include/sksl/DSLStatement.h +0 -82
  293. package/cpp/skia/include/sksl/DSLSymbols.h +0 -61
  294. package/cpp/skia/include/sksl/DSLType.h +0 -271
  295. package/cpp/skia/include/sksl/DSLVar.h +0 -231
  296. package/cpp/skia/include/sksl/SkSLErrorReporter.h +0 -65
  297. package/cpp/skia/include/sksl/SkSLOperator.h +0 -154
  298. package/cpp/skia/include/sksl/SkSLPosition.h +0 -104
  299. package/cpp/skia/include/utils/SkRandom.h +0 -169
  300. package/cpp/skia/src/core/SkLRUCache.h +0 -126
  301. package/cpp/skia/src/core/SkTInternalLList.h +0 -302
  302. /package/cpp/skia/include/{core → codec}/SkPngChunkReader.h +0 -0
  303. /package/cpp/skia/include/private/{SkTPin.h → base/SkTPin.h} +0 -0
  304. /package/cpp/skia/include/private/{SkThreadAnnotations.h → base/SkThreadAnnotations.h} +0 -0
@@ -8,36 +8,34 @@
8
8
  #ifndef skgpu_graphite_Context_DEFINED
9
9
  #define skgpu_graphite_Context_DEFINED
10
10
 
11
+ #include "include/core/SkImage.h"
11
12
  #include "include/core/SkRefCnt.h"
12
13
  #include "include/core/SkShader.h"
13
14
  #include "include/gpu/graphite/ContextOptions.h"
14
15
  #include "include/gpu/graphite/GraphiteTypes.h"
15
16
  #include "include/gpu/graphite/Recorder.h"
16
- #include "include/private/SingleOwner.h"
17
+ #include "include/private/base/SingleOwner.h"
17
18
 
19
+ #include <functional>
18
20
  #include <memory>
19
21
 
20
22
  class SkRuntimeEffect;
21
23
 
22
- namespace skgpu { struct VulkanBackendContext; }
23
-
24
24
  namespace skgpu::graphite {
25
25
 
26
26
  class BackendTexture;
27
+ class Buffer;
28
+ class ClientMappedBufferManager;
27
29
  class Context;
28
30
  class ContextPriv;
29
- struct DawnBackendContext;
30
31
  class GlobalCache;
31
- struct MtlBackendContext;
32
+ class PaintOptions;
33
+ class PlotUploadTracker;
32
34
  class QueueManager;
33
35
  class Recording;
34
36
  class ResourceProvider;
35
37
  class SharedContext;
36
-
37
- #ifdef SK_ENABLE_PRECOMPILE
38
- class BlenderID;
39
- class CombinationBuilder;
40
- #endif
38
+ class TextureProxy;
41
39
 
42
40
  class SK_API Context final {
43
41
  public:
@@ -48,37 +46,30 @@ public:
48
46
 
49
47
  ~Context();
50
48
 
51
- #ifdef SK_DAWN
52
- static std::unique_ptr<Context> MakeDawn(const DawnBackendContext&, const ContextOptions&);
53
- #endif
54
- #ifdef SK_METAL
55
- static std::unique_ptr<Context> MakeMetal(const MtlBackendContext&, const ContextOptions&);
56
- #endif
57
-
58
- #ifdef SK_VULKAN
59
- static std::unique_ptr<Context> MakeVulkan(const VulkanBackendContext&, const ContextOptions&);
60
- #endif
61
-
62
49
  BackendApi backend() const;
63
50
 
64
51
  std::unique_ptr<Recorder> makeRecorder(const RecorderOptions& = {});
65
52
 
66
- void insertRecording(const InsertRecordingInfo&);
67
- void submit(SyncToCpu = SyncToCpu::kNo);
53
+ bool insertRecording(const InsertRecordingInfo&);
54
+ bool submit(SyncToCpu = SyncToCpu::kNo);
55
+
56
+ void asyncReadPixels(const SkImage* image,
57
+ const SkColorInfo& dstColorInfo,
58
+ const SkIRect& srcRect,
59
+ SkImage::ReadPixelsCallback callback,
60
+ SkImage::ReadPixelsContext context);
61
+
62
+ void asyncReadPixels(const SkSurface* surface,
63
+ const SkColorInfo& dstColorInfo,
64
+ const SkIRect& srcRect,
65
+ SkImage::ReadPixelsCallback callback,
66
+ SkImage::ReadPixelsContext context);
68
67
 
69
68
  /**
70
69
  * Checks whether any asynchronous work is complete and if so calls related callbacks.
71
70
  */
72
71
  void checkAsyncWorkCompletion();
73
72
 
74
- #ifdef SK_ENABLE_PRECOMPILE
75
- // TODO: add "ShaderID addUserDefinedShader(sk_sp<SkRuntimeEffect>)" here
76
- // TODO: add "ColorFilterID addUserDefinedColorFilter(sk_sp<SkRuntimeEffect>)" here
77
- BlenderID addUserDefinedBlender(sk_sp<SkRuntimeEffect>);
78
-
79
- void precompile(CombinationBuilder*);
80
- #endif
81
-
82
73
  /**
83
74
  * Called to delete the passed in BackendTexture. This should only be called if the
84
75
  * BackendTexture was created by calling Recorder::createBackendTexture on a Recorder created
@@ -94,21 +85,83 @@ public:
94
85
  ContextPriv priv();
95
86
  const ContextPriv priv() const; // NOLINT(readability-const-return-type)
96
87
 
88
+ class ContextID {
89
+ public:
90
+ static Context::ContextID Next();
91
+
92
+ ContextID() : fID(SK_InvalidUniqueID) {}
93
+
94
+ bool operator==(const ContextID& that) const { return fID == that.fID; }
95
+ bool operator!=(const ContextID& that) const { return !(*this == that); }
96
+
97
+ void makeInvalid() { fID = SK_InvalidUniqueID; }
98
+ bool isValid() const { return fID != SK_InvalidUniqueID; }
99
+
100
+ private:
101
+ constexpr ContextID(uint32_t id) : fID(id) {}
102
+ uint32_t fID;
103
+ };
104
+
105
+ ContextID contextID() const { return fContextID; }
106
+
97
107
  protected:
98
- Context(sk_sp<SharedContext>, std::unique_ptr<QueueManager>);
108
+ Context(sk_sp<SharedContext>, std::unique_ptr<QueueManager>, const ContextOptions&);
99
109
 
100
110
  private:
101
111
  friend class ContextPriv;
112
+ friend class ContextCtorAccessor;
102
113
 
103
114
  SingleOwner* singleOwner() const { return &fSingleOwner; }
104
115
 
116
+ // Must be called in Make() to handle one-time GPU setup operations that can possibly fail and
117
+ // require Context::Make() to return a nullptr.
118
+ bool finishInitialization();
119
+
120
+ void asyncReadPixels(const TextureProxy* textureProxy,
121
+ const SkImageInfo& srcImageInfo,
122
+ const SkColorInfo& dstColorInfo,
123
+ const SkIRect& srcRect,
124
+ SkImage::ReadPixelsCallback callback,
125
+ SkImage::ReadPixelsContext context);
126
+
127
+ // Inserts a texture to buffer transfer task, used by asyncReadPixels methods
128
+ struct PixelTransferResult {
129
+ using ConversionFn = void(void* dst, const void* mappedBuffer);
130
+ // If null then the transfer could not be performed. Otherwise this buffer will contain
131
+ // the pixel data when the transfer is complete.
132
+ sk_sp<Buffer> fTransferBuffer;
133
+ // RowBytes for transfer buffer data
134
+ size_t fRowBytes;
135
+ // If this is null then the transfer buffer will contain the data in the requested
136
+ // color type. Otherwise, when the transfer is done this must be called to convert
137
+ // from the transfer buffer's color type to the requested color type.
138
+ std::function<ConversionFn> fPixelConverter;
139
+ };
140
+ PixelTransferResult transferPixels(const TextureProxy*,
141
+ const SkImageInfo& srcImageInfo,
142
+ const SkColorInfo& dstColorInfo,
143
+ const SkIRect& srcRect);
144
+
105
145
  sk_sp<SharedContext> fSharedContext;
106
146
  std::unique_ptr<ResourceProvider> fResourceProvider;
107
147
  std::unique_ptr<QueueManager> fQueueManager;
148
+ std::unique_ptr<ClientMappedBufferManager> fMappedBufferManager;
149
+ std::unique_ptr<PlotUploadTracker> fPlotUploadTracker;
108
150
 
109
151
  // In debug builds we guard against improper thread handling. This guard is passed to the
110
152
  // ResourceCache for the Context.
111
153
  mutable SingleOwner fSingleOwner;
154
+
155
+ #if GRAPHITE_TEST_UTILS
156
+ // In test builds a Recorder may track the Context that was used to create it.
157
+ bool fStoreContextRefInRecorder = false;
158
+ // If this tracking is on, to allow the client to safely delete this Context or its Recorders
159
+ // in any order we must also track the Recorders created here.
160
+ std::vector<Recorder*> fTrackedRecorders;
161
+ #endif
162
+
163
+ // Needed for MessageBox handling
164
+ const ContextID fContextID;
112
165
  };
113
166
 
114
167
  } // namespace skgpu::graphite
@@ -8,6 +8,8 @@
8
8
  #ifndef skgpu_graphite_ContextOptions_DEFINED
9
9
  #define skgpu_graphite_ContextOptions_DEFINED
10
10
 
11
+ #include "include/private/base/SkAPI.h"
12
+
11
13
  namespace skgpu { class ShaderErrorHandler; }
12
14
 
13
15
  namespace skgpu::graphite {
@@ -15,6 +17,13 @@ namespace skgpu::graphite {
15
17
  struct SK_API ContextOptions {
16
18
  ContextOptions() {}
17
19
 
20
+ /**
21
+ * Disables correctness workarounds that are enabled for particular GPUs, OSes, or drivers.
22
+ * This does not affect code path choices that are made for perfomance reasons nor does it
23
+ * override other ContextOption settings.
24
+ */
25
+ bool fDisableDriverCorrectnessWorkarounds = false;
26
+
18
27
  /**
19
28
  * If present, use this object to report shader compilation failures. If not, report failures
20
29
  * via SkDebugf and assert.
@@ -55,18 +64,7 @@ struct SK_API ContextOptions {
55
64
  * fGlypheCacheTextureMaximumBytes.
56
65
  */
57
66
  bool fAllowMultipleGlyphCacheTextures = true;
58
-
59
- /**
60
- * If true, then add 1 pixel padding to all glyph masks in the atlas to support bi-lerp
61
- * rendering of all glyphs. This must be set to true to use Slugs.
62
- */
63
- #if defined(SK_EXPERIMENTAL_SIMULATE_DRAWGLYPHRUNLIST_WITH_SLUG) || \
64
- defined(SK_EXPERIMENTAL_SIMULATE_DRAWGLYPHRUNLIST_WITH_SLUG_SERIALIZE) || \
65
- defined(SK_EXPERIMENTAL_SIMULATE_DRAWGLYPHRUNLIST_WITH_SLUG_STRIKE_SERIALIZE)
66
- bool fSupportBilerpFromGlyphAtlas = true;
67
- #else
68
67
  bool fSupportBilerpFromGlyphAtlas = false;
69
- #endif
70
68
 
71
69
  #if GRAPHITE_TEST_UTILS
72
70
  /**
@@ -77,6 +75,12 @@ struct SK_API ContextOptions {
77
75
  * Maximum width and height of internal texture atlases.
78
76
  */
79
77
  int fMaxTextureAtlasSize = 2048;
78
+
79
+ /**
80
+ * If true, will store a pointer in Recorder that points back to the Context
81
+ * that created it. Used by readPixels() and other methods that normally require a Context.
82
+ */
83
+ bool fStoreContextRefInRecorder = false;
80
84
  #endif
81
85
  };
82
86
 
@@ -8,14 +8,18 @@
8
8
  #ifndef skgpu_graphite_GraphiteTypes_DEFINED
9
9
  #define skgpu_graphite_GraphiteTypes_DEFINED
10
10
 
11
+ #include "include/core/SkPoint.h"
11
12
  #include "include/core/SkTypes.h"
12
13
  #include "include/gpu/GpuTypes.h"
13
14
 
14
15
  #include <memory>
15
16
 
17
+ class SkSurface;
18
+
16
19
  namespace skgpu::graphite {
17
20
 
18
21
  class Recording;
22
+ class Task;
19
23
 
20
24
  using GpuFinishedContext = void*;
21
25
  using GpuFinishedProc = void (*)(GpuFinishedContext finishedContext, CallbackResult);
@@ -27,9 +31,33 @@ using GpuFinishedProc = void (*)(GpuFinishedContext finishedContext, CallbackRes
27
31
  * the Recording that they may be holding onto. If the Recording is successfully submitted to the
28
32
  * GPU the callback will be called with CallbackResult::kSuccess once the GPU has finished. All
29
33
  * other cases where some failure occured it will be called with CallbackResult::kFailed.
34
+ *
35
+ * The fTargetSurface, if provided, is used as a target for any draws recorded onto a deferred
36
+ * canvas returned from Recorder::makeDeferredCanvas. This target surface must be provided iff
37
+ * the Recording contains any such draws. It must be Graphite-backed and its backing texture's
38
+ * TextureInfo must match the info provided to the Recorder when making the deferred canvas.
39
+ *
40
+ * fTargetTranslation is an additional translation applied to draws targeting fTargetSurface.
30
41
  */
31
42
  struct InsertRecordingInfo {
32
43
  Recording* fRecording = nullptr;
44
+
45
+ SkSurface* fTargetSurface = nullptr;
46
+ SkIVector fTargetTranslation = {0, 0};
47
+
48
+ GpuFinishedContext fFinishedContext = nullptr;
49
+ GpuFinishedProc fFinishedProc = nullptr;
50
+ };
51
+
52
+ /**
53
+ * The fFinishedProc is called when the Recording has been submitted and finished on the GPU, or
54
+ * when there is a failure that caused it not to be submitted. The callback will always be called
55
+ * and the caller can use the callback to know it is safe to free any resources associated with
56
+ * the Recording that they may be holding onto. If the Recording is successfully submitted to the
57
+ * GPU the callback will be called with CallbackResult::kSuccess once the GPU has finished. All
58
+ * other cases where some failure occured it will be called with CallbackResult::kFailed.
59
+ */
60
+ struct InsertFinishInfo {
33
61
  GpuFinishedContext fFinishedContext = nullptr;
34
62
  GpuFinishedProc fFinishedProc = nullptr;
35
63
  };
@@ -42,12 +70,34 @@ enum class SyncToCpu : bool {
42
70
  kNo = false
43
71
  };
44
72
 
45
- /**
46
- * Is the texture mipmapped or not
73
+ /*
74
+ * For Promise Images - should the Promise Image be fulfilled every time a Recording that references
75
+ * it is inserted into the Context.
47
76
  */
48
- enum class Mipmapped : bool {
49
- kNo = false,
50
- kYes = true,
77
+ enum class Volatile : bool {
78
+ kNo = false, // only fulfilled once
79
+ kYes = true // fulfilled on every insertion call
80
+ };
81
+
82
+ /*
83
+ * Graphite's different rendering methods each only apply to certain types of draws. This
84
+ * enum supports decision-making regarding the different renderers and what is being drawn.
85
+ */
86
+ enum DrawTypeFlags : uint8_t {
87
+
88
+ kNone = 0b000,
89
+
90
+ // SkCanvas:: drawSimpleText, drawString, drawGlyphs, drawTextBlob, drawSlug
91
+ kText = 0b001,
92
+
93
+ // SkCanvas::drawVertices
94
+ kDrawVertices = 0b010,
95
+
96
+ // All other canvas draw calls
97
+ kShape = 0b100,
98
+
99
+ kMostCommon = kText | kShape,
100
+ kAll = kText | kDrawVertices | kShape
51
101
  };
52
102
 
53
103
  } // namespace skgpu::graphite
@@ -13,7 +13,6 @@
13
13
 
14
14
  namespace skgpu::graphite {
15
15
 
16
- enum class Mipmapped : bool;
17
16
  class Recorder;
18
17
 
19
18
  /*
@@ -23,9 +22,12 @@ class Recorder;
23
22
  * return a Graphite-backed version of the provided SkImage that meets the specified
24
23
  * requirements.
25
24
  *
26
- * Skia requires that 'findOrCreate' return a Graphite-backed image that preserves the dimensions,
27
- * number of channels and alpha type of the original image. The bit depth of the
28
- * individual channels can change (e.g., 4444 -> 8888 is allowed).
25
+ * Skia requires that 'findOrCreate' return a Graphite-backed image that preserves the
26
+ * dimensions and alpha type of the original image. The bit depth of the
27
+ * individual channels can change (e.g., 4444 -> 8888 is allowed) as well as the channels - as
28
+ * long as the returned image has a superset of the original image's channels
29
+ * (e.g., 565 -> 8888 opaque is allowed).
30
+ *
29
31
  * Wrt mipmapping, the returned image can have different mipmap settings than requested. If
30
32
  * mipmapping was requested but not returned, the sampling level will be reduced to linear.
31
33
  * If the requirements are not met by the returned image (modulo the flexibility wrt mipmapping)
@@ -11,17 +11,20 @@
11
11
  #include "include/core/SkRefCnt.h"
12
12
  #include "include/core/SkSize.h"
13
13
  #include "include/gpu/graphite/GraphiteTypes.h"
14
- #include "include/private/SingleOwner.h"
15
- #include "include/private/SkTHash.h"
14
+ #include "include/gpu/graphite/Recording.h"
15
+ #include "include/private/base/SingleOwner.h"
16
+ #include "include/private/base/SkTArray.h"
16
17
 
17
18
  #include <vector>
18
19
 
20
+ class SkCanvas;
21
+ struct SkImageInfo;
19
22
  class SkPixmap;
20
- class SkRuntimeEffectDictionary;
21
- class SkTextureDataBlock;
22
- class SkUniformDataBlock;
23
23
 
24
- namespace skgpu { class TokenTracker; }
24
+ namespace skgpu {
25
+ class RefCntedCallback;
26
+ class TokenTracker;
27
+ }
25
28
 
26
29
  namespace sktext::gpu {
27
30
  class StrikeCache;
@@ -33,22 +36,26 @@ namespace skgpu::graphite {
33
36
  class AtlasManager;
34
37
  class BackendTexture;
35
38
  class Caps;
39
+ class Context;
36
40
  class Device;
37
41
  class DrawBufferManager;
38
42
  class GlobalCache;
39
43
  class ImageProvider;
44
+ class ProxyCache;
40
45
  class RecorderPriv;
41
- class Recording;
42
46
  class ResourceProvider;
47
+ class RuntimeEffectDictionary;
43
48
  class SharedContext;
44
49
  class Task;
45
50
  class TaskGraph;
51
+ class TextureDataBlock;
46
52
  class TextureInfo;
53
+ class UniformDataBlock;
47
54
  class UploadBufferManager;
48
55
 
49
56
  template<typename T> class PipelineDataCache;
50
- using UniformDataCache = PipelineDataCache<SkUniformDataBlock>;
51
- using TextureDataCache = PipelineDataCache<SkTextureDataBlock>;
57
+ using UniformDataCache = PipelineDataCache<UniformDataBlock>;
58
+ using TextureDataCache = PipelineDataCache<TextureDataBlock>;
52
59
 
53
60
  struct SK_API RecorderOptions final {
54
61
  RecorderOptions();
@@ -115,11 +122,23 @@ public:
115
122
  */
116
123
  void deleteBackendTexture(BackendTexture&);
117
124
 
125
+ // Adds a proc that will be moved to the Recording upon snap, subsequently attached to the
126
+ // CommandBuffer when the Recording is added, and called when that CommandBuffer is submitted
127
+ // and finishes. If the Recorder or Recording is deleted before the proc is added to the
128
+ // CommandBuffer, it will be called with result Failure.
129
+ void addFinishInfo(const InsertFinishInfo&);
130
+
131
+ // Returns a canvas that will record to a proxy surface, which must be instantiated on replay.
132
+ // This can only be called once per Recording; subsequent calls will return null until a
133
+ // Recording is snapped. Additionally, the returned SkCanvas is only valid until the next
134
+ // Recording snap, at which point it is deleted.
135
+ SkCanvas* makeDeferredCanvas(const SkImageInfo&, const TextureInfo&);
136
+
118
137
  // Provides access to functions that aren't part of the public API.
119
138
  RecorderPriv priv();
120
139
  const RecorderPriv priv() const; // NOLINT(readability-const-return-type)
121
140
 
122
- #if GR_TEST_UTILS
141
+ #if GRAPHITE_TEST_UTILS
123
142
  bool deviceIsRegistered(Device*);
124
143
  #endif
125
144
 
@@ -156,7 +175,7 @@ private:
156
175
 
157
176
  sk_sp<SharedContext> fSharedContext;
158
177
  std::unique_ptr<ResourceProvider> fResourceProvider;
159
- std::unique_ptr<SkRuntimeEffectDictionary> fRuntimeEffectDict;
178
+ std::unique_ptr<RuntimeEffectDictionary> fRuntimeEffectDict;
160
179
 
161
180
  std::unique_ptr<TaskGraph> fGraph;
162
181
  std::unique_ptr<UniformDataCache> fUniformDataCache;
@@ -176,6 +195,17 @@ private:
176
195
  // This guard is passed to the ResourceCache.
177
196
  // TODO: Should we also pass this to Device, DrawContext, and similar classes?
178
197
  mutable SingleOwner fSingleOwner;
198
+
199
+ sk_sp<Device> fTargetProxyDevice;
200
+ std::unique_ptr<SkCanvas> fTargetProxyCanvas;
201
+ std::unique_ptr<Recording::LazyProxyData> fTargetProxyData;
202
+
203
+ skia_private::TArray<sk_sp<RefCntedCallback>> fFinishedProcs;
204
+
205
+ #if GRAPHITE_TEST_UTILS
206
+ // For testing use only -- the Context used to create this Recorder
207
+ Context* fContext = nullptr;
208
+ #endif
179
209
  };
180
210
 
181
211
  } // namespace skgpu::graphite
@@ -9,10 +9,17 @@
9
9
  #define skgpu_graphite_Recording_DEFINED
10
10
 
11
11
  #include "include/core/SkRefCnt.h"
12
+ #include "include/private/SkChecksum.h"
13
+ #include "include/private/base/SkTArray.h"
12
14
 
13
15
  #include <memory>
16
+ #include <unordered_set>
14
17
  #include <vector>
15
18
 
19
+ namespace skgpu {
20
+ class RefCntedCallback;
21
+ }
22
+
16
23
  namespace skgpu::graphite {
17
24
 
18
25
  class CommandBuffer;
@@ -20,18 +27,51 @@ class RecordingPriv;
20
27
  class Resource;
21
28
  class ResourceProvider;
22
29
  class TaskGraph;
30
+ class Texture;
31
+ class TextureInfo;
32
+ class TextureProxy;
23
33
 
24
- class Recording final {
34
+ class SK_API Recording final {
25
35
  public:
26
36
  ~Recording();
27
37
 
28
38
  RecordingPriv priv();
29
39
 
40
+ #if GRAPHITE_TEST_UTILS
41
+ bool isTargetProxyInstantiated() const;
42
+ #endif
43
+
30
44
  private:
31
- friend class Recorder; // for ctor
45
+ friend class Recorder; // for ctor and LazyProxyData
32
46
  friend class RecordingPriv;
33
47
 
34
- Recording(std::unique_ptr<TaskGraph>);
48
+ // LazyProxyData is used if this recording should be replayed to a target that is provided on
49
+ // replay, and it handles the target proxy's instantiation with the provided target.
50
+ class LazyProxyData {
51
+ public:
52
+ LazyProxyData(const TextureInfo&);
53
+
54
+ TextureProxy* lazyProxy();
55
+ sk_sp<TextureProxy> refLazyProxy();
56
+
57
+ bool lazyInstantiate(ResourceProvider*, sk_sp<Texture>);
58
+
59
+ private:
60
+ sk_sp<Texture> fTarget;
61
+ sk_sp<TextureProxy> fTargetProxy;
62
+ };
63
+
64
+ struct ProxyHash {
65
+ std::size_t operator()(const sk_sp<TextureProxy>& proxy) const {
66
+ return SkGoodHash()(proxy.get());
67
+ }
68
+ };
69
+
70
+ Recording(std::unique_ptr<TaskGraph>,
71
+ std::unordered_set<sk_sp<TextureProxy>, ProxyHash>&& nonVolatileLazyProxies,
72
+ std::unordered_set<sk_sp<TextureProxy>, ProxyHash>&& volatileLazyProxies,
73
+ std::unique_ptr<LazyProxyData> targetProxyData,
74
+ skia_private::TArray<sk_sp<RefCntedCallback>>&& finishedProcs);
35
75
 
36
76
  bool addCommands(CommandBuffer*, ResourceProvider*);
37
77
  void addResourceRef(sk_sp<Resource>);
@@ -42,6 +82,13 @@ private:
42
82
  // Those refs are stored in the array here and will eventually be passed onto a CommandBuffer
43
83
  // when the Recording adds its commands.
44
84
  std::vector<sk_sp<Resource>> fExtraResourceRefs;
85
+
86
+ std::unordered_set<sk_sp<TextureProxy>, ProxyHash> fNonVolatileLazyProxies;
87
+ std::unordered_set<sk_sp<TextureProxy>, ProxyHash> fVolatileLazyProxies;
88
+
89
+ std::unique_ptr<LazyProxyData> fTargetProxyData;
90
+
91
+ skia_private::TArray<sk_sp<RefCntedCallback>> fFinishedProcs;
45
92
  };
46
93
 
47
94
  } // namespace skgpu::graphite
@@ -10,8 +10,12 @@
10
10
 
11
11
  #include "include/gpu/graphite/GraphiteTypes.h"
12
12
 
13
+ #ifdef SK_DAWN
14
+ #include "include/private/gpu/graphite/DawnTypesPriv.h"
15
+ #endif
16
+
13
17
  #ifdef SK_METAL
14
- #include "include/private/gpu/graphite/MtlTypesPriv.h"
18
+ #include "include/private/gpu/graphite/MtlGraphiteTypesPriv.h"
15
19
  #endif
16
20
 
17
21
  #ifdef SK_VULKAN
@@ -20,15 +24,25 @@
20
24
 
21
25
  namespace skgpu::graphite {
22
26
 
23
- class TextureInfo {
27
+ class SK_API TextureInfo {
24
28
  public:
25
29
  TextureInfo() {}
30
+ #ifdef SK_DAWN
31
+ TextureInfo(const DawnTextureInfo& dawnInfo)
32
+ : fBackend(BackendApi::kDawn)
33
+ , fValid(true)
34
+ , fSampleCount(dawnInfo.fSampleCount)
35
+ , fMipmapped(dawnInfo.fMipmapped)
36
+ , fProtected(Protected::kNo)
37
+ , fDawnSpec(dawnInfo) {}
38
+ #endif
39
+
26
40
  #ifdef SK_METAL
27
41
  TextureInfo(const MtlTextureInfo& mtlInfo)
28
42
  : fBackend(BackendApi::kMetal)
29
43
  , fValid(true)
30
44
  , fSampleCount(mtlInfo.fSampleCount)
31
- , fLevelCount(mtlInfo.fLevelCount)
45
+ , fMipmapped(mtlInfo.fMipmapped)
32
46
  , fProtected(Protected::kNo)
33
47
  , fMtlSpec(mtlInfo) {}
34
48
  #endif
@@ -38,7 +52,7 @@ public:
38
52
  : fBackend(BackendApi::kVulkan)
39
53
  , fValid(true)
40
54
  , fSampleCount(vkInfo.fSampleCount)
41
- , fLevelCount(vkInfo.fLevelCount)
55
+ , fMipmapped(vkInfo.fMipmapped)
42
56
  , fProtected(Protected::kNo)
43
57
  , fVkSpec(vkInfo) {
44
58
  if (vkInfo.fFlags & VK_IMAGE_CREATE_PROTECTED_BIT) {
@@ -58,15 +72,25 @@ public:
58
72
  BackendApi backend() const { return fBackend; }
59
73
 
60
74
  uint32_t numSamples() const { return fSampleCount; }
61
- uint32_t numMipLevels() const { return fLevelCount; }
75
+ Mipmapped mipmapped() const { return fMipmapped; }
62
76
  Protected isProtected() const { return fProtected; }
63
77
 
78
+ #ifdef SK_DAWN
79
+ bool getDawnTextureInfo(DawnTextureInfo* info) const {
80
+ if (!this->isValid() || fBackend != BackendApi::kDawn) {
81
+ return false;
82
+ }
83
+ *info = DawnTextureSpecToTextureInfo(fDawnSpec, fSampleCount, fMipmapped);
84
+ return true;
85
+ }
86
+ #endif
87
+
64
88
  #ifdef SK_METAL
65
89
  bool getMtlTextureInfo(MtlTextureInfo* info) const {
66
90
  if (!this->isValid() || fBackend != BackendApi::kMetal) {
67
91
  return false;
68
92
  }
69
- *info = MtlTextureSpecToTextureInfo(fMtlSpec, fSampleCount, fLevelCount);
93
+ *info = MtlTextureSpecToTextureInfo(fMtlSpec, fSampleCount, fMipmapped);
70
94
  return true;
71
95
  }
72
96
  #endif
@@ -76,12 +100,24 @@ public:
76
100
  if (!this->isValid() || fBackend != BackendApi::kVulkan) {
77
101
  return false;
78
102
  }
79
- *info = VulkanTextureSpecToTextureInfo(fVkSpec, fSampleCount, fLevelCount);
103
+ *info = VulkanTextureSpecToTextureInfo(fVkSpec, fSampleCount, fMipmapped);
80
104
  return true;
81
105
  }
82
106
  #endif
83
107
 
84
108
  private:
109
+ #ifdef SK_DAWN
110
+ friend class DawnCaps;
111
+ friend class DawnCommandBuffer;
112
+ friend class DawnGraphicsPipeline;
113
+ friend class DawnResourceProvider;
114
+ friend class DawnTexture;
115
+ const DawnTextureSpec& dawnTextureSpec() const {
116
+ SkASSERT(fValid && fBackend == BackendApi::kDawn);
117
+ return fDawnSpec;
118
+ }
119
+ #endif
120
+
85
121
  #ifdef SK_METAL
86
122
  friend class MtlCaps;
87
123
  friend class MtlGraphicsPipeline;
@@ -105,10 +141,13 @@ private:
105
141
  bool fValid = false;
106
142
 
107
143
  uint32_t fSampleCount = 1;
108
- uint32_t fLevelCount = 0;
144
+ Mipmapped fMipmapped = Mipmapped::kNo;
109
145
  Protected fProtected = Protected::kNo;
110
146
 
111
147
  union {
148
+ #ifdef SK_DAWN
149
+ DawnTextureSpec fDawnSpec;
150
+ #endif
112
151
  #ifdef SK_METAL
113
152
  MtlTextureSpec fMtlSpec;
114
153
  #endif