@shopify/react-native-skia 0.1.197 → 0.1.200

Sign up to get free protection for your applications and to get access to all the features.
Files changed (187) hide show
  1. package/android/CMakeLists.txt +32 -31
  2. package/android/cpp/rnskia-android/SkiaOpenGLRenderer.cpp +4 -2
  3. package/android/cpp/rnskia-android/SkiaOpenGLRenderer.h +3 -0
  4. package/cpp/api/JsiSkShaderFactory.h +4 -4
  5. package/cpp/api/JsiSkSurfaceFactory.h +2 -1
  6. package/cpp/rnskia/dom/nodes/JsiShaderNodes.h +2 -2
  7. package/cpp/skia/include/android/SkCanvasAndroid.h +20 -0
  8. package/cpp/skia/include/android/SkHeifDecoder.h +43 -0
  9. package/cpp/skia/include/android/SkSurfaceAndroid.h +50 -0
  10. package/cpp/skia/include/codec/SkAvifDecoder.h +43 -0
  11. package/cpp/skia/include/codec/SkBmpDecoder.h +43 -0
  12. package/cpp/skia/include/codec/SkCodec.h +25 -1
  13. package/cpp/skia/include/codec/SkGifDecoder.h +43 -0
  14. package/cpp/skia/include/codec/SkIcoDecoder.h +43 -0
  15. package/cpp/skia/include/codec/SkJpegDecoder.h +43 -0
  16. package/cpp/skia/include/codec/SkJpegxlDecoder.h +43 -0
  17. package/cpp/skia/include/codec/SkPngDecoder.h +43 -0
  18. package/cpp/skia/include/codec/SkRawDecoder.h +49 -0
  19. package/cpp/skia/include/codec/SkWbmpDecoder.h +43 -0
  20. package/cpp/skia/include/codec/SkWebpDecoder.h +43 -0
  21. package/cpp/skia/include/core/SkBBHFactory.h +5 -1
  22. package/cpp/skia/include/core/SkBlender.h +0 -2
  23. package/cpp/skia/include/core/SkCanvas.h +4 -23
  24. package/cpp/skia/include/core/SkColorFilter.h +14 -1
  25. package/cpp/skia/include/core/SkColorTable.h +59 -0
  26. package/cpp/skia/include/core/SkContourMeasure.h +3 -0
  27. package/cpp/skia/include/core/SkDeferredDisplayList.h +8 -104
  28. package/cpp/skia/include/core/SkDeferredDisplayListRecorder.h +8 -91
  29. package/cpp/skia/include/core/SkDrawable.h +5 -2
  30. package/cpp/skia/include/core/SkGraphics.h +7 -19
  31. package/cpp/skia/include/core/SkImage.h +157 -249
  32. package/cpp/skia/include/core/SkImageGenerator.h +0 -31
  33. package/cpp/skia/include/core/SkMilestone.h +1 -1
  34. package/cpp/skia/include/core/SkPathMeasure.h +3 -3
  35. package/cpp/skia/include/core/SkPictureRecorder.h +1 -1
  36. package/cpp/skia/include/core/SkPoint.h +5 -563
  37. package/cpp/skia/include/core/SkPoint3.h +1 -0
  38. package/cpp/skia/include/core/SkPromiseImageTexture.h +4 -30
  39. package/cpp/skia/include/core/SkRect.h +8 -8
  40. package/cpp/skia/include/core/SkSamplingOptions.h +4 -2
  41. package/cpp/skia/include/core/SkScalar.h +1 -1
  42. package/cpp/skia/include/core/SkSerialProcs.h +5 -1
  43. package/cpp/skia/include/core/SkShader.h +14 -21
  44. package/cpp/skia/include/core/SkString.h +2 -0
  45. package/cpp/skia/include/core/SkSurface.h +169 -701
  46. package/cpp/skia/include/core/SkSurfaceCharacterization.h +8 -256
  47. package/cpp/skia/include/core/SkTiledImageUtils.h +97 -0
  48. package/cpp/skia/include/core/SkTypes.h +4 -2
  49. package/cpp/skia/include/core/SkYUVAPixmaps.h +0 -5
  50. package/cpp/skia/include/effects/SkGradientShader.h +10 -1
  51. package/cpp/skia/include/effects/SkImageFilters.h +62 -37
  52. package/cpp/skia/include/effects/SkPerlinNoiseShader.h +28 -29
  53. package/cpp/skia/include/effects/SkRuntimeEffect.h +17 -12
  54. package/cpp/skia/include/gpu/GrBackendSurface.h +12 -39
  55. package/cpp/skia/include/gpu/GrBackendSurfaceMutableState.h +6 -0
  56. package/cpp/skia/include/gpu/GrContextThreadSafeProxy.h +3 -3
  57. package/cpp/skia/include/gpu/GrDirectContext.h +103 -3
  58. package/cpp/skia/include/gpu/GrRecordingContext.h +10 -19
  59. package/cpp/skia/include/gpu/MutableTextureState.h +4 -0
  60. package/cpp/skia/include/gpu/ganesh/GrExternalTextureGenerator.h +54 -0
  61. package/cpp/skia/include/gpu/ganesh/SkImageGanesh.h +20 -76
  62. package/cpp/skia/include/gpu/ganesh/SkSurfaceGanesh.h +217 -0
  63. package/cpp/skia/include/gpu/ganesh/mtl/SkSurfaceMetal.h +73 -0
  64. package/cpp/skia/include/gpu/gl/GrGLTypes.h +13 -2
  65. package/cpp/skia/include/gpu/graphite/BackendSemaphore.h +78 -0
  66. package/cpp/skia/include/gpu/graphite/BackendTexture.h +1 -0
  67. package/cpp/skia/include/gpu/graphite/Image.h +277 -0
  68. package/cpp/skia/include/gpu/graphite/ImageProvider.h +1 -1
  69. package/cpp/skia/include/gpu/graphite/Recording.h +1 -4
  70. package/cpp/skia/include/gpu/graphite/Surface.h +81 -0
  71. package/cpp/skia/include/gpu/graphite/TextureInfo.h +5 -7
  72. package/cpp/skia/include/gpu/graphite/YUVABackendTextures.h +2 -2
  73. package/cpp/skia/include/gpu/mock/GrMockTypes.h +23 -8
  74. package/cpp/skia/include/ports/SkTypeface_fontations.h +21 -0
  75. package/cpp/skia/include/private/SkGainmapInfo.h +2 -0
  76. package/cpp/skia/include/private/SkGainmapShader.h +1 -0
  77. package/cpp/skia/include/private/SkJpegMetadataDecoder.h +19 -1
  78. package/cpp/skia/include/private/SkPathRef.h +13 -15
  79. package/cpp/skia/include/private/SkXmp.h +53 -0
  80. package/cpp/skia/include/private/base/SkFeatures.h +0 -4
  81. package/cpp/skia/include/private/base/SkFloatingPoint.h +11 -5
  82. package/cpp/skia/include/private/base/SkPoint_impl.h +569 -0
  83. package/cpp/skia/include/private/base/SkSpan_impl.h +3 -7
  84. package/cpp/skia/include/private/base/SkTArray.h +11 -11
  85. package/cpp/skia/include/private/chromium/GrDeferredDisplayList.h +120 -0
  86. package/cpp/skia/include/private/chromium/GrDeferredDisplayListRecorder.h +98 -0
  87. package/cpp/skia/include/private/chromium/GrPromiseImageTexture.h +43 -0
  88. package/cpp/skia/include/private/chromium/GrSurfaceCharacterization.h +215 -0
  89. package/cpp/skia/include/private/chromium/GrVkSecondaryCBDrawContext.h +6 -6
  90. package/cpp/skia/include/private/chromium/SkImageChromium.h +104 -0
  91. package/cpp/skia/include/private/chromium/Slug.h +7 -3
  92. package/cpp/skia/include/private/gpu/ganesh/GrContext_Base.h +7 -3
  93. package/cpp/skia/include/private/gpu/ganesh/GrGLTypesPriv.h +2 -0
  94. package/cpp/skia/include/private/gpu/ganesh/GrImageContext.h +3 -2
  95. package/cpp/skia/include/private/gpu/ganesh/GrMtlTypesPriv.h +10 -2
  96. package/cpp/skia/include/{gpu → private/gpu}/ganesh/GrTextureGenerator.h +2 -13
  97. package/cpp/skia/include/private/gpu/ganesh/GrTypesPriv.h +1 -1
  98. package/cpp/skia/include/private/gpu/graphite/DawnTypesPriv.h +7 -0
  99. package/cpp/skia/include/private/gpu/graphite/MtlGraphiteTypesPriv.h +19 -6
  100. package/cpp/skia/include/private/gpu/graphite/VulkanGraphiteTypesPriv.h +13 -0
  101. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan.h +0 -1
  102. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_android.h +14 -1
  103. package/cpp/skia/include/third_party/vulkan/vulkan/vulkan_core.h +999 -79
  104. package/cpp/skia/modules/skcms/src/Transform_inl.h +36 -236
  105. package/cpp/skia/modules/skparagraph/include/Paragraph.h +2 -0
  106. package/cpp/skia/modules/skparagraph/include/ParagraphBuilder.h +16 -0
  107. package/cpp/skia/modules/skparagraph/include/TextStyle.h +6 -2
  108. package/cpp/skia/modules/skresources/include/SkResources.h +1 -1
  109. package/cpp/skia/modules/svg/include/SkSVGCircle.h +1 -1
  110. package/cpp/skia/modules/svg/include/SkSVGClipPath.h +1 -1
  111. package/cpp/skia/modules/svg/include/SkSVGContainer.h +1 -1
  112. package/cpp/skia/modules/svg/include/SkSVGDOM.h +1 -1
  113. package/cpp/skia/modules/svg/include/SkSVGDefs.h +1 -1
  114. package/cpp/skia/modules/svg/include/SkSVGEllipse.h +1 -1
  115. package/cpp/skia/modules/svg/include/SkSVGFe.h +1 -1
  116. package/cpp/skia/modules/svg/include/SkSVGFeBlend.h +1 -1
  117. package/cpp/skia/modules/svg/include/SkSVGFeColorMatrix.h +1 -1
  118. package/cpp/skia/modules/svg/include/SkSVGFeComposite.h +1 -1
  119. package/cpp/skia/modules/svg/include/SkSVGFeDisplacementMap.h +1 -1
  120. package/cpp/skia/modules/svg/include/SkSVGFeFlood.h +1 -1
  121. package/cpp/skia/modules/svg/include/SkSVGFeGaussianBlur.h +1 -1
  122. package/cpp/skia/modules/svg/include/SkSVGFeImage.h +1 -1
  123. package/cpp/skia/modules/svg/include/SkSVGFeLightSource.h +1 -1
  124. package/cpp/skia/modules/svg/include/SkSVGFeLighting.h +1 -1
  125. package/cpp/skia/modules/svg/include/SkSVGFeOffset.h +1 -1
  126. package/cpp/skia/modules/svg/include/SkSVGFeTurbulence.h +1 -1
  127. package/cpp/skia/modules/svg/include/SkSVGFilter.h +1 -1
  128. package/cpp/skia/modules/svg/include/SkSVGG.h +1 -1
  129. package/cpp/skia/modules/svg/include/SkSVGGradient.h +1 -1
  130. package/cpp/skia/modules/svg/include/SkSVGHiddenContainer.h +1 -1
  131. package/cpp/skia/modules/svg/include/SkSVGImage.h +1 -1
  132. package/cpp/skia/modules/svg/include/SkSVGLine.h +1 -1
  133. package/cpp/skia/modules/svg/include/SkSVGLinearGradient.h +1 -1
  134. package/cpp/skia/modules/svg/include/SkSVGMask.h +1 -1
  135. package/cpp/skia/modules/svg/include/SkSVGNode.h +1 -1
  136. package/cpp/skia/modules/svg/include/SkSVGPath.h +1 -1
  137. package/cpp/skia/modules/svg/include/SkSVGPattern.h +1 -1
  138. package/cpp/skia/modules/svg/include/SkSVGPoly.h +1 -1
  139. package/cpp/skia/modules/svg/include/SkSVGRadialGradient.h +1 -1
  140. package/cpp/skia/modules/svg/include/SkSVGRect.h +1 -1
  141. package/cpp/skia/modules/svg/include/SkSVGRenderContext.h +3 -3
  142. package/cpp/skia/modules/svg/include/SkSVGSVG.h +1 -1
  143. package/cpp/skia/modules/svg/include/SkSVGShape.h +1 -1
  144. package/cpp/skia/modules/svg/include/SkSVGStop.h +1 -1
  145. package/cpp/skia/modules/svg/include/SkSVGText.h +1 -1
  146. package/cpp/skia/modules/svg/include/SkSVGTransformableNode.h +1 -1
  147. package/cpp/skia/modules/svg/include/SkSVGTypes.h +21 -21
  148. package/cpp/skia/modules/svg/include/SkSVGUse.h +1 -1
  149. package/cpp/skia/modules/svg/include/SkSVGValue.h +2 -2
  150. package/cpp/skia/{include/private → src/core}/SkChecksum.h +32 -17
  151. package/cpp/skia/src/core/SkTHash.h +1 -1
  152. package/ios/RNSkia-iOS/RNSkMetalCanvasProvider.mm +3 -1
  153. package/ios/RNSkia-iOS/SkiaMetalRenderer.mm +3 -1
  154. package/libs/android/arm64-v8a/libskia.a +0 -0
  155. package/libs/android/arm64-v8a/libskottie.a +0 -0
  156. package/libs/android/arm64-v8a/libsksg.a +0 -0
  157. package/libs/android/arm64-v8a/libsvg.a +0 -0
  158. package/libs/android/armeabi-v7a/libskia.a +0 -0
  159. package/libs/android/armeabi-v7a/libskottie.a +0 -0
  160. package/libs/android/armeabi-v7a/libsksg.a +0 -0
  161. package/libs/android/armeabi-v7a/libsvg.a +0 -0
  162. package/libs/android/x86/libskia.a +0 -0
  163. package/libs/android/x86/libskottie.a +0 -0
  164. package/libs/android/x86/libsksg.a +0 -0
  165. package/libs/android/x86/libsvg.a +0 -0
  166. package/libs/android/x86_64/libskia.a +0 -0
  167. package/libs/android/x86_64/libskottie.a +0 -0
  168. package/libs/android/x86_64/libsksg.a +0 -0
  169. package/libs/android/x86_64/libsvg.a +0 -0
  170. package/libs/ios/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
  171. package/libs/ios/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
  172. package/libs/ios/libskottie.xcframework/ios-arm64_arm64e/libskottie.a +0 -0
  173. package/libs/ios/libskottie.xcframework/ios-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
  174. package/libs/ios/libsksg.xcframework/Info.plist +5 -5
  175. package/libs/ios/libsksg.xcframework/ios-arm64_arm64e/libsksg.a +0 -0
  176. package/libs/ios/libsksg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
  177. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
  178. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
  179. package/libs/ios/libsvg.xcframework/Info.plist +5 -5
  180. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
  181. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
  182. package/package.json +1 -3
  183. package/cpp/skia/include/effects/SkTableColorFilter.h +0 -29
  184. package/cpp/skia/include/private/SkOpts_spi.h +0 -23
  185. package/cpp/skia/include/private/SkSpinlock.h +0 -57
  186. package/cpp/skia/include/private/chromium/GrSlug.h +0 -16
  187. package/scripts/install-npm.js +0 -33
@@ -11,7 +11,7 @@
11
11
  #include "modules/svg/include/SkSVGFe.h"
12
12
  #include "modules/svg/include/SkSVGTypes.h"
13
13
 
14
- class SkSVGFeBlend : public SkSVGFe {
14
+ class SK_API SkSVGFeBlend : public SkSVGFe {
15
15
  public:
16
16
  enum class Mode {
17
17
  kNormal,
@@ -12,7 +12,7 @@
12
12
  #include "modules/svg/include/SkSVGFe.h"
13
13
  #include "modules/svg/include/SkSVGTypes.h"
14
14
 
15
- class SkSVGFeColorMatrix final : public SkSVGFe {
15
+ class SK_API SkSVGFeColorMatrix final : public SkSVGFe {
16
16
  public:
17
17
  static sk_sp<SkSVGFeColorMatrix> Make() {
18
18
  return sk_sp<SkSVGFeColorMatrix>(new SkSVGFeColorMatrix());
@@ -12,7 +12,7 @@
12
12
  #include "modules/svg/include/SkSVGFe.h"
13
13
  #include "modules/svg/include/SkSVGTypes.h"
14
14
 
15
- class SkSVGFeComposite final : public SkSVGFe {
15
+ class SK_API SkSVGFeComposite final : public SkSVGFe {
16
16
  public:
17
17
  static sk_sp<SkSVGFeComposite> Make() {
18
18
  return sk_sp<SkSVGFeComposite>(new SkSVGFeComposite());
@@ -11,7 +11,7 @@
11
11
  #include "modules/svg/include/SkSVGFe.h"
12
12
  #include "modules/svg/include/SkSVGTypes.h"
13
13
 
14
- class SkSVGFeDisplacementMap : public SkSVGFe {
14
+ class SK_API SkSVGFeDisplacementMap : public SkSVGFe {
15
15
  public:
16
16
  using ChannelSelector = SkColorChannel;
17
17
 
@@ -11,7 +11,7 @@
11
11
  #include "modules/svg/include/SkSVGFe.h"
12
12
  #include "modules/svg/include/SkSVGTypes.h"
13
13
 
14
- class SkSVGFeFlood : public SkSVGFe {
14
+ class SK_API SkSVGFeFlood : public SkSVGFe {
15
15
  public:
16
16
  static sk_sp<SkSVGFeFlood> Make() { return sk_sp<SkSVGFeFlood>(new SkSVGFeFlood()); }
17
17
 
@@ -11,7 +11,7 @@
11
11
  #include "modules/svg/include/SkSVGFe.h"
12
12
  #include "modules/svg/include/SkSVGTypes.h"
13
13
 
14
- class SkSVGFeGaussianBlur : public SkSVGFe {
14
+ class SK_API SkSVGFeGaussianBlur : public SkSVGFe {
15
15
  public:
16
16
  struct StdDeviation {
17
17
  SkSVGNumberType fX;
@@ -11,7 +11,7 @@
11
11
  #include "modules/svg/include/SkSVGFe.h"
12
12
  #include "modules/svg/include/SkSVGTypes.h"
13
13
 
14
- class SkSVGFeImage : public SkSVGFe {
14
+ class SK_API SkSVGFeImage : public SkSVGFe {
15
15
  public:
16
16
  static sk_sp<SkSVGFeImage> Make() { return sk_sp<SkSVGFeImage>(new SkSVGFeImage()); }
17
17
 
@@ -12,7 +12,7 @@
12
12
  #include "modules/svg/include/SkSVGHiddenContainer.h"
13
13
  #include "modules/svg/include/SkSVGTypes.h"
14
14
 
15
- class SkSVGFeLightSource : public SkSVGHiddenContainer {
15
+ class SK_API SkSVGFeLightSource : public SkSVGHiddenContainer {
16
16
  public:
17
17
  void appendChild(sk_sp<SkSVGNode>) final {
18
18
  SkDebugf("cannot append child nodes to an SVG light source.\n");
@@ -15,7 +15,7 @@ class SkSVGFeDistantLight;
15
15
  class SkSVGFePointLight;
16
16
  class SkSVGFeSpotLight;
17
17
 
18
- class SkSVGFeLighting : public SkSVGFe {
18
+ class SK_API SkSVGFeLighting : public SkSVGFe {
19
19
  public:
20
20
  struct KernelUnitLength {
21
21
  SkSVGNumberType fDx;
@@ -11,7 +11,7 @@
11
11
  #include "modules/svg/include/SkSVGFe.h"
12
12
  #include "modules/svg/include/SkSVGTypes.h"
13
13
 
14
- class SkSVGFeOffset : public SkSVGFe {
14
+ class SK_API SkSVGFeOffset : public SkSVGFe {
15
15
  public:
16
16
  static sk_sp<SkSVGFeOffset> Make() { return sk_sp<SkSVGFeOffset>(new SkSVGFeOffset()); }
17
17
 
@@ -11,7 +11,7 @@
11
11
  #include "modules/svg/include/SkSVGFe.h"
12
12
  #include "modules/svg/include/SkSVGTypes.h"
13
13
 
14
- class SkSVGFeTurbulence : public SkSVGFe {
14
+ class SK_API SkSVGFeTurbulence : public SkSVGFe {
15
15
  public:
16
16
  static sk_sp<SkSVGFeTurbulence> Make() {
17
17
  return sk_sp<SkSVGFeTurbulence>(new SkSVGFeTurbulence());
@@ -11,7 +11,7 @@
11
11
  #include "modules/svg/include/SkSVGHiddenContainer.h"
12
12
  #include "modules/svg/include/SkSVGTypes.h"
13
13
 
14
- class SkSVGFilter final : public SkSVGHiddenContainer {
14
+ class SK_API SkSVGFilter final : public SkSVGHiddenContainer {
15
15
  public:
16
16
  static sk_sp<SkSVGFilter> Make() { return sk_sp<SkSVGFilter>(new SkSVGFilter()); }
17
17
 
@@ -10,7 +10,7 @@
10
10
 
11
11
  #include "modules/svg/include/SkSVGContainer.h"
12
12
 
13
- class SkSVGG : public SkSVGContainer {
13
+ class SK_API SkSVGG : public SkSVGContainer {
14
14
  public:
15
15
  static sk_sp<SkSVGG> Make() { return sk_sp<SkSVGG>(new SkSVGG()); }
16
16
 
@@ -16,7 +16,7 @@ class SkMatrix;
16
16
  class SkSVGRenderContext;
17
17
  class SkSVGStop;
18
18
 
19
- class SkSVGGradient : public SkSVGHiddenContainer {
19
+ class SK_API SkSVGGradient : public SkSVGHiddenContainer {
20
20
  public:
21
21
  SVG_ATTR(Href, SkSVGIRI, SkSVGIRI())
22
22
  SVG_ATTR(GradientTransform, SkSVGTransformType, SkSVGTransformType(SkMatrix::I()))
@@ -10,7 +10,7 @@
10
10
 
11
11
  #include "modules/svg/include/SkSVGContainer.h"
12
12
 
13
- class SkSVGHiddenContainer : public SkSVGContainer {
13
+ class SK_API SkSVGHiddenContainer : public SkSVGContainer {
14
14
  protected:
15
15
  explicit SkSVGHiddenContainer(SkSVGTag t) : INHERITED(t) {}
16
16
 
@@ -15,7 +15,7 @@ namespace skresources {
15
15
  class ResourceProvider;
16
16
  }
17
17
 
18
- class SkSVGImage final : public SkSVGTransformableNode {
18
+ class SK_API SkSVGImage final : public SkSVGTransformableNode {
19
19
  public:
20
20
  static sk_sp<SkSVGImage> Make() {
21
21
  return sk_sp<SkSVGImage>(new SkSVGImage());
@@ -13,7 +13,7 @@
13
13
 
14
14
  struct SkPoint;
15
15
 
16
- class SkSVGLine final : public SkSVGShape {
16
+ class SK_API SkSVGLine final : public SkSVGShape {
17
17
  public:
18
18
  static sk_sp<SkSVGLine> Make() { return sk_sp<SkSVGLine>(new SkSVGLine()); }
19
19
 
@@ -11,7 +11,7 @@
11
11
  #include "modules/svg/include/SkSVGGradient.h"
12
12
  #include "modules/svg/include/SkSVGTypes.h"
13
13
 
14
- class SkSVGLinearGradient final : public SkSVGGradient {
14
+ class SK_API SkSVGLinearGradient final : public SkSVGGradient {
15
15
  public:
16
16
  static sk_sp<SkSVGLinearGradient> Make() {
17
17
  return sk_sp<SkSVGLinearGradient>(new SkSVGLinearGradient());
@@ -11,7 +11,7 @@
11
11
  #include "modules/svg/include/SkSVGHiddenContainer.h"
12
12
  #include "modules/svg/include/SkSVGTypes.h"
13
13
 
14
- class SkSVGMask final : public SkSVGHiddenContainer {
14
+ class SK_API SkSVGMask final : public SkSVGHiddenContainer {
15
15
  public:
16
16
  static sk_sp<SkSVGMask> Make() {
17
17
  return sk_sp<SkSVGMask>(new SkSVGMask());
@@ -92,7 +92,7 @@ public: \
92
92
  } \
93
93
  }
94
94
 
95
- class SkSVGNode : public SkRefCnt {
95
+ class SK_API SkSVGNode : public SkRefCnt {
96
96
  public:
97
97
  ~SkSVGNode() override;
98
98
 
@@ -11,7 +11,7 @@
11
11
  #include "include/core/SkPath.h"
12
12
  #include "modules/svg/include/SkSVGShape.h"
13
13
 
14
- class SkSVGPath final : public SkSVGShape {
14
+ class SK_API SkSVGPath final : public SkSVGShape {
15
15
  public:
16
16
  static sk_sp<SkSVGPath> Make() { return sk_sp<SkSVGPath>(new SkSVGPath()); }
17
17
 
@@ -13,7 +13,7 @@
13
13
 
14
14
  class SkSVGRenderContext;
15
15
 
16
- class SkSVGPattern final : public SkSVGHiddenContainer {
16
+ class SK_API SkSVGPattern final : public SkSVGHiddenContainer {
17
17
  public:
18
18
  static sk_sp<SkSVGPattern> Make() {
19
19
  return sk_sp<SkSVGPattern>(new SkSVGPattern());
@@ -12,7 +12,7 @@
12
12
  #include "modules/svg/include/SkSVGShape.h"
13
13
 
14
14
  // Handles <polygon> and <polyline> elements.
15
- class SkSVGPoly final : public SkSVGShape {
15
+ class SK_API SkSVGPoly final : public SkSVGShape {
16
16
  public:
17
17
  static sk_sp<SkSVGPoly> MakePolygon() {
18
18
  return sk_sp<SkSVGPoly>(new SkSVGPoly(SkSVGTag::kPolygon));
@@ -11,7 +11,7 @@
11
11
  #include "modules/svg/include/SkSVGGradient.h"
12
12
  #include "modules/svg/include/SkSVGTypes.h"
13
13
 
14
- class SkSVGRadialGradient final : public SkSVGGradient {
14
+ class SK_API SkSVGRadialGradient final : public SkSVGGradient {
15
15
  public:
16
16
  static sk_sp<SkSVGRadialGradient> Make() {
17
17
  return sk_sp<SkSVGRadialGradient>(new SkSVGRadialGradient());
@@ -13,7 +13,7 @@
13
13
 
14
14
  class SkRRect;
15
15
 
16
- class SkSVGRect final : public SkSVGShape {
16
+ class SK_API SkSVGRect final : public SkSVGShape {
17
17
  public:
18
18
  static sk_sp<SkSVGRect> Make() { return sk_sp<SkSVGRect>(new SkSVGRect()); }
19
19
 
@@ -24,7 +24,7 @@
24
24
  class SkCanvas;
25
25
  class SkSVGLength;
26
26
 
27
- class SkSVGLengthContext {
27
+ class SK_API SkSVGLengthContext {
28
28
  public:
29
29
  SkSVGLengthContext(const SkSize& viewport, SkScalar dpi = 90)
30
30
  : fViewport(viewport), fDPI(dpi) {}
@@ -47,7 +47,7 @@ private:
47
47
  SkScalar fDPI;
48
48
  };
49
49
 
50
- struct SkSVGPresentationContext {
50
+ struct SK_API SkSVGPresentationContext {
51
51
  SkSVGPresentationContext();
52
52
  SkSVGPresentationContext(const SkSVGPresentationContext&) = default;
53
53
  SkSVGPresentationContext& operator=(const SkSVGPresentationContext&) = default;
@@ -58,7 +58,7 @@ struct SkSVGPresentationContext {
58
58
  SkSVGPresentationAttributes fInherited;
59
59
  };
60
60
 
61
- class SkSVGRenderContext {
61
+ class SK_API SkSVGRenderContext {
62
62
  public:
63
63
  // Captures data required for object bounding box resolution.
64
64
  struct OBBScope {
@@ -14,7 +14,7 @@
14
14
 
15
15
  class SkSVGLengthContext;
16
16
 
17
- class SkSVGSVG : public SkSVGContainer {
17
+ class SK_API SkSVGSVG : public SkSVGContainer {
18
18
  public:
19
19
  enum class Type {
20
20
  kRoot,
@@ -14,7 +14,7 @@
14
14
  class SkSVGLengthContext;
15
15
  class SkPaint;
16
16
 
17
- class SkSVGShape : public SkSVGTransformableNode {
17
+ class SK_API SkSVGShape : public SkSVGTransformableNode {
18
18
  public:
19
19
  void appendChild(sk_sp<SkSVGNode>) override;
20
20
 
@@ -13,7 +13,7 @@
13
13
 
14
14
  class SkSVGLengthContext;
15
15
 
16
- class SkSVGStop : public SkSVGHiddenContainer {
16
+ class SK_API SkSVGStop : public SkSVGHiddenContainer {
17
17
  public:
18
18
  static sk_sp<SkSVGStop> Make() {
19
19
  return sk_sp<SkSVGStop>(new SkSVGStop());
@@ -13,7 +13,7 @@
13
13
  #include "modules/svg/include/SkSVGTransformableNode.h"
14
14
  #include "modules/svg/include/SkSVGTypes.h"
15
15
 
16
- class SkSVGTextContext;
16
+ class SK_API SkSVGTextContext;
17
17
 
18
18
  // Base class for text-rendering nodes.
19
19
  class SkSVGTextFragment : public SkSVGTransformableNode {
@@ -11,7 +11,7 @@
11
11
  #include "include/core/SkMatrix.h"
12
12
  #include "modules/svg/include/SkSVGNode.h"
13
13
 
14
- class SkSVGTransformableNode : public SkSVGNode {
14
+ class SK_API SkSVGTransformableNode : public SkSVGNode {
15
15
  public:
16
16
  void setTransform(const SkSVGTransformType& t) { fTransform = t; }
17
17
 
@@ -113,7 +113,7 @@ private:
113
113
  std::optional<T> fValue;
114
114
  };
115
115
 
116
- class SkSVGLength {
116
+ class SK_API SkSVGLength {
117
117
  public:
118
118
  enum class Unit {
119
119
  kUnknown,
@@ -149,7 +149,7 @@ private:
149
149
  };
150
150
 
151
151
  // https://www.w3.org/TR/SVG11/linking.html#IRIReference
152
- class SkSVGIRI {
152
+ class SK_API SkSVGIRI {
153
153
  public:
154
154
  enum class Type {
155
155
  kLocal,
@@ -174,7 +174,7 @@ private:
174
174
  };
175
175
 
176
176
  // https://www.w3.org/TR/SVG11/types.html#InterfaceSVGColor
177
- class SkSVGColor {
177
+ class SK_API SkSVGColor {
178
178
  public:
179
179
  enum class Type {
180
180
  kCurrentColor,
@@ -221,7 +221,7 @@ private:
221
221
  sk_sp<RefCntVars> fVars;
222
222
  };
223
223
 
224
- class SkSVGPaint {
224
+ class SK_API SkSVGPaint {
225
225
  public:
226
226
  enum class Type {
227
227
  kNone,
@@ -261,7 +261,7 @@ private:
261
261
  };
262
262
 
263
263
  // <funciri> | none (used for clip/mask/filter properties)
264
- class SkSVGFuncIRI {
264
+ class SK_API SkSVGFuncIRI {
265
265
  public:
266
266
  enum class Type {
267
267
  kNone,
@@ -291,7 +291,7 @@ enum class SkSVGLineCap {
291
291
  kSquare,
292
292
  };
293
293
 
294
- class SkSVGLineJoin {
294
+ class SK_API SkSVGLineJoin {
295
295
  public:
296
296
  enum class Type {
297
297
  kMiter,
@@ -315,7 +315,7 @@ private:
315
315
  Type fType;
316
316
  };
317
317
 
318
- class SkSVGSpreadMethod {
318
+ class SK_API SkSVGSpreadMethod {
319
319
  public:
320
320
  // These values must match Skia's SkShader::TileMode enum.
321
321
  enum class Type {
@@ -339,7 +339,7 @@ private:
339
339
  Type fType;
340
340
  };
341
341
 
342
- class SkSVGFillRule {
342
+ class SK_API SkSVGFillRule {
343
343
  public:
344
344
  enum class Type {
345
345
  kNonZero,
@@ -367,7 +367,7 @@ private:
367
367
  Type fType;
368
368
  };
369
369
 
370
- class SkSVGVisibility {
370
+ class SK_API SkSVGVisibility {
371
371
  public:
372
372
  enum class Type {
373
373
  kVisible,
@@ -391,7 +391,7 @@ private:
391
391
  Type fType;
392
392
  };
393
393
 
394
- class SkSVGDashArray {
394
+ class SK_API SkSVGDashArray {
395
395
  public:
396
396
  enum class Type {
397
397
  kNone,
@@ -422,7 +422,7 @@ private:
422
422
  std::vector<SkSVGLength> fDashArray;
423
423
  };
424
424
 
425
- class SkSVGStopColor {
425
+ class SK_API SkSVGStopColor {
426
426
  public:
427
427
  enum class Type {
428
428
  kColor,
@@ -451,7 +451,7 @@ private:
451
451
  SkSVGColorType fColor;
452
452
  };
453
453
 
454
- class SkSVGObjectBoundingBoxUnits {
454
+ class SK_API SkSVGObjectBoundingBoxUnits {
455
455
  public:
456
456
  enum class Type {
457
457
  kUserSpaceOnUse,
@@ -474,7 +474,7 @@ private:
474
474
  Type fType;
475
475
  };
476
476
 
477
- class SkSVGFontFamily {
477
+ class SK_API SkSVGFontFamily {
478
478
  public:
479
479
  enum class Type {
480
480
  kFamily,
@@ -500,7 +500,7 @@ private:
500
500
  SkString fFamily;
501
501
  };
502
502
 
503
- class SkSVGFontStyle {
503
+ class SK_API SkSVGFontStyle {
504
504
  public:
505
505
  enum class Type {
506
506
  kNormal,
@@ -523,7 +523,7 @@ private:
523
523
  Type fType;
524
524
  };
525
525
 
526
- class SkSVGFontSize {
526
+ class SK_API SkSVGFontSize {
527
527
  public:
528
528
  enum class Type {
529
529
  kLength,
@@ -549,7 +549,7 @@ private:
549
549
  SkSVGLength fSize;
550
550
  };
551
551
 
552
- class SkSVGFontWeight {
552
+ class SK_API SkSVGFontWeight {
553
553
  public:
554
554
  enum class Type {
555
555
  k100,
@@ -582,7 +582,7 @@ private:
582
582
  Type fType;
583
583
  };
584
584
 
585
- struct SkSVGPreserveAspectRatio {
585
+ struct SK_API SkSVGPreserveAspectRatio {
586
586
  enum Align : uint8_t {
587
587
  // These values are chosen such that bits [0,1] encode X alignment, and
588
588
  // bits [2,3] encode Y alignment.
@@ -608,7 +608,7 @@ struct SkSVGPreserveAspectRatio {
608
608
  Scale fScale = kMeet;
609
609
  };
610
610
 
611
- class SkSVGTextAnchor {
611
+ class SK_API SkSVGTextAnchor {
612
612
  public:
613
613
  enum class Type {
614
614
  kStart,
@@ -632,7 +632,7 @@ private:
632
632
  };
633
633
 
634
634
  // https://www.w3.org/TR/SVG11/filters.html#FilterPrimitiveInAttribute
635
- class SkSVGFeInputType {
635
+ class SK_API SkSVGFeInputType {
636
636
  public:
637
637
  enum class Type {
638
638
  kSourceGraphic,
@@ -685,7 +685,7 @@ enum class SkSVGFeCompositeOperator {
685
685
  kArithmetic,
686
686
  };
687
687
 
688
- class SkSVGFeTurbulenceBaseFrequency {
688
+ class SK_API SkSVGFeTurbulenceBaseFrequency {
689
689
  public:
690
690
  SkSVGFeTurbulenceBaseFrequency() : fFreqX(0), fFreqY(0) {}
691
691
  SkSVGFeTurbulenceBaseFrequency(SkSVGNumberType freqX, SkSVGNumberType freqY)
@@ -699,7 +699,7 @@ private:
699
699
  SkSVGNumberType fFreqY;
700
700
  };
701
701
 
702
- struct SkSVGFeTurbulenceType {
702
+ struct SK_API SkSVGFeTurbulenceType {
703
703
  enum Type {
704
704
  kFractalNoise,
705
705
  kTurbulence,
@@ -15,7 +15,7 @@
15
15
  * Implements support for <use> (reference) elements.
16
16
  * (https://www.w3.org/TR/SVG11/struct.html#UseElement)
17
17
  */
18
- class SkSVGUse final : public SkSVGTransformableNode {
18
+ class SK_API SkSVGUse final : public SkSVGTransformableNode {
19
19
  public:
20
20
  static sk_sp<SkSVGUse> Make() { return sk_sp<SkSVGUse>(new SkSVGUse()); }
21
21
 
@@ -15,7 +15,7 @@
15
15
  #include "include/private/base/SkNoncopyable.h"
16
16
  #include "modules/svg/include/SkSVGTypes.h"
17
17
 
18
- class SkSVGValue : public SkNoncopyable {
18
+ class SK_API SkSVGValue : public SkNoncopyable {
19
19
  public:
20
20
  enum class Type {
21
21
  kColor,
@@ -47,7 +47,7 @@ private:
47
47
  };
48
48
 
49
49
  template <typename T, SkSVGValue::Type ValueType>
50
- class SkSVGWrapperValue final : public SkSVGValue {
50
+ class SK_API SkSVGWrapperValue final : public SkSVGValue {
51
51
  public:
52
52
  static constexpr Type TYPE = ValueType;
53
53
 
@@ -10,27 +10,23 @@
10
10
 
11
11
  #include "include/core/SkString.h"
12
12
  #include "include/core/SkTypes.h"
13
- #include "include/private/SkOpts_spi.h"
14
- #include "include/private/base/SkTLogic.h"
13
+ #include "include/private/base/SkAPI.h"
15
14
 
16
15
  #include <string>
17
16
  #include <string_view>
18
17
  #include <type_traits>
19
18
 
20
- class SkChecksum {
21
- public:
22
- SkChecksum() = default;
23
- // Make noncopyable
24
- SkChecksum(const SkChecksum&) = delete;
25
- SkChecksum& operator=(const SkChecksum&) = delete;
26
-
19
+ /**
20
+ * Our hash functions are exposed as SK_SPI (e.g. SkParagraph)
21
+ */
22
+ namespace SkChecksum {
27
23
  /**
28
24
  * uint32_t -> uint32_t hash, useful for when you're about to truncate this hash but you
29
25
  * suspect its low bits aren't well mixed.
30
26
  *
31
27
  * This is the Murmur3 finalizer.
32
28
  */
33
- static uint32_t Mix(uint32_t hash) {
29
+ static inline uint32_t Mix(uint32_t hash) {
34
30
  hash ^= hash >> 16;
35
31
  hash *= 0x85ebca6b;
36
32
  hash ^= hash >> 13;
@@ -45,13 +41,32 @@ public:
45
41
  *
46
42
  * This version is 2-lines cheaper than Mix, but seems to be sufficient for the font cache.
47
43
  */
48
- static uint32_t CheapMix(uint32_t hash) {
44
+ static inline uint32_t CheapMix(uint32_t hash) {
49
45
  hash ^= hash >> 16;
50
46
  hash *= 0x85ebca6b;
51
47
  hash ^= hash >> 16;
52
48
  return hash;
53
49
  }
54
- };
50
+
51
+ /**
52
+ * This is a fast, high-quality 32-bit hash. We make no guarantees about this remaining stable
53
+ * over time, or being consistent across devices.
54
+ *
55
+ * For now, this is a 64-bit wyhash, truncated to 32-bits.
56
+ * See: https://github.com/wangyi-fudan/wyhash
57
+ */
58
+ uint32_t SK_SPI Hash32(const void* data, size_t bytes, uint32_t seed = 0);
59
+
60
+ /**
61
+ * This is a fast, high-quality 64-bit hash. We make no guarantees about this remaining stable
62
+ * over time, or being consistent across devices.
63
+ *
64
+ * For now, this is a 64-bit wyhash.
65
+ * See: https://github.com/wangyi-fudan/wyhash
66
+ */
67
+ uint64_t SK_SPI Hash64(const void* data, size_t bytes, uint64_t seed = 0);
68
+
69
+ } // namespace SkChecksum
55
70
 
56
71
  // SkGoodHash should usually be your first choice in hashing data.
57
72
  // It should be both reasonably fast and high quality.
@@ -65,19 +80,19 @@ struct SkGoodHash {
65
80
  template <typename K>
66
81
  std::enable_if_t<std::has_unique_object_representations<K>::value && sizeof(K) != 4, uint32_t>
67
82
  operator()(const K& k) const {
68
- return SkOpts::hash_fn(&k, sizeof(K), 0);
83
+ return SkChecksum::Hash32(&k, sizeof(K));
69
84
  }
70
85
 
71
86
  uint32_t operator()(const SkString& k) const {
72
- return SkOpts::hash_fn(k.c_str(), k.size(), 0);
87
+ return SkChecksum::Hash32(k.c_str(), k.size());
73
88
  }
74
89
 
75
90
  uint32_t operator()(const std::string& k) const {
76
- return SkOpts::hash_fn(k.c_str(), k.size(), 0);
91
+ return SkChecksum::Hash32(k.c_str(), k.size());
77
92
  }
78
93
 
79
94
  uint32_t operator()(std::string_view k) const {
80
- return SkOpts::hash_fn(k.data(), k.size(), 0);
95
+ return SkChecksum::Hash32(k.data(), k.size());
81
96
  }
82
97
  };
83
98
 
@@ -95,7 +110,7 @@ struct SkGoodHash {
95
110
  template <typename K>
96
111
  struct SkForceDirectHash {
97
112
  uint32_t operator()(const K& k) const {
98
- return SkOpts::hash_fn(&k, sizeof(K), 0);
113
+ return SkChecksum::Hash32(&k, sizeof(K));
99
114
  }
100
115
  };
101
116
 
@@ -9,8 +9,8 @@
9
9
  #define SkTHash_DEFINED
10
10
 
11
11
  #include "include/core/SkTypes.h"
12
- #include "include/private/SkChecksum.h"
13
12
  #include "include/private/base/SkTemplates.h"
13
+ #include "src/core/SkChecksum.h"
14
14
 
15
15
  #include <initializer_list>
16
16
  #include <new>