@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
@@ -8,235 +8,25 @@
8
8
  #ifndef SkTypes_DEFINED
9
9
  #define SkTypes_DEFINED
10
10
 
11
- /** \file SkTypes.h
12
- */
13
-
14
- // Pre-SkUserConfig.h setup.
15
-
16
- // Allows embedders that want to disable macros that take arguments to just
17
- // define that symbol to be one of these
18
- #define SK_NOTHING_ARG1(arg1)
19
- #define SK_NOTHING_ARG2(arg1, arg2)
20
- #define SK_NOTHING_ARG3(arg1, arg2, arg3)
21
-
22
- #if !defined(SK_BUILD_FOR_ANDROID) && !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_WIN) && \
23
- !defined(SK_BUILD_FOR_UNIX) && !defined(SK_BUILD_FOR_MAC)
24
-
25
- #ifdef __APPLE__
26
- #include <TargetConditionals.h>
27
- #endif
28
-
29
- #if defined(_WIN32) || defined(__SYMBIAN32__)
30
- #define SK_BUILD_FOR_WIN
31
- #elif defined(ANDROID) || defined(__ANDROID__)
32
- #define SK_BUILD_FOR_ANDROID
33
- #elif defined(linux) || defined(__linux) || defined(__FreeBSD__) || \
34
- defined(__OpenBSD__) || defined(__sun) || defined(__NetBSD__) || \
35
- defined(__DragonFly__) || defined(__Fuchsia__) || \
36
- defined(__GLIBC__) || defined(__GNU__) || defined(__unix__)
37
- #define SK_BUILD_FOR_UNIX
38
- #elif TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
39
- #define SK_BUILD_FOR_IOS
40
- #else
41
- #define SK_BUILD_FOR_MAC
42
- #endif
43
-
44
- #endif
45
-
46
- #if defined(SK_BUILD_FOR_WIN) && !defined(__clang__)
47
- #if !defined(SK_RESTRICT)
48
- #define SK_RESTRICT __restrict
49
- #endif
50
- #if !defined(SK_WARN_UNUSED_RESULT)
51
- #define SK_WARN_UNUSED_RESULT
52
- #endif
53
- #endif
54
-
55
- #if !defined(SK_RESTRICT)
56
- #define SK_RESTRICT __restrict__
57
- #endif
58
-
59
- #if !defined(SK_WARN_UNUSED_RESULT)
60
- #define SK_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
61
- #endif
62
-
63
- #if !defined(SK_CPU_BENDIAN) && !defined(SK_CPU_LENDIAN)
64
- #if defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
65
- #define SK_CPU_BENDIAN
66
- #elif defined(__BYTE_ORDER__) && (__BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
67
- #define SK_CPU_LENDIAN
68
- #elif defined(__sparc) || defined(__sparc__) || \
69
- defined(_POWER) || defined(__powerpc__) || \
70
- defined(__ppc__) || defined(__hppa) || \
71
- defined(__PPC__) || defined(__PPC64__) || \
72
- defined(_MIPSEB) || defined(__ARMEB__) || \
73
- defined(__s390__) || \
74
- (defined(__sh__) && defined(__BIG_ENDIAN__)) || \
75
- (defined(__ia64) && defined(__BIG_ENDIAN__))
76
- #define SK_CPU_BENDIAN
77
- #else
78
- #define SK_CPU_LENDIAN
79
- #endif
80
- #endif
81
-
82
- #if defined(__i386) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_X64)
83
- #define SK_CPU_X86 1
84
- #endif
85
-
86
- /**
87
- * SK_CPU_SSE_LEVEL
88
- *
89
- * If defined, SK_CPU_SSE_LEVEL should be set to the highest supported level.
90
- * On non-intel CPU this should be undefined.
91
- */
92
- #define SK_CPU_SSE_LEVEL_SSE1 10
93
- #define SK_CPU_SSE_LEVEL_SSE2 20
94
- #define SK_CPU_SSE_LEVEL_SSE3 30
95
- #define SK_CPU_SSE_LEVEL_SSSE3 31
96
- #define SK_CPU_SSE_LEVEL_SSE41 41
97
- #define SK_CPU_SSE_LEVEL_SSE42 42
98
- #define SK_CPU_SSE_LEVEL_AVX 51
99
- #define SK_CPU_SSE_LEVEL_AVX2 52
100
- #define SK_CPU_SSE_LEVEL_SKX 60
101
-
102
- // Are we in GCC/Clang?
103
- #ifndef SK_CPU_SSE_LEVEL
104
- // These checks must be done in descending order to ensure we set the highest
105
- // available SSE level.
106
- #if defined(__AVX512F__) && defined(__AVX512DQ__) && defined(__AVX512CD__) && \
107
- defined(__AVX512BW__) && defined(__AVX512VL__)
108
- #define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_SKX
109
- #elif defined(__AVX2__)
110
- #define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_AVX2
111
- #elif defined(__AVX__)
112
- #define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_AVX
113
- #elif defined(__SSE4_2__)
114
- #define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_SSE42
115
- #elif defined(__SSE4_1__)
116
- #define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_SSE41
117
- #elif defined(__SSSE3__)
118
- #define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_SSSE3
119
- #elif defined(__SSE3__)
120
- #define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_SSE3
121
- #elif defined(__SSE2__)
122
- #define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_SSE2
123
- #endif
124
- #endif
125
-
126
- // Are we in VisualStudio?
127
- #ifndef SK_CPU_SSE_LEVEL
128
- // These checks must be done in descending order to ensure we set the highest
129
- // available SSE level. 64-bit intel guarantees at least SSE2 support.
130
- #if defined(__AVX512F__) && defined(__AVX512DQ__) && defined(__AVX512CD__) && \
131
- defined(__AVX512BW__) && defined(__AVX512VL__)
132
- #define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_SKX
133
- #elif defined(__AVX2__)
134
- #define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_AVX2
135
- #elif defined(__AVX__)
136
- #define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_AVX
137
- #elif defined(_M_X64) || defined(_M_AMD64)
138
- #define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_SSE2
139
- #elif defined(_M_IX86_FP)
140
- #if _M_IX86_FP >= 2
141
- #define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_SSE2
142
- #elif _M_IX86_FP == 1
143
- #define SK_CPU_SSE_LEVEL SK_CPU_SSE_LEVEL_SSE1
144
- #endif
145
- #endif
146
- #endif
147
-
148
- // ARM defines
149
- #if defined(__arm__) && (!defined(__APPLE__) || !TARGET_IPHONE_SIMULATOR)
150
- #define SK_CPU_ARM32
151
- #elif defined(__aarch64__)
152
- #define SK_CPU_ARM64
153
- #endif
154
-
155
- // All 64-bit ARM chips have NEON. Many 32-bit ARM chips do too.
156
- #if !defined(SK_ARM_HAS_NEON) && defined(__ARM_NEON)
157
- #define SK_ARM_HAS_NEON
158
- #endif
159
-
160
- #if defined(__ARM_FEATURE_CRC32)
161
- #define SK_ARM_HAS_CRC32
162
- #endif
163
-
164
-
165
- // DLL/.so exports.
166
- #if !defined(SKIA_IMPLEMENTATION)
167
- #define SKIA_IMPLEMENTATION 0
168
- #endif
169
- #if !defined(SK_API)
170
- #if defined(SKIA_DLL)
171
- #if defined(_MSC_VER)
172
- #if SKIA_IMPLEMENTATION
173
- #define SK_API __declspec(dllexport)
174
- #else
175
- #define SK_API __declspec(dllimport)
176
- #endif
177
- #else
178
- #define SK_API __attribute__((visibility("default")))
179
- #endif
180
- #else
181
- #define SK_API
182
- #endif
183
- #endif
184
-
185
- // SK_SPI is functionally identical to SK_API, but used within src to clarify that it's less stable
186
- #if !defined(SK_SPI)
187
- #define SK_SPI SK_API
188
- #endif
189
-
11
+ // All of these files should be independent of things users can set via the user config file.
12
+ // They should also be able to be included in any order.
190
13
  // IWYU pragma: begin_exports
191
- #if defined (SK_USER_CONFIG_HEADER)
192
- #include SK_USER_CONFIG_HEADER
193
- #else
194
- #include "include/config/SkUserConfig.h"
195
- #endif
196
- // IWYU pragma: end_exports
197
- #include <stddef.h>
198
- #include <stdint.h>
199
-
200
- // Post SkUserConfig.h checks and such.
201
- #if !defined(SK_DEBUG) && !defined(SK_RELEASE)
202
- #ifdef NDEBUG
203
- #define SK_RELEASE
204
- #else
205
- #define SK_DEBUG
206
- #endif
207
- #endif
14
+ #include "include/private/base/SkFeatures.h"
208
15
 
209
- #if defined(SK_DEBUG) && defined(SK_RELEASE)
210
- # error "cannot define both SK_DEBUG and SK_RELEASE"
211
- #elif !defined(SK_DEBUG) && !defined(SK_RELEASE)
212
- # error "must define either SK_DEBUG or SK_RELEASE"
213
- #endif
214
-
215
- #if defined(SK_CPU_LENDIAN) && defined(SK_CPU_BENDIAN)
216
- # error "cannot define both SK_CPU_LENDIAN and SK_CPU_BENDIAN"
217
- #elif !defined(SK_CPU_LENDIAN) && !defined(SK_CPU_BENDIAN)
218
- # error "must define either SK_CPU_LENDIAN or SK_CPU_BENDIAN"
219
- #endif
220
-
221
- #if defined(SK_CPU_BENDIAN) && !defined(I_ACKNOWLEDGE_SKIA_DOES_NOT_SUPPORT_BIG_ENDIAN)
222
- #error "The Skia team is not endian-savvy enough to support big-endian CPUs."
223
- #error "If you still want to use Skia,"
224
- #error "please define I_ACKNOWLEDGE_SKIA_DOES_NOT_SUPPORT_BIG_ENDIAN."
225
- #endif
16
+ // Load and verify defines from the user config file.
17
+ #include "include/private/base/SkLoadUserConfig.h"
226
18
 
227
- #if !defined(SK_ATTRIBUTE)
228
- # if defined(__clang__) || defined(__GNUC__)
229
- # define SK_ATTRIBUTE(attr) __attribute__((attr))
230
- # else
231
- # define SK_ATTRIBUTE(attr)
232
- # endif
233
- #endif
19
+ // Any includes or defines below can be configured by the user config file.
20
+ #include "include/private/base/SkAPI.h"
21
+ #include "include/private/base/SkAssert.h"
22
+ #include "include/private/base/SkAttributes.h"
23
+ #include "include/private/base/SkDebug.h"
24
+ // IWYU pragma: end_exports
234
25
 
235
- #if !defined(SK_SUPPORT_GPU)
236
- # define SK_SUPPORT_GPU 1
237
- #endif
26
+ #include <climits>
27
+ #include <cstdint>
238
28
 
239
- #if SK_SUPPORT_GPU || defined(SK_GRAPHITE_ENABLED)
29
+ #if defined(SK_GANESH) || defined(SK_GRAPHITE)
240
30
  # if !defined(SK_ENABLE_SKSL)
241
31
  # define SK_ENABLE_SKSL
242
32
  # endif
@@ -248,45 +38,6 @@
248
38
  # undef SK_DIRECT3D
249
39
  #endif
250
40
 
251
- #if !defined(SkUNREACHABLE)
252
- # if defined(_MSC_VER) && !defined(__clang__)
253
- # include <intrin.h>
254
- # define FAST_FAIL_INVALID_ARG 5
255
- // See https://developercommunity.visualstudio.com/content/problem/1128631/code-flow-doesnt-see-noreturn-with-extern-c.html
256
- // for why this is wrapped. Hopefully removable after msvc++ 19.27 is no longer supported.
257
- [[noreturn]] static inline void sk_fast_fail() { __fastfail(FAST_FAIL_INVALID_ARG); }
258
- # define SkUNREACHABLE sk_fast_fail()
259
- # else
260
- # define SkUNREACHABLE __builtin_trap()
261
- # endif
262
- #endif
263
-
264
- #if defined(SK_BUILD_FOR_GOOGLE3)
265
- void SkDebugfForDumpStackTrace(const char* data, void* unused);
266
- namespace base {
267
- void DumpStackTrace(int skip_count, void w(const char*, void*), void* arg);
268
- }
269
- # define SK_DUMP_GOOGLE3_STACK() ::base::DumpStackTrace(0, SkDebugfForDumpStackTrace, nullptr)
270
- #else
271
- # define SK_DUMP_GOOGLE3_STACK()
272
- #endif
273
-
274
- #ifndef SK_ABORT
275
- # ifdef SK_BUILD_FOR_WIN
276
- // This style lets Visual Studio follow errors back to the source file.
277
- # define SK_DUMP_LINE_FORMAT "%s(%d)"
278
- # else
279
- # define SK_DUMP_LINE_FORMAT "%s:%d"
280
- # endif
281
- # define SK_ABORT(message, ...) \
282
- do { \
283
- SkDebugf(SK_DUMP_LINE_FORMAT ": fatal error: \"" message "\"\n", \
284
- __FILE__, __LINE__, ##__VA_ARGS__); \
285
- SK_DUMP_GOOGLE3_STACK(); \
286
- sk_abort_no_print(); \
287
- } while (false)
288
- #endif
289
-
290
41
  // If SK_R32_SHIFT is set, we'll use that to choose RGBA or BGRA.
291
42
  // If not, we'll default to RGBA everywhere except BGRA on Windows.
292
43
  #if defined(SK_R32_SHIFT)
@@ -306,7 +57,6 @@
306
57
  #define SK_G32_SHIFT 8
307
58
  #define SK_A32_SHIFT 24
308
59
 
309
-
310
60
  /**
311
61
  * SK_PMCOLOR_BYTE_ORDER can be used to query the byte order of SkPMColor at compile time.
312
62
  */
@@ -332,48 +82,6 @@
332
82
  #undef free
333
83
  #endif
334
84
 
335
- #if !defined(SK_UNUSED)
336
- # if !defined(__clang__) && defined(_MSC_VER)
337
- # define SK_UNUSED __pragma(warning(suppress:4189))
338
- # else
339
- # define SK_UNUSED SK_ATTRIBUTE(unused)
340
- # endif
341
- #endif
342
-
343
- /**
344
- * If your judgment is better than the compiler's (i.e. you've profiled it),
345
- * you can use SK_ALWAYS_INLINE to force inlining. E.g.
346
- * inline void someMethod() { ... } // may not be inlined
347
- * SK_ALWAYS_INLINE void someMethod() { ... } // should always be inlined
348
- */
349
- #if !defined(SK_ALWAYS_INLINE)
350
- # if defined(SK_BUILD_FOR_WIN)
351
- # define SK_ALWAYS_INLINE __forceinline
352
- # else
353
- # define SK_ALWAYS_INLINE SK_ATTRIBUTE(always_inline) inline
354
- # endif
355
- #endif
356
-
357
- /**
358
- * If your judgment is better than the compiler's (i.e. you've profiled it),
359
- * you can use SK_NEVER_INLINE to prevent inlining.
360
- */
361
- #if !defined(SK_NEVER_INLINE)
362
- # if defined(SK_BUILD_FOR_WIN)
363
- # define SK_NEVER_INLINE __declspec(noinline)
364
- # else
365
- # define SK_NEVER_INLINE SK_ATTRIBUTE(noinline)
366
- # endif
367
- #endif
368
-
369
- #ifndef SK_PRINTF_LIKE
370
- # if defined(__clang__) || defined(__GNUC__)
371
- # define SK_PRINTF_LIKE(A, B) __attribute__((format(printf, (A), (B))))
372
- # else
373
- # define SK_PRINTF_LIKE(A, B)
374
- # endif
375
- #endif
376
-
377
85
  #ifndef SK_ALLOW_STATIC_GLOBAL_INITIALIZERS
378
86
  #define SK_ALLOW_STATIC_GLOBAL_INITIALIZERS 0
379
87
  #endif
@@ -386,11 +94,6 @@
386
94
  # define GR_TEST_UTILS 0
387
95
  #endif
388
96
 
389
- #if !SK_SUPPORT_GPU
390
- #define SK_GPU_V1 0 // always false if Ganesh is disabled
391
- #elif !defined(SK_GPU_V1)
392
- # define SK_GPU_V1 1 // otherwise default to v1 enabled
393
- #endif
394
97
 
395
98
  #if defined(SK_HISTOGRAM_ENUMERATION) || \
396
99
  defined(SK_HISTOGRAM_BOOLEAN) || \
@@ -420,145 +123,44 @@
420
123
  #define SK_HISTOGRAM_PERCENTAGE(name, percent_as_int) \
421
124
  SK_HISTOGRAM_EXACT_LINEAR(name, percent_as_int, 101)
422
125
 
423
- #ifndef SK_DISABLE_LEGACY_SHADERCONTEXT
424
- #define SK_ENABLE_LEGACY_SHADERCONTEXT
126
+ // The top-level define SK_ENABLE_OPTIMIZE_SIZE can be used to remove several large features at once
127
+ #if defined(SK_ENABLE_OPTIMIZE_SIZE)
128
+ # define SK_FORCE_RASTER_PIPELINE_BLITTER
129
+ # define SK_DISABLE_SDF_TEXT
425
130
  #endif
426
131
 
427
- #ifdef SK_ENABLE_API_AVAILABLE
428
- #define SK_API_AVAILABLE API_AVAILABLE
429
- #else
430
- #define SK_API_AVAILABLE(...)
132
+ #ifndef SK_DISABLE_LEGACY_SHADERCONTEXT
133
+ # define SK_ENABLE_LEGACY_SHADERCONTEXT
431
134
  #endif
432
135
 
433
136
  #if defined(SK_BUILD_FOR_LIBFUZZER) || defined(SK_BUILD_FOR_AFL_FUZZ)
137
+ #if !defined(SK_BUILD_FOR_FUZZER)
434
138
  #define SK_BUILD_FOR_FUZZER
435
139
  #endif
140
+ #endif
436
141
 
437
- /** Called internally if we hit an unrecoverable error.
438
- The platform implementation must not return, but should either throw
439
- an exception or otherwise exit.
440
- */
441
- [[noreturn]] SK_API extern void sk_abort_no_print(void);
142
+ /**
143
+ * Gr defines are set to 0 or 1, rather than being undefined or defined
144
+ */
442
145
 
443
- #ifndef SkDebugf
444
- SK_API void SkDebugf(const char format[], ...) SK_PRINTF_LIKE(1, 2);
146
+ #if !defined(GR_CACHE_STATS)
147
+ #if defined(SK_DEBUG) || defined(SK_DUMP_STATS)
148
+ #define GR_CACHE_STATS 1
149
+ #else
150
+ #define GR_CACHE_STATS 0
151
+ #endif
445
152
  #endif
446
153
 
447
- // SkASSERT, SkASSERTF and SkASSERT_RELEASE can be used as stand alone assertion expressions, e.g.
448
- // uint32_t foo(int x) {
449
- // SkASSERT(x > 4);
450
- // return x - 4;
451
- // }
452
- // and are also written to be compatible with constexpr functions:
453
- // constexpr uint32_t foo(int x) {
454
- // return SkASSERT(x > 4),
455
- // x - 4;
456
- // }
457
- #define SkASSERT_RELEASE(cond) \
458
- static_cast<void>( (cond) ? (void)0 : []{ SK_ABORT("assert(%s)", #cond); }() )
459
-
460
- #ifdef SK_DEBUG
461
- #define SkASSERT(cond) SkASSERT_RELEASE(cond)
462
- #define SkASSERTF(cond, fmt, ...) static_cast<void>( (cond) ? (void)0 : [&]{ \
463
- SkDebugf(fmt"\n", ##__VA_ARGS__); \
464
- SK_ABORT("assert(%s)", #cond); \
465
- }() )
466
- #define SkDEBUGFAIL(message) SK_ABORT("%s", message)
467
- #define SkDEBUGFAILF(fmt, ...) SK_ABORT(fmt, ##__VA_ARGS__)
468
- #define SkDEBUGCODE(...) __VA_ARGS__
469
- #define SkDEBUGF(...) SkDebugf(__VA_ARGS__)
470
- #define SkAssertResult(cond) SkASSERT(cond)
471
- #else
472
- #define SkASSERT(cond) static_cast<void>(0)
473
- #define SkASSERTF(cond, fmt, ...) static_cast<void>(0)
474
- #define SkDEBUGFAIL(message)
475
- #define SkDEBUGFAILF(fmt, ...)
476
- #define SkDEBUGCODE(...)
477
- #define SkDEBUGF(...)
478
-
479
- // unlike SkASSERT, this macro executes its condition in the non-debug build.
480
- // The if is present so that this can be used with functions marked SK_WARN_UNUSED_RESULT.
481
- #define SkAssertResult(cond) if (cond) {} do {} while(false)
154
+ #if !defined(GR_GPU_STATS)
155
+ #if defined(SK_DEBUG) || defined(SK_DUMP_STATS) || GR_TEST_UTILS
156
+ #define GR_GPU_STATS 1
157
+ #else
158
+ #define GR_GPU_STATS 0
159
+ #endif
482
160
  #endif
483
161
 
484
162
  ////////////////////////////////////////////////////////////////////////////////
485
163
 
486
- /** Fast type for unsigned 8 bits. Use for parameter passing and local
487
- variables, not for storage
488
- */
489
- typedef unsigned U8CPU;
490
-
491
- /** Fast type for unsigned 16 bits. Use for parameter passing and local
492
- variables, not for storage
493
- */
494
- typedef unsigned U16CPU;
495
-
496
- /** @return false or true based on the condition
497
- */
498
- template <typename T> static constexpr bool SkToBool(const T& x) {
499
- return (bool)x;
500
- }
501
-
502
- static constexpr int16_t SK_MaxS16 = INT16_MAX;
503
- static constexpr int16_t SK_MinS16 = -SK_MaxS16;
504
-
505
- static constexpr int32_t SK_MaxS32 = INT32_MAX;
506
- static constexpr int32_t SK_MinS32 = -SK_MaxS32;
507
- static constexpr int32_t SK_NaN32 = INT32_MIN;
508
-
509
- static constexpr int64_t SK_MaxS64 = INT64_MAX;
510
- static constexpr int64_t SK_MinS64 = -SK_MaxS64;
511
-
512
- static inline constexpr int32_t SkLeftShift(int32_t value, int32_t shift) {
513
- return (int32_t) ((uint32_t) value << shift);
514
- }
515
-
516
- static inline constexpr int64_t SkLeftShift(int64_t value, int32_t shift) {
517
- return (int64_t) ((uint64_t) value << shift);
518
- }
519
-
520
- ////////////////////////////////////////////////////////////////////////////////
521
-
522
- /** @return the number of entries in an array (not a pointer)
523
- */
524
- // The SkArrayCountHelper template returns a type 'char (&)[N]', a reference to an array of
525
- // char with N elements, where N is deduced using function parameter type deduction. This is then
526
- // used in the sizeof operator in SK_ARRAY_COUNT. The sizeof operator ignores the reference, and
527
- // just evaluates the size of the array type.
528
- //
529
- // DEPRECATED: use std::size() instead.
530
- // Note: Rarely, std::size(z) can't deduce the type of z during compile time for static_assert
531
- // while SK_ARRAY_COUNT can. It can't be deduced because z is part of class, and the class' this
532
- // pointer is not a valid constexpr expression. Use SkASSERT instead.
533
- template <typename T, size_t N> char (&SkArrayCountHelper(T (&array)[N]))[N];
534
- #define SK_ARRAY_COUNT(array) (sizeof(SkArrayCountHelper(array)))
535
-
536
- ////////////////////////////////////////////////////////////////////////////////
537
-
538
- template <typename T> static constexpr T SkAlign2(T x) { return (x + 1) >> 1 << 1; }
539
- template <typename T> static constexpr T SkAlign4(T x) { return (x + 3) >> 2 << 2; }
540
- template <typename T> static constexpr T SkAlign8(T x) { return (x + 7) >> 3 << 3; }
541
-
542
- template <typename T> static constexpr bool SkIsAlign2(T x) { return 0 == (x & 1); }
543
- template <typename T> static constexpr bool SkIsAlign4(T x) { return 0 == (x & 3); }
544
- template <typename T> static constexpr bool SkIsAlign8(T x) { return 0 == (x & 7); }
545
-
546
- template <typename T> static constexpr T SkAlignPtr(T x) {
547
- return sizeof(void*) == 8 ? SkAlign8(x) : SkAlign4(x);
548
- }
549
- template <typename T> static constexpr bool SkIsAlignPtr(T x) {
550
- return sizeof(void*) == 8 ? SkIsAlign8(x) : SkIsAlign4(x);
551
- }
552
-
553
- /**
554
- * align up to a power of 2
555
- */
556
- static inline constexpr size_t SkAlignTo(size_t x, size_t alignment) {
557
- // The same as alignment && SkIsPow2(value), w/o a dependency cycle.
558
- SkASSERT(alignment && (alignment & (alignment - 1)) == 0);
559
- return (x + alignment - 1) & ~(alignment - 1);
560
- }
561
-
562
164
  typedef uint32_t SkFourByteTag;
563
165
  static inline constexpr SkFourByteTag SkSetFourByteTag(char a, char b, char c, char d) {
564
166
  return (((uint32_t)a << 24) | ((uint32_t)b << 16) | ((uint32_t)c << 8) | (uint32_t)d);
@@ -591,36 +193,5 @@ static constexpr uint32_t SK_InvalidGenID = 0;
591
193
  */
592
194
  static constexpr uint32_t SK_InvalidUniqueID = 0;
593
195
 
594
- static inline int32_t SkAbs32(int32_t value) {
595
- SkASSERT(value != SK_NaN32); // The most negative int32_t can't be negated.
596
- if (value < 0) {
597
- value = -value;
598
- }
599
- return value;
600
- }
601
-
602
- template <typename T> static inline T SkTAbs(T value) {
603
- if (value < 0) {
604
- value = -value;
605
- }
606
- return value;
607
- }
608
-
609
- ////////////////////////////////////////////////////////////////////////////////
610
-
611
- /** Indicates whether an allocation should count against a cache budget.
612
- */
613
- enum class SkBudgeted : bool {
614
- kNo = false,
615
- kYes = true
616
- };
617
-
618
- /** Indicates whether a backing store needs to be an exact match or can be
619
- larger than is strictly necessary
620
- */
621
- enum class SkBackingFit {
622
- kApprox,
623
- kExact
624
- };
625
196
 
626
197
  #endif
@@ -12,6 +12,8 @@
12
12
  #include "include/core/SkRect.h"
13
13
  #include "include/core/SkRefCnt.h"
14
14
 
15
+ #include <memory>
16
+
15
17
  class SkData;
16
18
  struct SkPoint;
17
19
  class SkVerticesPriv;
@@ -10,9 +10,13 @@
10
10
 
11
11
  #include "include/codec/SkEncodedOrigin.h"
12
12
  #include "include/core/SkImageInfo.h"
13
+ #include "include/core/SkMatrix.h"
13
14
  #include "include/core/SkSize.h"
15
+ #include "include/core/SkTypes.h"
14
16
 
15
17
  #include <array>
18
+ #include <cstddef>
19
+ #include <cstdint>
16
20
  #include <tuple>
17
21
 
18
22
  /**
@@ -8,14 +8,20 @@
8
8
  #ifndef SkYUVAPixmaps_DEFINED
9
9
  #define SkYUVAPixmaps_DEFINED
10
10
 
11
+ #include "include/core/SkColorType.h"
11
12
  #include "include/core/SkData.h"
12
13
  #include "include/core/SkImageInfo.h"
13
14
  #include "include/core/SkPixmap.h"
15
+ #include "include/core/SkRefCnt.h"
16
+ #include "include/core/SkSize.h"
17
+ #include "include/core/SkTypes.h"
14
18
  #include "include/core/SkYUVAInfo.h"
15
- #include "include/private/SkTo.h"
19
+ #include "include/private/base/SkTo.h"
16
20
 
17
21
  #include <array>
18
22
  #include <bitset>
23
+ #include <cstddef>
24
+ #include <tuple>
19
25
 
20
26
  class GrImageContext;
21
27
 
@@ -12,7 +12,7 @@
12
12
  #include "include/core/SkScalar.h"
13
13
  #include "include/core/SkString.h"
14
14
  #include "include/core/SkTime.h"
15
- #include "include/private/SkNoncopyable.h"
15
+ #include "include/private/base/SkNoncopyable.h"
16
16
 
17
17
  #define SKPDF_STRING(X) SKPDF_STRING_IMPL(X)
18
18
  #define SKPDF_STRING_IMPL(X) #X
@@ -143,6 +143,17 @@ struct Metadata {
143
143
  */
144
144
  SkExecutor* fExecutor = nullptr;
145
145
 
146
+ /** PDF streams may be compressed to save space.
147
+ Use this to specify the desired compression vs time tradeoff.
148
+ */
149
+ enum class CompressionLevel : int {
150
+ Default = -1,
151
+ None = 0,
152
+ LowButFast = 1,
153
+ Average = 6,
154
+ HighButSlow = 9,
155
+ } fCompressionLevel = CompressionLevel::Default;
156
+
146
157
  /** Preferred Subsetter. Only respected if both are compiled in.
147
158
 
148
159
  The Sfntly subsetter is deprecated.
@@ -8,12 +8,13 @@
8
8
  #ifndef SkColorMatrix_DEFINED
9
9
  #define SkColorMatrix_DEFINED
10
10
 
11
- #include "include/core/SkImageInfo.h"
12
11
  #include "include/core/SkTypes.h"
13
12
 
14
13
  #include <algorithm>
15
14
  #include <array>
16
15
 
16
+ enum SkYUVColorSpace : int;
17
+
17
18
  class SK_API SkColorMatrix {
18
19
  public:
19
20
  constexpr SkColorMatrix() : SkColorMatrix(1, 0, 0, 0, 0,