@shopify/react-native-skia 0.1.192 → 0.1.194

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 (304) hide show
  1. package/android/CMakeLists.txt +1 -1
  2. package/android/build.gradle +1 -0
  3. package/android/cpp/jni/JniPlatformContext.cpp +1 -1
  4. package/android/src/main/java/com/shopify/reactnative/skia/ViewScreenshotService.java +104 -103
  5. package/cpp/api/JsiSkImage.h +25 -4
  6. package/cpp/api/JsiSkImageFactory.h +2 -2
  7. package/cpp/api/JsiSkPath.h +8 -6
  8. package/cpp/rnskia/dom/base/Declaration.h +5 -7
  9. package/cpp/rnskia/dom/base/JsiDomDrawingNode.h +3 -1
  10. package/cpp/rnskia/dom/nodes/JsiBlurMaskNode.h +1 -0
  11. package/cpp/rnskia/dom/nodes/JsiPathNode.h +2 -2
  12. package/cpp/rnskia/dom/props/BoxShadowProps.h +2 -0
  13. package/cpp/skia/include/android/SkAndroidFrameworkUtils.h +2 -8
  14. package/cpp/skia/include/android/SkImageAndroid.h +101 -0
  15. package/cpp/skia/include/codec/SkAndroidCodec.h +26 -8
  16. package/cpp/skia/include/codec/SkCodec.h +31 -17
  17. package/cpp/skia/include/codec/SkEncodedImageFormat.h +36 -0
  18. package/cpp/skia/include/codec/SkPixmapUtils.h +31 -0
  19. package/cpp/skia/include/config/SkUserConfig.h +61 -29
  20. package/cpp/skia/include/core/SkBitmap.h +25 -25
  21. package/cpp/skia/include/core/SkBlurTypes.h +0 -2
  22. package/cpp/skia/include/core/SkCanvas.h +32 -15
  23. package/cpp/skia/include/core/SkCapabilities.h +2 -2
  24. package/cpp/skia/include/core/SkColor.h +2 -0
  25. package/cpp/skia/include/core/SkColorPriv.h +19 -4
  26. package/cpp/skia/include/core/SkColorSpace.h +14 -17
  27. package/cpp/skia/include/core/SkColorType.h +1 -0
  28. package/cpp/skia/include/core/SkContourMeasure.h +1 -1
  29. package/cpp/skia/include/core/SkCoverageMode.h +0 -2
  30. package/cpp/skia/include/core/SkCubicMap.h +2 -0
  31. package/cpp/skia/include/core/SkData.h +5 -2
  32. package/cpp/skia/include/core/SkDataTable.h +6 -2
  33. package/cpp/skia/include/core/SkDeferredDisplayList.h +11 -10
  34. package/cpp/skia/include/core/SkDeferredDisplayListRecorder.h +9 -8
  35. package/cpp/skia/include/core/SkDrawable.h +10 -2
  36. package/cpp/skia/include/core/SkEncodedImageFormat.h +3 -30
  37. package/cpp/skia/include/core/SkFlattenable.h +4 -2
  38. package/cpp/skia/include/core/SkFont.h +1 -0
  39. package/cpp/skia/include/core/SkFontMetrics.h +1 -0
  40. package/cpp/skia/include/core/SkFontMgr.h +20 -29
  41. package/cpp/skia/include/core/SkFontStyle.h +4 -1
  42. package/cpp/skia/include/core/SkGraphics.h +21 -18
  43. package/cpp/skia/include/core/SkICC.h +3 -13
  44. package/cpp/skia/include/core/SkImage.h +395 -717
  45. package/cpp/skia/include/core/SkImageGenerator.h +19 -74
  46. package/cpp/skia/include/core/SkImageInfo.h +7 -5
  47. package/cpp/skia/include/core/SkM44.h +11 -0
  48. package/cpp/skia/include/core/SkMaskFilter.h +6 -3
  49. package/cpp/skia/include/core/SkMatrix.h +14 -4
  50. package/cpp/skia/include/core/SkMesh.h +52 -18
  51. package/cpp/skia/include/core/SkMilestone.h +1 -1
  52. package/cpp/skia/include/core/SkPaint.h +11 -34
  53. package/cpp/skia/include/core/SkPath.h +23 -4
  54. package/cpp/skia/include/core/SkPathBuilder.h +13 -5
  55. package/cpp/skia/include/core/SkPathMeasure.h +1 -1
  56. package/cpp/skia/include/core/SkPathTypes.h +0 -2
  57. package/cpp/skia/include/core/SkPathUtils.h +42 -0
  58. package/cpp/skia/include/core/SkPicture.h +3 -2
  59. package/cpp/skia/include/core/SkPictureRecorder.h +2 -0
  60. package/cpp/skia/include/core/SkPixelRef.h +4 -8
  61. package/cpp/skia/include/core/SkPixmap.h +12 -20
  62. package/cpp/skia/include/core/SkPoint.h +4 -2
  63. package/cpp/skia/include/core/SkPromiseImageTexture.h +2 -2
  64. package/cpp/skia/include/core/SkRRect.h +5 -1
  65. package/cpp/skia/include/core/SkRect.h +6 -3
  66. package/cpp/skia/include/core/SkRefCnt.h +9 -14
  67. package/cpp/skia/include/core/SkRegion.h +1 -1
  68. package/cpp/skia/include/core/SkScalar.h +2 -4
  69. package/cpp/skia/include/core/SkSerialProcs.h +18 -10
  70. package/cpp/skia/include/core/SkShader.h +1 -64
  71. package/cpp/skia/include/core/SkSize.h +2 -0
  72. package/cpp/skia/include/core/SkSpan.h +4 -112
  73. package/cpp/skia/include/core/SkStream.h +11 -12
  74. package/cpp/skia/include/core/SkString.h +9 -25
  75. package/cpp/skia/include/core/SkStrokeRec.h +1 -1
  76. package/cpp/skia/include/core/SkSurface.h +83 -61
  77. package/cpp/skia/include/core/SkSurfaceCharacterization.h +3 -3
  78. package/cpp/skia/include/core/SkSurfaceProps.h +9 -1
  79. package/cpp/skia/include/core/SkTextBlob.h +2 -2
  80. package/cpp/skia/include/core/SkTextureCompressionType.h +30 -0
  81. package/cpp/skia/include/core/SkTime.h +1 -1
  82. package/cpp/skia/include/core/SkTypeface.h +9 -2
  83. package/cpp/skia/include/core/SkTypes.h +37 -466
  84. package/cpp/skia/include/core/SkVertices.h +2 -0
  85. package/cpp/skia/include/core/SkYUVAInfo.h +4 -0
  86. package/cpp/skia/include/core/SkYUVAPixmaps.h +7 -1
  87. package/cpp/skia/include/docs/SkPDFDocument.h +12 -1
  88. package/cpp/skia/include/effects/SkColorMatrix.h +2 -1
  89. package/cpp/skia/include/effects/SkGradientShader.h +65 -14
  90. package/cpp/skia/include/effects/SkImageFilters.h +0 -11
  91. package/cpp/skia/include/effects/SkRuntimeEffect.h +41 -11
  92. package/cpp/skia/include/encode/SkEncoder.h +7 -3
  93. package/cpp/skia/include/encode/SkICC.h +36 -0
  94. package/cpp/skia/include/encode/SkJpegEncoder.h +102 -71
  95. package/cpp/skia/include/encode/SkPngEncoder.h +89 -71
  96. package/cpp/skia/include/encode/SkWebpEncoder.h +65 -38
  97. package/cpp/skia/include/gpu/GpuTypes.h +23 -1
  98. package/cpp/skia/include/gpu/GrBackendSurface.h +9 -7
  99. package/cpp/skia/include/gpu/GrContextOptions.h +28 -9
  100. package/cpp/skia/include/gpu/GrContextThreadSafeProxy.h +6 -4
  101. package/cpp/skia/include/gpu/GrDirectContext.h +84 -63
  102. package/cpp/skia/include/gpu/GrDriverBugWorkarounds.h +2 -1
  103. package/cpp/skia/include/gpu/GrRecordingContext.h +9 -5
  104. package/cpp/skia/include/gpu/GrTypes.h +18 -18
  105. package/cpp/skia/include/gpu/d3d/GrD3DTypes.h +4 -4
  106. package/cpp/skia/include/gpu/dawn/GrDawnTypes.h +3 -3
  107. package/cpp/skia/include/gpu/ganesh/GrTextureGenerator.h +77 -0
  108. package/cpp/skia/include/gpu/ganesh/SkImageGanesh.h +385 -0
  109. package/cpp/skia/include/gpu/gl/GrGLExtensions.h +3 -3
  110. package/cpp/skia/include/gpu/gl/GrGLFunctions.h +1 -1
  111. package/cpp/skia/include/gpu/gl/GrGLInterface.h +0 -3
  112. package/cpp/skia/include/gpu/gl/GrGLTypes.h +2 -1
  113. package/cpp/skia/include/gpu/graphite/BackendTexture.h +72 -3
  114. package/cpp/skia/include/gpu/graphite/Context.h +85 -32
  115. package/cpp/skia/include/gpu/graphite/ContextOptions.h +15 -11
  116. package/cpp/skia/include/gpu/graphite/GraphiteTypes.h +55 -5
  117. package/cpp/skia/include/gpu/graphite/ImageProvider.h +6 -4
  118. package/cpp/skia/include/gpu/graphite/Recorder.h +41 -11
  119. package/cpp/skia/include/gpu/graphite/Recording.h +50 -3
  120. package/cpp/skia/include/gpu/graphite/TextureInfo.h +47 -8
  121. package/cpp/skia/include/gpu/graphite/YUVABackendTextures.h +139 -0
  122. package/cpp/skia/include/gpu/graphite/dawn/DawnTypes.h +40 -0
  123. package/cpp/skia/include/gpu/graphite/dawn/DawnUtils.h +28 -0
  124. package/cpp/skia/include/gpu/graphite/mtl/MtlBackendContext.h +1 -1
  125. package/cpp/skia/include/gpu/graphite/mtl/{MtlTypes.h → MtlGraphiteTypes.h} +7 -6
  126. package/cpp/skia/include/gpu/graphite/mtl/MtlGraphiteUtils.h +27 -0
  127. package/cpp/skia/include/gpu/graphite/vk/VulkanGraphiteTypes.h +4 -9
  128. package/cpp/skia/include/gpu/graphite/vk/VulkanGraphiteUtils.h +28 -0
  129. package/cpp/skia/include/gpu/mock/GrMockTypes.h +17 -13
  130. package/cpp/skia/include/gpu/mtl/GrMtlTypes.h +2 -2
  131. package/cpp/skia/include/gpu/vk/GrVkBackendContext.h +1 -1
  132. package/cpp/skia/include/gpu/vk/GrVkTypes.h +3 -3
  133. package/cpp/skia/include/gpu/vk/VulkanExtensions.h +3 -3
  134. package/cpp/skia/include/gpu/vk/VulkanMemoryAllocator.h +5 -7
  135. package/cpp/skia/include/pathops/SkPathOps.h +3 -3
  136. package/cpp/skia/include/ports/SkFontMgr_data.h +22 -0
  137. package/cpp/skia/include/ports/SkFontMgr_indirect.h +14 -14
  138. package/cpp/skia/include/ports/SkRemotableFontMgr.h +2 -2
  139. package/cpp/skia/include/ports/SkTypeface_win.h +2 -1
  140. package/cpp/skia/include/private/SkChecksum.h +32 -7
  141. package/cpp/skia/include/private/SkColorData.h +1 -26
  142. package/cpp/skia/include/private/SkGainmapInfo.h +97 -0
  143. package/cpp/skia/include/private/SkGainmapShader.h +53 -0
  144. package/cpp/skia/include/private/SkIDChangeListener.h +4 -3
  145. package/cpp/skia/include/private/SkJpegGainmapEncoder.h +71 -0
  146. package/cpp/skia/include/private/SkJpegMetadataDecoder.h +61 -0
  147. package/cpp/skia/include/private/SkOpts_spi.h +3 -1
  148. package/cpp/skia/include/private/SkPathRef.h +64 -47
  149. package/cpp/skia/include/private/SkSLDefines.h +5 -5
  150. package/cpp/skia/include/private/SkSLSampleUsage.h +0 -4
  151. package/cpp/skia/include/private/SkSpinlock.h +1 -1
  152. package/cpp/skia/include/private/SkWeakRefCnt.h +3 -0
  153. package/cpp/skia/include/private/{SingleOwner.h → base/SingleOwner.h} +8 -5
  154. package/cpp/skia/include/private/base/SkAPI.h +52 -0
  155. package/cpp/skia/include/private/base/SkAlign.h +39 -0
  156. package/cpp/skia/include/private/base/SkAlignedStorage.h +32 -0
  157. package/cpp/skia/include/private/base/SkAssert.h +92 -0
  158. package/cpp/skia/include/private/base/SkAttributes.h +102 -0
  159. package/cpp/skia/include/private/base/SkCPUTypes.h +25 -0
  160. package/cpp/skia/include/private/base/SkContainers.h +46 -0
  161. package/cpp/skia/include/private/base/SkDebug.h +27 -0
  162. package/cpp/skia/include/private/{SkDeque.h → base/SkDeque.h} +3 -1
  163. package/cpp/skia/include/private/base/SkFeatures.h +151 -0
  164. package/cpp/skia/include/private/{SkFixed.h → base/SkFixed.h} +9 -7
  165. package/cpp/skia/include/private/{SkFloatBits.h → base/SkFloatBits.h} +2 -3
  166. package/cpp/skia/include/private/{SkFloatingPoint.h → base/SkFloatingPoint.h} +18 -9
  167. package/cpp/skia/include/private/base/SkLoadUserConfig.h +63 -0
  168. package/cpp/skia/include/private/{SkMacros.h → base/SkMacros.h} +17 -2
  169. package/cpp/skia/include/private/{SkMalloc.h → base/SkMalloc.h} +4 -7
  170. package/cpp/skia/include/{core → private/base}/SkMath.h +25 -2
  171. package/cpp/skia/include/private/{SkMutex.h → base/SkMutex.h} +5 -5
  172. package/cpp/skia/include/private/{SkNoncopyable.h → base/SkNoncopyable.h} +2 -2
  173. package/cpp/skia/include/private/{SkOnce.h → base/SkOnce.h} +3 -1
  174. package/cpp/skia/include/private/base/SkPathEnums.h +25 -0
  175. package/cpp/skia/include/private/{SkSafe32.h → base/SkSafe32.h} +16 -1
  176. package/cpp/skia/include/private/{SkSemaphore.h → base/SkSemaphore.h} +4 -3
  177. package/cpp/skia/include/private/base/SkSpan_impl.h +129 -0
  178. package/cpp/skia/include/private/base/SkTArray.h +694 -0
  179. package/cpp/skia/include/private/{SkTDArray.h → base/SkTDArray.h} +17 -54
  180. package/cpp/skia/include/private/{SkTFitsIn.h → base/SkTFitsIn.h} +14 -8
  181. package/cpp/skia/include/private/{SkTLogic.h → base/SkTLogic.h} +1 -1
  182. package/cpp/skia/include/private/{SkTemplates.h → base/SkTemplates.h} +63 -88
  183. package/cpp/skia/include/private/{SkThreadID.h → base/SkThreadID.h} +5 -2
  184. package/cpp/skia/include/private/{SkTo.h → base/SkTo.h} +13 -2
  185. package/cpp/skia/include/private/base/SkTypeTraits.h +33 -0
  186. package/cpp/skia/include/private/chromium/GrVkSecondaryCBDrawContext.h +130 -0
  187. package/cpp/skia/include/private/chromium/SkChromeRemoteGlyphCache.h +5 -9
  188. package/cpp/skia/include/private/chromium/SkDiscardableMemory.h +70 -0
  189. package/cpp/skia/include/private/chromium/Slug.h +0 -9
  190. package/cpp/skia/include/private/gpu/ganesh/GrContext_Base.h +2 -1
  191. package/cpp/skia/include/private/gpu/ganesh/GrD3DTypesMinimal.h +1 -1
  192. package/cpp/skia/include/private/gpu/ganesh/GrDawnTypesPriv.h +1 -1
  193. package/cpp/skia/include/private/gpu/ganesh/GrGLTypesPriv.h +1 -1
  194. package/cpp/skia/include/private/gpu/ganesh/GrImageContext.h +1 -1
  195. package/cpp/skia/include/private/gpu/ganesh/GrMockTypesPriv.h +3 -2
  196. package/cpp/skia/include/private/gpu/ganesh/GrMtlTypesPriv.h +1 -1
  197. package/cpp/skia/include/private/gpu/ganesh/GrTypesPriv.h +17 -23
  198. package/cpp/skia/include/private/gpu/ganesh/GrVkTypesPriv.h +2 -2
  199. package/cpp/skia/include/private/gpu/graphite/DawnTypesPriv.h +38 -0
  200. package/cpp/skia/include/private/gpu/graphite/{MtlTypesPriv.h → MtlGraphiteTypesPriv.h} +5 -5
  201. package/cpp/skia/include/private/gpu/graphite/VulkanGraphiteTypesPriv.h +1 -9
  202. package/cpp/skia/include/private/gpu/vk/SkiaVulkan.h +4 -0
  203. package/cpp/skia/include/utils/SkCamera.h +1 -1
  204. package/cpp/skia/include/utils/SkCustomTypeface.h +7 -1
  205. package/cpp/skia/include/utils/SkNWayCanvas.h +6 -6
  206. package/cpp/skia/include/utils/SkOrderedFontMgr.h +7 -6
  207. package/cpp/skia/include/utils/SkPaintFilterCanvas.h +2 -2
  208. package/cpp/skia/include/utils/SkParsePath.h +1 -1
  209. package/cpp/skia/modules/skcms/skcms.h +14 -0
  210. package/cpp/skia/modules/skcms/src/Transform_inl.h +19 -0
  211. package/cpp/skia/modules/skparagraph/include/FontCollection.h +2 -2
  212. package/cpp/skia/modules/skparagraph/include/Paragraph.h +72 -2
  213. package/cpp/skia/modules/skparagraph/include/ParagraphCache.h +1 -11
  214. package/cpp/skia/modules/skparagraph/include/ParagraphPainter.h +63 -0
  215. package/cpp/skia/modules/skparagraph/include/TextStyle.h +27 -4
  216. package/cpp/skia/modules/skparagraph/include/TypefaceFontProvider.h +13 -13
  217. package/cpp/skia/modules/skresources/include/SkResources.h +18 -4
  218. package/cpp/skia/modules/svg/include/SkSVGAttribute.h +1 -1
  219. package/cpp/skia/modules/svg/include/SkSVGAttributeParser.h +2 -2
  220. package/cpp/skia/modules/svg/include/SkSVGContainer.h +2 -2
  221. package/cpp/skia/modules/svg/include/SkSVGDOM.h +1 -1
  222. package/cpp/skia/modules/svg/include/SkSVGFilterContext.h +2 -2
  223. package/cpp/skia/modules/svg/include/SkSVGGradient.h +2 -2
  224. package/cpp/skia/modules/svg/include/SkSVGIDMapper.h +2 -2
  225. package/cpp/skia/modules/svg/include/SkSVGRenderContext.h +3 -3
  226. package/cpp/skia/modules/svg/include/SkSVGSVG.h +1 -1
  227. package/cpp/skia/modules/svg/include/SkSVGTypes.h +22 -21
  228. package/cpp/skia/modules/svg/include/SkSVGValue.h +1 -1
  229. package/cpp/skia/{include/private → src/core}/SkTHash.h +41 -37
  230. package/ios/RNSkia-iOS/RNSkMetalCanvasProvider.mm +1 -2
  231. package/ios/RNSkia-iOS/ViewScreenshotService.mm +1 -1
  232. package/libs/android/arm64-v8a/libskia.a +0 -0
  233. package/libs/android/arm64-v8a/libskottie.a +0 -0
  234. package/libs/android/arm64-v8a/libsksg.a +0 -0
  235. package/libs/android/arm64-v8a/libskshaper.a +0 -0
  236. package/libs/android/arm64-v8a/libsvg.a +0 -0
  237. package/libs/android/armeabi-v7a/libskia.a +0 -0
  238. package/libs/android/armeabi-v7a/libskottie.a +0 -0
  239. package/libs/android/armeabi-v7a/libsksg.a +0 -0
  240. package/libs/android/armeabi-v7a/libskshaper.a +0 -0
  241. package/libs/android/armeabi-v7a/libsvg.a +0 -0
  242. package/libs/android/x86/libskia.a +0 -0
  243. package/libs/android/x86/libskottie.a +0 -0
  244. package/libs/android/x86/libsksg.a +0 -0
  245. package/libs/android/x86/libskshaper.a +0 -0
  246. package/libs/android/x86/libsvg.a +0 -0
  247. package/libs/android/x86_64/libskia.a +0 -0
  248. package/libs/android/x86_64/libskottie.a +0 -0
  249. package/libs/android/x86_64/libsksg.a +0 -0
  250. package/libs/android/x86_64/libskshaper.a +0 -0
  251. package/libs/android/x86_64/libsvg.a +0 -0
  252. package/libs/ios/libskia.xcframework/Info.plist +5 -5
  253. package/libs/ios/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
  254. package/libs/ios/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
  255. package/libs/ios/libskottie.xcframework/ios-arm64_arm64e/libskottie.a +0 -0
  256. package/libs/ios/libskottie.xcframework/ios-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
  257. package/libs/ios/libsksg.xcframework/ios-arm64_arm64e/libsksg.a +0 -0
  258. package/libs/ios/libsksg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
  259. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
  260. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
  261. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
  262. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
  263. package/package.json +1 -1
  264. package/react-native-skia.podspec +1 -1
  265. package/scripts/install-npm.js +11 -1
  266. package/cpp/skia/include/core/SkImageEncoder.h +0 -71
  267. package/cpp/skia/include/gpu/GrConfig.h +0 -53
  268. package/cpp/skia/include/gpu/graphite/CombinationBuilder.h +0 -195
  269. package/cpp/skia/include/private/SkHalf.h +0 -38
  270. package/cpp/skia/include/private/SkImageInfoPriv.h +0 -199
  271. package/cpp/skia/include/private/SkSLIRNode.h +0 -64
  272. package/cpp/skia/include/private/SkSLLayout.h +0 -144
  273. package/cpp/skia/include/private/SkSLModifiers.h +0 -178
  274. package/cpp/skia/include/private/SkSLProgramElement.h +0 -77
  275. package/cpp/skia/include/private/SkSLProgramKind.h +0 -35
  276. package/cpp/skia/include/private/SkSLStatement.h +0 -86
  277. package/cpp/skia/include/private/SkSLString.h +0 -41
  278. package/cpp/skia/include/private/SkSLSymbol.h +0 -94
  279. package/cpp/skia/include/private/SkSafe_math.h +0 -52
  280. package/cpp/skia/include/private/SkStringView.h +0 -51
  281. package/cpp/skia/include/private/SkTArray.h +0 -655
  282. package/cpp/skia/include/private/SkUniquePaintParamsID.h +0 -35
  283. package/cpp/skia/include/private/SkVx.h +0 -1026
  284. package/cpp/skia/include/sksl/DSL.h +0 -37
  285. package/cpp/skia/include/sksl/DSLBlock.h +0 -58
  286. package/cpp/skia/include/sksl/DSLCase.h +0 -62
  287. package/cpp/skia/include/sksl/DSLCore.h +0 -492
  288. package/cpp/skia/include/sksl/DSLExpression.h +0 -241
  289. package/cpp/skia/include/sksl/DSLFunction.h +0 -113
  290. package/cpp/skia/include/sksl/DSLLayout.h +0 -92
  291. package/cpp/skia/include/sksl/DSLModifiers.h +0 -69
  292. package/cpp/skia/include/sksl/DSLStatement.h +0 -82
  293. package/cpp/skia/include/sksl/DSLSymbols.h +0 -61
  294. package/cpp/skia/include/sksl/DSLType.h +0 -271
  295. package/cpp/skia/include/sksl/DSLVar.h +0 -231
  296. package/cpp/skia/include/sksl/SkSLErrorReporter.h +0 -65
  297. package/cpp/skia/include/sksl/SkSLOperator.h +0 -154
  298. package/cpp/skia/include/sksl/SkSLPosition.h +0 -104
  299. package/cpp/skia/include/utils/SkRandom.h +0 -169
  300. package/cpp/skia/src/core/SkLRUCache.h +0 -126
  301. package/cpp/skia/src/core/SkTInternalLList.h +0 -302
  302. /package/cpp/skia/include/{core → codec}/SkPngChunkReader.h +0 -0
  303. /package/cpp/skia/include/private/{SkTPin.h → base/SkTPin.h} +0 -0
  304. /package/cpp/skia/include/private/{SkThreadAnnotations.h → base/SkThreadAnnotations.h} +0 -0
@@ -9,17 +9,14 @@
9
9
  #ifndef SkNWayCanvas_DEFINED
10
10
  #define SkNWayCanvas_DEFINED
11
11
 
12
- #include "include/core/SkBlendMode.h"
13
- #include "include/core/SkCanvas.h"
14
12
  #include "include/core/SkCanvasVirtualEnforcer.h"
15
- #include "include/core/SkClipOp.h"
16
13
  #include "include/core/SkColor.h"
17
14
  #include "include/core/SkM44.h"
18
15
  #include "include/core/SkRefCnt.h"
19
16
  #include "include/core/SkSamplingOptions.h"
20
17
  #include "include/core/SkScalar.h"
21
18
  #include "include/core/SkTypes.h"
22
- #include "include/private/SkTDArray.h"
19
+ #include "include/private/base/SkTDArray.h"
23
20
  #include "include/utils/SkNoDrawCanvas.h"
24
21
 
25
22
  #include <cstddef>
@@ -28,6 +25,7 @@ namespace sktext {
28
25
  class GlyphRunList;
29
26
  }
30
27
 
28
+ class SkCanvas;
31
29
  class SkData;
32
30
  class SkDrawable;
33
31
  class SkImage;
@@ -40,12 +38,14 @@ class SkRegion;
40
38
  class SkShader;
41
39
  class SkTextBlob;
42
40
  class SkVertices;
41
+ enum class SkBlendMode;
42
+ enum class SkClipOp;
43
43
  struct SkDrawShadowRec;
44
44
  struct SkPoint;
45
45
  struct SkRSXform;
46
46
  struct SkRect;
47
47
 
48
- #if SK_SUPPORT_GPU
48
+ #if defined(SK_GANESH)
49
49
  namespace sktext::gpu {
50
50
  class Slug;
51
51
  }
@@ -77,7 +77,7 @@ protected:
77
77
  void onDrawGlyphRunList(const sktext::GlyphRunList&, const SkPaint&) override;
78
78
  void onDrawTextBlob(const SkTextBlob* blob, SkScalar x, SkScalar y,
79
79
  const SkPaint& paint) override;
80
- #if SK_SUPPORT_GPU
80
+ #if defined(SK_GANESH)
81
81
  void onDrawSlug(const sktext::gpu::Slug* slug) override;
82
82
  #endif
83
83
  void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4],
@@ -39,14 +39,15 @@ public:
39
39
  protected:
40
40
  int onCountFamilies() const override;
41
41
  void onGetFamilyName(int index, SkString* familyName) const override;
42
- SkFontStyleSet* onCreateStyleSet(int index)const override;
42
+ sk_sp<SkFontStyleSet> onCreateStyleSet(int index)const override;
43
43
 
44
- SkFontStyleSet* onMatchFamily(const char familyName[]) const override;
44
+ sk_sp<SkFontStyleSet> onMatchFamily(const char familyName[]) const override;
45
45
 
46
- SkTypeface* onMatchFamilyStyle(const char familyName[], const SkFontStyle&) const override;
47
- SkTypeface* onMatchFamilyStyleCharacter(const char familyName[], const SkFontStyle&,
48
- const char* bcp47[], int bcp47Count,
49
- SkUnichar character) const override;
46
+ sk_sp<SkTypeface> onMatchFamilyStyle(const char familyName[],
47
+ const SkFontStyle&) const override;
48
+ sk_sp<SkTypeface> onMatchFamilyStyleCharacter(const char familyName[], const SkFontStyle&,
49
+ const char* bcp47[], int bcp47Count,
50
+ SkUnichar character) const override;
50
51
 
51
52
  // Note: all of these always return null
52
53
  sk_sp<SkTypeface> onMakeFromData(sk_sp<SkData>, int ttcIndex) const override;
@@ -8,7 +8,6 @@
8
8
  #ifndef SkPaintFilterCanvas_DEFINED
9
9
  #define SkPaintFilterCanvas_DEFINED
10
10
 
11
- #include "include/core/SkBlendMode.h"
12
11
  #include "include/core/SkCanvas.h"
13
12
  #include "include/core/SkCanvasVirtualEnforcer.h"
14
13
  #include "include/core/SkColor.h"
@@ -18,7 +17,7 @@
18
17
  #include "include/core/SkScalar.h"
19
18
  #include "include/core/SkSize.h"
20
19
  #include "include/core/SkTypes.h"
21
- #include "include/private/SkTDArray.h"
20
+ #include "include/private/base/SkTDArray.h"
22
21
  #include "include/utils/SkNWayCanvas.h"
23
22
 
24
23
  #include <cstddef>
@@ -42,6 +41,7 @@ class SkSurface;
42
41
  class SkSurfaceProps;
43
42
  class SkTextBlob;
44
43
  class SkVertices;
44
+ enum class SkBlendMode;
45
45
  struct SkDrawShadowRec;
46
46
  struct SkPoint;
47
47
  struct SkRSXform;
@@ -19,7 +19,7 @@ public:
19
19
  static bool FromSVGString(const char str[], SkPath*);
20
20
 
21
21
  enum class PathEncoding { Absolute, Relative };
22
- static void ToSVGString(const SkPath&, SkString*, PathEncoding = PathEncoding::Absolute);
22
+ static SkString ToSVGString(const SkPath&, PathEncoding = PathEncoding::Absolute);
23
23
  };
24
24
 
25
25
  #endif
@@ -51,6 +51,17 @@ SKCMS_API float skcms_TransferFunction_eval (const skcms_TransferFunction*, flo
51
51
  SKCMS_API bool skcms_TransferFunction_invert(const skcms_TransferFunction*,
52
52
  skcms_TransferFunction*);
53
53
 
54
+ typedef enum skcms_TFType {
55
+ skcms_TFType_Invalid,
56
+ skcms_TFType_sRGBish,
57
+ skcms_TFType_PQish,
58
+ skcms_TFType_HLGish,
59
+ skcms_TFType_HLGinvish,
60
+ } skcms_TFType;
61
+
62
+ // Identify which kind of transfer function is encoded in an skcms_TransferFunction
63
+ SKCMS_API skcms_TFType skcms_TransferFunction_getType(const skcms_TransferFunction*);
64
+
54
65
  // We can jam a couple alternate transfer function forms into skcms_TransferFunction,
55
66
  // including those matching the general forms of the SMPTE ST 2084 PQ function or HLG.
56
67
  //
@@ -307,6 +318,9 @@ typedef enum skcms_PixelFormat {
307
318
  skcms_PixelFormat_BGR_fff, // Pointers must be 32-bit aligned.
308
319
  skcms_PixelFormat_RGBA_ffff,
309
320
  skcms_PixelFormat_BGRA_ffff,
321
+
322
+ skcms_PixelFormat_RGB_101010x_XR, // Note: This is located here to signal no clamping.
323
+ skcms_PixelFormat_BGR_101010x_XR, // Compatible with MTLPixelFormatBGR10_XR.
310
324
  } skcms_PixelFormat;
311
325
 
312
326
  // We always store any alpha channel linearly. In the chart below, tf-1() is the inverse
@@ -903,6 +903,16 @@ static void exec_ops(const Op* ops, const void** args,
903
903
  a = cast<F>((rgba >> 30) & 0x3 ) * (1/ 3.0f);
904
904
  } break;
905
905
 
906
+ case Op_load_101010x_XR:{
907
+ static constexpr float min = -0.752941f;
908
+ static constexpr float max = 1.25098f;
909
+ static constexpr float range = max - min;
910
+ U32 rgba = load<U32>(src + 4*i);
911
+ r = cast<F>((rgba >> 0) & 0x3ff) * (1/1023.0f) * range + min;
912
+ g = cast<F>((rgba >> 10) & 0x3ff) * (1/1023.0f) * range + min;
913
+ b = cast<F>((rgba >> 20) & 0x3ff) * (1/1023.0f) * range + min;
914
+ } break;
915
+
906
916
  case Op_load_161616LE:{
907
917
  uintptr_t ptr = (uintptr_t)(src + 6*i);
908
918
  assert( (ptr & 1) == 0 ); // src must be 2-byte aligned for this
@@ -1313,6 +1323,15 @@ static void exec_ops(const Op* ops, const void** args,
1313
1323
  | cast<U32>(to_fixed(a * 255)) << 24);
1314
1324
  } return;
1315
1325
 
1326
+ case Op_store_101010x_XR: {
1327
+ static constexpr float min = -0.752941f;
1328
+ static constexpr float max = 1.25098f;
1329
+ static constexpr float range = max - min;
1330
+ store(dst + 4*i, cast<U32>(to_fixed(((r - min) / range) * 1023)) << 0
1331
+ | cast<U32>(to_fixed(((g - min) / range) * 1023)) << 10
1332
+ | cast<U32>(to_fixed(((b - min) / range) * 1023)) << 20);
1333
+ return;
1334
+ }
1316
1335
  case Op_store_1010102: {
1317
1336
  store(dst + 4*i, cast<U32>(to_fixed(r * 1023)) << 0
1318
1337
  | cast<U32>(to_fixed(g * 1023)) << 10
@@ -7,10 +7,10 @@
7
7
  #include <set>
8
8
  #include "include/core/SkFontMgr.h"
9
9
  #include "include/core/SkRefCnt.h"
10
- #include "include/private/SkTHash.h"
11
10
  #include "modules/skparagraph/include/FontArguments.h"
12
11
  #include "modules/skparagraph/include/ParagraphCache.h"
13
12
  #include "modules/skparagraph/include/TextStyle.h"
13
+ #include "src/core/SkTHash.h"
14
14
 
15
15
  namespace skia {
16
16
  namespace textlayout {
@@ -69,7 +69,7 @@ private:
69
69
  };
70
70
 
71
71
  bool fEnableFontFallback;
72
- SkTHashMap<FamilyKey, std::vector<sk_sp<SkTypeface>>, FamilyKey::Hasher> fTypefaces;
72
+ skia_private::THashMap<FamilyKey, std::vector<sk_sp<SkTypeface>>, FamilyKey::Hasher> fTypefaces;
73
73
  sk_sp<SkFontMgr> fDefaultFontManager;
74
74
  sk_sp<SkFontMgr> fAssetFontManager;
75
75
  sk_sp<SkFontMgr> fDynamicFontManager;
@@ -12,6 +12,8 @@ class SkCanvas;
12
12
  namespace skia {
13
13
  namespace textlayout {
14
14
 
15
+ class ParagraphPainter;
16
+
15
17
  class Paragraph {
16
18
 
17
19
  public:
@@ -39,6 +41,8 @@ public:
39
41
 
40
42
  virtual void paint(SkCanvas* canvas, SkScalar x, SkScalar y) = 0;
41
43
 
44
+ virtual void paint(ParagraphPainter* painter, SkScalar x, SkScalar y) = 0;
45
+
42
46
  // Returns a vector of bounding boxes that enclose all text between
43
47
  // start and end glyph indexes, including start and excluding end
44
48
  virtual std::vector<TextBox> getRectsForRange(unsigned start,
@@ -66,9 +70,9 @@ public:
66
70
  // -1 if not applicable (has not been shaped yet - valid case)
67
71
  virtual int32_t unresolvedGlyphs() = 0;
68
72
 
69
- // Experimental API that allows fast way to update "immutable" paragraph
73
+ // Experimental API that allows fast way to update some of "immutable" paragraph attributes
74
+ // but not the text itself
70
75
  virtual void updateTextAlign(TextAlign textAlign) = 0;
71
- virtual void updateText(size_t from, SkString text) = 0;
72
76
  virtual void updateFontSize(size_t from, size_t to, SkScalar fontSize) = 0;
73
77
  virtual void updateForegroundPaint(size_t from, size_t to, SkPaint paint) = 0;
74
78
  virtual void updateBackgroundPaint(size_t from, size_t to, SkPaint paint) = 0;
@@ -91,6 +95,72 @@ public:
91
95
  using Visitor = std::function<void(int lineNumber, const VisitorInfo*)>;
92
96
  virtual void visit(const Visitor&) = 0;
93
97
 
98
+ // Editing API
99
+ virtual int getLineNumberAt(TextIndex codeUnitIndex) const = 0;
100
+
101
+ /* Returns line metrics info for the line
102
+ *
103
+ * @param lineNumber a line number
104
+ * @param lineMetrics an address to return the info (in case of null just skipped)
105
+ * @return true if the line is found; false if not
106
+ */
107
+ virtual bool getLineMetricsAt(int lineNumber, LineMetrics* lineMetrics) const = 0;
108
+
109
+ /* Returns the visible text on the line (excluding a possible ellipsis)
110
+ *
111
+ * @param lineNumber a line number
112
+ * @param includeSpaces indicates if the whitespaces should be included
113
+ * @return the range of the text that is shown in the line
114
+ */
115
+ virtual TextRange getActualTextRange(int lineNumber, bool includeSpaces) const = 0;
116
+
117
+ struct GlyphClusterInfo {
118
+ SkRect fBounds;
119
+ TextRange fClusterTextRange;
120
+ TextDirection fGlyphClusterPosition;
121
+ };
122
+
123
+ /** Finds a glyph cluster for text index
124
+ *
125
+ * @param codeUnitIndex a text index
126
+ * @param glyphInfo a glyph cluster info filled if not null
127
+ * @return true if glyph cluster was found; false if not
128
+ */
129
+ virtual bool getGlyphClusterAt(TextIndex codeUnitIndex, GlyphClusterInfo* glyphInfo) = 0;
130
+
131
+ /** Finds the closest glyph cluster for a visual text position
132
+ *
133
+ * @param dx x coordinate
134
+ * @param dy y coordinate
135
+ * @param glyphInfo a glyph cluster info filled if not null
136
+ * @return
137
+ */
138
+ virtual bool getClosestGlyphClusterAt(SkScalar dx,
139
+ SkScalar dy,
140
+ GlyphClusterInfo* glyphInfo) = 0;
141
+
142
+ struct FontInfo {
143
+ FontInfo(const SkFont font, const TextRange textRange)
144
+ : fFont(font), fTextRange(textRange) { }
145
+ virtual ~FontInfo() = default;
146
+ FontInfo(const FontInfo& ) = default;
147
+ SkFont fFont;
148
+ TextRange fTextRange;
149
+ };
150
+
151
+ /** Returns the font that is used to shape the text at the position
152
+ *
153
+ * @param codeUnitIndex text index
154
+ * @return font info or an empty font info if the text is not found
155
+ */
156
+ virtual SkFont getFontAt(TextIndex codeUnitIndex) const = 0;
157
+
158
+ /** Returns the information about all the fonts used to shape the paragraph text
159
+ *
160
+ * @return a list of fonts and text ranges
161
+ */
162
+ virtual std::vector<FontInfo> getFonts() const = 0;
163
+
94
164
  protected:
95
165
  sk_sp<FontCollection> fFontCollection;
96
166
  ParagraphStyle fParagraphStyle;
@@ -2,7 +2,7 @@
2
2
  #ifndef ParagraphCache_DEFINED
3
3
  #define ParagraphCache_DEFINED
4
4
 
5
- #include "include/private/SkMutex.h"
5
+ #include "include/private/base/SkMutex.h"
6
6
  #include "src/core/SkLRUCache.h"
7
7
  #include <functional> // std::function
8
8
 
@@ -11,16 +11,6 @@
11
11
  namespace skia {
12
12
  namespace textlayout {
13
13
 
14
- enum InternalState {
15
- kUnknown = 0,
16
- kShaped = 2,
17
- kClusterized = 3,
18
- kMarked = 4,
19
- kLineBroken = 5,
20
- kFormatted = 6,
21
- kDrawn = 7
22
- };
23
-
24
14
  class ParagraphImpl;
25
15
  class ParagraphCacheKey;
26
16
  class ParagraphCacheValue;
@@ -0,0 +1,63 @@
1
+ // Copyright 2019 Google LLC.
2
+ #ifndef ParagraphPainter_DEFINED
3
+ #define ParagraphPainter_DEFINED
4
+
5
+ #include "include/core/SkPaint.h"
6
+ #include "include/core/SkTextBlob.h"
7
+
8
+ #include <optional>
9
+ #include <variant>
10
+
11
+ namespace skia {
12
+ namespace textlayout {
13
+
14
+ class ParagraphPainter {
15
+ public:
16
+ typedef int PaintID;
17
+ typedef std::variant<SkPaint, PaintID> SkPaintOrID;
18
+
19
+ struct DashPathEffect {
20
+ DashPathEffect(SkScalar onLength, SkScalar offLength);
21
+
22
+ SkScalar fOnLength;
23
+ SkScalar fOffLength;
24
+ };
25
+
26
+ class DecorationStyle {
27
+ public:
28
+ DecorationStyle();
29
+ DecorationStyle(SkColor color, SkScalar strokeWidth,
30
+ std::optional<DashPathEffect> dashPathEffect);
31
+
32
+ SkColor getColor() const { return fColor; }
33
+ SkScalar getStrokeWidth() const { return fStrokeWidth; }
34
+ std::optional<DashPathEffect> getDashPathEffect() const { return fDashPathEffect; }
35
+ const SkPaint& skPaint() const { return fPaint; }
36
+
37
+ private:
38
+ SkColor fColor;
39
+ SkScalar fStrokeWidth;
40
+ std::optional<DashPathEffect> fDashPathEffect;
41
+ SkPaint fPaint;
42
+ };
43
+
44
+ virtual ~ParagraphPainter() = default;
45
+
46
+ virtual void drawTextBlob(const sk_sp<SkTextBlob>& blob, SkScalar x, SkScalar y, const SkPaintOrID& paint) = 0;
47
+ virtual void drawTextShadow(const sk_sp<SkTextBlob>& blob, SkScalar x, SkScalar y, SkColor color, SkScalar blurSigma) = 0;
48
+ virtual void drawRect(const SkRect& rect, const SkPaintOrID& paint) = 0;
49
+ virtual void drawFilledRect(const SkRect& rect, const DecorationStyle& decorStyle) = 0;
50
+ virtual void drawPath(const SkPath& path, const DecorationStyle& decorStyle) = 0;
51
+ virtual void drawLine(SkScalar x0, SkScalar y0, SkScalar x1, SkScalar y1, const DecorationStyle& decorStyle) = 0;
52
+
53
+ virtual void clipRect(const SkRect& rect) = 0;
54
+ virtual void translate(SkScalar dx, SkScalar dy) = 0;
55
+
56
+ virtual void save() = 0;
57
+ virtual void restore() = 0;
58
+ };
59
+
60
+ } // namespace textlayout
61
+ } // namespace skia
62
+
63
+ #endif // ParagraphPainter_DEFINED
@@ -12,6 +12,7 @@
12
12
  #include "include/core/SkScalar.h"
13
13
  #include "modules/skparagraph/include/DartTypes.h"
14
14
  #include "modules/skparagraph/include/FontArguments.h"
15
+ #include "modules/skparagraph/include/ParagraphPainter.h"
15
16
  #include "modules/skparagraph/include/TextShadow.h"
16
17
 
17
18
  // TODO: Make it external so the other platforms (Android) could use it
@@ -165,19 +166,41 @@ public:
165
166
  void setColor(SkColor color) { fColor = color; }
166
167
 
167
168
  bool hasForeground() const { return fHasForeground; }
168
- SkPaint getForeground() const { return fForeground; }
169
+ SkPaint getForeground() const {
170
+ const SkPaint* paint = std::get_if<SkPaint>(&fForeground);
171
+ return paint ? *paint : SkPaint();
172
+ }
173
+ ParagraphPainter::SkPaintOrID getForegroundPaintOrID() const {
174
+ return fForeground;
175
+ }
169
176
  void setForegroundColor(SkPaint paint) {
170
177
  fHasForeground = true;
171
178
  fForeground = std::move(paint);
172
179
  }
180
+ // Set the foreground to a paint ID. This is intended for use by clients
181
+ // that implement a custom ParagraphPainter that can not accept an SkPaint.
182
+ void setForegroundPaintID(ParagraphPainter::PaintID paintID) {
183
+ fHasForeground = true;
184
+ fForeground = paintID;
185
+ }
173
186
  void clearForegroundColor() { fHasForeground = false; }
174
187
 
175
188
  bool hasBackground() const { return fHasBackground; }
176
- SkPaint getBackground() const { return fBackground; }
189
+ SkPaint getBackground() const {
190
+ const SkPaint* paint = std::get_if<SkPaint>(&fBackground);
191
+ return paint ? *paint : SkPaint();
192
+ }
193
+ ParagraphPainter::SkPaintOrID getBackgroundPaintOrID() const {
194
+ return fBackground;
195
+ }
177
196
  void setBackgroundColor(SkPaint paint) {
178
197
  fHasBackground = true;
179
198
  fBackground = std::move(paint);
180
199
  }
200
+ void setBackgroundPaintID(ParagraphPainter::PaintID paintID) {
201
+ fHasBackground = true;
202
+ fBackground = paintID;
203
+ }
181
204
  void clearBackgroundColor() { fHasBackground = false; }
182
205
 
183
206
  // Decorations
@@ -291,9 +314,9 @@ private:
291
314
 
292
315
  SkColor fColor = SK_ColorWHITE;
293
316
  bool fHasBackground = false;
294
- SkPaint fBackground;
317
+ ParagraphPainter::SkPaintOrID fBackground;
295
318
  bool fHasForeground = false;
296
- SkPaint fForeground;
319
+ ParagraphPainter::SkPaintOrID fForeground;
297
320
 
298
321
  std::vector<TextShadow> fTextShadows;
299
322
 
@@ -2,8 +2,8 @@
2
2
  #ifndef TypefaceFontProvider_DEFINED
3
3
  #define TypefaceFontProvider_DEFINED
4
4
 
5
- #include "include/private/SkTArray.h"
6
- #include "include/private/SkTHash.h"
5
+ #include "include/private/base/SkTArray.h"
6
+ #include "src/core/SkTHash.h"
7
7
  #include <string>
8
8
  #include <unordered_map>
9
9
  #include <vector>
@@ -20,15 +20,15 @@ public:
20
20
 
21
21
  int count() override;
22
22
  void getStyle(int index, SkFontStyle*, SkString* name) override;
23
- SkTypeface* createTypeface(int index) override;
24
- SkTypeface* matchStyle(const SkFontStyle& pattern) override;
23
+ sk_sp<SkTypeface> createTypeface(int index) override;
24
+ sk_sp<SkTypeface> matchStyle(const SkFontStyle& pattern) override;
25
25
 
26
26
  SkString getFamilyName() const { return fFamilyName; }
27
27
  SkString getAlias() const { return fAlias; }
28
28
  void appendTypeface(sk_sp<SkTypeface> typeface);
29
29
 
30
30
  private:
31
- SkTArray<sk_sp<SkTypeface>> fStyles;
31
+ skia_private::TArray<sk_sp<SkTypeface>> fStyles;
32
32
  SkString fFamilyName;
33
33
  SkString fAlias;
34
34
  };
@@ -42,15 +42,15 @@ public:
42
42
 
43
43
  void onGetFamilyName(int index, SkString* familyName) const override;
44
44
 
45
- SkFontStyleSet* onMatchFamily(const char familyName[]) const override;
45
+ sk_sp<SkFontStyleSet> onMatchFamily(const char familyName[]) const override;
46
46
 
47
- SkFontStyleSet* onCreateStyleSet(int) const override { return nullptr; }
48
- SkTypeface* onMatchFamilyStyle(const char[], const SkFontStyle&) const override {
47
+ sk_sp<SkFontStyleSet> onCreateStyleSet(int) const override { return nullptr; }
48
+ sk_sp<SkTypeface> onMatchFamilyStyle(const char[], const SkFontStyle&) const override {
49
49
  return nullptr;
50
50
  }
51
- SkTypeface* onMatchFamilyStyleCharacter(const char[], const SkFontStyle&,
52
- const char*[], int,
53
- SkUnichar) const override {
51
+ sk_sp<SkTypeface> onMatchFamilyStyleCharacter(const char[], const SkFontStyle&,
52
+ const char*[], int,
53
+ SkUnichar) const override {
54
54
  return nullptr;
55
55
  }
56
56
 
@@ -71,8 +71,8 @@ public:
71
71
  }
72
72
 
73
73
  private:
74
- SkTHashMap<SkString, sk_sp<TypefaceFontStyleSet>> fRegisteredFamilies;
75
- SkTArray<SkString> fFamilyNames;
74
+ skia_private::THashMap<SkString, sk_sp<TypefaceFontStyleSet>> fRegisteredFamilies;
75
+ skia_private::TArray<SkString> fFamilyNames;
76
76
  };
77
77
 
78
78
  } // namespace textlayout
@@ -15,8 +15,8 @@
15
15
  #include "include/core/SkString.h"
16
16
  #include "include/core/SkTypeface.h"
17
17
  #include "include/core/SkTypes.h"
18
- #include "include/private/SkMutex.h"
19
- #include "include/private/SkTHash.h"
18
+ #include "include/private/base/SkMutex.h"
19
+ #include "src/core/SkTHash.h"
20
20
 
21
21
  #include <memory>
22
22
 
@@ -50,6 +50,18 @@ public:
50
50
  */
51
51
  virtual sk_sp<SkImage> getFrame(float t);
52
52
 
53
+ // Describes how the frame image is to be scaled to the animation-declared asset size.
54
+ enum class SizeFit {
55
+ // See SkMatrix::ScaleToFit
56
+ kFill = SkMatrix::kFill_ScaleToFit,
57
+ kStart = SkMatrix::kStart_ScaleToFit,
58
+ kCenter = SkMatrix::kCenter_ScaleToFit,
59
+ kEnd = SkMatrix::kEnd_ScaleToFit,
60
+
61
+ // No scaling.
62
+ kNone,
63
+ };
64
+
53
65
  struct FrameData {
54
66
  // SkImage payload.
55
67
  sk_sp<SkImage> image;
@@ -57,6 +69,8 @@ public:
57
69
  SkSamplingOptions sampling;
58
70
  // Additional image transform to be applied before AE scaling rules.
59
71
  SkMatrix matrix = SkMatrix::I();
72
+ // Strategy for image size -> AE asset size scaling.
73
+ SizeFit scaling = SizeFit::kCenter;
60
74
  };
61
75
 
62
76
  /**
@@ -227,8 +241,8 @@ private:
227
241
 
228
242
  sk_sp<ImageAsset> loadImageAsset(const char[], const char[], const char[]) const override;
229
243
 
230
- mutable SkMutex fMutex;
231
- mutable SkTHashMap<SkString, sk_sp<ImageAsset>> fImageCache;
244
+ mutable SkMutex fMutex;
245
+ mutable skia_private::THashMap<SkString, sk_sp<ImageAsset>> fImageCache;
232
246
 
233
247
  using INHERITED = ResourceProviderProxyBase;
234
248
  };
@@ -9,7 +9,7 @@
9
9
  #define SkSVGAttribute_DEFINED
10
10
 
11
11
  #include "modules/svg/include/SkSVGTypes.h"
12
- #include "src/core/SkTLazy.h"
12
+ #include "src/base/SkTLazy.h"
13
13
 
14
14
  class SkSVGRenderContext;
15
15
 
@@ -10,9 +10,9 @@
10
10
 
11
11
  #include <vector>
12
12
 
13
- #include "include/private/SkNoncopyable.h"
13
+ #include "include/private/base/SkNoncopyable.h"
14
14
  #include "modules/svg/include/SkSVGTypes.h"
15
- #include "src/core/SkTLazy.h"
15
+ #include "src/base/SkTLazy.h"
16
16
 
17
17
  class SkSVGAttributeParser : public SkNoncopyable {
18
18
  public:
@@ -8,7 +8,7 @@
8
8
  #ifndef SkSVGContainer_DEFINED
9
9
  #define SkSVGContainer_DEFINED
10
10
 
11
- #include "include/private/SkTArray.h"
11
+ #include "include/private/base/SkTArray.h"
12
12
  #include "modules/svg/include/SkSVGTransformableNode.h"
13
13
 
14
14
  class SkSVGContainer : public SkSVGTransformableNode {
@@ -27,7 +27,7 @@ protected:
27
27
  bool hasChildren() const final;
28
28
 
29
29
  // TODO: add some sort of child iterator, and hide the container.
30
- SkSTArray<1, sk_sp<SkSVGNode>, true> fChildren;
30
+ skia_private::STArray<1, sk_sp<SkSVGNode>, true> fChildren;
31
31
 
32
32
  private:
33
33
  using INHERITED = SkSVGTransformableNode;
@@ -11,7 +11,7 @@
11
11
  #include "include/core/SkFontMgr.h"
12
12
  #include "include/core/SkRefCnt.h"
13
13
  #include "include/core/SkSize.h"
14
- #include "include/private/SkTemplates.h"
14
+ #include "include/private/base/SkTemplates.h"
15
15
  #include "modules/skresources/include/SkResources.h"
16
16
  #include "modules/svg/include/SkSVGIDMapper.h"
17
17
 
@@ -11,8 +11,8 @@
11
11
  #include "include/core/SkRect.h"
12
12
  #include "include/core/SkRefCnt.h"
13
13
  #include "include/core/SkString.h"
14
- #include "include/private/SkTHash.h"
15
14
  #include "modules/svg/include/SkSVGTypes.h"
15
+ #include "src/core/SkTHash.h"
16
16
 
17
17
  class SkImageFilter;
18
18
  class SkSVGFeInputType;
@@ -61,7 +61,7 @@ private:
61
61
 
62
62
  SkSVGObjectBoundingBoxUnits fPrimitiveUnits;
63
63
 
64
- SkTHashMap<SkSVGStringType, Result> fResults;
64
+ skia_private::THashMap<SkSVGStringType, Result> fResults;
65
65
 
66
66
  Result fPreviousResult;
67
67
  };
@@ -37,8 +37,8 @@ protected:
37
37
  SkTileMode, const SkMatrix& localMatrix) const = 0;
38
38
 
39
39
  private:
40
- using StopPositionArray = SkSTArray<2, SkScalar , true>;
41
- using StopColorArray = SkSTArray<2, SkColor4f, true>;
40
+ using StopPositionArray = skia_private::STArray<2, SkScalar , true>;
41
+ using StopColorArray = skia_private::STArray<2, SkColor4f, true>;
42
42
  void collectColorStops(const SkSVGRenderContext&, StopPositionArray*, StopColorArray*) const;
43
43
  SkColor4f resolveStopColor(const SkSVGRenderContext&, const SkSVGStop&) const;
44
44
 
@@ -9,11 +9,11 @@
9
9
  #define SkSVGIDMapper_DEFINED
10
10
 
11
11
  #include "include/core/SkRefCnt.h"
12
- #include "include/private/SkTHash.h"
12
+ #include "src/core/SkTHash.h"
13
13
 
14
14
  class SkString;
15
15
  class SkSVGNode;
16
16
 
17
- using SkSVGIDMapper = SkTHashMap<SkString, sk_sp<SkSVGNode>>;
17
+ using SkSVGIDMapper = skia_private::THashMap<SkString, sk_sp<SkSVGNode>>;
18
18
 
19
19
  #endif // SkSVGIDMapper_DEFINED