@shopify/react-native-skia 1.3.12 → 1.3.13
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/commonjs/__tests__/globalSetup.d.ts +9 -0
- package/lib/commonjs/__tests__/globalTeardown.d.ts +2 -0
- package/lib/commonjs/__tests__/setup.d.ts +18 -0
- package/lib/commonjs/dom/__tests__/Compose.spec.d.ts +1 -0
- package/lib/commonjs/dom/__tests__/Demos.spec.d.ts +1 -0
- package/lib/commonjs/dom/__tests__/DrawingContext.spec.d.ts +1 -0
- package/lib/commonjs/dom/__tests__/Drawings.spec.d.ts +1 -0
- package/lib/commonjs/dom/__tests__/Group.spec.d.ts +1 -0
- package/lib/commonjs/dom/__tests__/Paint.spec.d.ts +1 -0
- package/lib/commonjs/dom/__tests__/RenderNodes.spec.d.ts +1 -0
- package/lib/commonjs/dom/__tests__/Shaders.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/Data.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/Drawings.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/FitBox.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/Glyphs.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/Image.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/Paths.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/Picture.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/Simple.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/SkiaDOM.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/Surfaces.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/Text.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/TouchHandler.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/Transform.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/documentation/Group.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/documentation/getting-started/HelloWorld.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/documentation/paint/Overview.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/documentation/shapes/Box.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/AnimatedImages.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/Atlas.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/BackdropFilters.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/Blending.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/Blur.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/Box.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/ColorFilters.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/Composition/ColorFilterComposition.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/CoonPatch.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/DataEncoding.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/Drawings.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/FontMgr.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/Gradient.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/Group.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/Image.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/ImageEncoding.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/ImageFilters.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/Mask.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/Matrix4.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/NativeBuffer.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/Offscreen.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/Opacity.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/Paint.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/ParagraphPaint.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/Paragraphs.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/PathEffects.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/Paths.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/Picture.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/Point.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/Rect.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/RuntimeShader.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/SDF.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/SVG.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/Shader.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/Snapshot.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/Surfaces.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/Text.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/TextPath.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/Transforms.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/Vertices.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/Video.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/e2e/setup/Paragraph.d.ts +19 -0
- package/lib/commonjs/renderer/__tests__/e2e/setup/SVG.d.ts +12 -0
- package/lib/commonjs/renderer/__tests__/e2e/setup/SkiaObject.d.ts +11 -0
- package/lib/commonjs/renderer/__tests__/e2e/setup/index.d.ts +3 -0
- package/lib/commonjs/renderer/__tests__/examples/BlendModes.spec.d.ts +1 -0
- package/lib/commonjs/renderer/__tests__/setup.d.ts +66 -0
- package/lib/commonjs/skia/__tests__/ColorFilter.spec.d.ts +1 -0
- package/lib/commonjs/skia/__tests__/Data.spec.d.ts +1 -0
- package/lib/commonjs/skia/__tests__/Drawings.spec.d.ts +1 -0
- package/lib/commonjs/skia/__tests__/Enums.spec.d.ts +1 -0
- package/lib/commonjs/skia/__tests__/Geometry.spec.d.ts +1 -0
- package/lib/commonjs/skia/__tests__/ImageFilter.spec.d.ts +1 -0
- package/lib/commonjs/skia/__tests__/Mock.spec.d.ts +0 -0
- package/lib/commonjs/skia/__tests__/Paint.spec.d.ts +1 -0
- package/lib/commonjs/skia/__tests__/Path.spec.d.ts +1 -0
- package/lib/commonjs/skia/__tests__/RuntimeEffect.spec.d.ts +1 -0
- package/lib/commonjs/skia/__tests__/Shader.spec.d.ts +1 -0
- package/lib/commonjs/skia/__tests__/Text.spec.d.ts +1 -0
- package/lib/commonjs/skia/__tests__/Transform.spec.d.ts +1 -0
- package/lib/commonjs/skia/__tests__/Vertices.spec.d.ts +1 -0
- package/lib/commonjs/skia/__tests__/setup.d.ts +19 -0
- package/lib/module/__tests__/globalSetup.d.ts +9 -0
- package/lib/module/__tests__/globalTeardown.d.ts +2 -0
- package/lib/module/__tests__/setup.d.ts +18 -0
- package/lib/module/dom/__tests__/Compose.spec.d.ts +1 -0
- package/lib/module/dom/__tests__/Demos.spec.d.ts +1 -0
- package/lib/module/dom/__tests__/DrawingContext.spec.d.ts +1 -0
- package/lib/module/dom/__tests__/Drawings.spec.d.ts +1 -0
- package/lib/module/dom/__tests__/Group.spec.d.ts +1 -0
- package/lib/module/dom/__tests__/Paint.spec.d.ts +1 -0
- package/lib/module/dom/__tests__/RenderNodes.spec.d.ts +1 -0
- package/lib/module/dom/__tests__/Shaders.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/Data.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/Drawings.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/FitBox.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/Glyphs.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/Image.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/Paths.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/Picture.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/Simple.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/SkiaDOM.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/Surfaces.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/Text.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/TouchHandler.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/Transform.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/documentation/Group.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/documentation/getting-started/HelloWorld.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/documentation/paint/Overview.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/documentation/shapes/Box.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/AnimatedImages.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/Atlas.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/BackdropFilters.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/Blending.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/Blur.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/Box.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/ColorFilters.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/Composition/ColorFilterComposition.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/CoonPatch.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/DataEncoding.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/Drawings.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/FontMgr.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/Gradient.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/Group.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/Image.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/ImageEncoding.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/ImageFilters.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/Mask.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/Matrix4.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/NativeBuffer.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/Offscreen.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/Opacity.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/Paint.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/ParagraphPaint.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/Paragraphs.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/PathEffects.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/Paths.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/Picture.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/Point.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/Rect.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/RuntimeShader.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/SDF.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/SVG.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/Shader.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/Snapshot.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/Surfaces.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/Text.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/TextPath.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/Transforms.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/Vertices.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/Video.d.ts +1 -0
- package/lib/module/renderer/__tests__/e2e/setup/Paragraph.d.ts +19 -0
- package/lib/module/renderer/__tests__/e2e/setup/SVG.d.ts +12 -0
- package/lib/module/renderer/__tests__/e2e/setup/SkiaObject.d.ts +11 -0
- package/lib/module/renderer/__tests__/e2e/setup/index.d.ts +3 -0
- package/lib/module/renderer/__tests__/examples/BlendModes.spec.d.ts +1 -0
- package/lib/module/renderer/__tests__/setup.d.ts +66 -0
- package/lib/module/skia/__tests__/ColorFilter.spec.d.ts +1 -0
- package/lib/module/skia/__tests__/Data.spec.d.ts +1 -0
- package/lib/module/skia/__tests__/Drawings.spec.d.ts +1 -0
- package/lib/module/skia/__tests__/Enums.spec.d.ts +1 -0
- package/lib/module/skia/__tests__/Geometry.spec.d.ts +1 -0
- package/lib/module/skia/__tests__/ImageFilter.spec.d.ts +1 -0
- package/lib/module/skia/__tests__/Mock.spec.d.ts +0 -0
- package/lib/module/skia/__tests__/Paint.spec.d.ts +1 -0
- package/lib/module/skia/__tests__/Path.spec.d.ts +1 -0
- package/lib/module/skia/__tests__/RuntimeEffect.spec.d.ts +1 -0
- package/lib/module/skia/__tests__/Shader.spec.d.ts +1 -0
- package/lib/module/skia/__tests__/Text.spec.d.ts +1 -0
- package/lib/module/skia/__tests__/Transform.spec.d.ts +1 -0
- package/lib/module/skia/__tests__/Vertices.spec.d.ts +1 -0
- package/lib/module/skia/__tests__/setup.d.ts +19 -0
- package/lib/typescript/src/__tests__/globalSetup.d.ts +9 -0
- package/lib/typescript/src/__tests__/globalTeardown.d.ts +2 -0
- package/lib/typescript/src/__tests__/setup.d.ts +18 -0
- package/lib/typescript/src/dom/__tests__/Compose.spec.d.ts +1 -0
- package/lib/typescript/src/dom/__tests__/Demos.spec.d.ts +1 -0
- package/lib/typescript/src/dom/__tests__/DrawingContext.spec.d.ts +1 -0
- package/lib/typescript/src/dom/__tests__/Drawings.spec.d.ts +1 -0
- package/lib/typescript/src/dom/__tests__/Group.spec.d.ts +1 -0
- package/lib/typescript/src/dom/__tests__/Paint.spec.d.ts +1 -0
- package/lib/typescript/src/dom/__tests__/RenderNodes.spec.d.ts +1 -0
- package/lib/typescript/src/dom/__tests__/Shaders.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/Data.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/Drawings.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/FitBox.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/Glyphs.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/Image.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/Paths.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/Picture.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/Simple.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/SkiaDOM.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/Surfaces.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/Text.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/TouchHandler.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/Transform.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/documentation/Group.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/documentation/getting-started/HelloWorld.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/documentation/paint/Overview.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/documentation/shapes/Box.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/AnimatedImages.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/Atlas.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/BackdropFilters.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/Blending.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/Blur.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/Box.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/ColorFilters.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/Composition/ColorFilterComposition.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/CoonPatch.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/DataEncoding.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/Drawings.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/FontMgr.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/Gradient.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/Group.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/Image.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/ImageEncoding.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/ImageFilters.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/Mask.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/Matrix4.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/NativeBuffer.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/Offscreen.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/Opacity.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/Paint.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/ParagraphPaint.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/Paragraphs.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/PathEffects.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/Paths.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/Picture.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/Point.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/Rect.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/RuntimeShader.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/SDF.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/SVG.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/Shader.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/Snapshot.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/Surfaces.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/Text.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/TextPath.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/Transforms.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/Vertices.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/Video.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/e2e/setup/Paragraph.d.ts +19 -0
- package/lib/typescript/src/renderer/__tests__/e2e/setup/SVG.d.ts +12 -0
- package/lib/typescript/src/renderer/__tests__/e2e/setup/SkiaObject.d.ts +11 -0
- package/lib/typescript/src/renderer/__tests__/e2e/setup/index.d.ts +3 -0
- package/lib/typescript/src/renderer/__tests__/examples/BlendModes.spec.d.ts +1 -0
- package/lib/typescript/src/renderer/__tests__/setup.d.ts +66 -0
- package/lib/typescript/src/skia/__tests__/ColorFilter.spec.d.ts +1 -0
- package/lib/typescript/src/skia/__tests__/Data.spec.d.ts +1 -0
- package/lib/typescript/src/skia/__tests__/Drawings.spec.d.ts +1 -0
- package/lib/typescript/src/skia/__tests__/Enums.spec.d.ts +1 -0
- package/lib/typescript/src/skia/__tests__/Geometry.spec.d.ts +1 -0
- package/lib/typescript/src/skia/__tests__/ImageFilter.spec.d.ts +1 -0
- package/lib/typescript/src/skia/__tests__/Mock.spec.d.ts +0 -0
- package/lib/typescript/src/skia/__tests__/Paint.spec.d.ts +1 -0
- package/lib/typescript/src/skia/__tests__/Path.spec.d.ts +1 -0
- package/lib/typescript/src/skia/__tests__/RuntimeEffect.spec.d.ts +1 -0
- package/lib/typescript/src/skia/__tests__/Shader.spec.d.ts +1 -0
- package/lib/typescript/src/skia/__tests__/Text.spec.d.ts +1 -0
- package/lib/typescript/src/skia/__tests__/Transform.spec.d.ts +1 -0
- package/lib/typescript/src/skia/__tests__/Vertices.spec.d.ts +1 -0
- package/lib/typescript/src/skia/__tests__/setup.d.ts +19 -0
- package/libs/ios/libskia.xcframework/Info.plist +46 -0
- package/libs/ios/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
- package/libs/ios/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
- package/libs/ios/libskottie.xcframework/Info.plist +46 -0
- package/libs/ios/libskottie.xcframework/ios-arm64_arm64e/libskottie.a +0 -0
- package/libs/ios/libskottie.xcframework/ios-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
- package/libs/ios/libskparagraph.xcframework/Info.plist +46 -0
- package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e/libskparagraph.a +0 -0
- package/libs/ios/libskparagraph.xcframework/ios-arm64_arm64e_x86_64-simulator/libskparagraph.a +0 -0
- package/libs/ios/libsksg.xcframework/Info.plist +46 -0
- package/libs/ios/libsksg.xcframework/ios-arm64_arm64e/libsksg.a +0 -0
- package/libs/ios/libsksg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
- package/libs/ios/libskshaper.xcframework/Info.plist +46 -0
- package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
- package/libs/ios/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
- package/libs/ios/libskunicode.xcframework/Info.plist +46 -0
- package/libs/ios/libskunicode.xcframework/ios-arm64_arm64e/libskunicode.a +0 -0
- package/libs/ios/libskunicode.xcframework/ios-arm64_arm64e_x86_64-simulator/libskunicode.a +0 -0
- package/libs/ios/libsvg.xcframework/Info.plist +46 -0
- package/libs/ios/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
- package/libs/ios/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
- package/package.json +11 -14
- package/src/__tests__/globalSetup.ts +51 -0
- package/src/__tests__/globalTeardown.ts +11 -0
- package/src/__tests__/setup.ts +129 -0
- package/src/__tests__/snapshots/animated-images/bird.png +0 -0
- package/src/__tests__/snapshots/animations/green.png +0 -0
- package/src/__tests__/snapshots/animations/lightblue.png +0 -0
- package/src/__tests__/snapshots/animations/quarter-lightblue.png +0 -0
- package/src/__tests__/snapshots/animations/red.png +0 -0
- package/src/__tests__/snapshots/atlas/identity.png +0 -0
- package/src/__tests__/snapshots/atlas/rsxform.png +0 -0
- package/src/__tests__/snapshots/atlas/rsxform1.png +0 -0
- package/src/__tests__/snapshots/atlas/simple.png +0 -0
- package/src/__tests__/snapshots/atlas/simple2.png +0 -0
- package/src/__tests__/snapshots/box/box-shadow.png +0 -0
- package/src/__tests__/snapshots/box/box-shadow2.png +0 -0
- package/src/__tests__/snapshots/box/box-shadow3.png +0 -0
- package/src/__tests__/snapshots/box/box-stroke.png +0 -0
- package/src/__tests__/snapshots/color-filter/color-filter-composition.png +0 -0
- package/src/__tests__/snapshots/color-filter/matrix1.png +0 -0
- package/src/__tests__/snapshots/color-filter/matrix3.png +0 -0
- package/src/__tests__/snapshots/color-filter/zurich-sepia.png +0 -0
- package/src/__tests__/snapshots/coons-patch/patch-with-opacity.png +0 -0
- package/src/__tests__/snapshots/coons-patch/simple.png +0 -0
- package/src/__tests__/snapshots/cyan-buffer.png +0 -0
- package/src/__tests__/snapshots/data/oslo.png +0 -0
- package/src/__tests__/snapshots/data/red.png +0 -0
- package/src/__tests__/snapshots/data/zurich.png +0 -0
- package/src/__tests__/snapshots/demos/apple-breathe.png +0 -0
- package/src/__tests__/snapshots/demos/apple-breathe1.png +0 -0
- package/src/__tests__/snapshots/demos/breathe.png +0 -0
- package/src/__tests__/snapshots/demos/breathe2.png +0 -0
- package/src/__tests__/snapshots/demos/product.png +0 -0
- package/src/__tests__/snapshots/demos/product2.png +0 -0
- package/src/__tests__/snapshots/demos/skia-neon.png +0 -0
- package/src/__tests__/snapshots/demos/skia-neon1.png +0 -0
- package/src/__tests__/snapshots/drawings/arc.png +0 -0
- package/src/__tests__/snapshots/drawings/blend-mode-multiply.png +0 -0
- package/src/__tests__/snapshots/drawings/blend-modes.png +0 -0
- package/src/__tests__/snapshots/drawings/blur-node.png +0 -0
- package/src/__tests__/snapshots/drawings/blur.png +0 -0
- package/src/__tests__/snapshots/drawings/blur2.png +0 -0
- package/src/__tests__/snapshots/drawings/custom-drawing.png +0 -0
- package/src/__tests__/snapshots/drawings/cyan-circle.png +0 -0
- package/src/__tests__/snapshots/drawings/cyan.png +0 -0
- package/src/__tests__/snapshots/drawings/default-props.png +0 -0
- package/src/__tests__/snapshots/drawings/hello-world.png +0 -0
- package/src/__tests__/snapshots/drawings/image-default-props.png +0 -0
- package/src/__tests__/snapshots/drawings/lightblue-quarter-circle.png +0 -0
- package/src/__tests__/snapshots/drawings/lightblue-rect.png +0 -0
- package/src/__tests__/snapshots/drawings/line.png +0 -0
- package/src/__tests__/snapshots/drawings/multiple-paints.png +0 -0
- package/src/__tests__/snapshots/drawings/nested-shader.png +0 -0
- package/src/__tests__/snapshots/drawings/nested-shader2.png +0 -0
- package/src/__tests__/snapshots/drawings/opacity-image.png +0 -0
- package/src/__tests__/snapshots/drawings/opacity-multiplication.png +0 -0
- package/src/__tests__/snapshots/drawings/opacity-multiplication2.png +0 -0
- package/src/__tests__/snapshots/drawings/points.png +0 -0
- package/src/__tests__/snapshots/drawings/purple.png +0 -0
- package/src/__tests__/snapshots/drawings/rotated-image.png +0 -0
- package/src/__tests__/snapshots/drawings/rotated-scaled-image.png +0 -0
- package/src/__tests__/snapshots/drawings/rrect-aa.png +0 -0
- package/src/__tests__/snapshots/drawings/rrect-no-aa.png +0 -0
- package/src/__tests__/snapshots/drawings/scaled-image.png +0 -0
- package/src/__tests__/snapshots/drawings/scaled-image2.png +0 -0
- package/src/__tests__/snapshots/drawings/shader-opacity-reference.png +0 -0
- package/src/__tests__/snapshots/drawings/skew-transform.png +0 -0
- package/src/__tests__/snapshots/drawings/skew-transform2.png +0 -0
- package/src/__tests__/snapshots/drawings/small-lightblue-rect.png +0 -0
- package/src/__tests__/snapshots/drawings/stroke.png +0 -0
- package/src/__tests__/snapshots/drawings/transform-origin.png +0 -0
- package/src/__tests__/snapshots/drawings/transparent.png +0 -0
- package/src/__tests__/snapshots/drawings/violet.png +0 -0
- package/src/__tests__/snapshots/font/green.png +0 -0
- package/src/__tests__/snapshots/font/red.png +0 -0
- package/src/__tests__/snapshots/glyphs/simple.png +0 -0
- package/src/__tests__/snapshots/gradient/linear-with-opacity.png +0 -0
- package/src/__tests__/snapshots/gradient/linear.png +0 -0
- package/src/__tests__/snapshots/green.png +0 -0
- package/src/__tests__/snapshots/image-filter/blur.png +0 -0
- package/src/__tests__/snapshots/image-filter/test-shadow.png +0 -0
- package/src/__tests__/snapshots/images/bundle-android.png +0 -0
- package/src/__tests__/snapshots/images/bundle-ios.png +0 -0
- package/src/__tests__/snapshots/images/bundle-node.png +0 -0
- package/src/__tests__/snapshots/images/bundle.png +0 -0
- package/src/__tests__/snapshots/images/filter.png +0 -0
- package/src/__tests__/snapshots/leak.png +0 -0
- package/src/__tests__/snapshots/matrix4/perspective.png +0 -0
- package/src/__tests__/snapshots/paint/blend-mode.png +0 -0
- package/src/__tests__/snapshots/paint/circle.png +0 -0
- package/src/__tests__/snapshots/paint/colors.png +0 -0
- package/src/__tests__/snapshots/paint/dither.png +0 -0
- package/src/__tests__/snapshots/paint/path-paint.png +0 -0
- package/src/__tests__/snapshots/paint/without-dither.png +0 -0
- package/src/__tests__/snapshots/paragraph/paragraph-auto-linebreaks-android.png +0 -0
- package/src/__tests__/snapshots/paragraph/paragraph-auto-linebreaks-ios.png +0 -0
- package/src/__tests__/snapshots/paragraph/paragraph-bounding-box-android.png +0 -0
- package/src/__tests__/snapshots/paragraph/paragraph-bounding-box-ios.png +0 -0
- package/src/__tests__/snapshots/paragraph/paragraph-bounding-box-node.png +0 -0
- package/src/__tests__/snapshots/paragraph/paragraph-ellipse-android.png +0 -0
- package/src/__tests__/snapshots/paragraph/paragraph-ellipse-ios.png +0 -0
- package/src/__tests__/snapshots/paragraph/paragraph-linebreaks-android.png +0 -0
- package/src/__tests__/snapshots/paragraph/paragraph-linebreaks-ios.png +0 -0
- package/src/__tests__/snapshots/paragraph/paragraph-text-align-center-android.png +0 -0
- package/src/__tests__/snapshots/paragraph/paragraph-text-align-center-ios.png +0 -0
- package/src/__tests__/snapshots/paragraph/paragraph-text-align-justify-android.png +0 -0
- package/src/__tests__/snapshots/paragraph/paragraph-text-align-justify-ios.png +0 -0
- package/src/__tests__/snapshots/paragraph/paragraph-text-align-left-android.png +0 -0
- package/src/__tests__/snapshots/paragraph/paragraph-text-align-left-ios.png +0 -0
- package/src/__tests__/snapshots/paragraph/paragraph-text-align-right-android.png +0 -0
- package/src/__tests__/snapshots/paragraph/paragraph-text-align-right-ios.png +0 -0
- package/src/__tests__/snapshots/paragraph/paragraph-text-align-rtl-android.png +0 -0
- package/src/__tests__/snapshots/paragraph/paragraph-text-align-rtl-ios.png +0 -0
- package/src/__tests__/snapshots/paragraph/paragraph-text-style-colors-android.png +0 -0
- package/src/__tests__/snapshots/paragraph/paragraph-text-style-colors-ios.png +0 -0
- package/src/__tests__/snapshots/paragraph/paragraph-text-style-decoration-android.png +0 -0
- package/src/__tests__/snapshots/paragraph/paragraph-text-style-decoration-ios.png +0 -0
- package/src/__tests__/snapshots/paragraph/paragraph-text-style-font-shadow-android.png +0 -0
- package/src/__tests__/snapshots/paragraph/paragraph-text-style-font-shadow-ios.png +0 -0
- package/src/__tests__/snapshots/paragraph/paragraph-text-style-font-style-android-box.png +0 -0
- package/src/__tests__/snapshots/paragraph/paragraph-text-style-font-style-android.png +0 -0
- package/src/__tests__/snapshots/paragraph/paragraph-text-style-font-style-ios-box.png +0 -0
- package/src/__tests__/snapshots/paragraph/paragraph-text-style-font-style-ios.png +0 -0
- package/src/__tests__/snapshots/paragraph/paragraph-text-style-in-paragraph-style-android.png +0 -0
- package/src/__tests__/snapshots/paragraph/paragraph-text-style-in-paragraph-style-ios.png +0 -0
- package/src/__tests__/snapshots/paragraph/simple-paragraph-android.png +0 -0
- package/src/__tests__/snapshots/paragraph/simple-paragraph-ios.png +0 -0
- package/src/__tests__/snapshots/paragraph/simple-paragraph-with-provider-android.png +0 -0
- package/src/__tests__/snapshots/paragraph/simple-paragraph-with-provider-ios.png +0 -0
- package/src/__tests__/snapshots/paragraph/simple-paragraph-with-provider-node.png +0 -0
- package/src/__tests__/snapshots/path/interpolate.png +0 -0
- package/src/__tests__/snapshots/path/logo.png +0 -0
- package/src/__tests__/snapshots/path-effects/discrete.png +0 -0
- package/src/__tests__/snapshots/path-effects/sum.png +0 -0
- package/src/__tests__/snapshots/path-effects/sum2.png +0 -0
- package/src/__tests__/snapshots/paths/arc.png +0 -0
- package/src/__tests__/snapshots/paths/emptyPath.png +0 -0
- package/src/__tests__/snapshots/paths/interpolation1.png +0 -0
- package/src/__tests__/snapshots/paths/oval.png +0 -0
- package/src/__tests__/snapshots/paths/pattern.png +0 -0
- package/src/__tests__/snapshots/paths/poly.png +0 -0
- package/src/__tests__/snapshots/paths/rrect.png +0 -0
- package/src/__tests__/snapshots/paths/skia-trimmed.png +0 -0
- package/src/__tests__/snapshots/paths/skia.png +0 -0
- package/src/__tests__/snapshots/pictures/create-picture.png +0 -0
- package/src/__tests__/snapshots/pictures/green.png +0 -0
- package/src/__tests__/snapshots/pictures/hello-world.png +0 -0
- package/src/__tests__/snapshots/pictures/red.png +0 -0
- package/src/__tests__/snapshots/pictures/simple-picture.png +0 -0
- package/src/__tests__/snapshots/platform-buffer-bgra.png +0 -0
- package/src/__tests__/snapshots/platform-buffer.png +0 -0
- package/src/__tests__/snapshots/points/points.png +0 -0
- package/src/__tests__/snapshots/points/points2.png +0 -0
- package/src/__tests__/snapshots/render-nodes/simple.png +0 -0
- package/src/__tests__/snapshots/render-nodes/simple2.png +0 -0
- package/src/__tests__/snapshots/runtime-effects/blend-color-burn.png +0 -0
- package/src/__tests__/snapshots/runtime-effects/blend-color-burn2.png +0 -0
- package/src/__tests__/snapshots/runtime-effects/blend-color-burn3.png +0 -0
- package/src/__tests__/snapshots/runtime-effects/blend-color-dodge.png +0 -0
- package/src/__tests__/snapshots/runtime-effects/blend-multiply.png +0 -0
- package/src/__tests__/snapshots/runtime-effects/int-uniform.png +0 -0
- package/src/__tests__/snapshots/runtime-effects/linear-gradient.png +0 -0
- package/src/__tests__/snapshots/runtime-effects/linear-gradient2.png +0 -0
- package/src/__tests__/snapshots/runtime-effects/small-spiral.png +0 -0
- package/src/__tests__/snapshots/runtime-effects/spiral.png +0 -0
- package/src/__tests__/snapshots/runtime-shader/scaled-circle.png +0 -0
- package/src/__tests__/snapshots/runtime-shader/scaled-circle2.png +0 -0
- package/src/__tests__/snapshots/runtime-shader/simple.png +0 -0
- package/src/__tests__/snapshots/runtime-shader/spiral.png +0 -0
- package/src/__tests__/snapshots/runtime-shader/unscaled-image.png +0 -0
- package/src/__tests__/snapshots/screens/snapshot1-android-ci.png +0 -0
- package/src/__tests__/snapshots/screens/snapshot1-android.png +0 -0
- package/src/__tests__/snapshots/screens/snapshot1-ios.png +0 -0
- package/src/__tests__/snapshots/screens/snapshot2-android-ci.png +0 -0
- package/src/__tests__/snapshots/screens/snapshot2-android.png +0 -0
- package/src/__tests__/snapshots/screens/snapshot2-ios.png +0 -0
- package/src/__tests__/snapshots/screens/snapshot3-android-ci.png +0 -0
- package/src/__tests__/snapshots/screens/snapshot3-android.png +0 -0
- package/src/__tests__/snapshots/screens/snapshot3-ios.png +0 -0
- package/src/__tests__/snapshots/screens/snapshot4-android-ci.png +0 -0
- package/src/__tests__/snapshots/screens/snapshot4-android.png +0 -0
- package/src/__tests__/snapshots/screens/snapshot4-ios.png +0 -0
- package/src/__tests__/snapshots/screens/snapshot5-android.png +0 -0
- package/src/__tests__/snapshots/screens/snapshot5-ios.png +0 -0
- package/src/__tests__/snapshots/sdf/circle.png +0 -0
- package/src/__tests__/snapshots/sdf/heart.png +0 -0
- package/src/__tests__/snapshots/sdf/line.png +0 -0
- package/src/__tests__/snapshots/sdf/rectangle.png +0 -0
- package/src/__tests__/snapshots/shader/bilinear-interpolation.png +0 -0
- package/src/__tests__/snapshots/shader/hue.png +0 -0
- package/src/__tests__/snapshots/shader/hue2.png +0 -0
- package/src/__tests__/snapshots/shader/shader1.png +0 -0
- package/src/__tests__/snapshots/shader/shader2.png +0 -0
- package/src/__tests__/snapshots/shader/sweep-gradient.png +0 -0
- package/src/__tests__/snapshots/text/text-bounds-android.png +0 -0
- package/src/__tests__/snapshots/text/text-bounds-ios.png +0 -0
- package/src/__tests__/snapshots/text/text-default-font-android.png +0 -0
- package/src/__tests__/snapshots/text/text-default-font-ios.png +0 -0
- package/src/__tests__/snapshots/text/text-path-bug-android.png +0 -0
- package/src/__tests__/snapshots/text/text-path-bug-ios.png +0 -0
- package/src/__tests__/snapshots/text/text-path-bug-node.png +0 -0
- package/src/__tests__/snapshots/text/text-path1-android.png +0 -0
- package/src/__tests__/snapshots/text/text-path1-ios.png +0 -0
- package/src/__tests__/snapshots/text/text-path1-node.png +0 -0
- package/src/__tests__/snapshots/text/text-path2-android.png +0 -0
- package/src/__tests__/snapshots/text/text-path2-ios.png +0 -0
- package/src/__tests__/snapshots/text/text-path2-node.png +0 -0
- package/src/__tests__/snapshots/transform/rectangles.png +0 -0
- package/src/__tests__/snapshots/transform/rotate-radiants.png +0 -0
- package/src/__tests__/snapshots/transform/rotate.png +0 -0
- package/src/__tests__/snapshots/transform/scale-origin.png +0 -0
- package/src/__tests__/snapshots/transform/scale.png +0 -0
- package/src/__tests__/snapshots/transform/skew.png +0 -0
- package/src/__tests__/snapshots/transparent.png +0 -0
- package/src/__tests__/snapshots/vertices/billinear-gradient.png +0 -0
- package/src/__tests__/snapshots/vertices/strip.png +0 -0
- package/src/__tests__/snapshots/vertices/vertices.png +0 -0
- package/src/dom/__tests__/Compose.spec.tsx +42 -0
- package/src/dom/__tests__/Demos.spec.tsx +145 -0
- package/src/dom/__tests__/DrawingContext.spec.tsx +99 -0
- package/src/dom/__tests__/Drawings.spec.tsx +95 -0
- package/src/dom/__tests__/Group.spec.tsx +132 -0
- package/src/dom/__tests__/Paint.spec.tsx +100 -0
- package/src/dom/__tests__/RenderNodes.spec.tsx +44 -0
- package/src/dom/__tests__/Shaders.spec.tsx +123 -0
- package/src/renderer/__tests__/Data.spec.tsx +67 -0
- package/src/renderer/__tests__/Drawings.spec.tsx +96 -0
- package/src/renderer/__tests__/FitBox.spec.tsx +126 -0
- package/src/renderer/__tests__/Glyphs.spec.tsx +46 -0
- package/src/renderer/__tests__/Image.spec.tsx +45 -0
- package/src/renderer/__tests__/Paths.spec.tsx +75 -0
- package/src/renderer/__tests__/Picture.spec.tsx +82 -0
- package/src/renderer/__tests__/Simple.spec.tsx +81 -0
- package/src/renderer/__tests__/SkiaDOM.spec.tsx +46 -0
- package/src/renderer/__tests__/Surfaces.spec.tsx +73 -0
- package/src/renderer/__tests__/Text.spec.tsx +134 -0
- package/src/renderer/__tests__/TouchHandler.spec.tsx +113 -0
- package/src/renderer/__tests__/Transform.spec.tsx +72 -0
- package/src/renderer/__tests__/documentation/Group.spec.tsx +171 -0
- package/src/renderer/__tests__/documentation/getting-started/HelloWorld.spec.tsx +51 -0
- package/src/renderer/__tests__/documentation/paint/Overview.spec.tsx +84 -0
- package/src/renderer/__tests__/documentation/shapes/Box.spec.tsx +46 -0
- package/src/renderer/__tests__/e2e/AnimatedImages.spec.tsx +88 -0
- package/src/renderer/__tests__/e2e/Atlas.spec.tsx +358 -0
- package/src/renderer/__tests__/e2e/BackdropFilters.spec.tsx +141 -0
- package/src/renderer/__tests__/e2e/Blending.spec.tsx +115 -0
- package/src/renderer/__tests__/e2e/Blur.spec.tsx +56 -0
- package/src/renderer/__tests__/e2e/Box.spec.tsx +83 -0
- package/src/renderer/__tests__/e2e/ColorFilters.spec.tsx +212 -0
- package/src/renderer/__tests__/e2e/Composition/ColorFilterComposition.spec.tsx +81 -0
- package/src/renderer/__tests__/e2e/CoonPatch.spec.tsx +74 -0
- package/src/renderer/__tests__/e2e/DataEncoding.spec.tsx +75 -0
- package/src/renderer/__tests__/e2e/Drawings.spec.tsx +209 -0
- package/src/renderer/__tests__/e2e/FontMgr.spec.tsx +150 -0
- package/src/renderer/__tests__/e2e/Gradient.spec.tsx +40 -0
- package/src/renderer/__tests__/e2e/Group.spec.tsx +129 -0
- package/src/renderer/__tests__/e2e/Image.spec.tsx +139 -0
- package/src/renderer/__tests__/e2e/ImageEncoding.spec.tsx +255 -0
- package/src/renderer/__tests__/e2e/ImageFilters.spec.tsx +230 -0
- package/src/renderer/__tests__/e2e/Mask.spec.tsx +85 -0
- package/src/renderer/__tests__/e2e/Matrix4.spec.tsx +275 -0
- package/src/renderer/__tests__/e2e/NativeBuffer.spec.tsx +156 -0
- package/src/renderer/__tests__/e2e/Offscreen.spec.tsx +109 -0
- package/src/renderer/__tests__/e2e/Opacity.spec.tsx +278 -0
- package/src/renderer/__tests__/e2e/Paint.spec.tsx +170 -0
- package/src/renderer/__tests__/e2e/ParagraphPaint.spec.tsx +262 -0
- package/src/renderer/__tests__/e2e/Paragraphs.spec.tsx +615 -0
- package/src/renderer/__tests__/e2e/PathEffects.spec.tsx +73 -0
- package/src/renderer/__tests__/e2e/Paths.spec.tsx +390 -0
- package/src/renderer/__tests__/e2e/Picture.spec.tsx +134 -0
- package/src/renderer/__tests__/e2e/Point.spec.tsx +35 -0
- package/src/renderer/__tests__/e2e/Rect.spec.tsx +139 -0
- package/src/renderer/__tests__/e2e/RuntimeShader.spec.tsx +324 -0
- package/src/renderer/__tests__/e2e/SDF.spec.tsx +148 -0
- package/src/renderer/__tests__/e2e/SVG.spec.tsx +191 -0
- package/src/renderer/__tests__/e2e/Shader.spec.tsx +260 -0
- package/src/renderer/__tests__/e2e/Snapshot.spec.tsx +29 -0
- package/src/renderer/__tests__/e2e/Surfaces.spec.tsx +17 -0
- package/src/renderer/__tests__/e2e/Text.spec.tsx +109 -0
- package/src/renderer/__tests__/e2e/TextPath.spec.tsx +45 -0
- package/src/renderer/__tests__/e2e/Transforms.spec.tsx +63 -0
- package/src/renderer/__tests__/e2e/Vertices.spec.tsx +30 -0
- package/src/renderer/__tests__/e2e/Video.ts +69 -0
- package/src/renderer/__tests__/e2e/setup/Paragraph.ts +56 -0
- package/src/renderer/__tests__/e2e/setup/SVG.ts +27 -0
- package/src/renderer/__tests__/e2e/setup/SkiaObject.ts +31 -0
- package/src/renderer/__tests__/e2e/setup/index.ts +3 -0
- package/src/renderer/__tests__/examples/BlendModes.spec.tsx +123 -0
- package/src/renderer/__tests__/setup.tsx +489 -0
- package/src/skia/__tests__/ColorFilter.spec.ts +67 -0
- package/src/skia/__tests__/Data.spec.ts +29 -0
- package/src/skia/__tests__/Drawings.spec.ts +119 -0
- package/src/skia/__tests__/Enums.spec.ts +114 -0
- package/src/skia/__tests__/Geometry.spec.ts +39 -0
- package/src/skia/__tests__/ImageFilter.spec.ts +19 -0
- package/src/skia/__tests__/Mock.spec.ts +7 -0
- package/src/skia/__tests__/Paint.spec.ts +25 -0
- package/src/skia/__tests__/Path.spec.ts +386 -0
- package/src/skia/__tests__/RuntimeEffect.spec.ts +66 -0
- package/src/skia/__tests__/Shader.spec.ts +96 -0
- package/src/skia/__tests__/Text.spec.ts +32 -0
- package/src/skia/__tests__/Transform.spec.ts +89 -0
- package/src/skia/__tests__/Vertices.spec.ts +40 -0
- package/src/skia/__tests__/assets/DIN-Medium.ttf +0 -0
- package/src/skia/__tests__/assets/NotoColorEmoji.ttf +0 -0
- package/src/skia/__tests__/assets/NotoSansSC-Regular.otf +0 -0
- package/src/skia/__tests__/assets/Pacifico-Regular.ttf +0 -0
- package/src/skia/__tests__/assets/Roboto-BlackItalic.ttf +0 -0
- package/src/skia/__tests__/assets/Roboto-Bold.ttf +0 -0
- package/src/skia/__tests__/assets/Roboto-Italic.ttf +0 -0
- package/src/skia/__tests__/assets/Roboto-Medium.ttf +0 -0
- package/src/skia/__tests__/assets/Roboto-Regular.ttf +0 -0
- package/src/skia/__tests__/assets/UberMove-Medium_mono.ttf +0 -0
- package/src/skia/__tests__/assets/bird.gif +0 -0
- package/src/skia/__tests__/assets/box.png +0 -0
- package/src/skia/__tests__/assets/box2.png +0 -0
- package/src/skia/__tests__/assets/card.png +0 -0
- package/src/skia/__tests__/assets/mask.png +0 -0
- package/src/skia/__tests__/assets/oslo.jpg +0 -0
- package/src/skia/__tests__/assets/product.png +0 -0
- package/src/skia/__tests__/assets/skia_logo.png +0 -0
- package/src/skia/__tests__/assets/skia_logo_jpeg.jpg +0 -0
- package/src/skia/__tests__/assets/tiger.svg +724 -0
- package/src/skia/__tests__/assets/zurich.jpg +0 -0
- package/src/skia/__tests__/setup.ts +77 -0
@@ -0,0 +1,390 @@
|
|
1
|
+
import React from "react";
|
2
|
+
|
3
|
+
import { surface, importSkia } from "../setup";
|
4
|
+
import { Fill, Group, Path, Rect } from "../../components";
|
5
|
+
import { checkImage, docPath } from "../../../__tests__/setup";
|
6
|
+
import type { Skia } from "../../../skia/types";
|
7
|
+
import { PaintStyle } from "../../../skia/types";
|
8
|
+
|
9
|
+
const star = (Skia: Skia) => {
|
10
|
+
const R = 115.2;
|
11
|
+
const C = 128.0;
|
12
|
+
const path = Skia.Path.Make();
|
13
|
+
path.moveTo(C + R, C);
|
14
|
+
for (let i = 1; i < 8; ++i) {
|
15
|
+
const a = 2.6927937 * i;
|
16
|
+
path.lineTo(C + R * Math.cos(a), C + R * Math.sin(a));
|
17
|
+
}
|
18
|
+
return path;
|
19
|
+
};
|
20
|
+
|
21
|
+
describe("Paths", () => {
|
22
|
+
it("can transform a path from a matrix array (1)", async () => {
|
23
|
+
const result = await surface.eval((Skia) => {
|
24
|
+
const path = Skia.Path.Make();
|
25
|
+
path.lineTo(30, 30);
|
26
|
+
path.transform([1, 0, 0, 0, 1, 0, 0, 0, 1]);
|
27
|
+
const cmds = path.toCmds();
|
28
|
+
return cmds;
|
29
|
+
});
|
30
|
+
expect(result).toEqual([
|
31
|
+
[0, 0, 0],
|
32
|
+
[1, 30, 30],
|
33
|
+
]);
|
34
|
+
});
|
35
|
+
it("can transform a path from a matrix array (2)", async () => {
|
36
|
+
const result = await surface.eval((Skia) => {
|
37
|
+
const path = Skia.Path.Make();
|
38
|
+
path.lineTo(30, 30);
|
39
|
+
path.transform([2, 0, 0, 0, 2, 0, 0, 0, 1]);
|
40
|
+
const cmds = path.toCmds();
|
41
|
+
return cmds;
|
42
|
+
});
|
43
|
+
expect(result).toEqual([
|
44
|
+
[0, 0, 0],
|
45
|
+
[1, 60, 60],
|
46
|
+
]);
|
47
|
+
});
|
48
|
+
it("generate commands properly", async () => {
|
49
|
+
const result = await surface.eval((Skia) => {
|
50
|
+
const path = Skia.Path.Make();
|
51
|
+
path.lineTo(30, 30);
|
52
|
+
const cmds = path.toCmds();
|
53
|
+
return cmds;
|
54
|
+
});
|
55
|
+
expect(result).toEqual([
|
56
|
+
[0, 0, 0],
|
57
|
+
[1, 30, 30],
|
58
|
+
]);
|
59
|
+
});
|
60
|
+
it("closePath shouldn't crash", async () => {
|
61
|
+
const result = await surface.eval((Skia) => {
|
62
|
+
const path = Skia.Path.Make();
|
63
|
+
path.moveTo(0, 0).lineTo(1, 0).lineTo(1, 1);
|
64
|
+
path.close();
|
65
|
+
const cmds = path.toCmds();
|
66
|
+
return cmds;
|
67
|
+
});
|
68
|
+
expect(result).toEqual([[0, 0, 0], [1, 1, 0], [1, 1, 1], [5]]);
|
69
|
+
});
|
70
|
+
it("toCmd should work properly", async () => {
|
71
|
+
const result = await surface.eval((Skia) => {
|
72
|
+
const path = Skia.Path.MakeFromSVGString(
|
73
|
+
// eslint-disable-next-line max-len
|
74
|
+
"M512.213 204.005C500.312 185.697 406.758 105.581 332.94 105.581C259.122 105.581 219.088 132 204.638 149.85C157.952 207.52 141.933 264.275 156.579 320.115C175.803 387.854 228.896 449.644 315.859 505.483C415.638 562.238 479.716 626.774 508.093 699.091C518.163 731.13 519.536 762.711 512.213 793.835C504.889 824.959 490.243 853.336 468.273 878.967C449.965 903.683 425.707 921.534 395.499 932.518C365.291 942.588 328.675 950.369 285.651 955.861C182.21 964.1 97.9935 948.538 33 909.176M595.972 733.419C710.397 564.985 795.529 424.47 851.369 311.876C865.1 279.837 875.169 255.579 881.577 239.102C887.985 221.709 894.393 198.824 900.801 170.447C907.208 142.069 909.497 115.98 907.666 92.1797C904.92 68.3793 893.02 51.9021 871.965 40.0019C850.911 28.1016 835.5 31.3101 811.549 44.1212C772.187 65.1754 745.64 101.334 731.909 152.596C723.67 174.566 715.432 200.197 707.193 229.49C699.87 258.783 694.378 281.21 690.716 296.772C687.97 312.334 682.935 340.711 675.612 381.904C668.289 422.182 663.712 445.982 661.881 453.306C643.573 567.731 621.603 733.876 595.972 951.742C624.349 852.878 656.846 774.154 693.462 715.568C706.278 689.937 717.263 669.798 726.417 655.152C735.571 640.505 748.844 624.486 766.237 607.093C784.545 589.701 803.768 576.885 823.907 568.646C892.562 543.015 941.994 545.304 972.202 575.512C990.51 594.735 999.664 618.078 999.664 645.54C1000.58 673.002 990.052 694.514 968.083 710.076C925.059 733.876 859.608 741.657 771.729 733.419C786.375 737.996 797.36 742.115 804.683 745.776C812.922 748.523 822.992 753.1 834.892 759.508C847.707 765.915 857.319 773.696 863.727 782.85C871.05 792.004 875.627 802.531 877.458 814.432C878.373 819.009 879.746 827.705 881.577 840.521C884.323 853.336 886.612 862.948 888.443 869.356C890.273 875.763 892.562 884.002 895.308 894.072C898.97 904.141 903.089 912.837 907.666 920.16C913.159 926.568 919.566 932.976 926.89 939.384C949.775 961.354 987.764 958.607 1040.86 931.145C1056.42 923.822 1070.61 914.668 1083.42 903.683C1097.15 892.698 1109.97 879.425 1121.87 863.863C1134.69 847.386 1144.76 834.113 1152.08 824.043C1159.4 813.058 1169.47 797.039 1182.29 775.985C1195.1 754.931 1204.26 740.742 1209.75 733.419C1239.04 674.833 1268.33 616.247 1297.63 557.661C1252.77 670.256 1223.94 756.304 1211.12 815.805C1205.63 833.197 1203.34 853.336 1204.26 876.221C1205.17 899.106 1212.04 917.414 1224.85 931.145C1234.01 942.13 1245.45 949.453 1259.18 953.115C1273.83 956.777 1287.56 956.319 1300.37 951.742C1356.21 935.265 1401.53 903.226 1436.31 855.625C1456.45 828.163 1483.45 787.427 1517.32 733.419M1360.79 390.143C1347.97 390.143 1340.19 384.193 1337.45 372.293C1335.62 359.477 1336.99 348.492 1341.57 339.338C1345.24 332 1357.13 333.846 1369.03 333.846C1380.93 333.846 1390.5 340.5 1391 348.95M1925.13 697.718C1902.25 633.64 1874.33 593.82 1841.38 578.258C1810.25 559.95 1775.47 551.254 1737.02 552.169C1698.57 552.169 1664.25 562.238 1634.04 582.377C1605.66 598.855 1581.4 620.824 1561.26 648.286C1541.12 674.833 1527.39 704.126 1520.07 736.165C1513.66 767.288 1514.58 798.87 1522.82 830.909C1531.97 862.032 1547.53 888.579 1569.5 910.549C1604.29 939.842 1646.4 954.488 1695.83 954.488C1745.26 954.488 1787.82 939.842 1823.53 910.549C1838.17 895.902 1848.7 885.375 1855.11 878.967C1861.51 872.56 1868.84 863.406 1877.08 851.505C1886.23 839.605 1893.55 827.247 1899.05 814.432M1958.09 556.288C1933.37 657.898 1916.9 746.234 1908.66 821.297C1900.42 878.967 1911.4 918.787 1941.61 940.757C1964.5 959.065 2000.2 956.319 2048.71 932.518C2090.82 912.38 2131.1 873.017 2169.55 814.432"
|
75
|
+
)!;
|
76
|
+
const cmds = path.toCmds();
|
77
|
+
return cmds;
|
78
|
+
});
|
79
|
+
const { Skia } = importSkia();
|
80
|
+
const ref = Skia.Path.MakeFromSVGString(
|
81
|
+
// eslint-disable-next-line max-len
|
82
|
+
"M512.213 204.005C500.312 185.697 406.758 105.581 332.94 105.581C259.122 105.581 219.088 132 204.638 149.85C157.952 207.52 141.933 264.275 156.579 320.115C175.803 387.854 228.896 449.644 315.859 505.483C415.638 562.238 479.716 626.774 508.093 699.091C518.163 731.13 519.536 762.711 512.213 793.835C504.889 824.959 490.243 853.336 468.273 878.967C449.965 903.683 425.707 921.534 395.499 932.518C365.291 942.588 328.675 950.369 285.651 955.861C182.21 964.1 97.9935 948.538 33 909.176M595.972 733.419C710.397 564.985 795.529 424.47 851.369 311.876C865.1 279.837 875.169 255.579 881.577 239.102C887.985 221.709 894.393 198.824 900.801 170.447C907.208 142.069 909.497 115.98 907.666 92.1797C904.92 68.3793 893.02 51.9021 871.965 40.0019C850.911 28.1016 835.5 31.3101 811.549 44.1212C772.187 65.1754 745.64 101.334 731.909 152.596C723.67 174.566 715.432 200.197 707.193 229.49C699.87 258.783 694.378 281.21 690.716 296.772C687.97 312.334 682.935 340.711 675.612 381.904C668.289 422.182 663.712 445.982 661.881 453.306C643.573 567.731 621.603 733.876 595.972 951.742C624.349 852.878 656.846 774.154 693.462 715.568C706.278 689.937 717.263 669.798 726.417 655.152C735.571 640.505 748.844 624.486 766.237 607.093C784.545 589.701 803.768 576.885 823.907 568.646C892.562 543.015 941.994 545.304 972.202 575.512C990.51 594.735 999.664 618.078 999.664 645.54C1000.58 673.002 990.052 694.514 968.083 710.076C925.059 733.876 859.608 741.657 771.729 733.419C786.375 737.996 797.36 742.115 804.683 745.776C812.922 748.523 822.992 753.1 834.892 759.508C847.707 765.915 857.319 773.696 863.727 782.85C871.05 792.004 875.627 802.531 877.458 814.432C878.373 819.009 879.746 827.705 881.577 840.521C884.323 853.336 886.612 862.948 888.443 869.356C890.273 875.763 892.562 884.002 895.308 894.072C898.97 904.141 903.089 912.837 907.666 920.16C913.159 926.568 919.566 932.976 926.89 939.384C949.775 961.354 987.764 958.607 1040.86 931.145C1056.42 923.822 1070.61 914.668 1083.42 903.683C1097.15 892.698 1109.97 879.425 1121.87 863.863C1134.69 847.386 1144.76 834.113 1152.08 824.043C1159.4 813.058 1169.47 797.039 1182.29 775.985C1195.1 754.931 1204.26 740.742 1209.75 733.419C1239.04 674.833 1268.33 616.247 1297.63 557.661C1252.77 670.256 1223.94 756.304 1211.12 815.805C1205.63 833.197 1203.34 853.336 1204.26 876.221C1205.17 899.106 1212.04 917.414 1224.85 931.145C1234.01 942.13 1245.45 949.453 1259.18 953.115C1273.83 956.777 1287.56 956.319 1300.37 951.742C1356.21 935.265 1401.53 903.226 1436.31 855.625C1456.45 828.163 1483.45 787.427 1517.32 733.419M1360.79 390.143C1347.97 390.143 1340.19 384.193 1337.45 372.293C1335.62 359.477 1336.99 348.492 1341.57 339.338C1345.24 332 1357.13 333.846 1369.03 333.846C1380.93 333.846 1390.5 340.5 1391 348.95M1925.13 697.718C1902.25 633.64 1874.33 593.82 1841.38 578.258C1810.25 559.95 1775.47 551.254 1737.02 552.169C1698.57 552.169 1664.25 562.238 1634.04 582.377C1605.66 598.855 1581.4 620.824 1561.26 648.286C1541.12 674.833 1527.39 704.126 1520.07 736.165C1513.66 767.288 1514.58 798.87 1522.82 830.909C1531.97 862.032 1547.53 888.579 1569.5 910.549C1604.29 939.842 1646.4 954.488 1695.83 954.488C1745.26 954.488 1787.82 939.842 1823.53 910.549C1838.17 895.902 1848.7 885.375 1855.11 878.967C1861.51 872.56 1868.84 863.406 1877.08 851.505C1886.23 839.605 1893.55 827.247 1899.05 814.432M1958.09 556.288C1933.37 657.898 1916.9 746.234 1908.66 821.297C1900.42 878.967 1911.4 918.787 1941.61 940.757C1964.5 959.065 2000.2 956.319 2048.71 932.518C2090.82 912.38 2131.1 873.017 2169.55 814.432"
|
83
|
+
)!;
|
84
|
+
expect(result).toEqual(ref.toCmds());
|
85
|
+
});
|
86
|
+
it("should accept [0, 1] as trim value", async () => {
|
87
|
+
const result = await surface.eval((Skia) => {
|
88
|
+
const path = Skia.Path.Make();
|
89
|
+
path.moveTo(20, 20);
|
90
|
+
path.lineTo(20, 40);
|
91
|
+
path.lineTo(40, 20);
|
92
|
+
path.trim(0, 1, false);
|
93
|
+
return path.toSVGString();
|
94
|
+
});
|
95
|
+
expect(result).toEqual("M20 20L20 40L40 20");
|
96
|
+
});
|
97
|
+
it("should accept [0.0001, 1.00001] as trim value", async () => {
|
98
|
+
const result = await surface.eval((Skia) => {
|
99
|
+
const path = Skia.Path.Make();
|
100
|
+
path.moveTo(20, 20);
|
101
|
+
path.lineTo(20, 40);
|
102
|
+
path.lineTo(40, 20);
|
103
|
+
path.trim(0.0001, 1.00001, false);
|
104
|
+
return path.toSVGString();
|
105
|
+
});
|
106
|
+
expect(result).toEqual("M20 20.0048L20 40L40 20");
|
107
|
+
});
|
108
|
+
it("should accept [0, 1.2] as trim value", async () => {
|
109
|
+
const result = await surface.eval((Skia) => {
|
110
|
+
const path = Skia.Path.Make();
|
111
|
+
path.moveTo(20, 20);
|
112
|
+
path.lineTo(20, 40);
|
113
|
+
path.lineTo(40, 20);
|
114
|
+
path.trim(0, 1.2, false);
|
115
|
+
return path.toSVGString();
|
116
|
+
});
|
117
|
+
expect(result).toEqual("M20 20L20 40L40 20");
|
118
|
+
});
|
119
|
+
it("interpolation values can overshoot", async () => {
|
120
|
+
const result = await surface.eval((Skia) => {
|
121
|
+
const path2 = Skia.Path.Make();
|
122
|
+
path2.moveTo(0, 0);
|
123
|
+
path2.lineTo(20, 20);
|
124
|
+
path2.lineTo(20, 40);
|
125
|
+
const path = Skia.Path.Make();
|
126
|
+
path.moveTo(20, 20);
|
127
|
+
path.lineTo(20, 40);
|
128
|
+
path.lineTo(40, 20);
|
129
|
+
path.trim(0, 1, false);
|
130
|
+
return [
|
131
|
+
path.interpolate(path2, -1)!.toSVGString(),
|
132
|
+
path.interpolate(path2, 0)!.toSVGString(),
|
133
|
+
path.interpolate(path2, 0.0001)!.toSVGString(),
|
134
|
+
path.interpolate(path2, 1)!.toSVGString(),
|
135
|
+
path.interpolate(path2, 1.0001)!.toSVGString(),
|
136
|
+
path.interpolate(path2, 1.2)!.toSVGString(),
|
137
|
+
path.interpolate(path2, 2)!.toSVGString(),
|
138
|
+
];
|
139
|
+
});
|
140
|
+
expect(result).toEqual([
|
141
|
+
"M-20 -20L20 0L0 60",
|
142
|
+
"M0 0L20 20L20 40",
|
143
|
+
"M0.002 0.002L20 20.002L20.002 39.998",
|
144
|
+
"M20 20L20 40L40 20",
|
145
|
+
"M20.002 20.002L20 40.002L40.002 19.998",
|
146
|
+
"M24 24L20 44L44 16",
|
147
|
+
"M40 40L20 60L60 0",
|
148
|
+
]);
|
149
|
+
});
|
150
|
+
it("should add a path", async () => {
|
151
|
+
const result = await surface.eval((Skia) => {
|
152
|
+
const path = Skia.Path.Make();
|
153
|
+
const path2 = Skia.Path.Make();
|
154
|
+
path.moveTo(20, 20);
|
155
|
+
path.lineTo(20, 40);
|
156
|
+
path.lineTo(40, 20);
|
157
|
+
path2.moveTo(60, 60);
|
158
|
+
path2.lineTo(80, 60);
|
159
|
+
path2.lineTo(80, 40);
|
160
|
+
const results: string[] = [];
|
161
|
+
for (let j = 0; j < 2; j++) {
|
162
|
+
const p = path.copy().addPath(path2, undefined, j === 1);
|
163
|
+
results.push(p.toSVGString());
|
164
|
+
}
|
165
|
+
return results;
|
166
|
+
});
|
167
|
+
expect(result).toEqual([
|
168
|
+
"M20 20L20 40L40 20M60 60L80 60L80 40",
|
169
|
+
"M20 20L20 40L40 20L60 60L80 60L80 40",
|
170
|
+
]);
|
171
|
+
});
|
172
|
+
it("should draw a pattern properly", async () => {
|
173
|
+
const { Skia } = importSkia();
|
174
|
+
|
175
|
+
const center = { x: 492 / 2, y: 757 / 2 };
|
176
|
+
const scale = 0.325;
|
177
|
+
const strokeWidth = 10;
|
178
|
+
|
179
|
+
const c1 = "#204E71";
|
180
|
+
const c2 = "#4A759B";
|
181
|
+
|
182
|
+
const whitePaint = Skia.Paint();
|
183
|
+
whitePaint.setAntiAlias(true);
|
184
|
+
whitePaint.setColor(Skia.Color("white"));
|
185
|
+
|
186
|
+
const strokePaint = Skia.Paint();
|
187
|
+
whitePaint.setAntiAlias(true);
|
188
|
+
strokePaint.setStyle(PaintStyle.Stroke);
|
189
|
+
strokePaint.setStrokeWidth(strokeWidth);
|
190
|
+
|
191
|
+
const borders = Skia.Path.MakeFromSVGString(
|
192
|
+
// eslint-disable-next-line max-len
|
193
|
+
"M447.955 756.37H44.699C20.5664 756.37 0.820374 736.624 0.820374 712.492V44.8242C0.820374 20.6898 20.5664 0.945557 44.699 0.945557H447.955C472.088 0.945557 491.834 20.6898 491.834 44.8242V712.492C491.834 736.624 472.088 756.37 447.955 756.37Z"
|
194
|
+
)!;
|
195
|
+
|
196
|
+
const bg =
|
197
|
+
// eslint-disable-next-line max-len
|
198
|
+
"M423.554 40.0679H69.3443C51.3334 40.0679 36.6796 54.7199 36.6796 72.7307V685.881C36.6796 703.892 51.3334 718.546 69.3443 718.546H423.554C441.565 718.546 456.219 703.892 456.219 685.881V72.7307C456.219 54.7199 441.565 40.0679 423.554 40.0679Z";
|
199
|
+
const Circles = () => {
|
200
|
+
const c = 12;
|
201
|
+
const delta = 100 / c;
|
202
|
+
return (
|
203
|
+
<>
|
204
|
+
{new Array(c).fill(0).map((_, i) => {
|
205
|
+
const r2 = i * delta;
|
206
|
+
const path = Skia.Path.Make();
|
207
|
+
path.addCircle(0, 0, r2);
|
208
|
+
return (
|
209
|
+
<Path
|
210
|
+
key={i}
|
211
|
+
path={path}
|
212
|
+
style="stroke"
|
213
|
+
strokeWidth={strokeWidth}
|
214
|
+
color={i % 2 === 0 ? c1 : c2}
|
215
|
+
/>
|
216
|
+
);
|
217
|
+
})}
|
218
|
+
</>
|
219
|
+
);
|
220
|
+
};
|
221
|
+
|
222
|
+
const img = await surface.draw(
|
223
|
+
<Group transform={[{ scale }]}>
|
224
|
+
<Path path={borders} color="white" />
|
225
|
+
<Path path={bg} color={c1} />
|
226
|
+
{new Array(4).fill(0).map((_, i) => {
|
227
|
+
const delta = i * strokeWidth;
|
228
|
+
const rect = {
|
229
|
+
x: -delta,
|
230
|
+
y: -delta,
|
231
|
+
width: center.x * 2 + delta * 2,
|
232
|
+
height: center.y * 2 + delta * 2,
|
233
|
+
};
|
234
|
+
const path = Skia.Path.Make();
|
235
|
+
path.addArc(rect, 0, 360).close();
|
236
|
+
return (
|
237
|
+
<Group key={i} origin={center} transform={[{ scale: 0.6 }]}>
|
238
|
+
<Rect
|
239
|
+
x={rect.x}
|
240
|
+
y={rect.y}
|
241
|
+
width={rect.width}
|
242
|
+
height={rect.height}
|
243
|
+
color={i % 2 === 0 ? c1 : c2}
|
244
|
+
style="stroke"
|
245
|
+
strokeWidth={strokeWidth}
|
246
|
+
/>
|
247
|
+
<Path
|
248
|
+
path={path}
|
249
|
+
color={i % 2 === 0 ? c1 : c2}
|
250
|
+
style="stroke"
|
251
|
+
strokeWidth={strokeWidth}
|
252
|
+
/>
|
253
|
+
</Group>
|
254
|
+
);
|
255
|
+
})}
|
256
|
+
<Group transform={[{ translate: [center.x, center.y] }]}>
|
257
|
+
<Group transform={[{ translateY: -200 }]}>
|
258
|
+
<Circles />
|
259
|
+
</Group>
|
260
|
+
<Group transform={[{ translateY: 200 }]}>
|
261
|
+
<Circles />
|
262
|
+
</Group>
|
263
|
+
<Group transform={[{ translateX: -100 }]}>
|
264
|
+
<Circles />
|
265
|
+
</Group>
|
266
|
+
<Group transform={[{ translateX: 100 }]}>
|
267
|
+
<Circles />
|
268
|
+
</Group>
|
269
|
+
</Group>
|
270
|
+
</Group>
|
271
|
+
);
|
272
|
+
checkImage(img, "snapshots/paths/pattern.png");
|
273
|
+
});
|
274
|
+
it("typename should be correct", async () => {
|
275
|
+
const typename = await surface.eval((Skia) => {
|
276
|
+
const path = Skia.Path.Make();
|
277
|
+
return path.__typename__;
|
278
|
+
});
|
279
|
+
return expect(typename).toBe("Path");
|
280
|
+
});
|
281
|
+
it("should be possible to call dispose on a path", async () => {
|
282
|
+
await surface.eval((Skia) => {
|
283
|
+
const path = Skia.Path.Make();
|
284
|
+
path.moveTo(20, 20).lineTo(20, 40).lineTo(40, 20);
|
285
|
+
path.dispose();
|
286
|
+
return path;
|
287
|
+
});
|
288
|
+
});
|
289
|
+
it("Path with default fillType", async () => {
|
290
|
+
const { Skia } = importSkia();
|
291
|
+
const path = star(Skia);
|
292
|
+
const img = await surface.draw(
|
293
|
+
<>
|
294
|
+
<Fill color="white" />
|
295
|
+
<Path path={path} style="stroke" strokeWidth={4} color="#3EB489" />
|
296
|
+
<Path path={path} color="lightblue" />
|
297
|
+
</>
|
298
|
+
);
|
299
|
+
checkImage(img, docPath("paths/default-filltype.png"));
|
300
|
+
});
|
301
|
+
it("Path with even odd fillType", async () => {
|
302
|
+
const { Skia } = importSkia();
|
303
|
+
const path = star(Skia);
|
304
|
+
const img = await surface.draw(
|
305
|
+
<>
|
306
|
+
<Fill color="white" />
|
307
|
+
<Path path={path} style="stroke" strokeWidth={4} color="#3EB489" />
|
308
|
+
<Path path={path} color="lightblue" fillType="evenOdd" />
|
309
|
+
</>
|
310
|
+
);
|
311
|
+
checkImage(img, docPath("paths/evenodd-filltype.png"));
|
312
|
+
});
|
313
|
+
it("Should interpolate paths", async () => {
|
314
|
+
// https://fiddle.skia.org/c/@Path_isInterpolatable
|
315
|
+
const { Skia } = importSkia();
|
316
|
+
const path = Skia.Path.Make();
|
317
|
+
const path2 = Skia.Path.Make();
|
318
|
+
path.moveTo(20, 20);
|
319
|
+
path.lineTo(40, 40);
|
320
|
+
path.lineTo(20, 20);
|
321
|
+
path.lineTo(40, 40);
|
322
|
+
path.close();
|
323
|
+
path2.addRect(Skia.XYWHRect(20, 20, 20, 20));
|
324
|
+
expect(path.isInterpolatable(path2)).toBe(true);
|
325
|
+
const result = path2.interpolate(path, 0.5)!;
|
326
|
+
expect(result).toBeDefined();
|
327
|
+
const img = await surface.draw(
|
328
|
+
<Path path={result} style="stroke" strokeWidth={3} />
|
329
|
+
);
|
330
|
+
checkImage(img, "snapshots/paths/interpolation1.png");
|
331
|
+
});
|
332
|
+
it("Should interpolate paths with a pre-allocated Path (1)", async () => {
|
333
|
+
// https://fiddle.skia.org/c/@Path_isInterpolatable
|
334
|
+
const { Skia } = importSkia();
|
335
|
+
const path = Skia.Path.Make();
|
336
|
+
const path2 = Skia.Path.Make();
|
337
|
+
path.moveTo(20, 20);
|
338
|
+
path.lineTo(40, 40);
|
339
|
+
path.lineTo(20, 20);
|
340
|
+
path.lineTo(40, 40);
|
341
|
+
path.close();
|
342
|
+
path2.addRect(Skia.XYWHRect(20, 20, 20, 20));
|
343
|
+
expect(path.isInterpolatable(path2)).toBe(true);
|
344
|
+
const result = Skia.Path.Make();
|
345
|
+
const result2 = path.interpolate(path2, 0.5, result);
|
346
|
+
expect(result).toBeDefined();
|
347
|
+
expect(result2).toBe(result);
|
348
|
+
const img = await surface.draw(
|
349
|
+
<Path path={result} style="stroke" strokeWidth={3} />
|
350
|
+
);
|
351
|
+
checkImage(img, "snapshots/paths/interpolation1.png");
|
352
|
+
});
|
353
|
+
it("Should interpolate paths with a pre-allocated Path (2)", async () => {
|
354
|
+
const result = await surface.eval((Skia) => {
|
355
|
+
const path = Skia.Path.Make();
|
356
|
+
const path2 = Skia.Path.Make();
|
357
|
+
path.moveTo(20, 20);
|
358
|
+
path.lineTo(40, 40);
|
359
|
+
path.lineTo(20, 20);
|
360
|
+
path.lineTo(40, 40);
|
361
|
+
path.close();
|
362
|
+
path2.addRect(Skia.XYWHRect(20, 20, 20, 20));
|
363
|
+
const result3 = Skia.Path.Make();
|
364
|
+
const result4 = path.interpolate(path2, 0.5, result3);
|
365
|
+
return { identity: result3 === result4, result: result3.toSVGString() };
|
366
|
+
});
|
367
|
+
expect(result.identity).toBe(true);
|
368
|
+
expect(result.result).toEqual("M20 20L40 30L30 30L30 40L20 20Z");
|
369
|
+
});
|
370
|
+
it("Shouldn't interpolate paths with a pre-allocated Path", async () => {
|
371
|
+
// https://fiddle.skia.org/c/@Path_isInterpolatable
|
372
|
+
const { Skia } = importSkia();
|
373
|
+
const path = Skia.Path.Make();
|
374
|
+
const path2 = Skia.Path.Make();
|
375
|
+
path.moveTo(20, 20);
|
376
|
+
path.lineTo(40, 40);
|
377
|
+
path.lineTo(20, 20);
|
378
|
+
path.lineTo(40, 40);
|
379
|
+
path.lineTo(0, 0);
|
380
|
+
path.close();
|
381
|
+
path2.addRect(Skia.XYWHRect(20, 20, 20, 20));
|
382
|
+
const result = Skia.Path.Make();
|
383
|
+
const success = path.interpolate(path2, 0.5, result);
|
384
|
+
expect(success).toBe(null);
|
385
|
+
const img = await surface.draw(
|
386
|
+
<Path path={result} style="stroke" strokeWidth={3} />
|
387
|
+
);
|
388
|
+
checkImage(img, "snapshots/paths/emptyPath.png");
|
389
|
+
});
|
390
|
+
});
|
@@ -0,0 +1,134 @@
|
|
1
|
+
import React from "react";
|
2
|
+
|
3
|
+
import { importSkia, surface } from "../setup";
|
4
|
+
import { checkImage, docPath, itRunsNodeOnly } from "../../../__tests__/setup";
|
5
|
+
import { Blur, Group, Paint, Picture } from "../../components";
|
6
|
+
import { BlendMode } from "../../../skia/types";
|
7
|
+
|
8
|
+
describe("Pictures", () => {
|
9
|
+
it("Should draw a simple picture", async () => {
|
10
|
+
const image = await surface.drawOffscreen(
|
11
|
+
(Skia, canvas, { size }) => {
|
12
|
+
const recorder = Skia.PictureRecorder();
|
13
|
+
const canvas2 = recorder.beginRecording(
|
14
|
+
Skia.XYWHRect(0, 0, size, size)
|
15
|
+
);
|
16
|
+
canvas2.drawColor(Skia.Color("cyan"));
|
17
|
+
const picture = recorder.finishRecordingAsPicture();
|
18
|
+
canvas.drawPicture(picture);
|
19
|
+
},
|
20
|
+
{ size: surface.width }
|
21
|
+
);
|
22
|
+
checkImage(image, "snapshots/pictures/simple-picture.png");
|
23
|
+
});
|
24
|
+
itRunsNodeOnly("Should use createPicture", async () => {
|
25
|
+
const { createPicture, Skia } = importSkia();
|
26
|
+
const picture = createPicture((canvas) => {
|
27
|
+
const size = 256;
|
28
|
+
const r = 0.33 * size;
|
29
|
+
const paint = Skia.Paint();
|
30
|
+
paint.setBlendMode(BlendMode.Multiply);
|
31
|
+
|
32
|
+
paint.setColor(Skia.Color("cyan"));
|
33
|
+
canvas.drawCircle(r, r, r, paint);
|
34
|
+
|
35
|
+
paint.setColor(Skia.Color("magenta"));
|
36
|
+
canvas.drawCircle(size - r, r, r, paint);
|
37
|
+
|
38
|
+
paint.setColor(Skia.Color("yellow"));
|
39
|
+
canvas.drawCircle(size / 2, size - r, r, paint);
|
40
|
+
});
|
41
|
+
expect(picture).toBeDefined();
|
42
|
+
const image = await surface.drawOffscreen(
|
43
|
+
(_, canvas, ctx) => {
|
44
|
+
canvas.drawPicture(ctx.picture);
|
45
|
+
},
|
46
|
+
{ picture }
|
47
|
+
);
|
48
|
+
checkImage(image, "snapshots/pictures/create-picture.png");
|
49
|
+
});
|
50
|
+
it("Should draw the hello world example as picture", async () => {
|
51
|
+
const image = await surface.drawOffscreen(
|
52
|
+
(Skia, canvas, ctx) => {
|
53
|
+
const { size } = ctx;
|
54
|
+
const r = size * 0.33;
|
55
|
+
const recorder = Skia.PictureRecorder();
|
56
|
+
const canvas2 = recorder.beginRecording(
|
57
|
+
Skia.XYWHRect(0, 0, size, size)
|
58
|
+
);
|
59
|
+
const paint = Skia.Paint();
|
60
|
+
paint.setBlendMode(ctx.BlendMode);
|
61
|
+
paint.setColor(Skia.Color("cyan"));
|
62
|
+
canvas2.drawCircle(r, r, r, paint);
|
63
|
+
paint.setColor(Skia.Color("magenta"));
|
64
|
+
canvas2.drawCircle(size - r, r, r, paint);
|
65
|
+
paint.setColor(Skia.Color("yellow"));
|
66
|
+
canvas2.drawCircle(size / 2, size - r, r, paint);
|
67
|
+
const picture = recorder.finishRecordingAsPicture();
|
68
|
+
canvas.drawPicture(picture);
|
69
|
+
},
|
70
|
+
{ BlendMode: BlendMode.Multiply, size: surface.width }
|
71
|
+
);
|
72
|
+
checkImage(image, "snapshots/pictures/hello-world.png");
|
73
|
+
});
|
74
|
+
it("Simple picture example", async () => {
|
75
|
+
const img = await surface.drawOffscreen(
|
76
|
+
(Skia, canvas, ctx) => {
|
77
|
+
const { size } = ctx;
|
78
|
+
const r = 0.33 * size;
|
79
|
+
const recorder = Skia.PictureRecorder();
|
80
|
+
const canvas2 = recorder.beginRecording(
|
81
|
+
Skia.XYWHRect(0, 0, size, size)
|
82
|
+
);
|
83
|
+
const paint = Skia.Paint();
|
84
|
+
paint.setBlendMode(ctx.BlendMode);
|
85
|
+
|
86
|
+
paint.setColor(Skia.Color("cyan"));
|
87
|
+
canvas2.drawCircle(r, r, r, paint);
|
88
|
+
|
89
|
+
paint.setColor(Skia.Color("magenta"));
|
90
|
+
canvas2.drawCircle(size - r, r, r, paint);
|
91
|
+
|
92
|
+
paint.setColor(Skia.Color("yellow"));
|
93
|
+
canvas2.drawCircle(size / 2, size - r, r, paint);
|
94
|
+
const picture = recorder.finishRecordingAsPicture();
|
95
|
+
canvas.drawPicture(picture);
|
96
|
+
},
|
97
|
+
{ BlendMode: BlendMode.Multiply, size: surface.width }
|
98
|
+
);
|
99
|
+
checkImage(img, docPath("simple-picture.png"));
|
100
|
+
});
|
101
|
+
itRunsNodeOnly("Blur Picture", async () => {
|
102
|
+
const { Skia, createPicture } = importSkia();
|
103
|
+
const picture = createPicture((canvas) => {
|
104
|
+
const size = 256;
|
105
|
+
const r = 0.33 * size;
|
106
|
+
const paint = Skia.Paint();
|
107
|
+
paint.setBlendMode(BlendMode.Multiply);
|
108
|
+
|
109
|
+
paint.setColor(Skia.Color("cyan"));
|
110
|
+
canvas.drawCircle(r, r, r, paint);
|
111
|
+
|
112
|
+
paint.setColor(Skia.Color("magenta"));
|
113
|
+
canvas.drawCircle(size - r, r, r, paint);
|
114
|
+
|
115
|
+
paint.setColor(Skia.Color("yellow"));
|
116
|
+
canvas.drawCircle(size / 2, size - r, r, paint);
|
117
|
+
});
|
118
|
+
|
119
|
+
const img = await surface.draw(
|
120
|
+
<>
|
121
|
+
<Group
|
122
|
+
layer={
|
123
|
+
<Paint>
|
124
|
+
<Blur blur={10} />
|
125
|
+
</Paint>
|
126
|
+
}
|
127
|
+
>
|
128
|
+
<Picture picture={picture} />
|
129
|
+
</Group>
|
130
|
+
</>
|
131
|
+
);
|
132
|
+
checkImage(img, docPath("blurred-picture.png"));
|
133
|
+
});
|
134
|
+
});
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import React from "react";
|
2
|
+
|
3
|
+
import { checkImage } from "../../../__tests__/setup";
|
4
|
+
import { Fill, Points } from "../../components";
|
5
|
+
import { surface, importSkia } from "../setup";
|
6
|
+
|
7
|
+
describe("Points", () => {
|
8
|
+
it("should draw a point without throwing an error", async () => {
|
9
|
+
const { vec } = importSkia();
|
10
|
+
const img = await surface.draw(
|
11
|
+
<>
|
12
|
+
<Fill color="#add8e6" />
|
13
|
+
<Points
|
14
|
+
points={[vec(-1, -1), { x: 0, y: 0 }, vec(1, 1)]}
|
15
|
+
style="stroke"
|
16
|
+
strokeWidth={4}
|
17
|
+
/>
|
18
|
+
</>
|
19
|
+
);
|
20
|
+
checkImage(img, "snapshots/points/points.png");
|
21
|
+
});
|
22
|
+
it("should draw points with fill", async () => {
|
23
|
+
const { vec } = importSkia();
|
24
|
+
const img = await surface.draw(
|
25
|
+
<>
|
26
|
+
<Fill color="#add8e6" />
|
27
|
+
<Points
|
28
|
+
points={[{ x: 0, y: 0 }, vec(100, 100), vec(100, 200)]}
|
29
|
+
strokeWidth={4}
|
30
|
+
/>
|
31
|
+
</>
|
32
|
+
);
|
33
|
+
checkImage(img, "snapshots/points/points2.png");
|
34
|
+
});
|
35
|
+
});
|