@shopify/react-native-skia 0.1.158 → 0.1.159

Sign up to get free protection for your applications and to get access to all the features.
Files changed (403) hide show
  1. package/android/CMakeLists.txt +35 -11
  2. package/android/build.gradle +21 -25
  3. package/android/cpp/jni/JniLoad.cpp +2 -0
  4. package/android/cpp/jni/include/JniSkiaDomView.h +89 -0
  5. package/android/cpp/rnskia-android/SkiaOpenGLRenderer.cpp +4 -3
  6. package/android/cpp/rnskia-android/SkiaOpenGLRenderer.h +4 -3
  7. package/android/src/main/java/com/shopify/reactnative/skia/RNSkiaPackage.java +2 -1
  8. package/android/src/main/java/com/shopify/reactnative/skia/SkiaDomView.java +45 -0
  9. package/android/src/main/java/com/shopify/reactnative/skia/SkiaDomViewManager.java +64 -0
  10. package/cpp/api/JsiSkHostObjects.h +6 -0
  11. package/cpp/api/JsiSkImageFilterFactory.h +1 -1
  12. package/cpp/api/JsiSkPaint.h +9 -2
  13. package/cpp/api/JsiSkPath.h +1 -0
  14. package/cpp/api/JsiSkRuntimeEffect.h +36 -36
  15. package/cpp/jsi/JsiHostObject.cpp +16 -28
  16. package/cpp/jsi/JsiHostObject.h +127 -7
  17. package/cpp/jsi/JsiValue.cpp +346 -0
  18. package/cpp/jsi/JsiValue.h +222 -0
  19. package/cpp/jsi/JsiValueWrapper.h +33 -5
  20. package/cpp/rnskia/RNSkDomView.cpp +220 -0
  21. package/cpp/rnskia/RNSkDomView.h +140 -0
  22. package/cpp/rnskia/RNSkJsView.cpp +0 -4
  23. package/cpp/rnskia/RNSkJsView.h +6 -4
  24. package/cpp/rnskia/RNSkManager.cpp +7 -0
  25. package/cpp/rnskia/RNSkPictureView.h +5 -8
  26. package/cpp/rnskia/RNSkView.h +113 -5
  27. package/cpp/rnskia/dom/JsiDomApi.h +167 -0
  28. package/cpp/rnskia/dom/base/BaseNodeProp.h +72 -0
  29. package/cpp/rnskia/dom/base/DerivedNodeProp.h +187 -0
  30. package/cpp/rnskia/dom/base/DrawingContext.cpp +227 -0
  31. package/cpp/rnskia/dom/base/DrawingContext.h +136 -0
  32. package/cpp/rnskia/dom/base/JsiDependencyManager.h +294 -0
  33. package/cpp/rnskia/dom/base/JsiDomDeclarationNode.h +176 -0
  34. package/cpp/rnskia/dom/base/JsiDomDrawingNode.h +50 -0
  35. package/cpp/rnskia/dom/base/JsiDomNode.h +361 -0
  36. package/cpp/rnskia/dom/base/JsiDomRenderNode.h +267 -0
  37. package/cpp/rnskia/dom/base/NodeProp.h +130 -0
  38. package/cpp/rnskia/dom/base/NodePropsContainer.h +119 -0
  39. package/cpp/rnskia/dom/nodes/JsiBackdropFilterNode.h +38 -0
  40. package/cpp/rnskia/dom/nodes/JsiBlendNode.h +112 -0
  41. package/cpp/rnskia/dom/nodes/JsiBlurMaskNode.h +78 -0
  42. package/cpp/rnskia/dom/nodes/JsiBoxNode.h +104 -0
  43. package/cpp/rnskia/dom/nodes/JsiBoxShadowNode.h +33 -0
  44. package/cpp/rnskia/dom/nodes/JsiCircleNode.h +38 -0
  45. package/cpp/rnskia/dom/nodes/JsiColorFilterNodes.h +192 -0
  46. package/cpp/rnskia/dom/nodes/JsiCustomDrawingNode.h +123 -0
  47. package/cpp/rnskia/dom/nodes/JsiDiffRectNode.h +42 -0
  48. package/cpp/rnskia/dom/nodes/JsiFillNode.h +22 -0
  49. package/cpp/rnskia/dom/nodes/JsiGlyphsNode.h +56 -0
  50. package/cpp/rnskia/dom/nodes/JsiGroupNode.h +26 -0
  51. package/cpp/rnskia/dom/nodes/JsiImageFilterNodes.h +415 -0
  52. package/cpp/rnskia/dom/nodes/JsiImageNode.h +34 -0
  53. package/cpp/rnskia/dom/nodes/JsiImageSvgNode.h +44 -0
  54. package/cpp/rnskia/dom/nodes/JsiLayerNode.h +64 -0
  55. package/cpp/rnskia/dom/nodes/JsiLineNode.h +43 -0
  56. package/cpp/rnskia/dom/nodes/JsiOvalNode.h +34 -0
  57. package/cpp/rnskia/dom/nodes/JsiPaintNode.h +77 -0
  58. package/cpp/rnskia/dom/nodes/JsiPatchNode.h +54 -0
  59. package/cpp/rnskia/dom/nodes/JsiPathEffectNodes.h +315 -0
  60. package/cpp/rnskia/dom/nodes/JsiPathNode.h +181 -0
  61. package/cpp/rnskia/dom/nodes/JsiPictureNode.h +32 -0
  62. package/cpp/rnskia/dom/nodes/JsiPointsNode.h +51 -0
  63. package/cpp/rnskia/dom/nodes/JsiRRectNode.h +34 -0
  64. package/cpp/rnskia/dom/nodes/JsiRectNode.h +34 -0
  65. package/cpp/rnskia/dom/nodes/JsiShaderNodes.h +517 -0
  66. package/cpp/rnskia/dom/nodes/JsiTextBlobNode.h +47 -0
  67. package/cpp/rnskia/dom/nodes/JsiTextNode.h +54 -0
  68. package/cpp/rnskia/dom/nodes/JsiTextPathNode.h +32 -0
  69. package/cpp/rnskia/dom/nodes/JsiVerticesNode.h +43 -0
  70. package/cpp/rnskia/dom/props/BezierProps.h +63 -0
  71. package/cpp/rnskia/dom/props/BlendModeProp.h +101 -0
  72. package/cpp/rnskia/dom/props/BoxShadowProps.h +61 -0
  73. package/cpp/rnskia/dom/props/CircleProp.h +46 -0
  74. package/cpp/rnskia/dom/props/ClipProp.h +62 -0
  75. package/cpp/rnskia/dom/props/ColorProp.h +80 -0
  76. package/cpp/rnskia/dom/props/DrawingProp.h +33 -0
  77. package/cpp/rnskia/dom/props/FontProp.h +34 -0
  78. package/cpp/rnskia/dom/props/GlyphsProp.h +53 -0
  79. package/cpp/rnskia/dom/props/ImageProps.h +173 -0
  80. package/cpp/rnskia/dom/props/LayerProp.h +50 -0
  81. package/cpp/rnskia/dom/props/MatrixProp.h +33 -0
  82. package/cpp/rnskia/dom/props/NumbersProp.h +63 -0
  83. package/cpp/rnskia/dom/props/PaintProps.h +172 -0
  84. package/cpp/rnskia/dom/props/PathProp.h +55 -0
  85. package/cpp/rnskia/dom/props/PictureProp.h +38 -0
  86. package/cpp/rnskia/dom/props/PointProp.h +72 -0
  87. package/cpp/rnskia/dom/props/PointsProp.h +83 -0
  88. package/cpp/rnskia/dom/props/RRectProp.h +134 -0
  89. package/cpp/rnskia/dom/props/RadiusProp.h +43 -0
  90. package/cpp/rnskia/dom/props/RectProp.h +118 -0
  91. package/cpp/rnskia/dom/props/StrokeProps.h +75 -0
  92. package/cpp/rnskia/dom/props/SvgProp.h +37 -0
  93. package/cpp/rnskia/dom/props/TextBlobProp.h +128 -0
  94. package/cpp/rnskia/dom/props/TileModeProp.h +50 -0
  95. package/cpp/rnskia/dom/props/TransformProp.h +80 -0
  96. package/cpp/rnskia/dom/props/TransformsProps.h +68 -0
  97. package/cpp/rnskia/dom/props/UniformsProp.h +194 -0
  98. package/cpp/rnskia/dom/props/VertexModeProp.h +47 -0
  99. package/cpp/rnskia/dom/props/VerticesProps.h +67 -0
  100. package/cpp/rnskia/values/RNSkReadonlyValue.h +13 -4
  101. package/cpp/skia/include/android/SkAndroidFrameworkUtils.h +35 -1
  102. package/cpp/skia/include/codec/SkAndroidCodec.h +17 -1
  103. package/cpp/skia/include/codec/SkCodec.h +8 -5
  104. package/cpp/skia/include/core/SkAnnotation.h +2 -0
  105. package/cpp/skia/include/core/SkBitmap.h +52 -1
  106. package/cpp/skia/include/core/SkBlendMode.h +2 -0
  107. package/cpp/skia/include/core/SkCanvas.h +52 -31
  108. package/cpp/skia/include/core/SkCapabilities.h +44 -0
  109. package/cpp/skia/include/core/SkColor.h +7 -0
  110. package/cpp/skia/include/core/SkColorFilter.h +37 -0
  111. package/cpp/skia/include/core/SkColorSpace.h +1 -1
  112. package/cpp/skia/include/core/SkFont.h +4 -0
  113. package/cpp/skia/include/core/SkFontMgr.h +3 -0
  114. package/cpp/skia/include/core/SkGraphics.h +9 -0
  115. package/cpp/skia/include/core/SkImage.h +77 -17
  116. package/cpp/skia/include/core/SkImageEncoder.h +5 -3
  117. package/cpp/skia/include/core/SkImageGenerator.h +27 -17
  118. package/cpp/skia/include/core/SkM44.h +1 -0
  119. package/cpp/skia/include/core/SkMesh.h +120 -34
  120. package/cpp/skia/include/core/SkMilestone.h +1 -1
  121. package/cpp/skia/include/core/SkOverdrawCanvas.h +2 -1
  122. package/cpp/skia/include/core/SkPaint.h +15 -2
  123. package/cpp/skia/include/core/SkPath.h +4 -0
  124. package/cpp/skia/include/core/SkPathBuilder.h +1 -1
  125. package/cpp/skia/include/core/SkPicture.h +0 -3
  126. package/cpp/skia/include/core/SkPictureRecorder.h +0 -2
  127. package/cpp/skia/include/core/SkPixmap.h +19 -0
  128. package/cpp/skia/include/core/SkRasterHandleAllocator.h +3 -1
  129. package/cpp/skia/include/core/SkRect.h +11 -4
  130. package/cpp/skia/include/core/SkRefCnt.h +13 -1
  131. package/cpp/skia/include/core/SkRegion.h +6 -0
  132. package/cpp/skia/include/core/SkSamplingOptions.h +8 -6
  133. package/cpp/skia/include/core/SkScalar.h +6 -25
  134. package/cpp/skia/include/core/SkShader.h +20 -12
  135. package/cpp/skia/include/core/SkSpan.h +51 -19
  136. package/cpp/skia/include/core/SkStream.h +2 -2
  137. package/cpp/skia/include/core/SkString.h +11 -3
  138. package/cpp/skia/include/core/SkSurface.h +85 -8
  139. package/cpp/skia/include/core/SkTextBlob.h +5 -2
  140. package/cpp/skia/include/core/SkTypes.h +11 -10
  141. package/cpp/skia/include/docs/SkPDFDocument.h +0 -5
  142. package/cpp/skia/include/effects/Sk1DPathEffect.h +6 -1
  143. package/cpp/skia/include/effects/Sk2DPathEffect.h +4 -1
  144. package/cpp/skia/include/effects/SkColorMatrix.h +1 -0
  145. package/cpp/skia/include/effects/SkColorMatrixFilter.h +5 -8
  146. package/cpp/skia/include/effects/SkCornerPathEffect.h +5 -1
  147. package/cpp/skia/include/effects/SkDashPathEffect.h +5 -1
  148. package/cpp/skia/include/effects/SkGradientShader.h +68 -38
  149. package/cpp/skia/include/effects/SkHighContrastFilter.h +5 -1
  150. package/cpp/skia/include/effects/SkImageFilters.h +5 -4
  151. package/cpp/skia/include/effects/SkLumaColorFilter.h +4 -1
  152. package/cpp/skia/include/effects/SkOpPathEffect.h +6 -2
  153. package/cpp/skia/include/effects/SkOverdrawColorFilter.h +5 -2
  154. package/cpp/skia/include/effects/SkRuntimeEffect.h +54 -62
  155. package/cpp/skia/include/effects/SkShaderMaskFilter.h +3 -1
  156. package/cpp/skia/include/effects/SkTableColorFilter.h +8 -21
  157. package/cpp/skia/include/effects/SkTableMaskFilter.h +5 -1
  158. package/cpp/skia/include/effects/SkTrimPathEffect.h +5 -1
  159. package/cpp/skia/include/encode/SkEncoder.h +17 -0
  160. package/cpp/skia/include/encode/SkWebpEncoder.h +17 -0
  161. package/cpp/skia/include/gpu/GpuTypes.h +18 -0
  162. package/cpp/skia/include/gpu/GrBackendSurface.h +38 -17
  163. package/cpp/skia/include/gpu/GrBackendSurfaceMutableState.h +6 -71
  164. package/cpp/skia/include/gpu/GrContextOptions.h +1 -1
  165. package/cpp/skia/include/gpu/GrContextThreadSafeProxy.h +10 -9
  166. package/cpp/skia/include/gpu/GrDirectContext.h +42 -22
  167. package/cpp/skia/include/gpu/GrRecordingContext.h +6 -3
  168. package/cpp/skia/include/gpu/GrTypes.h +11 -11
  169. package/cpp/skia/include/gpu/MutableTextureState.h +122 -0
  170. package/cpp/skia/include/gpu/gl/GrGLFunctions.h +1 -0
  171. package/cpp/skia/include/gpu/gl/GrGLInterface.h +1 -0
  172. package/cpp/skia/include/gpu/graphite/BackendTexture.h +7 -0
  173. package/cpp/skia/include/gpu/graphite/CombinationBuilder.h +195 -0
  174. package/cpp/skia/include/gpu/graphite/Context.h +47 -55
  175. package/cpp/skia/include/gpu/graphite/ContextOptions.h +85 -0
  176. package/cpp/skia/include/gpu/graphite/GraphiteTypes.h +1 -17
  177. package/cpp/skia/include/gpu/graphite/ImageProvider.h +61 -0
  178. package/cpp/skia/include/gpu/graphite/Recorder.h +87 -8
  179. package/cpp/skia/include/gpu/graphite/Recording.h +19 -9
  180. package/cpp/skia/include/gpu/graphite/TextureInfo.h +40 -8
  181. package/cpp/skia/include/gpu/graphite/dawn/DawnBackendContext.h +25 -0
  182. package/cpp/skia/include/gpu/graphite/mtl/MtlBackendContext.h +3 -2
  183. package/cpp/skia/include/gpu/graphite/vk/VulkanGraphiteTypes.h +69 -0
  184. package/cpp/skia/include/gpu/mtl/MtlMemoryAllocator.h +39 -0
  185. package/cpp/skia/include/gpu/vk/GrVkBackendContext.h +21 -19
  186. package/cpp/skia/include/gpu/vk/GrVkExtensions.h +2 -50
  187. package/cpp/skia/include/gpu/vk/GrVkMemoryAllocator.h +2 -127
  188. package/cpp/skia/include/gpu/vk/GrVkTypes.h +5 -43
  189. package/cpp/skia/include/gpu/vk/VulkanBackendContext.h +46 -0
  190. package/cpp/skia/include/gpu/vk/VulkanExtensions.h +67 -0
  191. package/cpp/skia/include/gpu/vk/VulkanMemoryAllocator.h +116 -0
  192. package/cpp/skia/include/gpu/vk/VulkanTypes.h +59 -0
  193. package/cpp/skia/include/pathops/SkPathOps.h +1 -1
  194. package/cpp/skia/include/private/SkColorData.h +10 -40
  195. package/cpp/skia/include/private/SkEncodedInfo.h +9 -3
  196. package/cpp/skia/include/private/SkFloatingPoint.h +9 -6
  197. package/cpp/skia/include/private/SkHalf.h +5 -52
  198. package/cpp/skia/include/private/SkMacros.h +1 -1
  199. package/cpp/skia/include/private/SkMalloc.h +4 -0
  200. package/cpp/skia/include/private/SkPathRef.h +10 -10
  201. package/cpp/skia/include/private/SkSLModifiers.h +59 -23
  202. package/cpp/skia/include/private/SkSLProgramKind.h +1 -0
  203. package/cpp/skia/include/private/SkSLSymbol.h +7 -3
  204. package/cpp/skia/include/private/SkStringView.h +4 -0
  205. package/cpp/skia/include/private/SkTArray.h +21 -7
  206. package/cpp/skia/include/private/SkTDArray.h +173 -285
  207. package/cpp/skia/include/private/SkTHash.h +33 -32
  208. package/cpp/skia/include/private/SkTemplates.h +24 -26
  209. package/cpp/skia/include/private/SkVx.h +218 -135
  210. package/cpp/skia/include/private/chromium/GrSlug.h +3 -65
  211. package/cpp/skia/include/private/chromium/SkChromeRemoteGlyphCache.h +6 -3
  212. package/cpp/skia/include/private/chromium/Slug.h +76 -0
  213. package/cpp/skia/include/private/gpu/ganesh/GrTypesPriv.h +6 -1
  214. package/cpp/skia/include/private/gpu/ganesh/GrVkTypesPriv.h +5 -39
  215. package/cpp/skia/include/private/gpu/graphite/VulkanGraphiteTypesPriv.h +63 -0
  216. package/cpp/skia/include/{gpu/vk/GrVkVulkan.h → private/gpu/vk/SkiaVulkan.h} +2 -2
  217. package/cpp/skia/include/private/gpu/vk/VulkanTypesPriv.h +57 -0
  218. package/cpp/skia/include/sksl/DSL.h +0 -1
  219. package/cpp/skia/include/sksl/DSLBlock.h +4 -18
  220. package/cpp/skia/include/sksl/DSLCase.h +2 -8
  221. package/cpp/skia/include/sksl/DSLCore.h +8 -15
  222. package/cpp/skia/include/sksl/DSLExpression.h +51 -142
  223. package/cpp/skia/include/sksl/DSLFunction.h +7 -15
  224. package/cpp/skia/include/sksl/DSLModifiers.h +5 -2
  225. package/cpp/skia/include/sksl/DSLStatement.h +4 -39
  226. package/cpp/skia/include/sksl/DSLSymbols.h +1 -11
  227. package/cpp/skia/include/sksl/DSLType.h +20 -12
  228. package/cpp/skia/include/sksl/DSLVar.h +56 -146
  229. package/cpp/skia/include/sksl/SkSLErrorReporter.h +2 -15
  230. package/cpp/skia/include/sksl/SkSLOperator.h +62 -59
  231. package/cpp/skia/include/sksl/SkSLPosition.h +2 -0
  232. package/cpp/skia/include/sksl/SkSLVersion.h +27 -0
  233. package/cpp/skia/include/svg/SkSVGCanvas.h +1 -0
  234. package/cpp/skia/include/utils/SkAnimCodecPlayer.h +1 -1
  235. package/cpp/skia/include/utils/SkBase64.h +2 -0
  236. package/cpp/skia/include/utils/SkCustomTypeface.h +24 -11
  237. package/cpp/skia/include/utils/SkEventTracer.h +12 -1
  238. package/cpp/skia/include/utils/SkNWayCanvas.h +11 -4
  239. package/cpp/skia/include/utils/SkPaintFilterCanvas.h +9 -4
  240. package/cpp/skia/include/utils/SkParse.h +3 -0
  241. package/cpp/skia/include/utils/SkShadowUtils.h +2 -0
  242. package/cpp/skia/include/utils/SkTextUtils.h +2 -1
  243. package/cpp/skia/{include/third_party → modules}/skcms/skcms.h +10 -0
  244. package/cpp/skia/modules/skcms/skcms_internal.h +56 -0
  245. package/cpp/skia/modules/skcms/src/Transform_inl.h +1609 -0
  246. package/cpp/skia/modules/skparagraph/include/DartTypes.h +153 -0
  247. package/cpp/skia/modules/skparagraph/include/FontArguments.h +46 -0
  248. package/cpp/skia/modules/skparagraph/include/FontCollection.h +84 -0
  249. package/cpp/skia/modules/skparagraph/include/Metrics.h +98 -0
  250. package/cpp/skia/modules/skparagraph/include/Paragraph.h +111 -0
  251. package/cpp/skia/modules/skparagraph/include/ParagraphBuilder.h +69 -0
  252. package/cpp/skia/modules/skparagraph/include/ParagraphCache.h +77 -0
  253. package/cpp/skia/modules/skparagraph/include/ParagraphStyle.h +143 -0
  254. package/cpp/skia/modules/skparagraph/include/TextShadow.h +30 -0
  255. package/cpp/skia/modules/skparagraph/include/TextStyle.h +352 -0
  256. package/cpp/skia/modules/skparagraph/include/TypefaceFontProvider.h +81 -0
  257. package/cpp/skia/modules/svg/include/SkSVGAttributeParser.h +1 -1
  258. package/cpp/skia/modules/svg/include/SkSVGTypes.h +3 -3
  259. package/cpp/skia/src/core/SkLRUCache.h +126 -0
  260. package/cpp/skia/src/core/SkTInternalLList.h +302 -0
  261. package/cpp/utils/RNSkTimingInfo.h +1 -0
  262. package/ios/RNSkia-iOS/RNSkMetalCanvasProvider.h +15 -4
  263. package/ios/RNSkia-iOS/RNSkMetalCanvasProvider.mm +40 -54
  264. package/ios/RNSkia-iOS/SkiaDomViewManager.h +8 -0
  265. package/ios/RNSkia-iOS/SkiaDomViewManager.mm +51 -0
  266. package/lib/commonjs/dom/nodes/JsiSkDOM.js +56 -56
  267. package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -1
  268. package/lib/commonjs/dom/nodes/RenderNode.js +1 -1
  269. package/lib/commonjs/dom/nodes/RenderNode.js.map +1 -1
  270. package/lib/commonjs/renderer/Canvas.js +19 -63
  271. package/lib/commonjs/renderer/Canvas.js.map +1 -1
  272. package/lib/commonjs/renderer/DependencyManager.js +0 -5
  273. package/lib/commonjs/renderer/DependencyManager.js.map +1 -1
  274. package/lib/commonjs/renderer/HostComponents.js.map +1 -1
  275. package/lib/commonjs/renderer/useCanvas.js +4 -18
  276. package/lib/commonjs/renderer/useCanvas.js.map +1 -1
  277. package/lib/commonjs/views/SkiaBaseWebView.js +7 -0
  278. package/lib/commonjs/views/SkiaBaseWebView.js.map +1 -1
  279. package/lib/commonjs/views/SkiaDomView.js +152 -0
  280. package/lib/commonjs/views/SkiaDomView.js.map +1 -0
  281. package/lib/commonjs/views/SkiaDomView.web.js +55 -0
  282. package/lib/commonjs/views/SkiaDomView.web.js.map +1 -0
  283. package/lib/commonjs/views/SkiaPictureView.js +16 -2
  284. package/lib/commonjs/views/SkiaPictureView.js.map +1 -1
  285. package/lib/commonjs/views/SkiaView.js +17 -2
  286. package/lib/commonjs/views/SkiaView.js.map +1 -1
  287. package/lib/commonjs/views/index.js +13 -0
  288. package/lib/commonjs/views/index.js.map +1 -1
  289. package/lib/commonjs/views/types.js.map +1 -1
  290. package/lib/module/dom/nodes/JsiSkDOM.js +56 -56
  291. package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -1
  292. package/lib/module/dom/nodes/RenderNode.js +1 -1
  293. package/lib/module/dom/nodes/RenderNode.js.map +1 -1
  294. package/lib/module/renderer/Canvas.js +20 -64
  295. package/lib/module/renderer/Canvas.js.map +1 -1
  296. package/lib/module/renderer/DependencyManager.js +0 -5
  297. package/lib/module/renderer/DependencyManager.js.map +1 -1
  298. package/lib/module/renderer/HostComponents.js.map +1 -1
  299. package/lib/module/renderer/useCanvas.js +2 -13
  300. package/lib/module/renderer/useCanvas.js.map +1 -1
  301. package/lib/module/views/SkiaBaseWebView.js +7 -0
  302. package/lib/module/views/SkiaBaseWebView.js.map +1 -1
  303. package/lib/module/views/SkiaDomView.js +128 -0
  304. package/lib/module/views/SkiaDomView.js.map +1 -0
  305. package/lib/module/views/SkiaDomView.web.js +41 -0
  306. package/lib/module/views/SkiaDomView.web.js.map +1 -0
  307. package/lib/module/views/SkiaPictureView.js +14 -2
  308. package/lib/module/views/SkiaPictureView.js.map +1 -1
  309. package/lib/module/views/SkiaView.js +15 -2
  310. package/lib/module/views/SkiaView.js.map +1 -1
  311. package/lib/module/views/index.js +1 -0
  312. package/lib/module/views/index.js.map +1 -1
  313. package/lib/module/views/types.js.map +1 -1
  314. package/lib/typescript/src/dom/nodes/JsiSkDOM.d.ts +57 -64
  315. package/lib/typescript/src/renderer/Canvas.d.ts +5 -8
  316. package/lib/typescript/src/renderer/DependencyManager.d.ts +0 -2
  317. package/lib/typescript/src/renderer/HostComponents.d.ts +66 -3
  318. package/lib/typescript/src/renderer/useCanvas.d.ts +0 -6
  319. package/lib/typescript/src/views/SkiaBaseWebView.d.ts +4 -0
  320. package/lib/typescript/src/views/SkiaDomView.d.ts +31 -0
  321. package/lib/typescript/src/views/SkiaDomView.web.d.ts +7 -0
  322. package/lib/typescript/src/views/index.d.ts +1 -0
  323. package/lib/typescript/src/views/types.d.ts +12 -2
  324. package/libs/android/arm64-v8a/libskia.a +0 -0
  325. package/libs/android/arm64-v8a/libskottie.a +0 -0
  326. package/libs/android/arm64-v8a/libskparagraph.a +0 -0
  327. package/libs/android/arm64-v8a/libsksg.a +0 -0
  328. package/libs/android/arm64-v8a/libskshaper.a +0 -0
  329. package/libs/android/arm64-v8a/libskunicode.a +0 -0
  330. package/libs/android/arm64-v8a/libsvg.a +0 -0
  331. package/libs/android/armeabi-v7a/libskia.a +0 -0
  332. package/libs/android/armeabi-v7a/libskottie.a +0 -0
  333. package/libs/android/armeabi-v7a/libskparagraph.a +0 -0
  334. package/libs/android/armeabi-v7a/libsksg.a +0 -0
  335. package/libs/android/armeabi-v7a/libskshaper.a +0 -0
  336. package/libs/android/armeabi-v7a/libskunicode.a +0 -0
  337. package/libs/android/armeabi-v7a/libsvg.a +0 -0
  338. package/libs/android/x86/libskia.a +0 -0
  339. package/libs/android/x86/libskottie.a +0 -0
  340. package/libs/android/x86/libskparagraph.a +0 -0
  341. package/libs/android/x86/libsksg.a +0 -0
  342. package/libs/android/x86/libskshaper.a +0 -0
  343. package/libs/android/x86/libskunicode.a +0 -0
  344. package/libs/android/x86/libsvg.a +0 -0
  345. package/libs/android/x86_64/libskia.a +0 -0
  346. package/libs/android/x86_64/libskottie.a +0 -0
  347. package/libs/android/x86_64/libskparagraph.a +0 -0
  348. package/libs/android/x86_64/libsksg.a +0 -0
  349. package/libs/android/x86_64/libskshaper.a +0 -0
  350. package/libs/android/x86_64/libskunicode.a +0 -0
  351. package/libs/android/x86_64/libsvg.a +0 -0
  352. package/libs/ios/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
  353. package/libs/ios/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
  354. package/libs/ios/libskottie.xcframework/ios-arm64_arm64e/libskottie.a +0 -0
  355. package/libs/ios/libskottie.xcframework/ios-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
  356. package/libs/ios/libskparagraph.xcframework/Info.plist +42 -0
  357. package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e/libskparagraph.a +0 -0
  358. package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e_x86_64-simulator/libskparagraph.a +0 -0
  359. package/libs/ios/libsksg.xcframework/Info.plist +5 -5
  360. package/libs/ios/libsksg.xcframework/ios-arm64_arm64e/libsksg.a +0 -0
  361. package/libs/ios/libsksg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
  362. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
  363. package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
  364. package/libs/ios/libskunicode.xcframework/Info.plist +42 -0
  365. package/libs/ios/libskunicode.xcframework/ios-arm64_arm64e/libskunicode.a +0 -0
  366. package/libs/ios/libskunicode.xcframework/ios-arm64_arm64e_x86_64-simulator/libskunicode.a +0 -0
  367. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
  368. package/libs/ios/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
  369. package/package.json +5 -3
  370. package/react-native-skia.podspec +3 -1
  371. package/src/dom/nodes/JsiSkDOM.ts +170 -56
  372. package/src/dom/nodes/RenderNode.ts +1 -1
  373. package/src/renderer/Canvas.tsx +32 -56
  374. package/src/renderer/DependencyManager.tsx +0 -5
  375. package/src/renderer/HostComponents.ts +152 -1
  376. package/src/renderer/useCanvas.ts +1 -15
  377. package/src/views/SkiaBaseWebView.tsx +4 -0
  378. package/src/views/SkiaDomView.tsx +120 -0
  379. package/src/views/SkiaDomView.web.tsx +37 -0
  380. package/src/views/SkiaPictureView.tsx +10 -2
  381. package/src/views/SkiaView.tsx +11 -3
  382. package/src/views/index.ts +1 -0
  383. package/src/views/types.ts +19 -2
  384. package/cpp/jsi/JsiSimpleValueWrapper.h +0 -99
  385. package/cpp/skia/include/c/sk_canvas.h +0 -159
  386. package/cpp/skia/include/c/sk_colorspace.h +0 -25
  387. package/cpp/skia/include/c/sk_data.h +0 -65
  388. package/cpp/skia/include/c/sk_image.h +0 -71
  389. package/cpp/skia/include/c/sk_imageinfo.h +0 -62
  390. package/cpp/skia/include/c/sk_maskfilter.h +0 -47
  391. package/cpp/skia/include/c/sk_matrix.h +0 -49
  392. package/cpp/skia/include/c/sk_paint.h +0 -145
  393. package/cpp/skia/include/c/sk_path.h +0 -102
  394. package/cpp/skia/include/c/sk_picture.h +0 -70
  395. package/cpp/skia/include/c/sk_shader.h +0 -143
  396. package/cpp/skia/include/c/sk_surface.h +0 -73
  397. package/cpp/skia/include/c/sk_types.h +0 -278
  398. package/cpp/skia/include/gpu/graphite/SkStuff.h +0 -47
  399. package/cpp/skia/include/private/SkNx.h +0 -430
  400. package/cpp/skia/include/private/SkNx_neon.h +0 -713
  401. package/cpp/skia/include/private/SkNx_sse.h +0 -823
  402. package/cpp/skia/include/sksl/DSLRuntimeEffects.h +0 -32
  403. package/cpp/skia/include/sksl/DSLWrapper.h +0 -77
@@ -1,102 +0,0 @@
1
- /*
2
- * Copyright 2014 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
- // EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
9
- // DO NOT USE -- FOR INTERNAL TESTING ONLY
10
-
11
- #ifndef sk_path_DEFINED
12
- #define sk_path_DEFINED
13
-
14
- #include "include/c/sk_types.h"
15
-
16
- SK_C_PLUS_PLUS_BEGIN_GUARD
17
-
18
- typedef enum {
19
- CW_SK_PATH_DIRECTION,
20
- CCW_SK_PATH_DIRECTION,
21
- } sk_path_direction_t;
22
-
23
- typedef struct sk_pathbuilder_t sk_pathbuilder_t;
24
-
25
- /** Create a new, empty path. */
26
- SK_API sk_pathbuilder_t* sk_pathbuilder_new(void);
27
-
28
- /** Release the memory used by a sk_pathbuilder_t. */
29
- SK_API void sk_pathbuilder_delete(sk_pathbuilder_t*);
30
-
31
- /** Set the beginning of the next contour to the point (x,y). */
32
- SK_API void sk_pathbuilder_move_to(sk_pathbuilder_t*, float x, float y);
33
- /**
34
- Add a line from the last point to the specified point (x,y). If no
35
- sk_pathbuilder_move_to() call has been made for this contour, the first
36
- point is automatically set to (0,0).
37
- */
38
- SK_API void sk_pathbuilder_line_to(sk_pathbuilder_t*, float x, float y);
39
- /**
40
- Add a quadratic bezier from the last point, approaching control
41
- point (x0,y0), and ending at (x1,y1). If no sk_pathbuilder_move_to() call
42
- has been made for this contour, the first point is automatically
43
- set to (0,0).
44
- */
45
- SK_API void sk_pathbuilder_quad_to(sk_pathbuilder_t*, float x0, float y0, float x1, float y1);
46
- /**
47
- Add a conic curve from the last point, approaching control point
48
- (x0,y01), and ending at (x1,y1) with weight w. If no
49
- sk_pathbuilder_move_to() call has been made for this contour, the first
50
- point is automatically set to (0,0).
51
- */
52
- SK_API void sk_pathbuilder_conic_to(sk_pathbuilder_t*, float x0, float y0, float x1, float y1, float w);
53
- /**
54
- Add a cubic bezier from the last point, approaching control points
55
- (x0,y0) and (x1,y1), and ending at (x2,y2). If no
56
- sk_pathbuilder_move_to() call has been made for this contour, the first
57
- point is automatically set to (0,0).
58
- */
59
- SK_API void sk_pathbuilder_cubic_to(sk_pathbuilder_t*,
60
- float x0, float y0,
61
- float x1, float y1,
62
- float x2, float y2);
63
- /**
64
- Close the current contour. If the current point is not equal to the
65
- first point of the contour, a line segment is automatically added.
66
- */
67
- SK_API void sk_pathbuilder_close(sk_pathbuilder_t*);
68
-
69
- /**
70
- Add a closed rectangle contour to the path.
71
- */
72
- SK_API void sk_pathbuilder_add_rect(sk_pathbuilder_t*, const sk_rect_t*, sk_path_direction_t);
73
- /**
74
- Add a closed oval contour to the path
75
- */
76
- SK_API void sk_pathbuilder_add_oval(sk_pathbuilder_t*, const sk_rect_t*, sk_path_direction_t);
77
-
78
- /**** path *****/
79
-
80
- /**
81
- * Return a Path from the builder, resetting the builder to its original empty state.
82
- */
83
- SK_API sk_path_t* sk_pathbuilder_detach_path(sk_pathbuilder_t*);
84
-
85
- /**
86
- * Return a Path from the builder. The builder reamins in its current state.
87
- */
88
- SK_API sk_path_t* sk_pathbuilder_snapshot_path(sk_pathbuilder_t*);
89
-
90
- /** Release the memory used by a sk_path_t. */
91
- SK_API void sk_path_delete(sk_path_t*);
92
-
93
- /**
94
- * If the path is empty, return false and set the rect parameter to [0, 0, 0, 0].
95
- * else return true and set the rect parameter to the bounds of the control-points
96
- * of the path.
97
- */
98
- SK_API bool sk_path_get_bounds(const sk_path_t*, sk_rect_t*);
99
-
100
- SK_C_PLUS_PLUS_END_GUARD
101
-
102
- #endif
@@ -1,70 +0,0 @@
1
- /*
2
- * Copyright 2014 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
- // EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
9
- // DO NOT USE -- FOR INTERNAL TESTING ONLY
10
-
11
- #ifndef sk_picture_DEFINED
12
- #define sk_picture_DEFINED
13
-
14
- #include "include/c/sk_types.h"
15
-
16
- SK_C_PLUS_PLUS_BEGIN_GUARD
17
-
18
- /**
19
- Create a new sk_picture_recorder_t. Its resources should be
20
- released with a call to sk_picture_recorder_delete().
21
- */
22
- SK_API sk_picture_recorder_t* sk_picture_recorder_new(void);
23
- /**
24
- Release the memory and other resources used by this
25
- sk_picture_recorder_t.
26
- */
27
- SK_API void sk_picture_recorder_delete(sk_picture_recorder_t*);
28
-
29
- /**
30
- Returns the canvas that records the drawing commands
31
-
32
- @param sk_rect_t* the cull rect used when recording this
33
- picture. Any drawing the falls outside of this
34
- rect is undefined, and may be drawn or it may not.
35
- */
36
- SK_API sk_canvas_t* sk_picture_recorder_begin_recording(sk_picture_recorder_t*, const sk_rect_t*);
37
- /**
38
- Signal that the caller is done recording. This invalidates the
39
- canvas returned by begin_recording. Ownership of the sk_picture_t
40
- is passed to the caller, who must call sk_picture_unref() when
41
- they are done using it. The returned picture is immutable.
42
- */
43
- SK_API sk_picture_t* sk_picture_recorder_end_recording(sk_picture_recorder_t*);
44
-
45
- /**
46
- Increment the reference count on the given sk_picture_t. Must be
47
- balanced by a call to sk_picture_unref().
48
- */
49
- SK_API void sk_picture_ref(sk_picture_t*);
50
- /**
51
- Decrement the reference count. If the reference count is 1 before
52
- the decrement, then release both the memory holding the
53
- sk_picture_t and any resouces it may be managing. New
54
- sk_picture_t are created with a reference count of 1.
55
- */
56
- SK_API void sk_picture_unref(sk_picture_t*);
57
-
58
- /**
59
- Returns a non-zero value unique among all pictures.
60
- */
61
- SK_API uint32_t sk_picture_get_unique_id(sk_picture_t*);
62
-
63
- /**
64
- Return the cull rect specified when this picture was recorded.
65
- */
66
- SK_API sk_rect_t sk_picture_get_bounds(sk_picture_t*);
67
-
68
- SK_C_PLUS_PLUS_END_GUARD
69
-
70
- #endif
@@ -1,143 +0,0 @@
1
- /*
2
- * Copyright 2014 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
- // EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
9
- // DO NOT USE -- FOR INTERNAL TESTING ONLY
10
-
11
- #ifndef sk_shader_DEFINED
12
- #define sk_shader_DEFINED
13
-
14
- #include "include/c/sk_types.h"
15
-
16
- SK_C_PLUS_PLUS_BEGIN_GUARD
17
-
18
- SK_API void sk_shader_ref(sk_shader_t*);
19
- SK_API void sk_shader_unref(sk_shader_t*);
20
-
21
- typedef enum {
22
- CLAMP_SK_SHADER_TILEMODE,
23
- REPEAT_SK_SHADER_TILEMODE,
24
- MIRROR_SK_SHADER_TILEMODE,
25
- } sk_shader_tilemode_t;
26
-
27
- /**
28
- Returns a shader that generates a linear gradient between the two
29
- specified points.
30
-
31
- @param points The start and end points for the gradient.
32
- @param colors The array[count] of colors, to be distributed between
33
- the two points
34
- @param colorPos May be NULL. array[count] of SkScalars, or NULL, of
35
- the relative position of each corresponding color
36
- in the colors array. If this is NULL, the the
37
- colors are distributed evenly between the start
38
- and end point. If this is not null, the values
39
- must begin with 0, end with 1.0, and intermediate
40
- values must be strictly increasing.
41
- @param colorCount Must be >=2. The number of colors (and pos if not
42
- NULL) entries.
43
- @param mode The tiling mode
44
- */
45
- SK_API sk_shader_t* sk_shader_new_linear_gradient(const sk_point_t points[2],
46
- const sk_color_t colors[],
47
- const float colorPos[],
48
- int colorCount,
49
- sk_shader_tilemode_t tileMode,
50
- const sk_matrix_t* localMatrix);
51
-
52
-
53
- /**
54
- Returns a shader that generates a radial gradient given the center
55
- and radius.
56
-
57
- @param center The center of the circle for this gradient
58
- @param radius Must be positive. The radius of the circle for this
59
- gradient
60
- @param colors The array[count] of colors, to be distributed
61
- between the center and edge of the circle
62
- @param colorPos May be NULL. The array[count] of the relative
63
- position of each corresponding color in the colors
64
- array. If this is NULL, the the colors are
65
- distributed evenly between the center and edge of
66
- the circle. If this is not null, the values must
67
- begin with 0, end with 1.0, and intermediate
68
- values must be strictly increasing.
69
- @param count Must be >= 2. The number of colors (and pos if not
70
- NULL) entries
71
- @param tileMode The tiling mode
72
- @param localMatrix May be NULL
73
- */
74
- SK_API sk_shader_t* sk_shader_new_radial_gradient(const sk_point_t* center,
75
- float radius,
76
- const sk_color_t colors[],
77
- const float colorPos[],
78
- int colorCount,
79
- sk_shader_tilemode_t tileMode,
80
- const sk_matrix_t* localMatrix);
81
-
82
- /**
83
- Returns a shader that generates a sweep gradient given a center.
84
-
85
- @param center The coordinates of the center of the sweep
86
- @param colors The array[count] of colors, to be distributed around
87
- the center.
88
- @param colorPos May be NULL. The array[count] of the relative
89
- position of each corresponding color in the colors
90
- array. If this is NULL, the the colors are
91
- distributed evenly between the center and edge of
92
- the circle. If this is not null, the values must
93
- begin with 0, end with 1.0, and intermediate
94
- values must be strictly increasing.
95
- @param colorCount Must be >= 2. The number of colors (and pos if
96
- not NULL) entries
97
- @param localMatrix May be NULL
98
- */
99
- SK_API sk_shader_t* sk_shader_new_sweep_gradient(const sk_point_t* center,
100
- const sk_color_t colors[],
101
- const float colorPos[],
102
- int colorCount,
103
- const sk_matrix_t* localMatrix);
104
-
105
- /**
106
- Returns a shader that generates a conical gradient given two circles, or
107
- returns NULL if the inputs are invalid. The gradient interprets the
108
- two circles according to the following HTML spec.
109
- http://dev.w3.org/html5/2dcontext/#dom-context-2d-createradialgradient
110
-
111
- Returns a shader that generates a sweep gradient given a center.
112
-
113
- @param start, startRadius Defines the first circle.
114
- @param end, endRadius Defines the first circle.
115
- @param colors The array[count] of colors, to be distributed between
116
- the two circles.
117
- @param colorPos May be NULL. The array[count] of the relative
118
- position of each corresponding color in the colors
119
- array. If this is NULL, the the colors are
120
- distributed evenly between the two circles. If
121
- this is not null, the values must begin with 0,
122
- end with 1.0, and intermediate values must be
123
- strictly increasing.
124
- @param colorCount Must be >= 2. The number of colors (and pos if
125
- not NULL) entries
126
- @param tileMode The tiling mode
127
- @param localMatrix May be NULL
128
-
129
- */
130
- SK_API sk_shader_t* sk_shader_new_two_point_conical_gradient(
131
- const sk_point_t* start,
132
- float startRadius,
133
- const sk_point_t* end,
134
- float endRadius,
135
- const sk_color_t colors[],
136
- const float colorPos[],
137
- int colorCount,
138
- sk_shader_tilemode_t tileMode,
139
- const sk_matrix_t* localMatrix);
140
-
141
- SK_C_PLUS_PLUS_END_GUARD
142
-
143
- #endif
@@ -1,73 +0,0 @@
1
- /*
2
- * Copyright 2014 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
- // EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
9
- // DO NOT USE -- FOR INTERNAL TESTING ONLY
10
-
11
- #ifndef sk_surface_DEFINED
12
- #define sk_surface_DEFINED
13
-
14
- #include "include/c/sk_types.h"
15
-
16
- SK_C_PLUS_PLUS_BEGIN_GUARD
17
-
18
- /**
19
- Return a new surface, with the memory for the pixels automatically
20
- allocated. If the requested surface cannot be created, or the
21
- request is not a supported configuration, NULL will be returned.
22
-
23
- @param sk_imageinfo_t* Specify the width, height, color type, and
24
- alpha type for the surface.
25
-
26
- @param sk_surfaceprops_t* If not NULL, specify additional non-default
27
- properties of the surface.
28
- */
29
- SK_API sk_surface_t* sk_surface_new_raster(const sk_imageinfo_t*, const sk_surfaceprops_t*);
30
-
31
- /**
32
- Create a new surface which will draw into the specified pixels
33
- with the specified rowbytes. If the requested surface cannot be
34
- created, or the request is not a supported configuration, NULL
35
- will be returned.
36
-
37
- @param sk_imageinfo_t* Specify the width, height, color type, and
38
- alpha type for the surface.
39
- @param void* pixels Specify the location in memory where the
40
- destination pixels are. This memory must
41
- outlast this surface.
42
- @param size_t rowBytes Specify the difference, in bytes, between
43
- each adjacent row. Should be at least
44
- (width * sizeof(one pixel)).
45
- @param sk_surfaceprops_t* If not NULL, specify additional non-default
46
- properties of the surface.
47
- */
48
- SK_API sk_surface_t* sk_surface_new_raster_direct(const sk_imageinfo_t*,
49
- void* pixels, size_t rowBytes,
50
- const sk_surfaceprops_t* props);
51
-
52
- /**
53
- Decrement the reference count. If the reference count is 1 before
54
- the decrement, then release both the memory holding the
55
- sk_surface_t and any pixel memory it may be managing. New
56
- sk_surface_t are created with a reference count of 1.
57
- */
58
- SK_API void sk_surface_unref(sk_surface_t*);
59
-
60
- /**
61
- * Return the canvas associated with this surface. Note: the canvas is owned by the surface,
62
- * so the returned object is only valid while the owning surface is valid.
63
- */
64
- SK_API sk_canvas_t* sk_surface_get_canvas(sk_surface_t*);
65
-
66
- /**
67
- * Call sk_image_unref() when the returned image is no longer used.
68
- */
69
- SK_API sk_image_t* sk_surface_new_image_snapshot(sk_surface_t*);
70
-
71
- SK_C_PLUS_PLUS_END_GUARD
72
-
73
- #endif
@@ -1,278 +0,0 @@
1
- /*
2
- * Copyright 2014 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
- // EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
9
- // DO NOT USE -- FOR INTERNAL TESTING ONLY
10
-
11
- #ifndef sk_types_DEFINED
12
- #define sk_types_DEFINED
13
-
14
- #include <stdint.h>
15
- #include <stddef.h>
16
-
17
- #ifdef __cplusplus
18
- #define SK_C_PLUS_PLUS_BEGIN_GUARD extern "C" {
19
- #define SK_C_PLUS_PLUS_END_GUARD }
20
- #else
21
- #include <stdbool.h>
22
- #define SK_C_PLUS_PLUS_BEGIN_GUARD
23
- #define SK_C_PLUS_PLUS_END_GUARD
24
- #endif
25
-
26
- #if !defined(SK_API)
27
- #if defined(SKIA_DLL)
28
- #if defined(_MSC_VER)
29
- #if SKIA_IMPLEMENTATION
30
- #define SK_API __declspec(dllexport)
31
- #else
32
- #define SK_API __declspec(dllimport)
33
- #endif
34
- #else
35
- #define SK_API __attribute__((visibility("default")))
36
- #endif
37
- #else
38
- #define SK_API
39
- #endif
40
- #endif
41
-
42
- ///////////////////////////////////////////////////////////////////////////////////////
43
-
44
- SK_C_PLUS_PLUS_BEGIN_GUARD
45
-
46
- typedef uint32_t sk_color_t;
47
-
48
- /* This macro assumes all arguments are >=0 and <=255. */
49
- #define sk_color_set_argb(a, r, g, b) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b))
50
- #define sk_color_get_a(c) (((c) >> 24) & 0xFF)
51
- #define sk_color_get_r(c) (((c) >> 16) & 0xFF)
52
- #define sk_color_get_g(c) (((c) >> 8) & 0xFF)
53
- #define sk_color_get_b(c) (((c) >> 0) & 0xFF)
54
-
55
- typedef enum {
56
- INTERSECT_SK_CLIPTYPE,
57
- DIFFERENCE_SK_CLIPTYPE,
58
- } sk_cliptype_t;
59
-
60
- typedef enum {
61
- UNKNOWN_SK_PIXELGEOMETRY,
62
- RGB_H_SK_PIXELGEOMETRY,
63
- BGR_H_SK_PIXELGEOMETRY,
64
- RGB_V_SK_PIXELGEOMETRY,
65
- BGR_V_SK_PIXELGEOMETRY,
66
- } sk_pixelgeometry_t;
67
-
68
- typedef struct {
69
- sk_pixelgeometry_t pixelGeometry;
70
- } sk_surfaceprops_t;
71
-
72
- typedef struct {
73
- float x;
74
- float y;
75
- } sk_point_t;
76
-
77
- typedef struct {
78
- int32_t left;
79
- int32_t top;
80
- int32_t right;
81
- int32_t bottom;
82
- } sk_irect_t;
83
-
84
- typedef struct {
85
- float left;
86
- float top;
87
- float right;
88
- float bottom;
89
- } sk_rect_t;
90
-
91
- /**
92
- The sk_matrix_t struct holds a 3x3 perspective matrix for
93
- transforming coordinates:
94
-
95
- (X,Y) = T[M]((x,y))
96
- X = (M[0] * x + M[1] * y + M[2]) / (M[6] * x + M[7] * y + M[8]);
97
- Y = (M[3] * x + M[4] * y + M[5]) / (M[6] * x + M[7] * y + M[8]);
98
-
99
- Therefore, the identity matrix is
100
-
101
- sk_matrix_t identity = {{1, 0, 0,
102
- 0, 1, 0,
103
- 0, 0, 1}};
104
-
105
- A matrix that scales by sx and sy is:
106
-
107
- sk_matrix_t scale = {{sx, 0, 0,
108
- 0, sy, 0,
109
- 0, 0, 1}};
110
-
111
- A matrix that translates by tx and ty is:
112
-
113
- sk_matrix_t translate = {{1, 0, tx,
114
- 0, 1, ty,
115
- 0, 0, 1}};
116
-
117
- A matrix that rotates around the origin by A radians:
118
-
119
- sk_matrix_t rotate = {{cos(A), -sin(A), 0,
120
- sin(A), cos(A), 0,
121
- 0, 0, 1}};
122
-
123
- Two matrixes can be concatinated by:
124
-
125
- void concat_matrices(sk_matrix_t* dst,
126
- const sk_matrix_t* matrixU,
127
- const sk_matrix_t* matrixV) {
128
- const float* u = matrixU->mat;
129
- const float* v = matrixV->mat;
130
- sk_matrix_t result = {{
131
- u[0] * v[0] + u[1] * v[3] + u[2] * v[6],
132
- u[0] * v[1] + u[1] * v[4] + u[2] * v[7],
133
- u[0] * v[2] + u[1] * v[5] + u[2] * v[8],
134
- u[3] * v[0] + u[4] * v[3] + u[5] * v[6],
135
- u[3] * v[1] + u[4] * v[4] + u[5] * v[7],
136
- u[3] * v[2] + u[4] * v[5] + u[5] * v[8],
137
- u[6] * v[0] + u[7] * v[3] + u[8] * v[6],
138
- u[6] * v[1] + u[7] * v[4] + u[8] * v[7],
139
- u[6] * v[2] + u[7] * v[5] + u[8] * v[8]
140
- }};
141
- *dst = result;
142
- }
143
- */
144
- typedef struct {
145
- float mat[9];
146
- } sk_matrix_t;
147
-
148
- /**
149
- A sk_canvas_t encapsulates all of the state about drawing into a
150
- destination This includes a reference to the destination itself,
151
- and a stack of matrix/clip values.
152
- */
153
- typedef struct sk_canvas_t sk_canvas_t;
154
- /**
155
- A sk_data_ holds an immutable data buffer.
156
- */
157
- typedef struct sk_data_t sk_data_t;
158
- /**
159
- A sk_image_t is an abstraction for drawing a rectagle of pixels.
160
- The content of the image is always immutable, though the actual
161
- storage may change, if for example that image can be re-created via
162
- encoded data or other means.
163
- */
164
- typedef struct sk_image_t sk_image_t;
165
-
166
- /**
167
- * Describes the color components. See ICC Profiles.
168
- */
169
- typedef struct sk_colorspace_t sk_colorspace_t;
170
-
171
- /**
172
- * Describes an image buffer : width, height, pixel type, colorspace, etc.
173
- */
174
- typedef struct sk_imageinfo_t sk_imageinfo_t;
175
-
176
- /**
177
- A sk_maskfilter_t is an object that perform transformations on an
178
- alpha-channel mask before drawing it; it may be installed into a
179
- sk_paint_t. Each time a primitive is drawn, it is first
180
- scan-converted into a alpha mask, which os handed to the
181
- maskfilter, which may create a new mask is to render into the
182
- destination.
183
- */
184
- typedef struct sk_maskfilter_t sk_maskfilter_t;
185
- /**
186
- A sk_paint_t holds the style and color information about how to
187
- draw geometries, text and bitmaps.
188
- */
189
- typedef struct sk_paint_t sk_paint_t;
190
- /**
191
- A sk_path_t encapsulates compound (multiple contour) geometric
192
- paths consisting of straight line segments, quadratic curves, and
193
- cubic curves.
194
- */
195
- typedef struct sk_path_t sk_path_t;
196
- /**
197
- A sk_picture_t holds recorded canvas drawing commands to be played
198
- back at a later time.
199
- */
200
- typedef struct sk_picture_t sk_picture_t;
201
- /**
202
- A sk_picture_recorder_t holds a sk_canvas_t that records commands
203
- to create a sk_picture_t.
204
- */
205
- typedef struct sk_picture_recorder_t sk_picture_recorder_t;
206
- /**
207
- A sk_shader_t specifies the source color(s) for what is being drawn. If a
208
- paint has no shader, then the paint's color is used. If the paint
209
- has a shader, then the shader's color(s) are use instead, but they
210
- are modulated by the paint's alpha.
211
- */
212
- typedef struct sk_shader_t sk_shader_t;
213
- /**
214
- A sk_surface_t holds the destination for drawing to a canvas. For
215
- raster drawing, the destination is an array of pixels in memory.
216
- For GPU drawing, the destination is a texture or a framebuffer.
217
- */
218
- typedef struct sk_surface_t sk_surface_t;
219
-
220
- typedef enum {
221
- NEAREST_SK_FILTER_MODE,
222
- LINEAR_SK_FILTER_MODE,
223
- } sk_filter_mode_t;
224
-
225
- typedef enum {
226
- NONE_SK_MIPMAP_MODE,
227
- NEAREST_SK_MIPMAP_MODE,
228
- LINEAR_SK_MIPMAP_MODE,
229
- } sk_mipmap_mode_t;
230
-
231
- typedef struct {
232
- float B, C;
233
- } sk_cubic_resampler_t;
234
-
235
- typedef struct {
236
- bool useCubic;
237
- sk_cubic_resampler_t cubic;
238
- sk_filter_mode_t filter;
239
- sk_mipmap_mode_t mipmap;
240
- } sk_sampling_options_t;
241
-
242
- typedef enum {
243
- CLEAR_SK_XFERMODE_MODE,
244
- SRC_SK_XFERMODE_MODE,
245
- DST_SK_XFERMODE_MODE,
246
- SRCOVER_SK_XFERMODE_MODE,
247
- DSTOVER_SK_XFERMODE_MODE,
248
- SRCIN_SK_XFERMODE_MODE,
249
- DSTIN_SK_XFERMODE_MODE,
250
- SRCOUT_SK_XFERMODE_MODE,
251
- DSTOUT_SK_XFERMODE_MODE,
252
- SRCATOP_SK_XFERMODE_MODE,
253
- DSTATOP_SK_XFERMODE_MODE,
254
- XOR_SK_XFERMODE_MODE,
255
- PLUS_SK_XFERMODE_MODE,
256
- MODULATE_SK_XFERMODE_MODE,
257
- SCREEN_SK_XFERMODE_MODE,
258
- OVERLAY_SK_XFERMODE_MODE,
259
- DARKEN_SK_XFERMODE_MODE,
260
- LIGHTEN_SK_XFERMODE_MODE,
261
- COLORDODGE_SK_XFERMODE_MODE,
262
- COLORBURN_SK_XFERMODE_MODE,
263
- HARDLIGHT_SK_XFERMODE_MODE,
264
- SOFTLIGHT_SK_XFERMODE_MODE,
265
- DIFFERENCE_SK_XFERMODE_MODE,
266
- EXCLUSION_SK_XFERMODE_MODE,
267
- MULTIPLY_SK_XFERMODE_MODE,
268
- HUE_SK_XFERMODE_MODE,
269
- SATURATION_SK_XFERMODE_MODE,
270
- COLOR_SK_XFERMODE_MODE,
271
- LUMINOSITY_SK_XFERMODE_MODE,
272
- } sk_xfermode_mode_t;
273
-
274
- //////////////////////////////////////////////////////////////////////////////////////////
275
-
276
- SK_C_PLUS_PLUS_END_GUARD
277
-
278
- #endif