@shopify/react-native-skia 0.1.213 → 0.1.215

Sign up to get free protection for your applications and to get access to all the features.
Files changed (327) hide show
  1. package/android/cpp/rnskia-android/SkiaOpenGLHelper.h +3 -2
  2. package/android/cpp/rnskia-android/SkiaOpenGLSurfaceFactory.cpp +9 -2
  3. package/cpp/api/JsiSkMatrix.h +31 -0
  4. package/cpp/api/JsiSkPath.h +15 -7
  5. package/cpp/api/JsiSkSurface.h +4 -1
  6. package/cpp/skia/include/android/GrAHardwareBufferUtils.h +99 -0
  7. package/cpp/skia/include/android/SkHeifDecoder.h +10 -3
  8. package/cpp/skia/include/codec/SkAvifDecoder.h +1 -0
  9. package/cpp/skia/include/codec/SkBmpDecoder.h +1 -0
  10. package/cpp/skia/include/codec/SkCodec.h +4 -3
  11. package/cpp/skia/include/codec/SkEncodedImageFormat.h +0 -3
  12. package/cpp/skia/include/codec/SkGifDecoder.h +1 -0
  13. package/cpp/skia/include/codec/SkIcoDecoder.h +1 -0
  14. package/cpp/skia/include/codec/SkJpegDecoder.h +1 -0
  15. package/cpp/skia/include/codec/SkJpegxlDecoder.h +1 -0
  16. package/cpp/skia/include/codec/SkPngDecoder.h +1 -0
  17. package/cpp/skia/include/codec/SkRawDecoder.h +1 -0
  18. package/cpp/skia/include/codec/SkWbmpDecoder.h +1 -0
  19. package/cpp/skia/include/codec/SkWebpDecoder.h +1 -0
  20. package/cpp/skia/include/config/SkUserConfig.h +0 -2
  21. package/cpp/skia/include/core/SkBitmap.h +8 -8
  22. package/cpp/skia/include/core/SkCanvas.h +37 -50
  23. package/cpp/skia/include/core/SkCapabilities.h +2 -7
  24. package/cpp/skia/include/core/SkColor.h +1 -1
  25. package/cpp/skia/include/core/SkColorFilter.h +6 -0
  26. package/cpp/skia/include/core/SkColorTable.h +3 -0
  27. package/cpp/skia/include/core/SkColorType.h +2 -0
  28. package/cpp/skia/include/core/SkContourMeasure.h +12 -8
  29. package/cpp/skia/include/core/SkDocument.h +1 -0
  30. package/cpp/skia/include/core/SkFont.h +11 -2
  31. package/cpp/skia/include/core/SkFontMgr.h +2 -3
  32. package/cpp/skia/include/core/SkGraphics.h +3 -13
  33. package/cpp/skia/include/core/SkImage.h +57 -111
  34. package/cpp/skia/include/core/SkImageFilter.h +6 -1
  35. package/cpp/skia/include/core/SkImageGenerator.h +8 -0
  36. package/cpp/skia/include/core/SkImageInfo.h +0 -2
  37. package/cpp/skia/include/core/SkM44.h +7 -3
  38. package/cpp/skia/include/core/SkMallocPixelRef.h +4 -1
  39. package/cpp/skia/include/core/SkMatrix.h +17 -17
  40. package/cpp/skia/include/core/SkMesh.h +71 -61
  41. package/cpp/skia/include/core/SkMilestone.h +1 -1
  42. package/cpp/skia/include/core/SkOverdrawCanvas.h +25 -0
  43. package/cpp/skia/include/core/SkPaint.h +1 -1
  44. package/cpp/skia/include/core/SkPath.h +12 -4
  45. package/cpp/skia/include/core/SkPathMeasure.h +3 -4
  46. package/cpp/skia/include/core/SkPicture.h +19 -6
  47. package/cpp/skia/include/core/SkPictureRecorder.h +6 -6
  48. package/cpp/skia/include/core/SkPixmap.h +2 -3
  49. package/cpp/skia/include/core/SkRRect.h +1 -1
  50. package/cpp/skia/include/core/SkRect.h +107 -110
  51. package/cpp/skia/include/core/SkRefCnt.h +1 -1
  52. package/cpp/skia/include/core/SkRegion.h +7 -1
  53. package/cpp/skia/include/core/SkSerialProcs.h +14 -0
  54. package/cpp/skia/include/core/SkShader.h +9 -0
  55. package/cpp/skia/include/core/SkStream.h +9 -9
  56. package/cpp/skia/include/core/SkString.h +1 -1
  57. package/cpp/skia/include/core/SkSurface.h +14 -25
  58. package/cpp/skia/include/core/SkTextBlob.h +17 -4
  59. package/cpp/skia/include/core/SkTiledImageUtils.h +28 -0
  60. package/cpp/skia/include/core/SkTypeface.h +7 -2
  61. package/cpp/skia/include/core/SkTypes.h +4 -12
  62. package/cpp/skia/include/docs/SkPDFDocument.h +17 -3
  63. package/cpp/skia/include/effects/SkImageFilters.h +73 -24
  64. package/cpp/skia/include/effects/SkRuntimeEffect.h +20 -51
  65. package/cpp/skia/include/gpu/GpuTypes.h +13 -0
  66. package/cpp/skia/include/gpu/GrBackendSurface.h +95 -262
  67. package/cpp/skia/include/gpu/GrContextOptions.h +7 -1
  68. package/cpp/skia/include/gpu/GrDirectContext.h +138 -128
  69. package/cpp/skia/include/gpu/GrRecordingContext.h +9 -4
  70. package/cpp/skia/include/gpu/GrSurfaceInfo.h +0 -24
  71. package/cpp/skia/include/gpu/GrTypes.h +16 -1
  72. package/cpp/skia/include/gpu/GrYUVABackendTextures.h +4 -4
  73. package/cpp/skia/include/gpu/d3d/GrD3DTypes.h +2 -2
  74. package/cpp/skia/include/gpu/ganesh/SkImageGanesh.h +44 -12
  75. package/cpp/skia/include/gpu/ganesh/SkMeshGanesh.h +57 -0
  76. package/cpp/skia/include/gpu/ganesh/SkSurfaceGanesh.h +2 -1
  77. package/cpp/skia/include/gpu/ganesh/gl/GrGLBackendSurface.h +58 -0
  78. package/cpp/skia/include/gpu/ganesh/gl/GrGLDirectContext.h +29 -0
  79. package/cpp/skia/include/gpu/ganesh/mtl/SkSurfaceMetal.h +1 -1
  80. package/cpp/skia/include/gpu/ganesh/vk/GrVkBackendSurface.h +67 -0
  81. package/cpp/skia/include/gpu/gl/GrGLInterface.h +2 -2
  82. package/cpp/skia/include/gpu/graphite/BackendTexture.h +14 -3
  83. package/cpp/skia/include/gpu/graphite/Context.h +93 -13
  84. package/cpp/skia/include/gpu/graphite/ContextOptions.h +19 -8
  85. package/cpp/skia/include/gpu/graphite/GraphiteTypes.h +23 -0
  86. package/cpp/skia/include/gpu/graphite/Image.h +56 -0
  87. package/cpp/skia/include/gpu/graphite/ImageProvider.h +5 -0
  88. package/cpp/skia/include/gpu/graphite/Recorder.h +26 -9
  89. package/cpp/skia/include/gpu/graphite/Recording.h +7 -5
  90. package/cpp/skia/include/gpu/graphite/TextureInfo.h +8 -0
  91. package/cpp/skia/include/gpu/graphite/mtl/MtlGraphiteTypes.h +2 -2
  92. package/cpp/skia/include/gpu/mtl/GrMtlTypes.h +2 -2
  93. package/cpp/skia/include/gpu/vk/GrVkTypes.h +4 -3
  94. package/cpp/skia/include/ports/SkCFObject.h +1 -1
  95. package/cpp/skia/include/private/SkGainmapInfo.h +4 -13
  96. package/cpp/skia/include/private/SkJpegGainmapEncoder.h +1 -24
  97. package/cpp/skia/include/private/SkWeakRefCnt.h +1 -1
  98. package/cpp/skia/include/private/base/SkAnySubclass.h +73 -0
  99. package/cpp/skia/include/private/base/SkAssert.h +106 -12
  100. package/cpp/skia/include/private/base/SkAttributes.h +0 -12
  101. package/cpp/skia/include/private/base/SkFeatures.h +0 -3
  102. package/cpp/skia/include/private/base/SkFloatingPoint.h +58 -105
  103. package/cpp/skia/include/private/base/SkSpan_impl.h +18 -12
  104. package/cpp/skia/include/private/base/SkTArray.h +22 -17
  105. package/cpp/skia/include/private/base/SkTDArray.h +5 -6
  106. package/cpp/skia/include/private/base/SkTemplates.h +50 -30
  107. package/cpp/skia/include/private/chromium/GrDeferredDisplayListRecorder.h +5 -2
  108. package/cpp/skia/include/private/chromium/GrSurfaceCharacterization.h +2 -2
  109. package/cpp/skia/include/private/chromium/SkChromeRemoteGlyphCache.h +13 -8
  110. package/cpp/skia/include/private/chromium/SkDiscardableMemory.h +1 -1
  111. package/cpp/skia/include/private/chromium/SkImageChromium.h +16 -3
  112. package/cpp/skia/include/private/chromium/Slug.h +11 -4
  113. package/cpp/skia/include/private/gpu/ganesh/GrD3DTypesMinimal.h +1 -1
  114. package/cpp/skia/include/private/gpu/ganesh/GrGLTypesPriv.h +6 -9
  115. package/cpp/skia/include/private/gpu/ganesh/GrTypesPriv.h +29 -13
  116. package/cpp/skia/include/private/gpu/ganesh/GrVkTypesPriv.h +2 -28
  117. package/cpp/skia/include/private/gpu/graphite/ContextOptionsPriv.h +34 -0
  118. package/cpp/skia/include/private/gpu/graphite/DawnTypesPriv.h +6 -0
  119. package/cpp/skia/include/private/gpu/graphite/MtlGraphiteTypesPriv.h +8 -0
  120. package/cpp/skia/include/private/gpu/graphite/VulkanGraphiteTypesPriv.h +10 -0
  121. package/cpp/skia/include/utils/SkBase64.h +2 -2
  122. package/cpp/skia/include/utils/SkNWayCanvas.h +1 -11
  123. package/cpp/skia/include/utils/SkNoDrawCanvas.h +0 -2
  124. package/cpp/skia/include/utils/SkPaintFilterCanvas.h +1 -2
  125. package/cpp/skia/include/utils/SkShadowUtils.h +15 -1
  126. package/cpp/skia/include/utils/SkTextUtils.h +1 -1
  127. package/cpp/skia/modules/skparagraph/include/Paragraph.h +107 -1
  128. package/cpp/skia/modules/skparagraph/include/ParagraphBuilder.h +3 -2
  129. package/cpp/skia/modules/skparagraph/include/ParagraphStyle.h +4 -0
  130. package/cpp/skia/modules/skparagraph/include/TypefaceFontProvider.h +5 -3
  131. package/cpp/skia/modules/svg/include/SkSVGAttributeParser.h +4 -0
  132. package/cpp/skia/src/core/SkChecksum.h +2 -1
  133. package/cpp/skia/src/core/SkPathPriv.h +1 -1
  134. package/cpp/skia/src/core/SkTHash.h +19 -9
  135. package/ios/RNSkia-iOS/RNSkMetalCanvasProvider.mm +3 -1
  136. package/ios/RNSkia-iOS/SkiaMetalSurfaceFactory.mm +1 -1
  137. package/lib/commonjs/animation/functions/interpolatePaths.d.ts +1 -1
  138. package/lib/commonjs/animation/functions/interpolatePaths.js +4 -4
  139. package/lib/commonjs/animation/functions/interpolatePaths.js.map +1 -1
  140. package/lib/commonjs/dom/nodes/datatypes/Rect.js +5 -1
  141. package/lib/commonjs/dom/nodes/datatypes/Rect.js.map +1 -1
  142. package/lib/commonjs/external/reanimated/index.d.ts +3 -1
  143. package/lib/commonjs/external/reanimated/index.js +30 -4
  144. package/lib/commonjs/external/reanimated/index.js.map +1 -1
  145. package/lib/commonjs/external/reanimated/interpolators.d.ts +9 -0
  146. package/lib/commonjs/external/reanimated/interpolators.js +56 -0
  147. package/lib/commonjs/external/reanimated/interpolators.js.map +1 -0
  148. package/lib/commonjs/external/reanimated/moduleWrapper.d.ts +8 -6
  149. package/lib/commonjs/external/reanimated/moduleWrapper.js +8 -18
  150. package/lib/commonjs/external/reanimated/moduleWrapper.js.map +1 -1
  151. package/lib/commonjs/external/reanimated/renderHelpers.js +46 -1
  152. package/lib/commonjs/external/reanimated/renderHelpers.js.map +1 -1
  153. package/lib/commonjs/external/reanimated/useAnimatedImageValue.d.ts +2 -0
  154. package/lib/commonjs/external/reanimated/useAnimatedImageValue.js +53 -0
  155. package/lib/commonjs/external/reanimated/useAnimatedImageValue.js.map +1 -0
  156. package/lib/commonjs/external/reanimated/useDerivedValueOnJS.d.ts +1 -0
  157. package/lib/commonjs/external/reanimated/useDerivedValueOnJS.js +27 -0
  158. package/lib/commonjs/external/reanimated/useDerivedValueOnJS.js.map +1 -0
  159. package/lib/commonjs/mock/index.js +8 -0
  160. package/lib/commonjs/mock/index.js.map +1 -1
  161. package/lib/commonjs/renderer/HostConfig.js +5 -5
  162. package/lib/commonjs/renderer/HostConfig.js.map +1 -1
  163. package/lib/commonjs/skia/core/AnimatedImage.d.ts +0 -1
  164. package/lib/commonjs/skia/core/AnimatedImage.js +1 -45
  165. package/lib/commonjs/skia/core/AnimatedImage.js.map +1 -1
  166. package/lib/commonjs/skia/types/MaskFilter.js +4 -0
  167. package/lib/commonjs/skia/types/MaskFilter.js.map +1 -1
  168. package/lib/commonjs/skia/types/Matrix.d.ts +4 -0
  169. package/lib/commonjs/skia/types/Matrix.js.map +1 -1
  170. package/lib/commonjs/skia/types/Path/Path.d.ts +10 -9
  171. package/lib/commonjs/skia/types/Path/Path.js.map +1 -1
  172. package/lib/commonjs/skia/web/JsiSkMatrix.d.ts +6 -0
  173. package/lib/commonjs/skia/web/JsiSkMatrix.js +33 -5
  174. package/lib/commonjs/skia/web/JsiSkMatrix.js.map +1 -1
  175. package/lib/commonjs/skia/web/JsiSkPath.d.ts +9 -9
  176. package/lib/commonjs/skia/web/JsiSkPath.js +15 -2
  177. package/lib/commonjs/skia/web/JsiSkPath.js.map +1 -1
  178. package/lib/commonjs/skia/web/JsiSkPicture.js +2 -1
  179. package/lib/commonjs/skia/web/JsiSkPicture.js.map +1 -1
  180. package/lib/commonjs/views/SkiaBaseWebView.js +1 -1
  181. package/lib/commonjs/views/SkiaBaseWebView.js.map +1 -1
  182. package/lib/commonjs/views/types.js +3 -0
  183. package/lib/commonjs/views/types.js.map +1 -1
  184. package/lib/module/animation/functions/interpolatePaths.d.ts +1 -1
  185. package/lib/module/animation/functions/interpolatePaths.js +4 -4
  186. package/lib/module/animation/functions/interpolatePaths.js.map +1 -1
  187. package/lib/module/dom/nodes/datatypes/Rect.js +5 -1
  188. package/lib/module/dom/nodes/datatypes/Rect.js.map +1 -1
  189. package/lib/module/external/reanimated/index.d.ts +3 -1
  190. package/lib/module/external/reanimated/index.js +3 -1
  191. package/lib/module/external/reanimated/index.js.map +1 -1
  192. package/lib/module/external/reanimated/interpolators.d.ts +9 -0
  193. package/lib/module/external/reanimated/interpolators.js +34 -0
  194. package/lib/module/external/reanimated/interpolators.js.map +1 -0
  195. package/lib/module/external/reanimated/moduleWrapper.d.ts +8 -6
  196. package/lib/module/external/reanimated/moduleWrapper.js +5 -16
  197. package/lib/module/external/reanimated/moduleWrapper.js.map +1 -1
  198. package/lib/module/external/reanimated/renderHelpers.js +48 -2
  199. package/lib/module/external/reanimated/renderHelpers.js.map +1 -1
  200. package/lib/module/external/reanimated/useAnimatedImageValue.d.ts +2 -0
  201. package/lib/module/external/reanimated/useAnimatedImageValue.js +41 -0
  202. package/lib/module/external/reanimated/useAnimatedImageValue.js.map +1 -0
  203. package/lib/module/external/reanimated/useDerivedValueOnJS.d.ts +1 -0
  204. package/lib/module/external/reanimated/useDerivedValueOnJS.js +16 -0
  205. package/lib/module/external/reanimated/useDerivedValueOnJS.js.map +1 -0
  206. package/lib/module/mock/index.js +8 -0
  207. package/lib/module/mock/index.js.map +1 -1
  208. package/lib/module/renderer/HostConfig.js +1 -1
  209. package/lib/module/renderer/HostConfig.js.map +1 -1
  210. package/lib/module/skia/core/AnimatedImage.d.ts +0 -1
  211. package/lib/module/skia/core/AnimatedImage.js +0 -40
  212. package/lib/module/skia/core/AnimatedImage.js.map +1 -1
  213. package/lib/module/skia/types/MaskFilter.js +3 -0
  214. package/lib/module/skia/types/MaskFilter.js.map +1 -1
  215. package/lib/module/skia/types/Matrix.d.ts +4 -0
  216. package/lib/module/skia/types/Matrix.js.map +1 -1
  217. package/lib/module/skia/types/Path/Path.d.ts +10 -9
  218. package/lib/module/skia/types/Path/Path.js.map +1 -1
  219. package/lib/module/skia/web/JsiSkMatrix.d.ts +6 -0
  220. package/lib/module/skia/web/JsiSkMatrix.js +33 -5
  221. package/lib/module/skia/web/JsiSkMatrix.js.map +1 -1
  222. package/lib/module/skia/web/JsiSkPath.d.ts +9 -9
  223. package/lib/module/skia/web/JsiSkPath.js +15 -2
  224. package/lib/module/skia/web/JsiSkPath.js.map +1 -1
  225. package/lib/module/views/types.js +3 -0
  226. package/lib/module/views/types.js.map +1 -1
  227. package/lib/typescript/jestEnv.d.mts +5 -0
  228. package/lib/typescript/jestSetup.d.mts +1 -0
  229. package/lib/typescript/src/animation/functions/interpolatePaths.d.ts +1 -1
  230. package/lib/typescript/src/external/reanimated/index.d.ts +3 -1
  231. package/lib/typescript/src/external/reanimated/interpolators.d.ts +9 -0
  232. package/lib/typescript/src/external/reanimated/moduleWrapper.d.ts +8 -6
  233. package/lib/typescript/src/external/reanimated/useAnimatedImageValue.d.ts +2 -0
  234. package/lib/typescript/src/external/reanimated/useDerivedValueOnJS.d.ts +1 -0
  235. package/lib/typescript/src/skia/core/AnimatedImage.d.ts +0 -1
  236. package/lib/typescript/src/skia/types/Matrix.d.ts +4 -0
  237. package/lib/typescript/src/skia/types/Path/Path.d.ts +10 -9
  238. package/lib/typescript/src/skia/web/JsiSkMatrix.d.ts +6 -0
  239. package/lib/typescript/src/skia/web/JsiSkPath.d.ts +9 -9
  240. package/libs/android/arm64-v8a/libskia.a +0 -0
  241. package/libs/android/arm64-v8a/libskottie.a +0 -0
  242. package/libs/android/arm64-v8a/libskparagraph.a +0 -0
  243. package/libs/android/arm64-v8a/libsksg.a +0 -0
  244. package/libs/android/arm64-v8a/libskshaper.a +0 -0
  245. package/libs/android/arm64-v8a/libskunicode.a +0 -0
  246. package/libs/android/arm64-v8a/libsvg.a +0 -0
  247. package/libs/android/armeabi-v7a/libskia.a +0 -0
  248. package/libs/android/armeabi-v7a/libskottie.a +0 -0
  249. package/libs/android/armeabi-v7a/libskparagraph.a +0 -0
  250. package/libs/android/armeabi-v7a/libsksg.a +0 -0
  251. package/libs/android/armeabi-v7a/libskshaper.a +0 -0
  252. package/libs/android/armeabi-v7a/libskunicode.a +0 -0
  253. package/libs/android/armeabi-v7a/libsvg.a +0 -0
  254. package/libs/android/x86/libskia.a +0 -0
  255. package/libs/android/x86/libskottie.a +0 -0
  256. package/libs/android/x86/libskparagraph.a +0 -0
  257. package/libs/android/x86/libsksg.a +0 -0
  258. package/libs/android/x86/libskshaper.a +0 -0
  259. package/libs/android/x86/libskunicode.a +0 -0
  260. package/libs/android/x86/libsvg.a +0 -0
  261. package/libs/android/x86_64/libskia.a +0 -0
  262. package/libs/android/x86_64/libskottie.a +0 -0
  263. package/libs/android/x86_64/libskparagraph.a +0 -0
  264. package/libs/android/x86_64/libsksg.a +0 -0
  265. package/libs/android/x86_64/libskshaper.a +0 -0
  266. package/libs/android/x86_64/libskunicode.a +0 -0
  267. package/libs/android/x86_64/libsvg.a +0 -0
  268. package/libs/ios/libskia.xcframework/Info.plist +5 -5
  269. package/libs/ios/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
  270. package/libs/ios/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
  271. package/libs/ios/libskottie.xcframework/ios-arm64_arm64e/libskottie.a +0 -0
  272. package/libs/ios/libskottie.xcframework/ios-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
  273. package/libs/ios/libskparagraph.xcframework/Info.plist +5 -5
  274. package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e/libskparagraph.a +0 -0
  275. package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e_x86_64-simulator/libskparagraph.a +0 -0
  276. package/libs/ios/libsksg.xcframework/Info.plist +5 -5
  277. package/libs/ios/libsksg.xcframework/ios-arm64_arm64e/libsksg.a +0 -0
  278. package/libs/ios/libsksg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
  279. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
  280. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
  281. package/libs/ios/libskunicode.xcframework/Info.plist +5 -5
  282. package/libs/ios/libskunicode.xcframework/ios-arm64_arm64e/libskunicode.a +0 -0
  283. package/libs/ios/libskunicode.xcframework/ios-arm64_arm64e_x86_64-simulator/libskunicode.a +0 -0
  284. package/libs/ios/libsvg.xcframework/Info.plist +5 -5
  285. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
  286. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
  287. package/package.json +4 -3
  288. package/react-native-skia.podspec +1 -1
  289. package/src/animation/functions/interpolatePaths.ts +7 -4
  290. package/src/dom/nodes/datatypes/Rect.ts +6 -2
  291. package/src/external/reanimated/index.ts +3 -1
  292. package/src/external/reanimated/interpolators.ts +89 -0
  293. package/src/external/reanimated/moduleWrapper.ts +38 -25
  294. package/src/external/reanimated/renderHelpers.ts +42 -2
  295. package/src/external/reanimated/useAnimatedImageValue.ts +51 -0
  296. package/src/external/reanimated/useDerivedValueOnJS.ts +25 -0
  297. package/src/mock/index.ts +5 -0
  298. package/src/renderer/HostConfig.ts +1 -1
  299. package/src/skia/core/AnimatedImage.ts +0 -47
  300. package/src/skia/types/Matrix.ts +4 -0
  301. package/src/skia/types/Path/Path.ts +10 -9
  302. package/src/skia/web/JsiSkMatrix.ts +33 -27
  303. package/src/skia/web/JsiSkPath.ts +15 -2
  304. package/cpp/skia/include/core/SkDeferredDisplayList.h +0 -15
  305. package/cpp/skia/include/core/SkDeferredDisplayListRecorder.h +0 -15
  306. package/cpp/skia/include/core/SkPromiseImageTexture.h +0 -20
  307. package/cpp/skia/include/core/SkSurfaceCharacterization.h +0 -15
  308. package/cpp/skia/include/core/SkTime.h +0 -63
  309. package/cpp/skia/include/effects/SkOpPathEffect.h +0 -43
  310. package/cpp/skia/include/effects/SkStrokeAndFillPathEffect.h +0 -28
  311. package/cpp/skia/include/gpu/GrBackendSurfaceMutableState.h +0 -32
  312. package/cpp/skia/include/gpu/dawn/GrDawnTypes.h +0 -95
  313. package/cpp/skia/include/private/SkBitmaskEnum.h +0 -59
  314. package/cpp/skia/include/private/SkSLDefines.h +0 -64
  315. package/cpp/skia/include/private/SkShadowFlags.h +0 -27
  316. package/cpp/skia/include/private/gpu/ganesh/GrDawnTypesPriv.h +0 -26
  317. package/globalJestSetup.js +0 -6
  318. package/lib/commonjs/external/reanimated/useSharedValueEffect.d.ts +0 -8
  319. package/lib/commonjs/external/reanimated/useSharedValueEffect.js +0 -52
  320. package/lib/commonjs/external/reanimated/useSharedValueEffect.js.map +0 -1
  321. package/lib/module/external/reanimated/useSharedValueEffect.d.ts +0 -8
  322. package/lib/module/external/reanimated/useSharedValueEffect.js +0 -42
  323. package/lib/module/external/reanimated/useSharedValueEffect.js.map +0 -1
  324. package/lib/typescript/globalJestSetup.d.ts +0 -2
  325. package/lib/typescript/src/external/reanimated/useSharedValueEffect.d.ts +0 -8
  326. package/src/external/reanimated/useSharedValueEffect.ts +0 -58
  327. /package/cpp/skia/{include/private/base → src/core}/SkPathEnums.h +0 -0
@@ -9,12 +9,14 @@ import {
9
9
  stopMapper,
10
10
  isSharedValue,
11
11
  HAS_REANIMATED3,
12
+ HAS_REANIMATED2,
13
+ runOnJS,
12
14
  } from "./moduleWrapper";
13
15
 
14
16
  const _bindings = new WeakMap<Node<unknown>, unknown>();
15
17
 
16
18
  export function extractReanimatedProps(props: AnimatedProps<any>) {
17
- if (!HAS_REANIMATED3) {
19
+ if (!HAS_REANIMATED3 && !HAS_REANIMATED2) {
18
20
  return [props, {}];
19
21
  }
20
22
  const reanimatedProps = {} as AnimatedProps<any>;
@@ -34,18 +36,56 @@ export function extractReanimatedProps(props: AnimatedProps<any>) {
34
36
  return [otherProps, reanimatedProps];
35
37
  }
36
38
 
39
+ function bindReanimatedProps2(
40
+ container: Container,
41
+ node: Node<any>,
42
+ reanimatedProps: AnimatedProps<any>
43
+ ) {
44
+ const sharedValues = Object.values(reanimatedProps);
45
+ const previousMapperId = _bindings.get(node);
46
+ if (previousMapperId !== undefined) {
47
+ stopMapper(previousMapperId as number);
48
+ }
49
+ if (sharedValues.length > 0) {
50
+ const viewId = container.getNativeId();
51
+ const { SkiaViewApi } = global;
52
+ const updateProps = () => {
53
+ for (const propName in reanimatedProps) {
54
+ node && node.setProp(propName, reanimatedProps[propName].value);
55
+ }
56
+ // On React Native we use the SkiaViewApi to redraw because it can
57
+ // run on the worklet thread (container.redraw can't)
58
+ // if SkiaViewApi is undefined, we are on web and container.redraw()
59
+ // can safely be invoked
60
+ if (SkiaViewApi) {
61
+ SkiaViewApi.requestRedraw(viewId);
62
+ } else {
63
+ container.redraw();
64
+ }
65
+ };
66
+ const mapperId = startMapper(() => {
67
+ "worklet";
68
+ runOnJS(updateProps)();
69
+ }, sharedValues);
70
+ _bindings.set(node, mapperId);
71
+ }
72
+ }
73
+
37
74
  export function bindReanimatedProps(
38
75
  container: Container,
39
76
  node: Node<any>,
40
77
  reanimatedProps: AnimatedProps<any>
41
78
  ) {
79
+ if (HAS_REANIMATED2) {
80
+ return bindReanimatedProps2(container, node, reanimatedProps);
81
+ }
42
82
  if (!HAS_REANIMATED3) {
43
83
  return;
44
84
  }
45
85
  const sharedValues = Object.values(reanimatedProps);
46
86
  const previousMapperId = _bindings.get(node);
47
87
  if (previousMapperId !== undefined) {
48
- stopMapper(previousMapperId);
88
+ stopMapper(previousMapperId as number);
49
89
  }
50
90
  if (sharedValues.length > 0) {
51
91
  const viewId = container.getNativeId();
@@ -0,0 +1,51 @@
1
+ import type { FrameInfo } from "react-native-reanimated";
2
+
3
+ import { useAnimatedImage } from "../../skia/core/AnimatedImage";
4
+ import type { DataSourceParam, SkImage } from "../../skia/types";
5
+
6
+ import {
7
+ throwOnMissingReanimated,
8
+ useFrameCallback,
9
+ useSharedValue,
10
+ } from "./moduleWrapper";
11
+
12
+ const DEFAULT_FRAME_DURATION = 60;
13
+
14
+ export const useAnimatedImageValue = (source: DataSourceParam) => {
15
+ throwOnMissingReanimated();
16
+ const currentFrame = useSharedValue<null | SkImage>(null);
17
+ const lastTimestamp = useSharedValue(0);
18
+ const animatedImage = useAnimatedImage(source, (err) => {
19
+ console.error(err);
20
+ throw new Error(`Could not load animated image - got '${err.message}'`);
21
+ });
22
+ const frameDuration =
23
+ animatedImage?.currentFrameDuration() || DEFAULT_FRAME_DURATION;
24
+
25
+ useFrameCallback((frameInfo: FrameInfo) => {
26
+ if (!animatedImage) {
27
+ currentFrame.value = null;
28
+ return;
29
+ }
30
+
31
+ const { timestamp } = frameInfo;
32
+ const elapsed = timestamp - lastTimestamp.value;
33
+
34
+ // Check if it's time to switch frames based on GIF frame duration
35
+ if (elapsed < frameDuration) {
36
+ return;
37
+ }
38
+
39
+ // Update the current frame
40
+ animatedImage.decodeNextFrame();
41
+ if (currentFrame.value) {
42
+ currentFrame.value.dispose();
43
+ }
44
+ currentFrame.value = animatedImage.getCurrentFrame();
45
+
46
+ // Update the last timestamp
47
+ lastTimestamp.value = timestamp;
48
+ // eslint-disable-next-line react-hooks/exhaustive-deps
49
+ }, true);
50
+ return currentFrame;
51
+ };
@@ -0,0 +1,25 @@
1
+ import { useEffect, useMemo } from "react";
2
+
3
+ import {
4
+ useSharedValue,
5
+ runOnJS,
6
+ startMapper,
7
+ stopMapper,
8
+ } from "./moduleWrapper";
9
+
10
+ export const useDerivedValueOnJS = (
11
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
12
+ fn: () => any,
13
+ deps: unknown[]
14
+ ) => {
15
+ const init = useMemo(() => fn(), [fn]);
16
+ const value = useSharedValue(init);
17
+ useEffect(() => {
18
+ const mapperId = startMapper(() => {
19
+ "worklet";
20
+ runOnJS(fn)();
21
+ }, deps);
22
+ return () => stopMapper(mapperId);
23
+ }, [deps, fn]);
24
+ return value;
25
+ };
package/src/mock/index.ts CHANGED
@@ -6,6 +6,7 @@ import { ValueApi } from "../values/web";
6
6
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
7
7
  const Noop: () => any = () => undefined;
8
8
  const NoopValue = () => ({ current: 0 });
9
+ const NoopSharedValue = () => ({ value: 0 });
9
10
 
10
11
  export const Mock = (CanvasKit: CanvasKit) => {
11
12
  global.SkiaApi = JsiSkApi(CanvasKit);
@@ -21,6 +22,7 @@ export const Mock = (CanvasKit: CanvasKit) => {
21
22
  ...require("../dom/nodes"),
22
23
  // We could use the real Canvas if we mock the SkiaView component for node
23
24
  Canvas: Noop,
25
+ // Skia Animations
24
26
  useValue: NoopValue,
25
27
  useComputedValue: NoopValue,
26
28
  useTouchHandler: Noop,
@@ -29,6 +31,9 @@ export const Mock = (CanvasKit: CanvasKit) => {
29
31
  useSpring: NoopValue,
30
32
  useClockValue: NoopValue,
31
33
  useValueEffect: Noop,
34
+ // Reanimated hooks
35
+ useClock: NoopSharedValue,
36
+ usePathInterpolation: NoopSharedValue,
32
37
  useRawData: Noop,
33
38
  useData: Noop,
34
39
  useFont: () => Skia.Font(undefined, 0),
@@ -7,7 +7,7 @@ import type { SkiaValue } from "../values";
7
7
  import {
8
8
  bindReanimatedProps,
9
9
  extractReanimatedProps,
10
- } from "../external/reanimated";
10
+ } from "../external/reanimated/renderHelpers";
11
11
 
12
12
  import type { Container } from "./Container";
13
13
  import { createNode } from "./HostComponents";
@@ -1,8 +1,3 @@
1
- import {
2
- throwOnMissingReanimated,
3
- useFrameCallback,
4
- useSharedValue,
5
- } from "../../external/reanimated/moduleWrapper";
6
1
  import { Skia } from "../Skia";
7
2
  import type { DataSourceParam } from "../types";
8
3
 
@@ -19,45 +14,3 @@ export const useAnimatedImage = (
19
14
  source: DataSourceParam,
20
15
  onError?: (err: Error) => void
21
16
  ) => useRawData(source, animatedImgFactory, onError);
22
-
23
- const DEFAULT_FRAME_DURATION = 60;
24
-
25
- export const useAnimatedImageValue = (source: DataSourceParam) => {
26
- throwOnMissingReanimated();
27
- const currentFrame = useSharedValue(null);
28
- const lastTimestamp = useSharedValue(0);
29
- const animatedImage = useAnimatedImage(source, (err) => {
30
- console.error(err);
31
- throw new Error(`Could not load animated image - got '${err.message}'`);
32
- });
33
- const frameDuration =
34
- animatedImage?.currentFrameDuration() || DEFAULT_FRAME_DURATION;
35
-
36
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
37
- useFrameCallback((frameInfo: any) => {
38
- if (!animatedImage) {
39
- currentFrame.value = null;
40
- return;
41
- }
42
-
43
- const { timestamp } = frameInfo;
44
- const elapsed = timestamp - lastTimestamp.value;
45
-
46
- // Check if it's time to switch frames based on GIF frame duration
47
- if (elapsed < frameDuration) {
48
- return;
49
- }
50
-
51
- // Update the current frame
52
- animatedImage.decodeNextFrame();
53
- if (currentFrame.value) {
54
- currentFrame.value.dispose();
55
- }
56
- currentFrame.value = animatedImage.getCurrentFrame();
57
-
58
- // Update the last timestamp
59
- lastTimestamp.value = timestamp;
60
- // eslint-disable-next-line react-hooks/exhaustive-deps
61
- }, true);
62
- return currentFrame;
63
- };
@@ -21,6 +21,10 @@ export interface SkMatrix extends SkJSIInstance<"Matrix"> {
21
21
  scale: (x: number, y?: number) => SkMatrix;
22
22
  skew: (x: number, y: number) => SkMatrix;
23
23
  rotate: (theta: number) => SkMatrix;
24
+ postTranslate: (x: number, y: number) => SkMatrix;
25
+ postScale: (x: number, y?: number) => SkMatrix;
26
+ postSkew: (x: number, y: number) => SkMatrix;
27
+ postRotate: (theta: number) => SkMatrix;
24
28
  identity: () => SkMatrix;
25
29
  get: () => number[];
26
30
  }
@@ -213,7 +213,7 @@ export interface SkPath extends SkJSIInstance<"Path"> {
213
213
  * Sets FillType, the rule used to fill Path.
214
214
  * @param fill
215
215
  */
216
- setFillType(fill: FillType): void;
216
+ setFillType(fill: FillType): SkPath;
217
217
 
218
218
  /**
219
219
  * Specifies whether Path is volatile; whether it will be altered or discarded
@@ -223,7 +223,7 @@ export interface SkPath extends SkJSIInstance<"Path"> {
223
223
  * Mark unchanging Path non-volatile to improve repeated rendering.
224
224
  * @param volatile
225
225
  */
226
- setIsVolatile(volatile: boolean): void;
226
+ setIsVolatile(volatile: boolean): SkPath;
227
227
 
228
228
  /**
229
229
  * Turns this path into the filled equivalent of the stroked path. Returns false if the operation
@@ -237,14 +237,14 @@ export interface SkPath extends SkJSIInstance<"Path"> {
237
237
  * Appends CLOSE_VERB to Path. A closed contour connects the first and last point
238
238
  * with a line, forming a continuous loop.
239
239
  */
240
- close(): void;
240
+ close(): SkPath;
241
241
 
242
242
  /**
243
243
  * Sets Path to its initial state.
244
244
  * Removes verb array, point array, and weights, and sets FillType to Winding.
245
245
  * Internal storage associated with Path is released
246
246
  */
247
- reset(): void;
247
+ reset(): SkPath;
248
248
 
249
249
  /**
250
250
  * Sets Path to its initial state.
@@ -253,7 +253,7 @@ export interface SkPath extends SkJSIInstance<"Path"> {
253
253
  * Use rewind() instead of reset() if Path storage will be reused and performance
254
254
  * is critical.
255
255
  */
256
- rewind(): void;
256
+ rewind(): SkPath;
257
257
 
258
258
  /**
259
259
  * Returns minimum and maximum axes values of the lines and curves in Path.
@@ -420,7 +420,7 @@ export interface SkPath extends SkJSIInstance<"Path"> {
420
420
  reference to SkPath
421
421
  example: https://fiddle.skia.org/c/@Path_quadTo
422
422
  */
423
- quadTo(x1: number, y1: number, x2: number, y2: number): void;
423
+ quadTo(x1: number, y1: number, x2: number, y2: number): SkPath;
424
424
 
425
425
  /**
426
426
  * Adds Rect to Path, appending kMove_Verb, three kLine_Verb, and kClose_Verb,
@@ -431,7 +431,7 @@ export interface SkPath extends SkJSIInstance<"Path"> {
431
431
  * @param rect
432
432
  * @param isCCW
433
433
  */
434
- addRect(rect: SkRect, isCCW?: boolean): void;
434
+ addRect(rect: SkRect, isCCW?: boolean): SkPath;
435
435
 
436
436
  /**
437
437
  * Adds rrect to Path, creating a new closed contour.
@@ -540,7 +540,7 @@ export interface SkPath extends SkJSIInstance<"Path"> {
540
540
  /**
541
541
  * Transforms the path by the specified matrix.
542
542
  */
543
- transform(m3: SkMatrix): void;
543
+ transform(m3: SkMatrix): SkPath;
544
544
 
545
545
  /**
546
546
  * Interpolates between Path with point array of equal size.
@@ -558,10 +558,11 @@ export interface SkPath extends SkJSIInstance<"Path"> {
558
558
  * @param ending path to interpolate with
559
559
  * @param weight contribution of this path, and
560
560
  * one minus contribution of ending path
561
+ * @param output path to be replaced with the interpolated averages
561
562
  * @return Path replaced by interpolated averages or null if
562
563
  * not interpolatable
563
564
  * */
564
- interpolate(end: SkPath, weight: number): SkPath | null;
565
+ interpolate(end: SkPath, weight: number, output?: SkPath): SkPath | null;
565
566
 
566
567
  /** Returns true if Path contain equal verbs and equal weights.
567
568
  * @param compare path to compare
@@ -12,54 +12,60 @@ export class JsiSkMatrix
12
12
  super(CanvasKit, ref, "Matrix");
13
13
  }
14
14
 
15
+ private preMultiply(matrix: number[]) {
16
+ this.ref.set(this.CanvasKit.Matrix.multiply(this.ref, matrix));
17
+ }
18
+
19
+ private postMultiply(matrix: number[]) {
20
+ this.ref.set(this.CanvasKit.Matrix.multiply(matrix, this.ref));
21
+ }
22
+
15
23
  dispose = () => {
16
24
  // Do nothing - the matrix is represenetd by a Float32Array
17
25
  };
18
26
 
19
27
  concat(matrix: SkMatrix) {
20
- this.ref.set(
21
- this.CanvasKit.Matrix.multiply(this.ref, JsiSkMatrix.fromValue(matrix))
22
- );
28
+ this.preMultiply(JsiSkMatrix.fromValue(matrix));
23
29
  return this;
24
30
  }
25
31
 
26
32
  translate(x: number, y: number) {
27
- this.concat(
28
- new JsiSkMatrix(
29
- this.CanvasKit,
30
- Float32Array.of(...this.CanvasKit.Matrix.translated(x, y))
31
- )
32
- );
33
+ this.preMultiply(this.CanvasKit.Matrix.translated(x, y));
34
+ return this;
35
+ }
36
+
37
+ postTranslate(x: number, y: number) {
38
+ this.postMultiply(this.CanvasKit.Matrix.translated(x, y));
33
39
  return this;
34
40
  }
35
41
 
36
42
  scale(x: number, y?: number) {
37
- this.concat(
38
- new JsiSkMatrix(
39
- this.CanvasKit,
40
- Float32Array.of(...this.CanvasKit.Matrix.scaled(x, y ?? x))
41
- )
42
- );
43
+ this.preMultiply(this.CanvasKit.Matrix.scaled(x, y ?? x));
44
+ return this;
45
+ }
46
+
47
+ postScale(x: number, y?: number) {
48
+ this.postMultiply(this.CanvasKit.Matrix.scaled(x, y ?? x));
43
49
  return this;
44
50
  }
45
51
 
46
52
  skew(x: number, y: number) {
47
- this.concat(
48
- new JsiSkMatrix(
49
- this.CanvasKit,
50
- Float32Array.of(...this.CanvasKit.Matrix.skewed(x, y))
51
- )
52
- );
53
+ this.preMultiply(this.CanvasKit.Matrix.skewed(x, y));
54
+ return this;
55
+ }
56
+
57
+ postSkew(x: number, y: number) {
58
+ this.postMultiply(this.CanvasKit.Matrix.skewed(x, y));
53
59
  return this;
54
60
  }
55
61
 
56
62
  rotate(value: number) {
57
- this.concat(
58
- new JsiSkMatrix(
59
- this.CanvasKit,
60
- Float32Array.of(...this.CanvasKit.Matrix.rotated(value))
61
- )
62
- );
63
+ this.preMultiply(this.CanvasKit.Matrix.rotated(value));
64
+ return this;
65
+ }
66
+
67
+ postRotate(value: number) {
68
+ this.postMultiply(this.CanvasKit.Matrix.rotated(value));
63
69
  return this;
64
70
  }
65
71
 
@@ -150,10 +150,12 @@ export class JsiSkPath extends HostObject<Path, "Path"> implements SkPath {
150
150
 
151
151
  setFillType(fill: FillType) {
152
152
  this.ref.setFillType(ckEnum(fill));
153
+ return this;
153
154
  }
154
155
 
155
156
  setIsVolatile(volatile: boolean) {
156
157
  this.ref.setIsVolatile(volatile);
158
+ return this;
157
159
  }
158
160
 
159
161
  stroke(opts?: StrokeOpts) {
@@ -174,14 +176,17 @@ export class JsiSkPath extends HostObject<Path, "Path"> implements SkPath {
174
176
 
175
177
  close() {
176
178
  this.ref.close();
179
+ return this;
177
180
  }
178
181
 
179
182
  reset() {
180
183
  this.ref.reset();
184
+ return this;
181
185
  }
182
186
 
183
187
  rewind() {
184
188
  this.ref.rewind();
189
+ return this;
185
190
  }
186
191
 
187
192
  computeTightBounds(): SkRect {
@@ -272,10 +277,12 @@ export class JsiSkPath extends HostObject<Path, "Path"> implements SkPath {
272
277
 
273
278
  quadTo(x1: number, y1: number, x2: number, y2: number) {
274
279
  this.ref.quadTo(x1, y1, x2, y2);
280
+ return this;
275
281
  }
276
282
 
277
283
  addRect(rect: SkRect, isCCW?: boolean) {
278
284
  this.ref.addRect(JsiSkRect.fromValue(this.CanvasKit, rect), isCCW);
285
+ return this;
279
286
  }
280
287
 
281
288
  addRRect(rrect: SkRRect, isCCW?: boolean) {
@@ -331,9 +338,10 @@ export class JsiSkPath extends HostObject<Path, "Path"> implements SkPath {
331
338
 
332
339
  transform(m3: SkMatrix) {
333
340
  this.ref.transform(JsiSkMatrix.fromValue(m3));
341
+ return this;
334
342
  }
335
343
 
336
- interpolate(end: SkPath, t: number) {
344
+ interpolate(end: SkPath, t: number, output?: SkPath) {
337
345
  const path = this.CanvasKit.Path.MakeFromPathInterpolation(
338
346
  this.ref,
339
347
  JsiSkPath.fromValue(end),
@@ -342,7 +350,12 @@ export class JsiSkPath extends HostObject<Path, "Path"> implements SkPath {
342
350
  if (path === null) {
343
351
  return null;
344
352
  }
345
- return new JsiSkPath(this.CanvasKit, path);
353
+ if (output) {
354
+ (output as JsiSkPath).ref = path;
355
+ return output;
356
+ } else {
357
+ return new JsiSkPath(this.CanvasKit, path);
358
+ }
346
359
  }
347
360
 
348
361
  isInterpolatable(path2: SkPath): boolean {
@@ -1,15 +0,0 @@
1
- /*
2
- * Copyright 2017 Google Inc.
3
- *
4
- * Use of this source code is governed by a BSD-style license that can be
5
- * found in the LICENSE file.
6
- */
7
-
8
- // TODO(kjlubick, robertphillips) migrate Chromium to use the new location and name
9
- #include "include/private/chromium/GrDeferredDisplayList.h" // IWYU pragma: export
10
-
11
- class GrDeferredDisplayListRecorder;
12
- class GrSurfaceCharacterization;
13
- using SkDeferredDisplayList = GrDeferredDisplayList;
14
- using SkDeferredDisplayListRecorder = GrDeferredDisplayListRecorder;
15
- using SkSurfaceCharacterization = GrSurfaceCharacterization;
@@ -1,15 +0,0 @@
1
- /*
2
- * Copyright 2017 Google Inc.
3
- *
4
- * Use of this source code is governed by a BSD-style license that can be
5
- * found in the LICENSE file.
6
- */
7
-
8
- // TODO(kjlubick, robertphillips) migrate Chromium to use the new location
9
- #include "include/private/chromium/GrDeferredDisplayListRecorder.h" // IWYU pragma: export
10
-
11
- class GrDeferredDisplayList;
12
- class GrSurfaceCharacterization;
13
- using SkDeferredDisplayList = GrDeferredDisplayList;
14
- using SkDeferredDisplayListRecorder = GrDeferredDisplayListRecorder;
15
- using SkSurfaceCharacterization = GrSurfaceCharacterization;
@@ -1,20 +0,0 @@
1
- /*
2
- * Copyright 2017 Google Inc.
3
- *
4
- * Use of this source code is governed by a BSD-style license that can be
5
- * found in the LICENSE file.
6
- */
7
-
8
- #ifndef SkPromiseImageTexture_DEFINED
9
- #define SkPromiseImageTexture_DEFINED
10
-
11
- #include "include/core/SkTypes.h"
12
-
13
- // TODO(kjlubick) remove this shim header after clients are migrated
14
- #if defined(SK_GANESH)
15
- #include "include/private/chromium/GrPromiseImageTexture.h"
16
-
17
- typedef GrPromiseImageTexture SkPromiseImageTexture;
18
- #endif
19
-
20
- #endif // SkPromiseImageTexture_DEFINED
@@ -1,15 +0,0 @@
1
- /*
2
- * Copyright 2017 Google Inc.
3
- *
4
- * Use of this source code is governed by a BSD-style license that can be
5
- * found in the LICENSE file.
6
- */
7
-
8
- // TODO(kjlubick, robertphillips) migrate Chromium to use the new location and name
9
- #include "include/private/chromium/GrSurfaceCharacterization.h" // IWYU pragma: export
10
-
11
- class GrDeferredDisplayList;
12
- class GrDeferredDisplayListRecorder;
13
- using SkDeferredDisplayList = GrDeferredDisplayList;
14
- using SkDeferredDisplayListRecorder = GrDeferredDisplayListRecorder;
15
- using SkSurfaceCharacterization = GrSurfaceCharacterization;
@@ -1,63 +0,0 @@
1
-
2
- /*
3
- * Copyright 2006 The Android Open Source Project
4
- *
5
- * Use of this source code is governed by a BSD-style license that can be
6
- * found in the LICENSE file.
7
- */
8
-
9
-
10
- #ifndef SkTime_DEFINED
11
- #define SkTime_DEFINED
12
-
13
- #include "include/core/SkTypes.h"
14
- #include "include/private/base/SkMacros.h"
15
-
16
- #include <cinttypes>
17
-
18
- class SkString;
19
-
20
- /** \class SkTime
21
- Platform-implemented utilities to return time of day, and millisecond counter.
22
- */
23
- class SK_API SkTime {
24
- public:
25
- struct DateTime {
26
- int16_t fTimeZoneMinutes; // The number of minutes that GetDateTime()
27
- // is ahead of or behind UTC.
28
- uint16_t fYear; //!< e.g. 2005
29
- uint8_t fMonth; //!< 1..12
30
- uint8_t fDayOfWeek; //!< 0..6, 0==Sunday
31
- uint8_t fDay; //!< 1..31
32
- uint8_t fHour; //!< 0..23
33
- uint8_t fMinute; //!< 0..59
34
- uint8_t fSecond; //!< 0..59
35
-
36
- void toISO8601(SkString* dst) const;
37
- };
38
- static void GetDateTime(DateTime*);
39
-
40
- static double GetSecs() { return GetNSecs() * 1e-9; }
41
- static double GetMSecs() { return GetNSecs() * 1e-6; }
42
- static double GetNSecs();
43
- };
44
-
45
- ///////////////////////////////////////////////////////////////////////////////
46
-
47
- class SkAutoTime {
48
- public:
49
- // The label is not deep-copied, so its address must remain valid for the
50
- // lifetime of this object
51
- SkAutoTime(const char* label = nullptr)
52
- : fLabel(label)
53
- , fNow(SkTime::GetMSecs()) {}
54
- ~SkAutoTime() {
55
- uint64_t dur = static_cast<uint64_t>(SkTime::GetMSecs() - fNow);
56
- SkDebugf("%s %" PRIu64 "\n", fLabel ? fLabel : "", dur);
57
- }
58
- private:
59
- const char* fLabel;
60
- double fNow;
61
- };
62
-
63
- #endif
@@ -1,43 +0,0 @@
1
- /*
2
- * Copyright 2018 Google Inc.
3
- *
4
- * Use of this source code is governed by a BSD-style license that can be
5
- * found in the LICENSE file.
6
- */
7
-
8
- #ifndef SkOpPathEffect_DEFINED
9
- #define SkOpPathEffect_DEFINED
10
-
11
- #include "include/core/SkPaint.h"
12
- #include "include/core/SkRefCnt.h"
13
- #include "include/core/SkScalar.h"
14
- #include "include/core/SkTypes.h"
15
- #include "include/pathops/SkPathOps.h"
16
-
17
- class SkMatrix;
18
- class SkPathEffect;
19
-
20
- class SK_API SkMergePathEffect {
21
- public:
22
- /* Defers to two other patheffects, and then combines their outputs using the specified op.
23
- * e.g.
24
- * result = output_one op output_two
25
- *
26
- * If either one or two is nullptr, then the original path is passed through to the op.
27
- */
28
- static sk_sp<SkPathEffect> Make(sk_sp<SkPathEffect> one, sk_sp<SkPathEffect> two, SkPathOp op);
29
- };
30
-
31
- class SK_API SkMatrixPathEffect {
32
- public:
33
- static sk_sp<SkPathEffect> MakeTranslate(SkScalar dx, SkScalar dy);
34
- static sk_sp<SkPathEffect> Make(const SkMatrix&);
35
- };
36
-
37
- class SK_API SkStrokePathEffect {
38
- public:
39
- static sk_sp<SkPathEffect> Make(SkScalar width, SkPaint::Join, SkPaint::Cap,
40
- SkScalar miter = 4);
41
- };
42
-
43
- #endif