@shopify/react-native-skia 0.1.192 → 0.1.193

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -0,0 +1,129 @@
1
+ /*
2
+ * Copyright 2018 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 SkSpan_DEFINED
9
+ #define SkSpan_DEFINED
10
+
11
+ #include "include/private/base/SkAssert.h"
12
+ #include "include/private/base/SkTo.h"
13
+
14
+ #include <cstddef>
15
+ #include <initializer_list>
16
+ #include <iterator>
17
+ #include <limits>
18
+ #include <utility>
19
+
20
+ // Having this be an export works around IWYU churn related to
21
+ // https://github.com/include-what-you-use/include-what-you-use/issues/1121
22
+ #include <type_traits> // IWYU pragma: export
23
+
24
+ // Add macro to check the lifetime of initializer_list arguments. initializer_list has a very
25
+ // short life span, and can only be used as a parameter, and not as a variable.
26
+ #if defined(__clang__) && defined(__has_cpp_attribute) && __has_cpp_attribute(clang::lifetimebound)
27
+ #define SK_CHECK_IL_LIFETIME [[clang::lifetimebound]]
28
+ #else
29
+ #define SK_CHECK_IL_LIFETIME
30
+ #endif
31
+
32
+ /**
33
+ * SkSpan holds a reference to contiguous data of type T along with a count. SkSpan does not own
34
+ * the data itself but is merely a reference, therefore you must take care with the lifetime of
35
+ * the underlying data.
36
+ *
37
+ * SkSpan is a count and a pointer into existing array or data type that stores its data in
38
+ * contiguous memory like std::vector. Any container that works with std::size() and std::data()
39
+ * can be used.
40
+ *
41
+ * SkSpan makes a convenient parameter for a routine to accept array like things. This allows you to
42
+ * write the routine without overloads for all different container types.
43
+ *
44
+ * Example:
45
+ * void routine(SkSpan<const int> a) { ... }
46
+ *
47
+ * std::vector v = {1, 2, 3, 4, 5};
48
+ *
49
+ * routine(a);
50
+ *
51
+ * A word of caution when working with initializer_list, initializer_lists have a lifetime that is
52
+ * limited to the current statement. The following is correct and safe:
53
+ *
54
+ * Example:
55
+ * routine({1,2,3,4,5});
56
+ *
57
+ * The following is undefined, and will result in erratic execution:
58
+ *
59
+ * Bad Example:
60
+ * initializer_list l = {1, 2, 3, 4, 5}; // The data behind l dies at the ;.
61
+ * routine(l);
62
+ */
63
+ template <typename T>
64
+ class SkSpan {
65
+ public:
66
+ constexpr SkSpan() : fPtr{nullptr}, fSize{0} {}
67
+
68
+ template <typename Integer, std::enable_if_t<std::is_integral_v<Integer>, bool> = true>
69
+ constexpr SkSpan(T* ptr, Integer size) : fPtr{ptr}, fSize{SkToSizeT(size)} {
70
+ SkASSERT(ptr || fSize == 0); // disallow nullptr + a nonzero size
71
+ SkASSERT(fSize < kMaxSize);
72
+ }
73
+ template <typename U, typename = std::enable_if_t<std::is_same_v<const U, T>>>
74
+ constexpr SkSpan(const SkSpan<U>& that) : fPtr(std::data(that)), fSize(std::size(that)) {}
75
+ constexpr SkSpan(const SkSpan& o) = default;
76
+ template<size_t N> constexpr SkSpan(T(&a)[N]) : SkSpan(a, N) { }
77
+ template<typename Container>
78
+ constexpr SkSpan(Container& c) : SkSpan(std::data(c), std::size(c)) { }
79
+ SkSpan(std::initializer_list<T> il SK_CHECK_IL_LIFETIME)
80
+ : SkSpan(std::data(il), std::size(il)) {}
81
+
82
+ constexpr SkSpan& operator=(const SkSpan& that) = default;
83
+
84
+ constexpr T& operator [] (size_t i) const {
85
+ SkASSERT(i < this->size());
86
+ return fPtr[i];
87
+ }
88
+ constexpr T& front() const { return fPtr[0]; }
89
+ constexpr T& back() const { return fPtr[fSize - 1]; }
90
+ constexpr T* begin() const { return fPtr; }
91
+ constexpr T* end() const { return fPtr + fSize; }
92
+ constexpr auto rbegin() const { return std::make_reverse_iterator(this->end()); }
93
+ constexpr auto rend() const { return std::make_reverse_iterator(this->begin()); }
94
+ constexpr T* data() const { return this->begin(); }
95
+ constexpr size_t size() const { return fSize; }
96
+ constexpr bool empty() const { return fSize == 0; }
97
+ constexpr size_t size_bytes() const { return fSize * sizeof(T); }
98
+ constexpr SkSpan<T> first(size_t prefixLen) const {
99
+ SkASSERT(prefixLen <= this->size());
100
+ return SkSpan{fPtr, prefixLen};
101
+ }
102
+ constexpr SkSpan<T> last(size_t postfixLen) const {
103
+ SkASSERT(postfixLen <= this->size());
104
+ return SkSpan{fPtr + (this->size() - postfixLen), postfixLen};
105
+ }
106
+ constexpr SkSpan<T> subspan(size_t offset) const {
107
+ return this->subspan(offset, this->size() - offset);
108
+ }
109
+ constexpr SkSpan<T> subspan(size_t offset, size_t count) const {
110
+ SkASSERT(offset <= this->size());
111
+ SkASSERT(count <= this->size() - offset);
112
+ return SkSpan{fPtr + offset, count};
113
+ }
114
+
115
+ private:
116
+ static const constexpr size_t kMaxSize = std::numeric_limits<size_t>::max() / sizeof(T);
117
+ T* fPtr;
118
+ size_t fSize;
119
+ };
120
+
121
+ template <typename Container>
122
+ SkSpan(Container&) ->
123
+ SkSpan<std::remove_pointer_t<decltype(std::data(std::declval<Container&>()))>>;
124
+
125
+ template <typename T>
126
+ SkSpan(std::initializer_list<T>) ->
127
+ SkSpan<std::remove_pointer_t<decltype(std::data(std::declval<std::initializer_list<T>>()))>>;
128
+
129
+ #endif // SkSpan_DEFINED