@shopify/react-native-skia 0.1.192 → 0.1.193

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 (301) 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/cpp/api/JsiSkImage.h +25 -4
  5. package/cpp/api/JsiSkImageFactory.h +2 -2
  6. package/cpp/api/JsiSkPath.h +8 -6
  7. package/cpp/rnskia/dom/base/Declaration.h +5 -7
  8. package/cpp/rnskia/dom/nodes/JsiBlurMaskNode.h +1 -0
  9. package/cpp/rnskia/dom/nodes/JsiPathNode.h +2 -2
  10. package/cpp/rnskia/dom/props/BoxShadowProps.h +2 -0
  11. package/cpp/skia/include/android/SkAndroidFrameworkUtils.h +2 -8
  12. package/cpp/skia/include/android/SkImageAndroid.h +101 -0
  13. package/cpp/skia/include/codec/SkAndroidCodec.h +26 -8
  14. package/cpp/skia/include/codec/SkCodec.h +31 -17
  15. package/cpp/skia/include/codec/SkEncodedImageFormat.h +36 -0
  16. package/cpp/skia/include/codec/SkPixmapUtils.h +31 -0
  17. package/cpp/skia/include/config/SkUserConfig.h +61 -29
  18. package/cpp/skia/include/core/SkBitmap.h +25 -25
  19. package/cpp/skia/include/core/SkBlurTypes.h +0 -2
  20. package/cpp/skia/include/core/SkCanvas.h +32 -15
  21. package/cpp/skia/include/core/SkCapabilities.h +2 -2
  22. package/cpp/skia/include/core/SkColor.h +2 -0
  23. package/cpp/skia/include/core/SkColorPriv.h +19 -4
  24. package/cpp/skia/include/core/SkColorSpace.h +14 -17
  25. package/cpp/skia/include/core/SkColorType.h +1 -0
  26. package/cpp/skia/include/core/SkContourMeasure.h +1 -1
  27. package/cpp/skia/include/core/SkCoverageMode.h +0 -2
  28. package/cpp/skia/include/core/SkCubicMap.h +2 -0
  29. package/cpp/skia/include/core/SkData.h +5 -2
  30. package/cpp/skia/include/core/SkDataTable.h +6 -2
  31. package/cpp/skia/include/core/SkDeferredDisplayList.h +11 -10
  32. package/cpp/skia/include/core/SkDeferredDisplayListRecorder.h +9 -8
  33. package/cpp/skia/include/core/SkDrawable.h +10 -2
  34. package/cpp/skia/include/core/SkEncodedImageFormat.h +3 -30
  35. package/cpp/skia/include/core/SkFlattenable.h +4 -2
  36. package/cpp/skia/include/core/SkFont.h +1 -0
  37. package/cpp/skia/include/core/SkFontMetrics.h +1 -0
  38. package/cpp/skia/include/core/SkFontMgr.h +20 -29
  39. package/cpp/skia/include/core/SkFontStyle.h +4 -1
  40. package/cpp/skia/include/core/SkGraphics.h +21 -18
  41. package/cpp/skia/include/core/SkICC.h +3 -13
  42. package/cpp/skia/include/core/SkImage.h +395 -717
  43. package/cpp/skia/include/core/SkImageGenerator.h +19 -74
  44. package/cpp/skia/include/core/SkImageInfo.h +7 -5
  45. package/cpp/skia/include/core/SkM44.h +11 -0
  46. package/cpp/skia/include/core/SkMaskFilter.h +6 -3
  47. package/cpp/skia/include/core/SkMatrix.h +14 -4
  48. package/cpp/skia/include/core/SkMesh.h +52 -18
  49. package/cpp/skia/include/core/SkMilestone.h +1 -1
  50. package/cpp/skia/include/core/SkPaint.h +11 -34
  51. package/cpp/skia/include/core/SkPath.h +23 -4
  52. package/cpp/skia/include/core/SkPathBuilder.h +13 -5
  53. package/cpp/skia/include/core/SkPathMeasure.h +1 -1
  54. package/cpp/skia/include/core/SkPathTypes.h +0 -2
  55. package/cpp/skia/include/core/SkPathUtils.h +42 -0
  56. package/cpp/skia/include/core/SkPicture.h +3 -2
  57. package/cpp/skia/include/core/SkPictureRecorder.h +2 -0
  58. package/cpp/skia/include/core/SkPixelRef.h +4 -8
  59. package/cpp/skia/include/core/SkPixmap.h +12 -20
  60. package/cpp/skia/include/core/SkPoint.h +4 -2
  61. package/cpp/skia/include/core/SkPromiseImageTexture.h +2 -2
  62. package/cpp/skia/include/core/SkRRect.h +5 -1
  63. package/cpp/skia/include/core/SkRect.h +6 -3
  64. package/cpp/skia/include/core/SkRefCnt.h +9 -14
  65. package/cpp/skia/include/core/SkRegion.h +1 -1
  66. package/cpp/skia/include/core/SkScalar.h +2 -4
  67. package/cpp/skia/include/core/SkSerialProcs.h +18 -10
  68. package/cpp/skia/include/core/SkShader.h +1 -64
  69. package/cpp/skia/include/core/SkSize.h +2 -0
  70. package/cpp/skia/include/core/SkSpan.h +4 -112
  71. package/cpp/skia/include/core/SkStream.h +11 -12
  72. package/cpp/skia/include/core/SkString.h +9 -25
  73. package/cpp/skia/include/core/SkStrokeRec.h +1 -1
  74. package/cpp/skia/include/core/SkSurface.h +83 -61
  75. package/cpp/skia/include/core/SkSurfaceCharacterization.h +3 -3
  76. package/cpp/skia/include/core/SkSurfaceProps.h +9 -1
  77. package/cpp/skia/include/core/SkTextBlob.h +2 -2
  78. package/cpp/skia/include/core/SkTextureCompressionType.h +30 -0
  79. package/cpp/skia/include/core/SkTime.h +1 -1
  80. package/cpp/skia/include/core/SkTypeface.h +9 -2
  81. package/cpp/skia/include/core/SkTypes.h +37 -466
  82. package/cpp/skia/include/core/SkVertices.h +2 -0
  83. package/cpp/skia/include/core/SkYUVAInfo.h +4 -0
  84. package/cpp/skia/include/core/SkYUVAPixmaps.h +7 -1
  85. package/cpp/skia/include/docs/SkPDFDocument.h +12 -1
  86. package/cpp/skia/include/effects/SkColorMatrix.h +2 -1
  87. package/cpp/skia/include/effects/SkGradientShader.h +65 -14
  88. package/cpp/skia/include/effects/SkImageFilters.h +0 -11
  89. package/cpp/skia/include/effects/SkRuntimeEffect.h +41 -11
  90. package/cpp/skia/include/encode/SkEncoder.h +7 -3
  91. package/cpp/skia/include/encode/SkICC.h +36 -0
  92. package/cpp/skia/include/encode/SkJpegEncoder.h +102 -71
  93. package/cpp/skia/include/encode/SkPngEncoder.h +89 -71
  94. package/cpp/skia/include/encode/SkWebpEncoder.h +65 -38
  95. package/cpp/skia/include/gpu/GpuTypes.h +23 -1
  96. package/cpp/skia/include/gpu/GrBackendSurface.h +9 -7
  97. package/cpp/skia/include/gpu/GrContextOptions.h +28 -9
  98. package/cpp/skia/include/gpu/GrContextThreadSafeProxy.h +6 -4
  99. package/cpp/skia/include/gpu/GrDirectContext.h +84 -63
  100. package/cpp/skia/include/gpu/GrDriverBugWorkarounds.h +2 -1
  101. package/cpp/skia/include/gpu/GrRecordingContext.h +9 -5
  102. package/cpp/skia/include/gpu/GrTypes.h +18 -18
  103. package/cpp/skia/include/gpu/d3d/GrD3DTypes.h +4 -4
  104. package/cpp/skia/include/gpu/dawn/GrDawnTypes.h +3 -3
  105. package/cpp/skia/include/gpu/ganesh/GrTextureGenerator.h +77 -0
  106. package/cpp/skia/include/gpu/ganesh/SkImageGanesh.h +385 -0
  107. package/cpp/skia/include/gpu/gl/GrGLExtensions.h +3 -3
  108. package/cpp/skia/include/gpu/gl/GrGLFunctions.h +1 -1
  109. package/cpp/skia/include/gpu/gl/GrGLInterface.h +0 -3
  110. package/cpp/skia/include/gpu/gl/GrGLTypes.h +2 -1
  111. package/cpp/skia/include/gpu/graphite/BackendTexture.h +72 -3
  112. package/cpp/skia/include/gpu/graphite/Context.h +85 -32
  113. package/cpp/skia/include/gpu/graphite/ContextOptions.h +15 -11
  114. package/cpp/skia/include/gpu/graphite/GraphiteTypes.h +55 -5
  115. package/cpp/skia/include/gpu/graphite/ImageProvider.h +6 -4
  116. package/cpp/skia/include/gpu/graphite/Recorder.h +41 -11
  117. package/cpp/skia/include/gpu/graphite/Recording.h +50 -3
  118. package/cpp/skia/include/gpu/graphite/TextureInfo.h +47 -8
  119. package/cpp/skia/include/gpu/graphite/YUVABackendTextures.h +139 -0
  120. package/cpp/skia/include/gpu/graphite/dawn/DawnTypes.h +40 -0
  121. package/cpp/skia/include/gpu/graphite/dawn/DawnUtils.h +28 -0
  122. package/cpp/skia/include/gpu/graphite/mtl/MtlBackendContext.h +1 -1
  123. package/cpp/skia/include/gpu/graphite/mtl/{MtlTypes.h → MtlGraphiteTypes.h} +7 -6
  124. package/cpp/skia/include/gpu/graphite/mtl/MtlGraphiteUtils.h +27 -0
  125. package/cpp/skia/include/gpu/graphite/vk/VulkanGraphiteTypes.h +4 -9
  126. package/cpp/skia/include/gpu/graphite/vk/VulkanGraphiteUtils.h +28 -0
  127. package/cpp/skia/include/gpu/mock/GrMockTypes.h +17 -13
  128. package/cpp/skia/include/gpu/mtl/GrMtlTypes.h +2 -2
  129. package/cpp/skia/include/gpu/vk/GrVkBackendContext.h +1 -1
  130. package/cpp/skia/include/gpu/vk/GrVkTypes.h +3 -3
  131. package/cpp/skia/include/gpu/vk/VulkanExtensions.h +3 -3
  132. package/cpp/skia/include/gpu/vk/VulkanMemoryAllocator.h +5 -7
  133. package/cpp/skia/include/pathops/SkPathOps.h +3 -3
  134. package/cpp/skia/include/ports/SkFontMgr_data.h +22 -0
  135. package/cpp/skia/include/ports/SkFontMgr_indirect.h +14 -14
  136. package/cpp/skia/include/ports/SkRemotableFontMgr.h +2 -2
  137. package/cpp/skia/include/ports/SkTypeface_win.h +2 -1
  138. package/cpp/skia/include/private/SkChecksum.h +32 -7
  139. package/cpp/skia/include/private/SkColorData.h +1 -26
  140. package/cpp/skia/include/private/SkGainmapInfo.h +97 -0
  141. package/cpp/skia/include/private/SkGainmapShader.h +53 -0
  142. package/cpp/skia/include/private/SkIDChangeListener.h +4 -3
  143. package/cpp/skia/include/private/SkJpegGainmapEncoder.h +71 -0
  144. package/cpp/skia/include/private/SkJpegMetadataDecoder.h +61 -0
  145. package/cpp/skia/include/private/SkOpts_spi.h +3 -1
  146. package/cpp/skia/include/private/SkPathRef.h +64 -47
  147. package/cpp/skia/include/private/SkSLDefines.h +5 -5
  148. package/cpp/skia/include/private/SkSLSampleUsage.h +0 -4
  149. package/cpp/skia/include/private/SkSpinlock.h +1 -1
  150. package/cpp/skia/include/private/SkWeakRefCnt.h +3 -0
  151. package/cpp/skia/include/private/{SingleOwner.h → base/SingleOwner.h} +8 -5
  152. package/cpp/skia/include/private/base/SkAPI.h +52 -0
  153. package/cpp/skia/include/private/base/SkAlign.h +39 -0
  154. package/cpp/skia/include/private/base/SkAlignedStorage.h +32 -0
  155. package/cpp/skia/include/private/base/SkAssert.h +92 -0
  156. package/cpp/skia/include/private/base/SkAttributes.h +102 -0
  157. package/cpp/skia/include/private/base/SkCPUTypes.h +25 -0
  158. package/cpp/skia/include/private/base/SkContainers.h +46 -0
  159. package/cpp/skia/include/private/base/SkDebug.h +27 -0
  160. package/cpp/skia/include/private/{SkDeque.h → base/SkDeque.h} +3 -1
  161. package/cpp/skia/include/private/base/SkFeatures.h +151 -0
  162. package/cpp/skia/include/private/{SkFixed.h → base/SkFixed.h} +9 -7
  163. package/cpp/skia/include/private/{SkFloatBits.h → base/SkFloatBits.h} +2 -3
  164. package/cpp/skia/include/private/{SkFloatingPoint.h → base/SkFloatingPoint.h} +18 -9
  165. package/cpp/skia/include/private/base/SkLoadUserConfig.h +63 -0
  166. package/cpp/skia/include/private/{SkMacros.h → base/SkMacros.h} +17 -2
  167. package/cpp/skia/include/private/{SkMalloc.h → base/SkMalloc.h} +4 -7
  168. package/cpp/skia/include/{core → private/base}/SkMath.h +25 -2
  169. package/cpp/skia/include/private/{SkMutex.h → base/SkMutex.h} +5 -5
  170. package/cpp/skia/include/private/{SkNoncopyable.h → base/SkNoncopyable.h} +2 -2
  171. package/cpp/skia/include/private/{SkOnce.h → base/SkOnce.h} +3 -1
  172. package/cpp/skia/include/private/base/SkPathEnums.h +25 -0
  173. package/cpp/skia/include/private/{SkSafe32.h → base/SkSafe32.h} +16 -1
  174. package/cpp/skia/include/private/{SkSemaphore.h → base/SkSemaphore.h} +4 -3
  175. package/cpp/skia/include/private/base/SkSpan_impl.h +129 -0
  176. package/cpp/skia/include/private/base/SkTArray.h +694 -0
  177. package/cpp/skia/include/private/{SkTDArray.h → base/SkTDArray.h} +17 -54
  178. package/cpp/skia/include/private/{SkTFitsIn.h → base/SkTFitsIn.h} +14 -8
  179. package/cpp/skia/include/private/{SkTLogic.h → base/SkTLogic.h} +1 -1
  180. package/cpp/skia/include/private/{SkTemplates.h → base/SkTemplates.h} +63 -88
  181. package/cpp/skia/include/private/{SkThreadID.h → base/SkThreadID.h} +5 -2
  182. package/cpp/skia/include/private/{SkTo.h → base/SkTo.h} +13 -2
  183. package/cpp/skia/include/private/base/SkTypeTraits.h +33 -0
  184. package/cpp/skia/include/private/chromium/GrVkSecondaryCBDrawContext.h +130 -0
  185. package/cpp/skia/include/private/chromium/SkChromeRemoteGlyphCache.h +5 -9
  186. package/cpp/skia/include/private/chromium/SkDiscardableMemory.h +70 -0
  187. package/cpp/skia/include/private/chromium/Slug.h +0 -9
  188. package/cpp/skia/include/private/gpu/ganesh/GrContext_Base.h +2 -1
  189. package/cpp/skia/include/private/gpu/ganesh/GrD3DTypesMinimal.h +1 -1
  190. package/cpp/skia/include/private/gpu/ganesh/GrDawnTypesPriv.h +1 -1
  191. package/cpp/skia/include/private/gpu/ganesh/GrGLTypesPriv.h +1 -1
  192. package/cpp/skia/include/private/gpu/ganesh/GrImageContext.h +1 -1
  193. package/cpp/skia/include/private/gpu/ganesh/GrMockTypesPriv.h +3 -2
  194. package/cpp/skia/include/private/gpu/ganesh/GrMtlTypesPriv.h +1 -1
  195. package/cpp/skia/include/private/gpu/ganesh/GrTypesPriv.h +17 -23
  196. package/cpp/skia/include/private/gpu/ganesh/GrVkTypesPriv.h +2 -2
  197. package/cpp/skia/include/private/gpu/graphite/DawnTypesPriv.h +38 -0
  198. package/cpp/skia/include/private/gpu/graphite/{MtlTypesPriv.h → MtlGraphiteTypesPriv.h} +5 -5
  199. package/cpp/skia/include/private/gpu/graphite/VulkanGraphiteTypesPriv.h +1 -9
  200. package/cpp/skia/include/private/gpu/vk/SkiaVulkan.h +4 -0
  201. package/cpp/skia/include/utils/SkCamera.h +1 -1
  202. package/cpp/skia/include/utils/SkCustomTypeface.h +7 -1
  203. package/cpp/skia/include/utils/SkNWayCanvas.h +6 -6
  204. package/cpp/skia/include/utils/SkOrderedFontMgr.h +7 -6
  205. package/cpp/skia/include/utils/SkPaintFilterCanvas.h +2 -2
  206. package/cpp/skia/include/utils/SkParsePath.h +1 -1
  207. package/cpp/skia/modules/skcms/skcms.h +14 -0
  208. package/cpp/skia/modules/skcms/src/Transform_inl.h +19 -0
  209. package/cpp/skia/modules/skparagraph/include/FontCollection.h +2 -2
  210. package/cpp/skia/modules/skparagraph/include/Paragraph.h +72 -2
  211. package/cpp/skia/modules/skparagraph/include/ParagraphCache.h +1 -11
  212. package/cpp/skia/modules/skparagraph/include/ParagraphPainter.h +63 -0
  213. package/cpp/skia/modules/skparagraph/include/TextStyle.h +27 -4
  214. package/cpp/skia/modules/skparagraph/include/TypefaceFontProvider.h +13 -13
  215. package/cpp/skia/modules/skresources/include/SkResources.h +18 -4
  216. package/cpp/skia/modules/svg/include/SkSVGAttribute.h +1 -1
  217. package/cpp/skia/modules/svg/include/SkSVGAttributeParser.h +2 -2
  218. package/cpp/skia/modules/svg/include/SkSVGContainer.h +2 -2
  219. package/cpp/skia/modules/svg/include/SkSVGDOM.h +1 -1
  220. package/cpp/skia/modules/svg/include/SkSVGFilterContext.h +2 -2
  221. package/cpp/skia/modules/svg/include/SkSVGGradient.h +2 -2
  222. package/cpp/skia/modules/svg/include/SkSVGIDMapper.h +2 -2
  223. package/cpp/skia/modules/svg/include/SkSVGRenderContext.h +3 -3
  224. package/cpp/skia/modules/svg/include/SkSVGSVG.h +1 -1
  225. package/cpp/skia/modules/svg/include/SkSVGTypes.h +22 -21
  226. package/cpp/skia/modules/svg/include/SkSVGValue.h +1 -1
  227. package/cpp/skia/{include/private → src/core}/SkTHash.h +41 -37
  228. package/ios/RNSkia-iOS/ViewScreenshotService.mm +1 -1
  229. package/libs/android/arm64-v8a/libskia.a +0 -0
  230. package/libs/android/arm64-v8a/libskottie.a +0 -0
  231. package/libs/android/arm64-v8a/libsksg.a +0 -0
  232. package/libs/android/arm64-v8a/libskshaper.a +0 -0
  233. package/libs/android/arm64-v8a/libsvg.a +0 -0
  234. package/libs/android/armeabi-v7a/libskia.a +0 -0
  235. package/libs/android/armeabi-v7a/libskottie.a +0 -0
  236. package/libs/android/armeabi-v7a/libsksg.a +0 -0
  237. package/libs/android/armeabi-v7a/libskshaper.a +0 -0
  238. package/libs/android/armeabi-v7a/libsvg.a +0 -0
  239. package/libs/android/x86/libskia.a +0 -0
  240. package/libs/android/x86/libskottie.a +0 -0
  241. package/libs/android/x86/libsksg.a +0 -0
  242. package/libs/android/x86/libskshaper.a +0 -0
  243. package/libs/android/x86/libsvg.a +0 -0
  244. package/libs/android/x86_64/libskia.a +0 -0
  245. package/libs/android/x86_64/libskottie.a +0 -0
  246. package/libs/android/x86_64/libsksg.a +0 -0
  247. package/libs/android/x86_64/libskshaper.a +0 -0
  248. package/libs/android/x86_64/libsvg.a +0 -0
  249. package/libs/ios/libskia.xcframework/Info.plist +5 -5
  250. package/libs/ios/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
  251. package/libs/ios/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
  252. package/libs/ios/libskottie.xcframework/ios-arm64_arm64e/libskottie.a +0 -0
  253. package/libs/ios/libskottie.xcframework/ios-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
  254. package/libs/ios/libsksg.xcframework/ios-arm64_arm64e/libsksg.a +0 -0
  255. package/libs/ios/libsksg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
  256. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
  257. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
  258. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
  259. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
  260. package/package.json +1 -1
  261. package/react-native-skia.podspec +1 -1
  262. package/scripts/install-npm.js +11 -1
  263. package/cpp/skia/include/core/SkImageEncoder.h +0 -71
  264. package/cpp/skia/include/gpu/GrConfig.h +0 -53
  265. package/cpp/skia/include/gpu/graphite/CombinationBuilder.h +0 -195
  266. package/cpp/skia/include/private/SkHalf.h +0 -38
  267. package/cpp/skia/include/private/SkImageInfoPriv.h +0 -199
  268. package/cpp/skia/include/private/SkSLIRNode.h +0 -64
  269. package/cpp/skia/include/private/SkSLLayout.h +0 -144
  270. package/cpp/skia/include/private/SkSLModifiers.h +0 -178
  271. package/cpp/skia/include/private/SkSLProgramElement.h +0 -77
  272. package/cpp/skia/include/private/SkSLProgramKind.h +0 -35
  273. package/cpp/skia/include/private/SkSLStatement.h +0 -86
  274. package/cpp/skia/include/private/SkSLString.h +0 -41
  275. package/cpp/skia/include/private/SkSLSymbol.h +0 -94
  276. package/cpp/skia/include/private/SkSafe_math.h +0 -52
  277. package/cpp/skia/include/private/SkStringView.h +0 -51
  278. package/cpp/skia/include/private/SkTArray.h +0 -655
  279. package/cpp/skia/include/private/SkUniquePaintParamsID.h +0 -35
  280. package/cpp/skia/include/private/SkVx.h +0 -1026
  281. package/cpp/skia/include/sksl/DSL.h +0 -37
  282. package/cpp/skia/include/sksl/DSLBlock.h +0 -58
  283. package/cpp/skia/include/sksl/DSLCase.h +0 -62
  284. package/cpp/skia/include/sksl/DSLCore.h +0 -492
  285. package/cpp/skia/include/sksl/DSLExpression.h +0 -241
  286. package/cpp/skia/include/sksl/DSLFunction.h +0 -113
  287. package/cpp/skia/include/sksl/DSLLayout.h +0 -92
  288. package/cpp/skia/include/sksl/DSLModifiers.h +0 -69
  289. package/cpp/skia/include/sksl/DSLStatement.h +0 -82
  290. package/cpp/skia/include/sksl/DSLSymbols.h +0 -61
  291. package/cpp/skia/include/sksl/DSLType.h +0 -271
  292. package/cpp/skia/include/sksl/DSLVar.h +0 -231
  293. package/cpp/skia/include/sksl/SkSLErrorReporter.h +0 -65
  294. package/cpp/skia/include/sksl/SkSLOperator.h +0 -154
  295. package/cpp/skia/include/sksl/SkSLPosition.h +0 -104
  296. package/cpp/skia/include/utils/SkRandom.h +0 -169
  297. package/cpp/skia/src/core/SkLRUCache.h +0 -126
  298. package/cpp/skia/src/core/SkTInternalLList.h +0 -302
  299. /package/cpp/skia/include/{core → codec}/SkPngChunkReader.h +0 -0
  300. /package/cpp/skia/include/private/{SkTPin.h → base/SkTPin.h} +0 -0
  301. /package/cpp/skia/include/private/{SkThreadAnnotations.h → base/SkThreadAnnotations.h} +0 -0
@@ -1,53 +0,0 @@
1
-
2
- /*
3
- * Copyright 2010 Google Inc.
4
- *
5
- * Use of this source code is governed by a BSD-style license that can be
6
- * found in the LICENSE file.
7
- */
8
-
9
- #ifndef GrConfig_DEFINED
10
- #define GrConfig_DEFINED
11
-
12
- #include "include/core/SkTypes.h"
13
-
14
- /**
15
- * Gr defines are set to 0 or 1, rather than being undefined or defined
16
- */
17
-
18
- #if !defined(GR_CACHE_STATS)
19
- #if defined(SK_DEBUG) || defined(SK_DUMP_STATS)
20
- #define GR_CACHE_STATS 1
21
- #else
22
- #define GR_CACHE_STATS 0
23
- #endif
24
- #endif
25
-
26
- #if !defined(GR_GPU_STATS)
27
- #if defined(SK_DEBUG) || defined(SK_DUMP_STATS) || GR_TEST_UTILS
28
- #define GR_GPU_STATS 1
29
- #else
30
- #define GR_GPU_STATS 0
31
- #endif
32
- #endif
33
-
34
- #endif
35
-
36
- /**
37
- * GR_STRING makes a string of X where X is expanded before conversion to a string
38
- * if X itself contains macros.
39
- */
40
- #define GR_STRING(X) GR_STRING_IMPL(X)
41
- #define GR_STRING_IMPL(X) #X
42
-
43
- /**
44
- * GR_CONCAT concatenates X and Y where each is expanded before
45
- * contanenation if either contains macros.
46
- */
47
- #define GR_CONCAT(X,Y) GR_CONCAT_IMPL(X,Y)
48
- #define GR_CONCAT_IMPL(X,Y) X##Y
49
-
50
- /**
51
- * Creates a string of the form "<filename>(<linenumber>) : "
52
- */
53
- #define GR_FILE_AND_LINE_STR __FILE__ "(" GR_STRING(__LINE__) ") : "
@@ -1,195 +0,0 @@
1
- /*
2
- * Copyright 2022 Google LLC
3
- *
4
- * Use of this source code is governed by a BSD-style license that can be
5
- * found in the LICENSE file.
6
- */
7
-
8
- #ifndef skgpu_graphite_CombinationBuilder_DEFINED
9
- #define skgpu_graphite_CombinationBuilder_DEFINED
10
-
11
- #include "include/core/SkTypes.h"
12
-
13
- #ifdef SK_ENABLE_PRECOMPILE
14
-
15
- #include <functional>
16
- #include <memory>
17
- #include <vector>
18
- #include "include/core/SkBlendMode.h"
19
- #include "include/core/SkSpan.h"
20
- #include "include/core/SkTileMode.h"
21
- #include "include/private/SkTArray.h"
22
- #include "include/private/SkTHash.h"
23
-
24
- class SkArenaAllocWithReset;
25
- class SkKeyContext;
26
- class SkPaintParamsKeyBuilder;
27
- class SkShaderCodeDictionary;
28
- class SkUniquePaintParamsID;
29
-
30
- namespace skgpu::graphite {
31
-
32
- class CombinationBuilder;
33
- class CombinationBuilderTestAccess;
34
- class Context;
35
- class Option;
36
-
37
- enum class ShaderType : uint32_t {
38
- kSolidColor,
39
-
40
- kLinearGradient,
41
- kRadialGradient,
42
- kSweepGradient,
43
- kConicalGradient,
44
-
45
- kLocalMatrix,
46
- kImage,
47
- kPorterDuffBlendShader,
48
- kBlendShader,
49
-
50
- kLast = kBlendShader
51
- };
52
-
53
- static constexpr int kShaderTypeCount = static_cast<int>(ShaderType::kLast) + 1;
54
-
55
- struct TileModePair {
56
- SkTileMode fX;
57
- SkTileMode fY;
58
-
59
- bool operator==(const TileModePair& other) const { return fX == other.fX && fY == other.fY; }
60
- bool operator!=(const TileModePair& other) const { return !(*this == other); }
61
- };
62
-
63
- // TODO: add ShaderID and ColorFilterID too
64
- class BlenderID {
65
- public:
66
- BlenderID() : fID(0) {} // 0 is an invalid blender ID
67
- BlenderID(const BlenderID& src) : fID(src.fID) {}
68
-
69
- bool isValid() const { return fID > 0; }
70
-
71
- bool operator==(const BlenderID& other) const { return fID == other.fID; }
72
-
73
- BlenderID& operator=(const BlenderID& src) {
74
- fID = src.fID;
75
- return *this;
76
- }
77
-
78
- private:
79
- friend class ::SkShaderCodeDictionary; // for ctor and asUInt access
80
- friend class CombinationBuilder; // for asUInt access
81
-
82
- BlenderID(uint32_t id) : fID(id) {}
83
-
84
- uint32_t asUInt() const { return fID; }
85
-
86
- uint32_t fID;
87
- };
88
-
89
- // When combination options are added to the combination builder an CombinationOption
90
- // object is frequently returned. This allows options to be added, recursively, to the
91
- // previously added options.
92
- // Note: CombinationOptions are stable memory-wise so, once returned, they are valid
93
- // until CombinationBuilder::reset is called.
94
- class CombinationOption {
95
- public:
96
- CombinationOption addChildOption(int childIndex, ShaderType);
97
-
98
- CombinationOption addChildOption(int childIndex, ShaderType,
99
- int minNumStops, int maxNumStops);
100
-
101
- CombinationOption addChildOption(int childIndex, ShaderType,
102
- SkSpan<TileModePair> tileModes);
103
-
104
- bool isValid() const { return fDataInArena; }
105
-
106
- private:
107
- friend class CombinationBuilder; // for ctor
108
- friend class CombinationBuilderTestAccess;
109
-
110
- CombinationOption(CombinationBuilder* builder, Option* dataInArena)
111
- : fBuilder(builder)
112
- , fDataInArena(dataInArena) {}
113
-
114
- ShaderType type() const;
115
- int numChildSlots() const;
116
- SkDEBUGCODE(int epoch() const;)
117
-
118
- CombinationBuilder* fBuilder;
119
- Option* fDataInArena;
120
- };
121
-
122
- class CombinationBuilder {
123
- public:
124
- enum class BlendModeGroup {
125
- kPorterDuff, // [ kClear .. kScreen ]
126
- kAdvanced, // [ kOverlay .. kMultiply ]
127
- kColorAware, // [ kHue .. kLuminosity ]
128
- kAll
129
- };
130
-
131
- CombinationBuilder(SkShaderCodeDictionary*);
132
- ~CombinationBuilder();
133
-
134
- // Blend Modes
135
- void addOption(SkBlendMode);
136
- void addOption(SkBlendMode rangeStart, SkBlendMode rangeEnd); // inclusive
137
- void addOption(BlendModeGroup);
138
-
139
- // TODO: have this variant return an CombinationOption object
140
- void addOption(BlenderID);
141
-
142
- // Shaders
143
- CombinationOption addOption(ShaderType);
144
- CombinationOption addOption(ShaderType, int minNumStops, int maxNumStops); // inclusive
145
- CombinationOption addOption(ShaderType, SkSpan<TileModePair> tileModes);
146
-
147
- void reset();
148
-
149
- private:
150
- friend class Context; // for access to 'buildCombinations'
151
- friend class CombinationOption; // for 'addOptionInternal' and 'arena'
152
- friend class CombinationBuilderTestAccess; // for 'num*Combinations' and 'epoch'
153
-
154
- int numShaderCombinations() const;
155
- int numBlendModeCombinations() const;
156
- int numCombinations() {
157
- return this->numShaderCombinations() * this->numBlendModeCombinations();
158
- }
159
-
160
- // 'desiredCombination' must be less than numCombinations
161
- void createKey(const SkKeyContext&, int desiredCombination, SkPaintParamsKeyBuilder*);
162
-
163
- #ifdef SK_DEBUG
164
- void dump() const;
165
- int epoch() const { return fEpoch; }
166
- #endif
167
-
168
- SkArenaAllocWithReset* arena() { return fArena.get(); }
169
-
170
- template<typename T, typename... Args>
171
- Option* allocInArena(Args&&... args);
172
-
173
- Option* addOptionInternal(ShaderType);
174
- Option* addOptionInternal(ShaderType, int minNumStops, int maxNumStops);
175
- Option* addOptionInternal(ShaderType, SkSpan<TileModePair> tileModes);
176
-
177
- void buildCombinations(SkShaderCodeDictionary*,
178
- const std::function<void(SkUniquePaintParamsID)>&);
179
-
180
- SkShaderCodeDictionary* fDictionary;
181
- std::unique_ptr<SkArenaAllocWithReset> fArena;
182
- SkTArray<Option*> fShaderOptions;
183
-
184
- uint32_t fBlendModes;
185
- // TODO: store the SkBlender-based blenders in the arena
186
- SkTHashSet<BlenderID> fBlenders;
187
-
188
- SkDEBUGCODE(int fEpoch = 0;)
189
- };
190
-
191
- } // namespace skgpu::graphite
192
-
193
- #endif // SK_ENABLE_PRECOMPILE
194
-
195
- #endif // skgpu_graphite_CombinationBuilder_DEFINED
@@ -1,38 +0,0 @@
1
- /*
2
- * Copyright 2014 Google Inc.
3
- *
4
- * Use of this source code is governed by a BSD-style license that can be
5
- * found in the LICENSE file.
6
- */
7
-
8
- #ifndef SkHalf_DEFINED
9
- #define SkHalf_DEFINED
10
-
11
- #include "include/core/SkTypes.h"
12
- #include "include/private/SkVx.h"
13
-
14
- // 16-bit floating point value
15
- // format is 1 bit sign, 5 bits exponent, 10 bits mantissa
16
- // only used for storage
17
- typedef uint16_t SkHalf;
18
-
19
- static constexpr uint16_t SK_HalfMin = 0x0400; // 2^-14 (minimum positive normal value)
20
- static constexpr uint16_t SK_HalfMax = 0x7bff; // 65504
21
- static constexpr uint16_t SK_HalfEpsilon = 0x1400; // 2^-10
22
- static constexpr uint16_t SK_Half1 = 0x3C00; // 1
23
-
24
- // convert between half and single precision floating point
25
- float SkHalfToFloat(SkHalf h);
26
- SkHalf SkFloatToHalf(float f);
27
-
28
- // Convert between half and single precision floating point,
29
- // assuming inputs and outputs are both finite, and may
30
- // flush values which would be denormal half floats to zero.
31
- static inline skvx::float4 SkHalfToFloat_finite_ftz(uint64_t rgba) {
32
- return skvx::from_half(skvx::half4::Load(&rgba));
33
- }
34
- static inline skvx::half4 SkFloatToHalf_finite_ftz(const skvx::float4& c) {
35
- return skvx::to_half(c);
36
- }
37
-
38
- #endif
@@ -1,199 +0,0 @@
1
- /*
2
- * Copyright 2017 Google Inc.
3
- *
4
- * Use of this source code is governed by a BSD-style license that can be
5
- * found in the LICENSE file.
6
- */
7
-
8
- #ifndef SkImageInfoPriv_DEFINED
9
- #define SkImageInfoPriv_DEFINED
10
-
11
- #include "include/core/SkColor.h"
12
- #include "include/core/SkImageInfo.h"
13
-
14
- static inline uint32_t SkColorTypeChannelFlags(SkColorType ct) {
15
- switch (ct) {
16
- case kUnknown_SkColorType: return 0;
17
- case kAlpha_8_SkColorType: return kAlpha_SkColorChannelFlag;
18
- case kRGB_565_SkColorType: return kRGB_SkColorChannelFlags;
19
- case kARGB_4444_SkColorType: return kRGBA_SkColorChannelFlags;
20
- case kRGBA_8888_SkColorType: return kRGBA_SkColorChannelFlags;
21
- case kRGB_888x_SkColorType: return kRGB_SkColorChannelFlags;
22
- case kBGRA_8888_SkColorType: return kRGBA_SkColorChannelFlags;
23
- case kRGBA_1010102_SkColorType: return kRGBA_SkColorChannelFlags;
24
- case kRGB_101010x_SkColorType: return kRGB_SkColorChannelFlags;
25
- case kBGRA_1010102_SkColorType: return kRGBA_SkColorChannelFlags;
26
- case kBGR_101010x_SkColorType: return kRGB_SkColorChannelFlags;
27
- case kGray_8_SkColorType: return kGray_SkColorChannelFlag;
28
- case kRGBA_F16Norm_SkColorType: return kRGBA_SkColorChannelFlags;
29
- case kRGBA_F16_SkColorType: return kRGBA_SkColorChannelFlags;
30
- case kRGBA_F32_SkColorType: return kRGBA_SkColorChannelFlags;
31
- case kR8G8_unorm_SkColorType: return kRG_SkColorChannelFlags;
32
- case kA16_unorm_SkColorType: return kAlpha_SkColorChannelFlag;
33
- case kR16G16_unorm_SkColorType: return kRG_SkColorChannelFlags;
34
- case kA16_float_SkColorType: return kAlpha_SkColorChannelFlag;
35
- case kR16G16_float_SkColorType: return kRG_SkColorChannelFlags;
36
- case kR16G16B16A16_unorm_SkColorType: return kRGBA_SkColorChannelFlags;
37
- case kSRGBA_8888_SkColorType: return kRGBA_SkColorChannelFlags;
38
- case kR8_unorm_SkColorType: return kRed_SkColorChannelFlag;
39
- }
40
- SkUNREACHABLE;
41
- }
42
-
43
- static inline bool SkColorTypeIsAlphaOnly(SkColorType ct) {
44
- return SkColorTypeChannelFlags(ct) == kAlpha_SkColorChannelFlag;
45
- }
46
-
47
- static inline bool SkAlphaTypeIsValid(unsigned value) {
48
- return value <= kLastEnum_SkAlphaType;
49
- }
50
-
51
- static int SkColorTypeShiftPerPixel(SkColorType ct) {
52
- switch (ct) {
53
- case kUnknown_SkColorType: return 0;
54
- case kAlpha_8_SkColorType: return 0;
55
- case kRGB_565_SkColorType: return 1;
56
- case kARGB_4444_SkColorType: return 1;
57
- case kRGBA_8888_SkColorType: return 2;
58
- case kRGB_888x_SkColorType: return 2;
59
- case kBGRA_8888_SkColorType: return 2;
60
- case kRGBA_1010102_SkColorType: return 2;
61
- case kRGB_101010x_SkColorType: return 2;
62
- case kBGRA_1010102_SkColorType: return 2;
63
- case kBGR_101010x_SkColorType: return 2;
64
- case kGray_8_SkColorType: return 0;
65
- case kRGBA_F16Norm_SkColorType: return 3;
66
- case kRGBA_F16_SkColorType: return 3;
67
- case kRGBA_F32_SkColorType: return 4;
68
- case kR8G8_unorm_SkColorType: return 1;
69
- case kA16_unorm_SkColorType: return 1;
70
- case kR16G16_unorm_SkColorType: return 2;
71
- case kA16_float_SkColorType: return 1;
72
- case kR16G16_float_SkColorType: return 2;
73
- case kR16G16B16A16_unorm_SkColorType: return 3;
74
- case kSRGBA_8888_SkColorType: return 2;
75
- case kR8_unorm_SkColorType: return 0;
76
- }
77
- SkUNREACHABLE;
78
- }
79
-
80
- static inline size_t SkColorTypeMinRowBytes(SkColorType ct, int width) {
81
- return (size_t)(width * SkColorTypeBytesPerPixel(ct));
82
- }
83
-
84
- static inline bool SkColorTypeIsValid(unsigned value) {
85
- return value <= kLastEnum_SkColorType;
86
- }
87
-
88
- static inline size_t SkColorTypeComputeOffset(SkColorType ct, int x, int y, size_t rowBytes) {
89
- if (kUnknown_SkColorType == ct) {
90
- return 0;
91
- }
92
- return (size_t)y * rowBytes + ((size_t)x << SkColorTypeShiftPerPixel(ct));
93
- }
94
-
95
- static inline bool SkColorTypeIsNormalized(SkColorType ct) {
96
- switch (ct) {
97
- case kUnknown_SkColorType:
98
- case kAlpha_8_SkColorType:
99
- case kRGB_565_SkColorType:
100
- case kARGB_4444_SkColorType:
101
- case kRGBA_8888_SkColorType:
102
- case kRGB_888x_SkColorType:
103
- case kBGRA_8888_SkColorType:
104
- case kRGBA_1010102_SkColorType:
105
- case kRGB_101010x_SkColorType:
106
- case kBGRA_1010102_SkColorType:
107
- case kBGR_101010x_SkColorType:
108
- case kGray_8_SkColorType:
109
- case kRGBA_F16Norm_SkColorType:
110
- case kR8G8_unorm_SkColorType:
111
- case kA16_unorm_SkColorType:
112
- case kA16_float_SkColorType: /*subtle... alpha is always [0,1]*/
113
- case kR16G16_unorm_SkColorType:
114
- case kR16G16B16A16_unorm_SkColorType:
115
- case kSRGBA_8888_SkColorType:
116
- case kR8_unorm_SkColorType:
117
- return true;
118
-
119
- case kRGBA_F16_SkColorType:
120
- case kRGBA_F32_SkColorType:
121
- case kR16G16_float_SkColorType:
122
- return false;
123
- }
124
- SkUNREACHABLE;
125
- }
126
-
127
- static inline int SkColorTypeMaxBitsPerChannel(SkColorType ct) {
128
- switch (ct) {
129
- case kUnknown_SkColorType:
130
- return 0;
131
-
132
- case kARGB_4444_SkColorType:
133
- return 4;
134
-
135
- case kRGB_565_SkColorType:
136
- return 6;
137
-
138
- case kAlpha_8_SkColorType:
139
- case kRGBA_8888_SkColorType:
140
- case kRGB_888x_SkColorType:
141
- case kBGRA_8888_SkColorType:
142
- case kGray_8_SkColorType:
143
- case kR8G8_unorm_SkColorType:
144
- case kSRGBA_8888_SkColorType:
145
- case kR8_unorm_SkColorType:
146
- return 8;
147
-
148
- case kRGBA_1010102_SkColorType:
149
- case kRGB_101010x_SkColorType:
150
- case kBGRA_1010102_SkColorType:
151
- case kBGR_101010x_SkColorType:
152
- return 10;
153
-
154
- case kRGBA_F16Norm_SkColorType:
155
- case kA16_unorm_SkColorType:
156
- case kA16_float_SkColorType:
157
- case kR16G16_unorm_SkColorType:
158
- case kR16G16B16A16_unorm_SkColorType:
159
- case kRGBA_F16_SkColorType:
160
- case kR16G16_float_SkColorType:
161
- return 16;
162
-
163
- case kRGBA_F32_SkColorType:
164
- return 32;
165
- }
166
- SkUNREACHABLE;
167
- }
168
-
169
- /**
170
- * Returns true if |info| contains a valid colorType and alphaType.
171
- */
172
- static inline bool SkColorInfoIsValid(const SkColorInfo& info) {
173
- return info.colorType() != kUnknown_SkColorType && info.alphaType() != kUnknown_SkAlphaType;
174
- }
175
-
176
- /**
177
- * Returns true if |info| contains a valid combination of width, height and colorInfo.
178
- */
179
- static inline bool SkImageInfoIsValid(const SkImageInfo& info) {
180
- if (info.width() <= 0 || info.height() <= 0) {
181
- return false;
182
- }
183
-
184
- const int kMaxDimension = SK_MaxS32 >> 2;
185
- if (info.width() > kMaxDimension || info.height() > kMaxDimension) {
186
- return false;
187
- }
188
-
189
- return SkColorInfoIsValid(info.colorInfo());
190
- }
191
-
192
- /**
193
- * Returns true if Skia has defined a pixel conversion from the |src| to the |dst|.
194
- * Returns false otherwise.
195
- */
196
- static inline bool SkImageInfoValidConversion(const SkImageInfo& dst, const SkImageInfo& src) {
197
- return SkImageInfoIsValid(dst) && SkImageInfoIsValid(src);
198
- }
199
- #endif // SkImageInfoPriv_DEFINED
@@ -1,64 +0,0 @@
1
- /*
2
- * Copyright 2016 Google Inc.
3
- *
4
- * Use of this source code is governed by a BSD-style license that can be
5
- * found in the LICENSE file.
6
- */
7
-
8
- #ifndef SKSL_IRNODE
9
- #define SKSL_IRNODE
10
-
11
- #include "include/private/SkSLString.h"
12
- #include "include/private/SkTArray.h"
13
- #include "include/sksl/SkSLPosition.h"
14
- #include "src/sksl/SkSLLexer.h"
15
- #include "src/sksl/SkSLModifiersPool.h"
16
- #include "src/sksl/SkSLPool.h"
17
-
18
- #include <algorithm>
19
- #include <atomic>
20
- #include <unordered_set>
21
- #include <vector>
22
-
23
- namespace SkSL {
24
-
25
- class Expression;
26
- class FunctionDeclaration;
27
- class FunctionDefinition;
28
- class Statement;
29
- class Symbol;
30
- class SymbolTable;
31
- class Type;
32
- class Variable;
33
- class VariableReference;
34
- enum class VariableRefKind : int8_t;
35
- enum class VariableStorage : int8_t;
36
-
37
- /**
38
- * Represents a node in the intermediate representation (IR) tree. The IR is a fully-resolved
39
- * version of the program (all types determined, everything validated), ready for code generation.
40
- */
41
- class IRNode : public Poolable {
42
- public:
43
- virtual ~IRNode() {}
44
-
45
- virtual std::string description() const = 0;
46
-
47
- // No copy construction or assignment
48
- IRNode(const IRNode&) = delete;
49
- IRNode& operator=(const IRNode&) = delete;
50
-
51
- // position of this element within the program being compiled, for error reporting purposes
52
- Position fPosition;
53
-
54
- protected:
55
- IRNode(Position position, int kind)
56
- : fPosition(position)
57
- , fKind(kind) {}
58
-
59
- int fKind;
60
- };
61
-
62
- } // namespace SkSL
63
-
64
- #endif
@@ -1,144 +0,0 @@
1
- /*
2
- * Copyright 2016 Google Inc.
3
- *
4
- * Use of this source code is governed by a BSD-style license that can be
5
- * found in the LICENSE file.
6
- */
7
-
8
- #ifndef SKSL_LAYOUT
9
- #define SKSL_LAYOUT
10
-
11
- #include "include/private/SkSLString.h"
12
-
13
- namespace SkSL {
14
-
15
- /**
16
- * Represents a layout block appearing before a variable declaration, as in:
17
- *
18
- * layout (location = 0) int x;
19
- */
20
- struct Layout {
21
- enum Flag {
22
- kOriginUpperLeft_Flag = 1 << 0,
23
- kPushConstant_Flag = 1 << 1,
24
- kBlendSupportAllEquations_Flag = 1 << 2,
25
- kColor_Flag = 1 << 3,
26
-
27
- // These flags indicate if the qualifier appeared, regardless of the accompanying value.
28
- kLocation_Flag = 1 << 4,
29
- kOffset_Flag = 1 << 5,
30
- kBinding_Flag = 1 << 6,
31
- kIndex_Flag = 1 << 7,
32
- kSet_Flag = 1 << 8,
33
- kBuiltin_Flag = 1 << 9,
34
- kInputAttachmentIndex_Flag = 1 << 10,
35
- };
36
-
37
- Layout(int flags, int location, int offset, int binding, int index, int set, int builtin,
38
- int inputAttachmentIndex)
39
- : fFlags(flags)
40
- , fLocation(location)
41
- , fOffset(offset)
42
- , fBinding(binding)
43
- , fIndex(index)
44
- , fSet(set)
45
- , fBuiltin(builtin)
46
- , fInputAttachmentIndex(inputAttachmentIndex) {}
47
-
48
- Layout()
49
- : fFlags(0)
50
- , fLocation(-1)
51
- , fOffset(-1)
52
- , fBinding(-1)
53
- , fIndex(-1)
54
- , fSet(-1)
55
- , fBuiltin(-1)
56
- , fInputAttachmentIndex(-1) {}
57
-
58
- static Layout builtin(int builtin) {
59
- Layout result;
60
- result.fBuiltin = builtin;
61
- return result;
62
- }
63
-
64
- std::string description() const {
65
- std::string result;
66
- auto separator = [firstSeparator = true]() mutable -> std::string {
67
- if (firstSeparator) {
68
- firstSeparator = false;
69
- return "";
70
- } else {
71
- return ", ";
72
- }};
73
- if (fLocation >= 0) {
74
- result += separator() + "location = " + std::to_string(fLocation);
75
- }
76
- if (fOffset >= 0) {
77
- result += separator() + "offset = " + std::to_string(fOffset);
78
- }
79
- if (fBinding >= 0) {
80
- result += separator() + "binding = " + std::to_string(fBinding);
81
- }
82
- if (fIndex >= 0) {
83
- result += separator() + "index = " + std::to_string(fIndex);
84
- }
85
- if (fSet >= 0) {
86
- result += separator() + "set = " + std::to_string(fSet);
87
- }
88
- if (fBuiltin >= 0) {
89
- result += separator() + "builtin = " + std::to_string(fBuiltin);
90
- }
91
- if (fInputAttachmentIndex >= 0) {
92
- result += separator() + "input_attachment_index = " +
93
- std::to_string(fInputAttachmentIndex);
94
- }
95
- if (fFlags & kOriginUpperLeft_Flag) {
96
- result += separator() + "origin_upper_left";
97
- }
98
- if (fFlags & kBlendSupportAllEquations_Flag) {
99
- result += separator() + "blend_support_all_equations";
100
- }
101
- if (fFlags & kPushConstant_Flag) {
102
- result += separator() + "push_constant";
103
- }
104
- if (fFlags & kColor_Flag) {
105
- result += separator() + "color";
106
- }
107
- if (result.size() > 0) {
108
- result = "layout (" + result + ")";
109
- }
110
- return result;
111
- }
112
-
113
- bool operator==(const Layout& other) const {
114
- return fFlags == other.fFlags &&
115
- fLocation == other.fLocation &&
116
- fOffset == other.fOffset &&
117
- fBinding == other.fBinding &&
118
- fIndex == other.fIndex &&
119
- fSet == other.fSet &&
120
- fBuiltin == other.fBuiltin &&
121
- fInputAttachmentIndex == other.fInputAttachmentIndex;
122
- }
123
-
124
- bool operator!=(const Layout& other) const {
125
- return !(*this == other);
126
- }
127
-
128
- int fFlags;
129
- int fLocation;
130
- int fOffset;
131
- int fBinding;
132
- int fIndex;
133
- int fSet;
134
- // builtin comes from SPIR-V and identifies which particular builtin value this object
135
- // represents.
136
- int fBuiltin;
137
- // input_attachment_index comes from Vulkan/SPIR-V to connect a shader variable to the a
138
- // corresponding attachment on the subpass in which the shader is being used.
139
- int fInputAttachmentIndex;
140
- };
141
-
142
- } // namespace SkSL
143
-
144
- #endif