@shopify/react-native-skia 0.1.162 → 0.1.164

Sign up to get free protection for your applications and to get access to all the features.
Files changed (194) hide show
  1. package/android/cpp/rnskia-android/RNSkAndroidPlatformContext.h +2 -0
  2. package/android/cpp/rnskia-android/RNSkOpenGLCanvasProvider.cpp +2 -2
  3. package/android/cpp/rnskia-android/RNSkOpenGLCanvasProvider.h +2 -2
  4. package/android/cpp/rnskia-android/SkiaOpenGLRenderer.h +5 -5
  5. package/cpp/api/JsiSkCanvas.h +8 -8
  6. package/cpp/api/JsiSkColor.h +1 -1
  7. package/cpp/api/JsiSkColorFilter.h +1 -1
  8. package/cpp/api/JsiSkColorFilterFactory.h +2 -2
  9. package/cpp/api/JsiSkContourMeasure.h +1 -1
  10. package/cpp/api/JsiSkContourMeasureIter.h +2 -2
  11. package/cpp/api/JsiSkData.h +2 -2
  12. package/cpp/api/JsiSkDataFactory.h +1 -1
  13. package/cpp/api/JsiSkFont.h +2 -2
  14. package/cpp/api/JsiSkImage.h +3 -3
  15. package/cpp/api/JsiSkImageFilter.h +1 -1
  16. package/cpp/api/JsiSkImageFilterFactory.h +1 -1
  17. package/cpp/api/JsiSkImageInfo.h +1 -1
  18. package/cpp/api/JsiSkMaskFilter.h +1 -1
  19. package/cpp/api/JsiSkMaskFilterFactory.h +1 -1
  20. package/cpp/api/JsiSkMatrix.h +1 -1
  21. package/cpp/api/JsiSkPaint.h +7 -1
  22. package/cpp/api/JsiSkPath.h +15 -15
  23. package/cpp/api/JsiSkPathEffect.h +1 -1
  24. package/cpp/api/JsiSkPathEffectFactory.h +4 -4
  25. package/cpp/api/JsiSkPathFactory.h +2 -2
  26. package/cpp/api/JsiSkPicture.h +1 -1
  27. package/cpp/api/JsiSkPictureFactory.h +2 -2
  28. package/cpp/api/JsiSkPictureRecorder.h +2 -2
  29. package/cpp/api/JsiSkPoint.h +1 -1
  30. package/cpp/api/JsiSkRRect.h +1 -1
  31. package/cpp/api/JsiSkRSXform.h +1 -1
  32. package/cpp/api/JsiSkRect.h +1 -1
  33. package/cpp/api/JsiSkRuntimeEffect.h +1 -1
  34. package/cpp/api/JsiSkRuntimeShaderBuilder.h +1 -1
  35. package/cpp/api/JsiSkSVGFactory.h +1 -1
  36. package/cpp/api/JsiSkShader.h +2 -2
  37. package/cpp/api/JsiSkShaderFactory.h +3 -3
  38. package/cpp/api/JsiSkSurface.h +1 -1
  39. package/cpp/api/JsiSkSurfaceFactory.h +2 -2
  40. package/cpp/api/JsiSkTextBlob.h +1 -1
  41. package/cpp/api/JsiSkTextBlobFactory.h +1 -1
  42. package/cpp/api/JsiSkTypeface.h +2 -2
  43. package/cpp/api/JsiSkVertices.h +1 -1
  44. package/cpp/jsi/JsiHostObject.h +25 -25
  45. package/cpp/rnskia/RNSkJsView.h +3 -3
  46. package/cpp/rnskia/RNSkPictureView.h +3 -3
  47. package/cpp/rnskia/RNSkPlatformContext.h +5 -3
  48. package/cpp/rnskia/RNSkView.h +2 -2
  49. package/cpp/rnskia/dom/base/DrawingContext.cpp +24 -9
  50. package/cpp/rnskia/dom/base/DrawingContext.h +3 -2
  51. package/cpp/rnskia/dom/base/JsiDomDeclarationNode.h +12 -2
  52. package/cpp/rnskia/dom/base/JsiDomDrawingNode.h +4 -4
  53. package/cpp/rnskia/dom/base/JsiDomNode.h +68 -10
  54. package/cpp/rnskia/dom/base/JsiDomRenderNode.h +26 -61
  55. package/cpp/rnskia/dom/base/NodeProp.h +2 -1
  56. package/cpp/rnskia/dom/base/NodePropsContainer.h +10 -0
  57. package/cpp/rnskia/dom/nodes/JsiBlendNode.h +7 -9
  58. package/cpp/rnskia/dom/nodes/JsiBlurMaskNode.h +3 -6
  59. package/cpp/rnskia/dom/nodes/JsiBoxNode.h +2 -4
  60. package/cpp/rnskia/dom/nodes/JsiBoxShadowNode.h +1 -2
  61. package/cpp/rnskia/dom/nodes/JsiCircleNode.h +2 -3
  62. package/cpp/rnskia/dom/nodes/JsiColorFilterNodes.h +4 -8
  63. package/cpp/rnskia/dom/nodes/JsiCustomDrawingNode.h +1 -2
  64. package/cpp/rnskia/dom/nodes/JsiDiffRectNode.h +2 -7
  65. package/cpp/rnskia/dom/nodes/JsiGlyphsNode.h +4 -8
  66. package/cpp/rnskia/dom/nodes/JsiImageFilterNodes.h +19 -37
  67. package/cpp/rnskia/dom/nodes/JsiImageNode.h +1 -1
  68. package/cpp/rnskia/dom/nodes/JsiImageSvgNode.h +2 -4
  69. package/cpp/rnskia/dom/nodes/JsiLineNode.h +2 -7
  70. package/cpp/rnskia/dom/nodes/JsiOvalNode.h +1 -3
  71. package/cpp/rnskia/dom/nodes/JsiPaintNode.h +2 -3
  72. package/cpp/rnskia/dom/nodes/JsiPatchNode.h +4 -8
  73. package/cpp/rnskia/dom/nodes/JsiPathEffectNodes.h +14 -28
  74. package/cpp/rnskia/dom/nodes/JsiPathNode.h +16 -24
  75. package/cpp/rnskia/dom/nodes/JsiPictureNode.h +1 -2
  76. package/cpp/rnskia/dom/nodes/JsiPointsNode.h +2 -5
  77. package/cpp/rnskia/dom/nodes/JsiRRectNode.h +1 -2
  78. package/cpp/rnskia/dom/nodes/JsiRectNode.h +1 -2
  79. package/cpp/rnskia/dom/nodes/JsiShaderNodes.h +37 -69
  80. package/cpp/rnskia/dom/nodes/JsiTextBlobNode.h +3 -6
  81. package/cpp/rnskia/dom/nodes/JsiTextNode.h +4 -8
  82. package/cpp/rnskia/dom/nodes/JsiTextPathNode.h +1 -2
  83. package/cpp/rnskia/dom/nodes/JsiVerticesNode.h +2 -4
  84. package/cpp/rnskia/dom/props/BlendModeProp.h +2 -2
  85. package/cpp/rnskia/dom/props/PaintProps.h +3 -0
  86. package/cpp/rnskia/dom/props/TransformProp.h +0 -2
  87. package/cpp/utils/RNSkLog.h +1 -1
  88. package/ios/RNSkia-iOS/RNSkMetalCanvasProvider.mm +8 -7
  89. package/ios/RNSkia-iOS/RNSkiOSPlatformContext.h +2 -1
  90. package/ios/RNSkia-iOS/SkiaDrawViewManager.mm +4 -4
  91. package/ios/RNSkia-iOS/SkiaManager.mm +5 -5
  92. package/ios/RNSkia-iOS/SkiaPictureViewManager.mm +3 -3
  93. package/ios/RNSkia-iOS/SkiaUIView.mm +10 -10
  94. package/lib/commonjs/dom/nodes/RenderNode.js +12 -16
  95. package/lib/commonjs/dom/nodes/RenderNode.js.map +1 -1
  96. package/lib/commonjs/dom/nodes/datatypes/index.js +0 -13
  97. package/lib/commonjs/dom/nodes/datatypes/index.js.map +1 -1
  98. package/lib/commonjs/dom/nodes/drawings/Box.js +6 -6
  99. package/lib/commonjs/dom/nodes/drawings/Box.js.map +1 -1
  100. package/lib/commonjs/dom/nodes/drawings/PatchNode.js +3 -7
  101. package/lib/commonjs/dom/nodes/drawings/PatchNode.js.map +1 -1
  102. package/lib/commonjs/dom/nodes/drawings/VerticesNode.js +1 -1
  103. package/lib/commonjs/dom/nodes/drawings/VerticesNode.js.map +1 -1
  104. package/lib/commonjs/dom/nodes/paint/ColorFilters.js +1 -3
  105. package/lib/commonjs/dom/nodes/paint/ColorFilters.js.map +1 -1
  106. package/lib/commonjs/dom/nodes/paint/ImageFilters.js +1 -1
  107. package/lib/commonjs/dom/nodes/paint/ImageFilters.js.map +1 -1
  108. package/lib/commonjs/dom/nodes/paint/Shaders.js +1 -3
  109. package/lib/commonjs/dom/nodes/paint/Shaders.js.map +1 -1
  110. package/lib/commonjs/dom/types/DrawingContext.js.map +1 -1
  111. package/lib/commonjs/renderer/Canvas.js +2 -11
  112. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  113. package/lib/commonjs/renderer/Container.js +2 -1
  114. package/lib/commonjs/renderer/Container.js.map +1 -1
  115. package/lib/commonjs/renderer/DrawingContext.js.map +1 -1
  116. package/lib/commonjs/renderer/components/Mask.js +11 -25
  117. package/lib/commonjs/renderer/components/Mask.js.map +1 -1
  118. package/lib/commonjs/renderer/index.js +0 -13
  119. package/lib/commonjs/renderer/index.js.map +1 -1
  120. package/lib/commonjs/skia/types/Paint/Paint.js.map +1 -1
  121. package/lib/commonjs/skia/web/JsiSkPaint.js +4 -0
  122. package/lib/commonjs/skia/web/JsiSkPaint.js.map +1 -1
  123. package/lib/commonjs/web/LoadSkiaWeb.js +1 -1
  124. package/lib/commonjs/web/LoadSkiaWeb.js.map +1 -1
  125. package/lib/module/dom/nodes/RenderNode.js +12 -16
  126. package/lib/module/dom/nodes/RenderNode.js.map +1 -1
  127. package/lib/module/dom/nodes/datatypes/index.js +0 -1
  128. package/lib/module/dom/nodes/datatypes/index.js.map +1 -1
  129. package/lib/module/dom/nodes/drawings/Box.js +6 -5
  130. package/lib/module/dom/nodes/drawings/Box.js.map +1 -1
  131. package/lib/module/dom/nodes/drawings/PatchNode.js +4 -8
  132. package/lib/module/dom/nodes/drawings/PatchNode.js.map +1 -1
  133. package/lib/module/dom/nodes/drawings/VerticesNode.js +2 -2
  134. package/lib/module/dom/nodes/drawings/VerticesNode.js.map +1 -1
  135. package/lib/module/dom/nodes/paint/ColorFilters.js +1 -2
  136. package/lib/module/dom/nodes/paint/ColorFilters.js.map +1 -1
  137. package/lib/module/dom/nodes/paint/ImageFilters.js +2 -2
  138. package/lib/module/dom/nodes/paint/ImageFilters.js.map +1 -1
  139. package/lib/module/dom/nodes/paint/Shaders.js +1 -2
  140. package/lib/module/dom/nodes/paint/Shaders.js.map +1 -1
  141. package/lib/module/dom/types/DrawingContext.js.map +1 -1
  142. package/lib/module/renderer/Canvas.js +3 -10
  143. package/lib/module/renderer/Canvas.js.map +1 -1
  144. package/lib/module/renderer/Container.js +2 -1
  145. package/lib/module/renderer/Container.js.map +1 -1
  146. package/lib/module/renderer/DrawingContext.js.map +1 -1
  147. package/lib/module/renderer/components/Mask.js +9 -21
  148. package/lib/module/renderer/components/Mask.js.map +1 -1
  149. package/lib/module/renderer/index.js +0 -1
  150. package/lib/module/renderer/index.js.map +1 -1
  151. package/lib/module/skia/types/Paint/Paint.js.map +1 -1
  152. package/lib/module/skia/web/JsiSkPaint.js +4 -0
  153. package/lib/module/skia/web/JsiSkPaint.js.map +1 -1
  154. package/lib/module/web/LoadSkiaWeb.js +1 -1
  155. package/lib/module/web/LoadSkiaWeb.js.map +1 -1
  156. package/lib/typescript/src/dom/nodes/datatypes/index.d.ts +0 -1
  157. package/lib/typescript/src/dom/nodes/drawings/Box.d.ts +1 -1
  158. package/lib/typescript/src/dom/nodes/drawings/PatchNode.d.ts +1 -1
  159. package/lib/typescript/src/dom/types/DrawingContext.d.ts +0 -1
  160. package/lib/typescript/src/renderer/Container.d.ts +1 -1
  161. package/lib/typescript/src/renderer/DrawingContext.d.ts +3 -5
  162. package/lib/typescript/src/renderer/index.d.ts +0 -1
  163. package/lib/typescript/src/skia/types/Paint/Paint.d.ts +4 -0
  164. package/lib/typescript/src/skia/web/JsiSkPaint.d.ts +1 -0
  165. package/package.json +1 -1
  166. package/src/dom/nodes/RenderNode.ts +11 -21
  167. package/src/dom/nodes/datatypes/index.ts +0 -1
  168. package/src/dom/nodes/drawings/Box.ts +7 -4
  169. package/src/dom/nodes/drawings/PatchNode.ts +4 -18
  170. package/src/dom/nodes/drawings/VerticesNode.ts +2 -2
  171. package/src/dom/nodes/paint/ColorFilters.ts +1 -2
  172. package/src/dom/nodes/paint/ImageFilters.ts +2 -2
  173. package/src/dom/nodes/paint/Shaders.ts +1 -2
  174. package/src/dom/types/DrawingContext.ts +0 -1
  175. package/src/renderer/Canvas.tsx +2 -12
  176. package/src/renderer/Container.tsx +1 -1
  177. package/src/renderer/DrawingContext.ts +5 -5
  178. package/src/renderer/components/Mask.tsx +11 -20
  179. package/src/renderer/index.ts +0 -1
  180. package/src/skia/types/Paint/Paint.ts +5 -0
  181. package/src/skia/web/JsiSkPaint.ts +4 -0
  182. package/src/web/LoadSkiaWeb.tsx +1 -1
  183. package/lib/commonjs/dom/nodes/datatypes/Color.js +0 -27
  184. package/lib/commonjs/dom/nodes/datatypes/Color.js.map +0 -1
  185. package/lib/commonjs/renderer/useCanvas.js +0 -32
  186. package/lib/commonjs/renderer/useCanvas.js.map +0 -1
  187. package/lib/module/dom/nodes/datatypes/Color.js +0 -11
  188. package/lib/module/dom/nodes/datatypes/Color.js.map +0 -1
  189. package/lib/module/renderer/useCanvas.js +0 -15
  190. package/lib/module/renderer/useCanvas.js.map +0 -1
  191. package/lib/typescript/src/dom/nodes/datatypes/Color.d.ts +0 -7
  192. package/lib/typescript/src/renderer/useCanvas.d.ts +0 -9
  193. package/src/dom/nodes/datatypes/Color.ts +0 -15
  194. package/src/renderer/useCanvas.ts +0 -21
@@ -1,21 +0,0 @@
1
- import React, { useContext } from "react";
2
-
3
- import type { Skia } from "../skia/types";
4
-
5
- interface CanvasContext {
6
- Skia: Skia;
7
- }
8
-
9
- const CanvasContext = React.createContext<CanvasContext | null>(null);
10
-
11
- export const CanvasProvider = CanvasContext.Provider;
12
-
13
- // This private function will be removed once we remove the useCanvas hook and
14
- // implement the Mask component as a node (will be faster too)
15
- export const useSkiaPrivate = () => {
16
- const ctx = useContext(CanvasContext);
17
- if (!ctx) {
18
- throw new Error("Skia Canvas context is not available");
19
- }
20
- return ctx.Skia;
21
- };