@shopify/react-native-skia 2.2.21 → 2.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/CMakeLists.txt +0 -3
- package/android/cpp/rnskia-android/RNSkAndroidPlatformContext.h +4 -1
- package/apple/RNSkApplePlatformContext.mm +21 -12
- package/cpp/api/JsiSkCanvas.h +3 -21
- package/cpp/api/JsiSkImage.h +8 -2
- package/cpp/api/JsiSkPath.h +1 -1
- package/cpp/api/JsiSkPathFactory.h +1 -1
- package/cpp/api/JsiSkSVG.h +4 -1
- package/cpp/api/JsiSkSVGFactory.h +127 -8
- package/cpp/skia/include/android/AHardwareBufferUtils.h +3 -0
- package/cpp/skia/include/android/GrAHardwareBufferUtils.h +0 -4
- package/cpp/skia/include/android/SkAndroidFrameworkUtils.h +0 -4
- package/cpp/skia/include/android/SkImageAndroid.h +1 -0
- package/cpp/skia/include/codec/SkCodec.h +23 -2
- package/cpp/skia/include/codec/SkPngRustDecoder.h +30 -0
- package/cpp/skia/include/core/SkBitmap.h +1 -1
- package/cpp/skia/include/core/SkCPURecorder.h +5 -0
- package/cpp/skia/include/core/SkCanvas.h +2 -0
- package/cpp/skia/include/core/SkColorSpace.h +11 -12
- package/cpp/skia/include/core/SkContourMeasure.h +6 -2
- package/cpp/skia/include/core/SkExecutor.h +18 -0
- package/cpp/skia/include/core/SkFont.h +26 -19
- package/cpp/skia/include/core/SkImage.h +4 -66
- package/cpp/skia/include/core/SkImageGenerator.h +0 -5
- package/cpp/skia/include/core/SkMatrix.h +84 -120
- package/cpp/skia/include/core/SkMilestone.h +1 -1
- package/cpp/skia/include/core/SkPath.h +390 -395
- package/cpp/skia/include/core/SkPathBuilder.h +64 -34
- package/cpp/skia/include/core/SkPathEffect.h +12 -5
- package/cpp/skia/include/core/SkPathIter.h +90 -0
- package/cpp/skia/include/core/SkPathMeasure.h +5 -1
- package/cpp/skia/include/core/SkPathTypes.h +7 -3
- package/cpp/skia/include/core/SkPathUtils.h +20 -13
- package/cpp/skia/include/core/SkRRect.h +7 -11
- package/cpp/skia/include/core/SkRecorder.h +12 -0
- package/cpp/skia/include/core/SkRect.h +33 -8
- package/cpp/skia/include/core/SkRegion.h +14 -3
- package/cpp/skia/include/core/SkScalar.h +0 -12
- package/cpp/skia/include/core/SkShader.h +20 -7
- package/cpp/skia/include/core/SkStrokeRec.h +2 -1
- package/cpp/skia/include/core/SkTypeface.h +8 -10
- package/cpp/skia/include/core/SkTypes.h +4 -0
- package/cpp/skia/include/encode/SkJpegEncoder.h +5 -10
- package/cpp/skia/include/encode/SkPngEncoder.h +8 -7
- package/cpp/skia/include/encode/SkPngRustEncoder.h +88 -0
- package/cpp/skia/include/encode/SkWebpEncoder.h +5 -10
- package/cpp/skia/include/gpu/graphite/BackendSemaphore.h +5 -2
- package/cpp/skia/include/gpu/graphite/BackendTexture.h +5 -2
- package/cpp/skia/include/gpu/graphite/Context.h +15 -2
- package/cpp/skia/include/gpu/graphite/ContextOptions.h +26 -0
- package/cpp/skia/include/gpu/graphite/GraphiteTypes.h +75 -0
- package/cpp/skia/include/gpu/graphite/Recorder.h +15 -6
- package/cpp/skia/include/gpu/graphite/Recording.h +0 -3
- package/cpp/skia/include/gpu/graphite/mtl/MtlBackendContext.h +2 -0
- package/cpp/skia/include/gpu/graphite/precompile/PaintOptions.h +3 -7
- package/cpp/skia/include/gpu/graphite/precompile/PrecompileBase.h +2 -10
- package/cpp/skia/include/gpu/graphite/precompile/PrecompileImageFilter.h +1 -6
- package/cpp/skia/include/gpu/graphite/precompile/PrecompileMaskFilter.h +1 -5
- package/cpp/skia/include/gpu/graphite/precompile/PrecompileShader.h +16 -3
- package/cpp/skia/include/gpu/vk/VulkanPreferredFeatures.h +3 -0
- package/cpp/skia/{modules/pathops/include → include/pathops}/SkPathOps.h +49 -20
- package/cpp/skia/include/ports/SkFontMgr_FontConfigInterface.h +2 -1
- package/cpp/skia/include/ports/SkFontMgr_android.h +0 -4
- package/cpp/skia/include/ports/SkFontMgr_android_ndk.h +4 -2
- package/cpp/skia/include/ports/SkFontMgr_fontconfig.h +0 -3
- package/cpp/skia/include/private/SkEncodedInfo.h +73 -54
- package/cpp/skia/include/private/SkHdrMetadata.h +173 -0
- package/cpp/skia/include/private/SkPathRef.h +117 -146
- package/cpp/skia/include/private/base/SkTemplates.h +74 -32
- package/cpp/skia/include/utils/SkParsePath.h +9 -1
- package/cpp/skia/modules/skcms/src/Transform_inl.h +53 -7
- package/cpp/skia/modules/skcms/src/skcms_Transform.h +2 -0
- package/cpp/skia/modules/skcms/src/skcms_internals.h +8 -0
- package/cpp/skia/modules/skottie/include/TextShaper.h +4 -0
- package/cpp/skia/modules/skparagraph/include/FontCollection.h +1 -1
- package/cpp/skia/modules/skparagraph/include/ParagraphStyle.h +7 -1
- package/cpp/skia/modules/skparagraph/include/TextStyle.h +12 -0
- package/cpp/skia/modules/sksg/include/SkSGGeometryEffect.h +26 -0
- package/cpp/skia/modules/sksg/include/SkSGPath.h +1 -1
- package/cpp/skia/modules/skunicode/include/SkUnicode.h +11 -1
- package/cpp/skia/modules/svg/include/SkSVGAttributeParser.h +7 -11
- package/cpp/skia/modules/svg/include/SkSVGCircle.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGEllipse.h +1 -2
- package/cpp/skia/modules/svg/include/SkSVGFe.h +0 -1
- package/cpp/skia/modules/svg/include/SkSVGFeLightSource.h +0 -1
- package/cpp/skia/modules/svg/include/SkSVGFeLighting.h +0 -1
- package/cpp/skia/modules/svg/include/SkSVGLine.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGNode.h +11 -10
- package/cpp/skia/modules/svg/include/SkSVGPath.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGPattern.h +4 -3
- package/cpp/skia/modules/svg/include/SkSVGPoly.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGRadialGradient.h +0 -1
- package/cpp/skia/modules/svg/include/SkSVGRect.h +1 -2
- package/cpp/skia/modules/svg/include/SkSVGRenderContext.h +5 -5
- package/cpp/skia/modules/svg/include/SkSVGSVG.h +0 -1
- package/cpp/skia/modules/svg/include/SkSVGShape.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGTransformableNode.h +2 -2
- package/cpp/skia/src/base/SkTLazy.h +8 -0
- package/cpp/skia/src/core/SkLRUCache.h +17 -13
- package/lib/commonjs/skia/types/SVG/SVGFactory.d.ts +3 -2
- package/lib/commonjs/skia/types/SVG/SVGFactory.js.map +1 -1
- package/lib/module/skia/types/SVG/SVGFactory.d.ts +3 -2
- package/lib/module/skia/types/SVG/SVGFactory.js.map +1 -1
- package/lib/typescript/src/skia/types/SVG/SVGFactory.d.ts +3 -2
- package/package.json +9 -8
- package/react-native-skia.podspec +1 -2
- package/scripts/install-skia.mjs +360 -0
- package/src/skia/types/SVG/SVGFactory.ts +11 -2
- package/cpp/skia/include/android/SkHeifDecoder.h +0 -50
- package/lib/commonjs/__tests__/globalSetup.d.ts +0 -9
- package/lib/commonjs/__tests__/globalTeardown.d.ts +0 -2
- package/lib/commonjs/__tests__/setup.d.ts +0 -36
- package/lib/commonjs/mock/__tests__/mock.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/Data.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/Drawings.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/FitBox.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/Glyphs.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/Image.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/Paths.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/Picture.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/Simple.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/Surfaces.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/Text.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/Transform.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/documentation/Group.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/documentation/getting-started/HelloWorld.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/documentation/paint/Overview.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/documentation/shapes/Box.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/AdvancedImageFilters.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/AnimatedImages.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/Atlas.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/BackdropFilters.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/Blending.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/Blur.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/Box.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/Camera.spec.d.ts +0 -21
- package/lib/commonjs/renderer/__tests__/e2e/ColorFilters.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/Composition/ColorFilterComposition.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/CoonPatch.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/DataEncoding.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/Drawings.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/FontMgr.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/Gradient.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/Group.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/Image.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/ImageEncoding.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/ImageFilter.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/ImageFilters.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/LightingImageFilters.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/Mask.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/Matrix4.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/NativeBuffer.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/Offscreen.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/Opacity.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/Paint.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/ParagraphMethods.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/ParagraphPaint.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/Paragraphs.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/PathEffects.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/Paths.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/Picture.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/Point.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/Rect.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/RuntimeShader.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/SDF.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/SVG.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/Shader.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/Skottie.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/Snapshot.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/Surfaces.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/Text.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/TextPath.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/Transforms.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/Vertices.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/Video.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/e2e/setup/Paragraph.d.ts +0 -20
- package/lib/commonjs/renderer/__tests__/e2e/setup/SVG.d.ts +0 -13
- package/lib/commonjs/renderer/__tests__/e2e/setup/SkiaObject.d.ts +0 -11
- package/lib/commonjs/renderer/__tests__/e2e/setup/index.d.ts +0 -3
- package/lib/commonjs/renderer/__tests__/examples/BlendModes.spec.d.ts +0 -1
- package/lib/commonjs/renderer/__tests__/setup.d.ts +0 -71
- package/lib/commonjs/skia/__tests__/ColorFilter.spec.d.ts +0 -1
- package/lib/commonjs/skia/__tests__/Data.spec.d.ts +0 -1
- package/lib/commonjs/skia/__tests__/Drawings.spec.d.ts +0 -1
- package/lib/commonjs/skia/__tests__/Enums.spec.d.ts +0 -1
- package/lib/commonjs/skia/__tests__/Geometry.spec.d.ts +0 -1
- package/lib/commonjs/skia/__tests__/ImageFilter.spec.d.ts +0 -1
- package/lib/commonjs/skia/__tests__/Mock.spec.d.ts +0 -0
- package/lib/commonjs/skia/__tests__/Paint.spec.d.ts +0 -1
- package/lib/commonjs/skia/__tests__/Path.spec.d.ts +0 -1
- package/lib/commonjs/skia/__tests__/RuntimeEffect.spec.d.ts +0 -1
- package/lib/commonjs/skia/__tests__/Shader.spec.d.ts +0 -1
- package/lib/commonjs/skia/__tests__/Text.spec.d.ts +0 -1
- package/lib/commonjs/skia/__tests__/Transform.spec.d.ts +0 -1
- package/lib/commonjs/skia/__tests__/Vertices.spec.d.ts +0 -1
- package/lib/commonjs/skia/__tests__/setup.d.ts +0 -16
- package/lib/commonjs/sksg/__tests__/Simple.spec.d.ts +0 -1
- package/lib/module/__tests__/globalSetup.d.ts +0 -9
- package/lib/module/__tests__/globalTeardown.d.ts +0 -2
- package/lib/module/__tests__/setup.d.ts +0 -36
- package/lib/module/mock/__tests__/mock.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/Data.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/Drawings.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/FitBox.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/Glyphs.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/Image.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/Paths.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/Picture.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/Simple.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/Surfaces.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/Text.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/Transform.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/documentation/Group.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/documentation/getting-started/HelloWorld.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/documentation/paint/Overview.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/documentation/shapes/Box.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/AdvancedImageFilters.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/AnimatedImages.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/Atlas.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/BackdropFilters.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/Blending.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/Blur.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/Box.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/Camera.spec.d.ts +0 -21
- package/lib/module/renderer/__tests__/e2e/ColorFilters.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/Composition/ColorFilterComposition.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/CoonPatch.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/DataEncoding.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/Drawings.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/FontMgr.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/Gradient.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/Group.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/Image.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/ImageEncoding.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/ImageFilter.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/ImageFilters.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/LightingImageFilters.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/Mask.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/Matrix4.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/NativeBuffer.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/Offscreen.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/Opacity.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/Paint.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/ParagraphMethods.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/ParagraphPaint.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/Paragraphs.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/PathEffects.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/Paths.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/Picture.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/Point.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/Rect.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/RuntimeShader.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/SDF.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/SVG.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/Shader.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/Skottie.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/Snapshot.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/Surfaces.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/Text.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/TextPath.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/Transforms.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/Vertices.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/Video.d.ts +0 -1
- package/lib/module/renderer/__tests__/e2e/setup/Paragraph.d.ts +0 -20
- package/lib/module/renderer/__tests__/e2e/setup/SVG.d.ts +0 -13
- package/lib/module/renderer/__tests__/e2e/setup/SkiaObject.d.ts +0 -11
- package/lib/module/renderer/__tests__/e2e/setup/index.d.ts +0 -3
- package/lib/module/renderer/__tests__/examples/BlendModes.spec.d.ts +0 -1
- package/lib/module/renderer/__tests__/setup.d.ts +0 -71
- package/lib/module/skia/__tests__/ColorFilter.spec.d.ts +0 -1
- package/lib/module/skia/__tests__/Data.spec.d.ts +0 -1
- package/lib/module/skia/__tests__/Drawings.spec.d.ts +0 -1
- package/lib/module/skia/__tests__/Enums.spec.d.ts +0 -1
- package/lib/module/skia/__tests__/Geometry.spec.d.ts +0 -1
- package/lib/module/skia/__tests__/ImageFilter.spec.d.ts +0 -1
- package/lib/module/skia/__tests__/Mock.spec.d.ts +0 -0
- package/lib/module/skia/__tests__/Paint.spec.d.ts +0 -1
- package/lib/module/skia/__tests__/Path.spec.d.ts +0 -1
- package/lib/module/skia/__tests__/RuntimeEffect.spec.d.ts +0 -1
- package/lib/module/skia/__tests__/Shader.spec.d.ts +0 -1
- package/lib/module/skia/__tests__/Text.spec.d.ts +0 -1
- package/lib/module/skia/__tests__/Transform.spec.d.ts +0 -1
- package/lib/module/skia/__tests__/Vertices.spec.d.ts +0 -1
- package/lib/module/skia/__tests__/setup.d.ts +0 -16
- package/lib/module/sksg/__tests__/Simple.spec.d.ts +0 -1
- package/lib/typescript/src/__tests__/globalSetup.d.ts +0 -9
- package/lib/typescript/src/__tests__/globalTeardown.d.ts +0 -2
- package/lib/typescript/src/__tests__/setup.d.ts +0 -36
- package/lib/typescript/src/mock/__tests__/mock.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/Data.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/Drawings.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/FitBox.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/Glyphs.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/Image.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/Paths.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/Picture.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/Simple.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/Surfaces.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/Text.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/Transform.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/documentation/Group.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/documentation/getting-started/HelloWorld.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/documentation/paint/Overview.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/documentation/shapes/Box.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/AdvancedImageFilters.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/AnimatedImages.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/Atlas.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/BackdropFilters.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/Blending.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/Blur.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/Box.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/Camera.spec.d.ts +0 -21
- package/lib/typescript/src/renderer/__tests__/e2e/ColorFilters.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/Composition/ColorFilterComposition.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/CoonPatch.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/DataEncoding.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/Drawings.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/FontMgr.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/Gradient.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/Group.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/Image.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/ImageEncoding.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/ImageFilter.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/ImageFilters.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/LightingImageFilters.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/Mask.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/Matrix4.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/NativeBuffer.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/Offscreen.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/Opacity.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/Paint.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/ParagraphMethods.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/ParagraphPaint.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/Paragraphs.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/PathEffects.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/Paths.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/Picture.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/Point.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/Rect.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/RuntimeShader.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/SDF.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/SVG.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/Shader.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/Skottie.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/Snapshot.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/Surfaces.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/Text.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/TextPath.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/Transforms.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/Vertices.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/Video.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/e2e/setup/Paragraph.d.ts +0 -20
- package/lib/typescript/src/renderer/__tests__/e2e/setup/SVG.d.ts +0 -13
- package/lib/typescript/src/renderer/__tests__/e2e/setup/SkiaObject.d.ts +0 -11
- package/lib/typescript/src/renderer/__tests__/e2e/setup/index.d.ts +0 -3
- package/lib/typescript/src/renderer/__tests__/examples/BlendModes.spec.d.ts +0 -1
- package/lib/typescript/src/renderer/__tests__/setup.d.ts +0 -71
- package/lib/typescript/src/skia/__tests__/ColorFilter.spec.d.ts +0 -1
- package/lib/typescript/src/skia/__tests__/Data.spec.d.ts +0 -1
- package/lib/typescript/src/skia/__tests__/Drawings.spec.d.ts +0 -1
- package/lib/typescript/src/skia/__tests__/Enums.spec.d.ts +0 -1
- package/lib/typescript/src/skia/__tests__/Geometry.spec.d.ts +0 -1
- package/lib/typescript/src/skia/__tests__/ImageFilter.spec.d.ts +0 -1
- package/lib/typescript/src/skia/__tests__/Mock.spec.d.ts +0 -0
- package/lib/typescript/src/skia/__tests__/Paint.spec.d.ts +0 -1
- package/lib/typescript/src/skia/__tests__/Path.spec.d.ts +0 -1
- package/lib/typescript/src/skia/__tests__/RuntimeEffect.spec.d.ts +0 -1
- package/lib/typescript/src/skia/__tests__/Shader.spec.d.ts +0 -1
- package/lib/typescript/src/skia/__tests__/Text.spec.d.ts +0 -1
- package/lib/typescript/src/skia/__tests__/Transform.spec.d.ts +0 -1
- package/lib/typescript/src/skia/__tests__/Vertices.spec.d.ts +0 -1
- package/lib/typescript/src/skia/__tests__/setup.d.ts +0 -16
- package/lib/typescript/src/sksg/__tests__/Simple.spec.d.ts +0 -1
- package/libs/android/arm64-v8a/libjsonreader.a +0 -0
- package/libs/android/arm64-v8a/libpathops.a +0 -0
- package/libs/android/arm64-v8a/libskia.a +0 -0
- package/libs/android/arm64-v8a/libskottie.a +0 -0
- package/libs/android/arm64-v8a/libskparagraph.a +0 -0
- package/libs/android/arm64-v8a/libsksg.a +0 -0
- package/libs/android/arm64-v8a/libskshaper.a +0 -0
- package/libs/android/arm64-v8a/libskunicode_core.a +0 -0
- package/libs/android/arm64-v8a/libskunicode_icu.a +0 -0
- package/libs/android/arm64-v8a/libsvg.a +0 -0
- package/libs/android/armeabi-v7a/libjsonreader.a +0 -0
- package/libs/android/armeabi-v7a/libpathops.a +0 -0
- package/libs/android/armeabi-v7a/libskia.a +0 -0
- package/libs/android/armeabi-v7a/libskottie.a +0 -0
- package/libs/android/armeabi-v7a/libskparagraph.a +0 -0
- package/libs/android/armeabi-v7a/libsksg.a +0 -0
- package/libs/android/armeabi-v7a/libskshaper.a +0 -0
- package/libs/android/armeabi-v7a/libskunicode_core.a +0 -0
- package/libs/android/armeabi-v7a/libskunicode_icu.a +0 -0
- package/libs/android/armeabi-v7a/libsvg.a +0 -0
- package/libs/android/x86/libjsonreader.a +0 -0
- package/libs/android/x86/libpathops.a +0 -0
- package/libs/android/x86/libskia.a +0 -0
- package/libs/android/x86/libskottie.a +0 -0
- package/libs/android/x86/libskparagraph.a +0 -0
- package/libs/android/x86/libsksg.a +0 -0
- package/libs/android/x86/libskshaper.a +0 -0
- package/libs/android/x86/libskunicode_core.a +0 -0
- package/libs/android/x86/libskunicode_icu.a +0 -0
- package/libs/android/x86/libsvg.a +0 -0
- package/libs/android/x86_64/libjsonreader.a +0 -0
- package/libs/android/x86_64/libpathops.a +0 -0
- package/libs/android/x86_64/libskia.a +0 -0
- package/libs/android/x86_64/libskottie.a +0 -0
- package/libs/android/x86_64/libskparagraph.a +0 -0
- package/libs/android/x86_64/libsksg.a +0 -0
- package/libs/android/x86_64/libskshaper.a +0 -0
- package/libs/android/x86_64/libskunicode_core.a +0 -0
- package/libs/android/x86_64/libskunicode_icu.a +0 -0
- package/libs/android/x86_64/libsvg.a +0 -0
- package/libs/apple/libpathops.xcframework/Info.plist +0 -94
- package/libs/apple/libpathops.xcframework/ios-arm64_arm64e/libpathops.a +0 -0
- package/libs/apple/libpathops.xcframework/ios-arm64_arm64e_x86_64-simulator/libpathops.a +0 -0
- package/libs/apple/libpathops.xcframework/macos-arm64_x86_64/libpathops.a +0 -0
- package/libs/apple/libpathops.xcframework/tvos-arm64_arm64e/libpathops.a +0 -0
- package/libs/apple/libpathops.xcframework/tvos-arm64_arm64e_x86_64-simulator/libpathops.a +0 -0
- package/libs/apple/libskia.xcframework/Info.plist +0 -94
- package/libs/apple/libskia.xcframework/ios-arm64_arm64e/libskia.a +0 -0
- package/libs/apple/libskia.xcframework/ios-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
- package/libs/apple/libskia.xcframework/macos-arm64_x86_64/libskia.a +0 -0
- package/libs/apple/libskia.xcframework/tvos-arm64_arm64e/libskia.a +0 -0
- package/libs/apple/libskia.xcframework/tvos-arm64_arm64e_x86_64-simulator/libskia.a +0 -0
- package/libs/apple/libskottie.xcframework/Info.plist +0 -94
- package/libs/apple/libskottie.xcframework/ios-arm64_arm64e/libskottie.a +0 -0
- package/libs/apple/libskottie.xcframework/ios-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
- package/libs/apple/libskottie.xcframework/macos-arm64_x86_64/libskottie.a +0 -0
- package/libs/apple/libskottie.xcframework/tvos-arm64_arm64e/libskottie.a +0 -0
- package/libs/apple/libskottie.xcframework/tvos-arm64_arm64e_x86_64-simulator/libskottie.a +0 -0
- package/libs/apple/libskparagraph.xcframework/Info.plist +0 -94
- package/libs/apple/libskparagraph.xcframework/ios-arm64_arm64e/libskparagraph.a +0 -0
- package/libs/apple/libskparagraph.xcframework/ios-arm64_arm64e_x86_64-simulator/libskparagraph.a +0 -0
- package/libs/apple/libskparagraph.xcframework/macos-arm64_x86_64/libskparagraph.a +0 -0
- package/libs/apple/libskparagraph.xcframework/tvos-arm64_arm64e/libskparagraph.a +0 -0
- package/libs/apple/libskparagraph.xcframework/tvos-arm64_arm64e_x86_64-simulator/libskparagraph.a +0 -0
- package/libs/apple/libsksg.xcframework/Info.plist +0 -94
- package/libs/apple/libsksg.xcframework/ios-arm64_arm64e/libsksg.a +0 -0
- package/libs/apple/libsksg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
- package/libs/apple/libsksg.xcframework/macos-arm64_x86_64/libsksg.a +0 -0
- package/libs/apple/libsksg.xcframework/tvos-arm64_arm64e/libsksg.a +0 -0
- package/libs/apple/libsksg.xcframework/tvos-arm64_arm64e_x86_64-simulator/libsksg.a +0 -0
- package/libs/apple/libskshaper.xcframework/Info.plist +0 -94
- package/libs/apple/libskshaper.xcframework/ios-arm64_arm64e/libskshaper.a +0 -0
- package/libs/apple/libskshaper.xcframework/ios-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
- package/libs/apple/libskshaper.xcframework/macos-arm64_x86_64/libskshaper.a +0 -0
- package/libs/apple/libskshaper.xcframework/tvos-arm64_arm64e/libskshaper.a +0 -0
- package/libs/apple/libskshaper.xcframework/tvos-arm64_arm64e_x86_64-simulator/libskshaper.a +0 -0
- package/libs/apple/libskunicode_core.xcframework/Info.plist +0 -94
- package/libs/apple/libskunicode_core.xcframework/ios-arm64_arm64e/libskunicode_core.a +0 -0
- package/libs/apple/libskunicode_core.xcframework/ios-arm64_arm64e_x86_64-simulator/libskunicode_core.a +0 -0
- package/libs/apple/libskunicode_core.xcframework/macos-arm64_x86_64/libskunicode_core.a +0 -0
- package/libs/apple/libskunicode_core.xcframework/tvos-arm64_arm64e/libskunicode_core.a +0 -0
- package/libs/apple/libskunicode_core.xcframework/tvos-arm64_arm64e_x86_64-simulator/libskunicode_core.a +0 -0
- package/libs/apple/libskunicode_libgrapheme.xcframework/Info.plist +0 -94
- package/libs/apple/libskunicode_libgrapheme.xcframework/ios-arm64_arm64e/libskunicode_libgrapheme.a +0 -0
- package/libs/apple/libskunicode_libgrapheme.xcframework/ios-arm64_arm64e_x86_64-simulator/libskunicode_libgrapheme.a +0 -0
- package/libs/apple/libskunicode_libgrapheme.xcframework/macos-arm64_x86_64/libskunicode_libgrapheme.a +0 -0
- package/libs/apple/libskunicode_libgrapheme.xcframework/tvos-arm64_arm64e/libskunicode_libgrapheme.a +0 -0
- package/libs/apple/libskunicode_libgrapheme.xcframework/tvos-arm64_arm64e_x86_64-simulator/libskunicode_libgrapheme.a +0 -0
- package/libs/apple/libsvg.xcframework/Info.plist +0 -94
- package/libs/apple/libsvg.xcframework/ios-arm64_arm64e/libsvg.a +0 -0
- package/libs/apple/libsvg.xcframework/ios-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
- package/libs/apple/libsvg.xcframework/macos-arm64_x86_64/libsvg.a +0 -0
- package/libs/apple/libsvg.xcframework/tvos-arm64_arm64e/libsvg.a +0 -0
- package/libs/apple/libsvg.xcframework/tvos-arm64_arm64e_x86_64-simulator/libsvg.a +0 -0
- package/src/__tests__/globalSetup.ts +0 -53
- package/src/__tests__/globalTeardown.ts +0 -11
- package/src/__tests__/setup.ts +0 -192
- 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-opacity.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/semi-transparent-layer.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-layer.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/camera-corner.png +0 -0
- package/src/__tests__/snapshots/matrix4/camera-offset.png +0 -0
- package/src/__tests__/snapshots/matrix4/camera-top-left-center.png +0 -0
- package/src/__tests__/snapshots/matrix4/camera-zoom-out.png +0 -0
- package/src/__tests__/snapshots/matrix4/full-rect.png +0 -0
- package/src/__tests__/snapshots/matrix4/perspective.png +0 -0
- package/src/__tests__/snapshots/matrix4/rect.png +0 -0
- package/src/__tests__/snapshots/matrix4/scaled-rect.png +0 -0
- package/src/__tests__/snapshots/matrix4/test-perspective.png +0 -0
- package/src/__tests__/snapshots/matrix4/test-perspective2.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/sksg/breathe-0.png +0 -0
- package/src/__tests__/snapshots/sksg/breathe.png +0 -0
- package/src/__tests__/snapshots/sksg/simple.png +0 -0
- package/src/__tests__/snapshots/sksg/simple2.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/mock/__tests__/mock.spec.ts +0 -47
- package/src/renderer/__tests__/Data.spec.tsx +0 -66
- package/src/renderer/__tests__/Drawings.spec.tsx +0 -96
- package/src/renderer/__tests__/FitBox.spec.tsx +0 -677
- package/src/renderer/__tests__/Glyphs.spec.tsx +0 -46
- package/src/renderer/__tests__/Image.spec.tsx +0 -45
- package/src/renderer/__tests__/Paths.spec.tsx +0 -75
- package/src/renderer/__tests__/Picture.spec.tsx +0 -83
- package/src/renderer/__tests__/Simple.spec.tsx +0 -81
- package/src/renderer/__tests__/Surfaces.spec.tsx +0 -68
- package/src/renderer/__tests__/Text.spec.tsx +0 -134
- package/src/renderer/__tests__/Transform.spec.tsx +0 -72
- package/src/renderer/__tests__/documentation/Group.spec.tsx +0 -170
- package/src/renderer/__tests__/documentation/getting-started/HelloWorld.spec.tsx +0 -51
- package/src/renderer/__tests__/documentation/paint/Overview.spec.tsx +0 -84
- package/src/renderer/__tests__/documentation/shapes/Box.spec.tsx +0 -46
- package/src/renderer/__tests__/e2e/AdvancedImageFilters.spec.tsx +0 -492
- package/src/renderer/__tests__/e2e/AnimatedImages.spec.tsx +0 -87
- package/src/renderer/__tests__/e2e/Atlas.spec.tsx +0 -358
- package/src/renderer/__tests__/e2e/BackdropFilters.spec.tsx +0 -164
- package/src/renderer/__tests__/e2e/Blending.spec.tsx +0 -115
- package/src/renderer/__tests__/e2e/Blur.spec.tsx +0 -56
- package/src/renderer/__tests__/e2e/Box.spec.tsx +0 -105
- package/src/renderer/__tests__/e2e/Camera.spec.tsx +0 -475
- package/src/renderer/__tests__/e2e/ColorFilters.spec.tsx +0 -227
- package/src/renderer/__tests__/e2e/Composition/ColorFilterComposition.spec.tsx +0 -102
- package/src/renderer/__tests__/e2e/CoonPatch.spec.tsx +0 -74
- package/src/renderer/__tests__/e2e/DataEncoding.spec.tsx +0 -79
- package/src/renderer/__tests__/e2e/Drawings.spec.tsx +0 -254
- package/src/renderer/__tests__/e2e/FontMgr.spec.tsx +0 -150
- package/src/renderer/__tests__/e2e/Gradient.spec.tsx +0 -40
- package/src/renderer/__tests__/e2e/Group.spec.tsx +0 -128
- package/src/renderer/__tests__/e2e/Image.spec.tsx +0 -77
- package/src/renderer/__tests__/e2e/ImageEncoding.spec.tsx +0 -255
- package/src/renderer/__tests__/e2e/ImageFilter.spec.tsx +0 -99
- package/src/renderer/__tests__/e2e/ImageFilters.spec.tsx +0 -320
- package/src/renderer/__tests__/e2e/LightingImageFilters.spec.tsx +0 -1478
- package/src/renderer/__tests__/e2e/Mask.spec.tsx +0 -85
- package/src/renderer/__tests__/e2e/Matrix4.spec.tsx +0 -367
- package/src/renderer/__tests__/e2e/NativeBuffer.spec.tsx +0 -158
- package/src/renderer/__tests__/e2e/Offscreen.spec.tsx +0 -109
- package/src/renderer/__tests__/e2e/Opacity.spec.tsx +0 -301
- package/src/renderer/__tests__/e2e/Paint.spec.tsx +0 -230
- package/src/renderer/__tests__/e2e/ParagraphMethods.spec.tsx +0 -388
- package/src/renderer/__tests__/e2e/ParagraphPaint.spec.tsx +0 -262
- package/src/renderer/__tests__/e2e/Paragraphs.spec.tsx +0 -615
- package/src/renderer/__tests__/e2e/PathEffects.spec.tsx +0 -73
- package/src/renderer/__tests__/e2e/Paths.spec.tsx +0 -394
- package/src/renderer/__tests__/e2e/Picture.spec.tsx +0 -134
- package/src/renderer/__tests__/e2e/Point.spec.tsx +0 -35
- package/src/renderer/__tests__/e2e/Rect.spec.tsx +0 -139
- package/src/renderer/__tests__/e2e/RuntimeShader.spec.tsx +0 -323
- package/src/renderer/__tests__/e2e/SDF.spec.tsx +0 -148
- package/src/renderer/__tests__/e2e/SVG.spec.tsx +0 -192
- package/src/renderer/__tests__/e2e/Shader.spec.tsx +0 -353
- package/src/renderer/__tests__/e2e/Skottie.spec.tsx +0 -463
- package/src/renderer/__tests__/e2e/Snapshot.spec.tsx +0 -29
- package/src/renderer/__tests__/e2e/Surfaces.spec.tsx +0 -17
- package/src/renderer/__tests__/e2e/Text.spec.tsx +0 -109
- package/src/renderer/__tests__/e2e/TextPath.spec.tsx +0 -43
- package/src/renderer/__tests__/e2e/Transforms.spec.tsx +0 -63
- package/src/renderer/__tests__/e2e/Vertices.spec.tsx +0 -30
- package/src/renderer/__tests__/e2e/Video.ts +0 -68
- package/src/renderer/__tests__/e2e/setup/Paragraph.ts +0 -60
- package/src/renderer/__tests__/e2e/setup/SVG.ts +0 -31
- package/src/renderer/__tests__/e2e/setup/SkiaObject.ts +0 -31
- package/src/renderer/__tests__/e2e/setup/index.ts +0 -3
- package/src/renderer/__tests__/e2e/setup/skottie/basic_slots.json +0 -1118
- package/src/renderer/__tests__/e2e/setup/skottie/color-props.json +0 -1
- package/src/renderer/__tests__/e2e/setup/skottie/confetti.json +0 -5899
- package/src/renderer/__tests__/e2e/setup/skottie/drinks.json +0 -43857
- package/src/renderer/__tests__/e2e/setup/skottie/fingerprint.json +0 -1
- package/src/renderer/__tests__/e2e/setup/skottie/lego_loader.json +0 -29540
- package/src/renderer/__tests__/e2e/setup/skottie/new-drop.json +0 -1
- package/src/renderer/__tests__/e2e/setup/skottie/onboarding.json +0 -1
- package/src/renderer/__tests__/e2e/setup/skottie/text-layer.json +0 -1
- package/src/renderer/__tests__/examples/BlendModes.spec.tsx +0 -123
- package/src/renderer/__tests__/setup.tsx +0 -525
- package/src/skia/__tests__/ColorFilter.spec.ts +0 -67
- package/src/skia/__tests__/Data.spec.ts +0 -29
- package/src/skia/__tests__/Drawings.spec.ts +0 -119
- package/src/skia/__tests__/Enums.spec.ts +0 -136
- package/src/skia/__tests__/Geometry.spec.ts +0 -39
- package/src/skia/__tests__/ImageFilter.spec.ts +0 -19
- package/src/skia/__tests__/Mock.spec.ts +0 -7
- package/src/skia/__tests__/Paint.spec.ts +0 -25
- package/src/skia/__tests__/Path.spec.ts +0 -384
- package/src/skia/__tests__/RuntimeEffect.spec.ts +0 -66
- package/src/skia/__tests__/Shader.spec.ts +0 -96
- package/src/skia/__tests__/Text.spec.ts +0 -32
- package/src/skia/__tests__/Transform.spec.ts +0 -89
- package/src/skia/__tests__/Vertices.spec.ts +0 -40
- package/src/skia/__tests__/assets/Avenir-Heavy.ttf +0 -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-mini.jpg +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 +0 -724
- package/src/skia/__tests__/assets/zurich.jpg +0 -0
- package/src/skia/__tests__/setup.ts +0 -27
- package/src/sksg/__tests__/Simple.spec.tsx +0 -148
|
@@ -1,677 +0,0 @@
|
|
|
1
|
-
import fs from "fs";
|
|
2
|
-
import nodePath from "path";
|
|
3
|
-
|
|
4
|
-
import React from "react";
|
|
5
|
-
|
|
6
|
-
import { processResult } from "../../__tests__/setup";
|
|
7
|
-
import { Circle, FitBox, Rect, Image, Group, fitbox } from "../components";
|
|
8
|
-
|
|
9
|
-
import { drawOnNode, width, height, importSkia } from "./setup";
|
|
10
|
-
|
|
11
|
-
describe("FitBox", () => {
|
|
12
|
-
it("Should scale the rectangle in half", async () => {
|
|
13
|
-
const { Skia } = importSkia();
|
|
14
|
-
const surface = await drawOnNode(
|
|
15
|
-
<FitBox
|
|
16
|
-
src={Skia.XYWHRect(0, 0, width, height)}
|
|
17
|
-
dst={Skia.XYWHRect(width / 4, height / 4, width / 2, height / 2)}
|
|
18
|
-
>
|
|
19
|
-
<Rect x={0} y={0} width={width} height={height} color="lightblue" />
|
|
20
|
-
</FitBox>
|
|
21
|
-
);
|
|
22
|
-
processResult(surface, "snapshots/drawings/lightblue-rect.png");
|
|
23
|
-
});
|
|
24
|
-
it("Should take the bottom right quarter of the circle and scale to the full canvas", async () => {
|
|
25
|
-
const { Skia } = importSkia();
|
|
26
|
-
const surface = await drawOnNode(
|
|
27
|
-
<FitBox
|
|
28
|
-
src={Skia.XYWHRect(width / 2, height / 2, width / 2, height / 2)}
|
|
29
|
-
dst={Skia.XYWHRect(0, 0, width, height)}
|
|
30
|
-
>
|
|
31
|
-
<Circle
|
|
32
|
-
r={width / 2}
|
|
33
|
-
cx={width / 2}
|
|
34
|
-
cy={height / 2}
|
|
35
|
-
color="lightblue"
|
|
36
|
-
/>
|
|
37
|
-
</FitBox>
|
|
38
|
-
);
|
|
39
|
-
processResult(surface, "snapshots/drawings/lightblue-quarter-circle.png");
|
|
40
|
-
});
|
|
41
|
-
it("Should scale the image (1)", async () => {
|
|
42
|
-
const { Skia, rect } = importSkia();
|
|
43
|
-
const image = Skia.Image.MakeImageFromEncoded(
|
|
44
|
-
Skia.Data.fromBytes(
|
|
45
|
-
fs.readFileSync(
|
|
46
|
-
nodePath.resolve(__dirname, "../../skia/__tests__/assets/box.png")
|
|
47
|
-
)
|
|
48
|
-
)
|
|
49
|
-
)!;
|
|
50
|
-
const surface = await drawOnNode(
|
|
51
|
-
<Group
|
|
52
|
-
transform={fitbox(
|
|
53
|
-
"cover",
|
|
54
|
-
rect(0, 0, image.width(), image.height()),
|
|
55
|
-
rect(0, 0, width, height)
|
|
56
|
-
)}
|
|
57
|
-
>
|
|
58
|
-
<Image
|
|
59
|
-
image={image}
|
|
60
|
-
x={0}
|
|
61
|
-
y={0}
|
|
62
|
-
width={image.width()}
|
|
63
|
-
height={image.height()}
|
|
64
|
-
/>
|
|
65
|
-
</Group>
|
|
66
|
-
);
|
|
67
|
-
processResult(surface, "snapshots/drawings/scaled-image.png");
|
|
68
|
-
});
|
|
69
|
-
it("Should scale the image (2)", async () => {
|
|
70
|
-
const { Skia, rect } = importSkia();
|
|
71
|
-
const image = Skia.Image.MakeImageFromEncoded(
|
|
72
|
-
Skia.Data.fromBytes(
|
|
73
|
-
fs.readFileSync(
|
|
74
|
-
nodePath.resolve(__dirname, "../../skia/__tests__/assets/box.png")
|
|
75
|
-
)
|
|
76
|
-
)
|
|
77
|
-
)!;
|
|
78
|
-
const screen = rect(256, 128, 256, 512);
|
|
79
|
-
const surface = await drawOnNode(
|
|
80
|
-
<Group>
|
|
81
|
-
<Image
|
|
82
|
-
image={image}
|
|
83
|
-
x={0}
|
|
84
|
-
y={0}
|
|
85
|
-
width={image.width()}
|
|
86
|
-
height={image.height()}
|
|
87
|
-
transform={fitbox(
|
|
88
|
-
"cover",
|
|
89
|
-
rect(0, 0, image.width(), image.height()),
|
|
90
|
-
screen
|
|
91
|
-
)}
|
|
92
|
-
/>
|
|
93
|
-
<Rect rect={screen} color="green" opacity={0.5} />
|
|
94
|
-
</Group>
|
|
95
|
-
);
|
|
96
|
-
processResult(surface, "snapshots/drawings/scaled-image2.png");
|
|
97
|
-
});
|
|
98
|
-
it("Should rotate and scale the image", async () => {
|
|
99
|
-
const { Skia, rect } = importSkia();
|
|
100
|
-
const image = Skia.Image.MakeImageFromEncoded(
|
|
101
|
-
Skia.Data.fromBytes(
|
|
102
|
-
fs.readFileSync(
|
|
103
|
-
nodePath.resolve(__dirname, "../../skia/__tests__/assets/box2.png")
|
|
104
|
-
)
|
|
105
|
-
)
|
|
106
|
-
)!;
|
|
107
|
-
const screen = rect(256, 128, 256, 512);
|
|
108
|
-
const imageRect = rect(0, 0, image.width(), image.height());
|
|
109
|
-
const transform = fitbox("contain", imageRect, screen, 270);
|
|
110
|
-
const surface = await drawOnNode(
|
|
111
|
-
<Group>
|
|
112
|
-
<Image
|
|
113
|
-
image={image}
|
|
114
|
-
x={0}
|
|
115
|
-
y={0}
|
|
116
|
-
width={image.width()}
|
|
117
|
-
height={image.height()}
|
|
118
|
-
fit="none"
|
|
119
|
-
transform={transform}
|
|
120
|
-
/>
|
|
121
|
-
<Rect rect={screen} color="green" opacity={0.5} />
|
|
122
|
-
</Group>
|
|
123
|
-
);
|
|
124
|
-
processResult(surface, "snapshots/drawings/rotated-scaled-image.png");
|
|
125
|
-
});
|
|
126
|
-
|
|
127
|
-
test("transform simple rectangle with fitbox fill", () => {
|
|
128
|
-
const { Skia, processTransform2d } = importSkia();
|
|
129
|
-
|
|
130
|
-
const path = Skia.Path.Make();
|
|
131
|
-
path.moveTo(0, 0);
|
|
132
|
-
path.lineTo(10, 0);
|
|
133
|
-
path.lineTo(10, 10);
|
|
134
|
-
path.lineTo(0, 10);
|
|
135
|
-
path.close();
|
|
136
|
-
|
|
137
|
-
const src = path.computeTightBounds();
|
|
138
|
-
const dst = Skia.XYWHRect(0, 0, 20, 20);
|
|
139
|
-
const transform = fitbox("fill", src, dst);
|
|
140
|
-
const c = path.copy().transform(processTransform2d(transform));
|
|
141
|
-
const newBounds = c.computeTightBounds();
|
|
142
|
-
expect(newBounds.x).toBe(0);
|
|
143
|
-
expect(newBounds.y).toBe(0);
|
|
144
|
-
expect(newBounds.width).toBe(20);
|
|
145
|
-
expect(newBounds.height).toBe(20);
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
test("transform simple rectangle with fitbox contain", () => {
|
|
149
|
-
const { Skia, processTransform2d } = importSkia();
|
|
150
|
-
|
|
151
|
-
const path = Skia.Path.Make();
|
|
152
|
-
path.moveTo(0, 0);
|
|
153
|
-
path.lineTo(10, 0);
|
|
154
|
-
path.lineTo(10, 5);
|
|
155
|
-
path.lineTo(0, 5);
|
|
156
|
-
path.close();
|
|
157
|
-
|
|
158
|
-
const src = path.computeTightBounds();
|
|
159
|
-
|
|
160
|
-
const dst = Skia.XYWHRect(0, 0, 20, 20);
|
|
161
|
-
const matrix = fitbox("contain", src, dst);
|
|
162
|
-
|
|
163
|
-
path.transform(processTransform2d(matrix));
|
|
164
|
-
const newBounds = path.computeTightBounds();
|
|
165
|
-
expect(newBounds.x).toBe(0);
|
|
166
|
-
expect(newBounds.y).toBe(5);
|
|
167
|
-
expect(newBounds.width).toBe(20);
|
|
168
|
-
expect(newBounds.height).toBe(10);
|
|
169
|
-
});
|
|
170
|
-
|
|
171
|
-
test("transform line with fitbox scale", () => {
|
|
172
|
-
const { Skia, processTransform2d } = importSkia();
|
|
173
|
-
const path = Skia.Path.Make();
|
|
174
|
-
path.moveTo(0, 0);
|
|
175
|
-
path.lineTo(5, 5);
|
|
176
|
-
|
|
177
|
-
const src = path.computeTightBounds();
|
|
178
|
-
const dst = Skia.XYWHRect(0, 0, 10, 10);
|
|
179
|
-
const matrix = fitbox("fill", src, dst);
|
|
180
|
-
path.transform(processTransform2d(matrix));
|
|
181
|
-
const newBounds = path.computeTightBounds();
|
|
182
|
-
expect(newBounds.x).toBe(0);
|
|
183
|
-
expect(newBounds.y).toBe(0);
|
|
184
|
-
expect(newBounds.width).toBe(10);
|
|
185
|
-
expect(newBounds.height).toBe(10);
|
|
186
|
-
});
|
|
187
|
-
|
|
188
|
-
test("transform with offset destination", () => {
|
|
189
|
-
const { Skia, processTransform2d } = importSkia();
|
|
190
|
-
const path = Skia.Path.Make();
|
|
191
|
-
path.moveTo(0, 0);
|
|
192
|
-
path.lineTo(4, 0);
|
|
193
|
-
path.lineTo(4, 4);
|
|
194
|
-
path.lineTo(0, 4);
|
|
195
|
-
path.close();
|
|
196
|
-
|
|
197
|
-
const src = path.computeTightBounds();
|
|
198
|
-
const dst = Skia.XYWHRect(10, 20, 8, 8);
|
|
199
|
-
const matrix = fitbox("fill", src, dst);
|
|
200
|
-
path.transform(processTransform2d(matrix));
|
|
201
|
-
const newBounds = path.computeTightBounds();
|
|
202
|
-
expect(newBounds.x).toBe(10);
|
|
203
|
-
expect(newBounds.y).toBe(20);
|
|
204
|
-
expect(newBounds.width).toBe(8);
|
|
205
|
-
expect(newBounds.height).toBe(8);
|
|
206
|
-
});
|
|
207
|
-
|
|
208
|
-
test("transform with cover fit mode", () => {
|
|
209
|
-
const { Skia, processTransform2d } = importSkia();
|
|
210
|
-
const path = Skia.Path.Make();
|
|
211
|
-
path.moveTo(0, 0);
|
|
212
|
-
path.lineTo(10, 0);
|
|
213
|
-
path.lineTo(10, 5);
|
|
214
|
-
path.lineTo(0, 5);
|
|
215
|
-
path.close();
|
|
216
|
-
|
|
217
|
-
const src = path.computeTightBounds();
|
|
218
|
-
const dst = Skia.XYWHRect(0, 0, 10, 10);
|
|
219
|
-
const matrix = fitbox("cover", src, dst);
|
|
220
|
-
path.transform(processTransform2d(matrix));
|
|
221
|
-
const newBounds = path.computeTightBounds();
|
|
222
|
-
expect(newBounds.x).toBe(-5);
|
|
223
|
-
expect(newBounds.y).toBe(0);
|
|
224
|
-
expect(newBounds.width).toBe(20);
|
|
225
|
-
expect(newBounds.height).toBe(10);
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
describe("rect2rect", () => {
|
|
229
|
-
test("basic scaling from unit square to double size", () => {
|
|
230
|
-
const { Skia, rect2rect } = importSkia();
|
|
231
|
-
const src = Skia.XYWHRect(0, 0, 1, 1);
|
|
232
|
-
const dst = Skia.XYWHRect(0, 0, 2, 2);
|
|
233
|
-
const result = rect2rect(src, dst);
|
|
234
|
-
|
|
235
|
-
expect(result).toEqual([
|
|
236
|
-
{ translateX: 0 },
|
|
237
|
-
{ translateY: 0 },
|
|
238
|
-
{ scaleX: 2 },
|
|
239
|
-
{ scaleY: 2 },
|
|
240
|
-
]);
|
|
241
|
-
});
|
|
242
|
-
|
|
243
|
-
test("scaling with translation", () => {
|
|
244
|
-
const { Skia, rect2rect } = importSkia();
|
|
245
|
-
const src = Skia.XYWHRect(0, 0, 10, 10);
|
|
246
|
-
const dst = Skia.XYWHRect(5, 5, 20, 20);
|
|
247
|
-
const result = rect2rect(src, dst);
|
|
248
|
-
|
|
249
|
-
expect(result).toEqual([
|
|
250
|
-
{ translateX: 5 },
|
|
251
|
-
{ translateY: 5 },
|
|
252
|
-
{ scaleX: 2 },
|
|
253
|
-
{ scaleY: 2 },
|
|
254
|
-
]);
|
|
255
|
-
});
|
|
256
|
-
|
|
257
|
-
test("scaling with non-zero source origin", () => {
|
|
258
|
-
const { Skia, rect2rect } = importSkia();
|
|
259
|
-
const src = Skia.XYWHRect(10, 10, 20, 20);
|
|
260
|
-
const dst = Skia.XYWHRect(0, 0, 40, 40);
|
|
261
|
-
const result = rect2rect(src, dst);
|
|
262
|
-
|
|
263
|
-
expect(result).toEqual([
|
|
264
|
-
{ translateX: -20 },
|
|
265
|
-
{ translateY: -20 },
|
|
266
|
-
{ scaleX: 2 },
|
|
267
|
-
{ scaleY: 2 },
|
|
268
|
-
]);
|
|
269
|
-
});
|
|
270
|
-
|
|
271
|
-
test("shrinking transformation", () => {
|
|
272
|
-
const { Skia, rect2rect } = importSkia();
|
|
273
|
-
const src = Skia.XYWHRect(0, 0, 100, 100);
|
|
274
|
-
const dst = Skia.XYWHRect(0, 0, 50, 50);
|
|
275
|
-
const result = rect2rect(src, dst);
|
|
276
|
-
|
|
277
|
-
expect(result).toEqual([
|
|
278
|
-
{ translateX: 0 },
|
|
279
|
-
{ translateY: 0 },
|
|
280
|
-
{ scaleX: 0.5 },
|
|
281
|
-
{ scaleY: 0.5 },
|
|
282
|
-
]);
|
|
283
|
-
});
|
|
284
|
-
|
|
285
|
-
test("non-uniform scaling", () => {
|
|
286
|
-
const { Skia, rect2rect } = importSkia();
|
|
287
|
-
const src = Skia.XYWHRect(0, 0, 10, 20);
|
|
288
|
-
const dst = Skia.XYWHRect(0, 0, 30, 40);
|
|
289
|
-
const result = rect2rect(src, dst);
|
|
290
|
-
|
|
291
|
-
expect(result).toEqual([
|
|
292
|
-
{ translateX: 0 },
|
|
293
|
-
{ translateY: 0 },
|
|
294
|
-
{ scaleX: 3 },
|
|
295
|
-
{ scaleY: 2 },
|
|
296
|
-
]);
|
|
297
|
-
});
|
|
298
|
-
|
|
299
|
-
test("transformation with offset source and destination", () => {
|
|
300
|
-
const { Skia, rect2rect } = importSkia();
|
|
301
|
-
const src = Skia.XYWHRect(5, 10, 15, 20);
|
|
302
|
-
const dst = Skia.XYWHRect(50, 100, 30, 40);
|
|
303
|
-
const result = rect2rect(src, dst);
|
|
304
|
-
|
|
305
|
-
expect(result).toEqual([
|
|
306
|
-
{ translateX: 40 },
|
|
307
|
-
{ translateY: 80 },
|
|
308
|
-
{ scaleX: 2 },
|
|
309
|
-
{ scaleY: 2 },
|
|
310
|
-
]);
|
|
311
|
-
});
|
|
312
|
-
|
|
313
|
-
test("identity transformation", () => {
|
|
314
|
-
const { Skia, rect2rect } = importSkia();
|
|
315
|
-
const src = Skia.XYWHRect(10, 20, 30, 40);
|
|
316
|
-
const dst = Skia.XYWHRect(10, 20, 30, 40);
|
|
317
|
-
const result = rect2rect(src, dst);
|
|
318
|
-
|
|
319
|
-
expect(result).toEqual([
|
|
320
|
-
{ translateX: 0 },
|
|
321
|
-
{ translateY: 0 },
|
|
322
|
-
{ scaleX: 1 },
|
|
323
|
-
{ scaleY: 1 },
|
|
324
|
-
]);
|
|
325
|
-
});
|
|
326
|
-
|
|
327
|
-
test("fractional scaling", () => {
|
|
328
|
-
const { Skia, rect2rect } = importSkia();
|
|
329
|
-
const src = Skia.XYWHRect(0, 0, 3, 4);
|
|
330
|
-
const dst = Skia.XYWHRect(0, 0, 1.5, 2);
|
|
331
|
-
const result = rect2rect(src, dst);
|
|
332
|
-
|
|
333
|
-
expect(result).toEqual([
|
|
334
|
-
{ translateX: 0 },
|
|
335
|
-
{ translateY: 0 },
|
|
336
|
-
{ scaleX: 0.5 },
|
|
337
|
-
{ scaleY: 0.5 },
|
|
338
|
-
]);
|
|
339
|
-
});
|
|
340
|
-
|
|
341
|
-
test("complex transformation with negative coordinates", () => {
|
|
342
|
-
const { Skia, rect2rect } = importSkia();
|
|
343
|
-
const src = Skia.XYWHRect(-10, -20, 20, 30);
|
|
344
|
-
const dst = Skia.XYWHRect(10, 5, 40, 60);
|
|
345
|
-
const result = rect2rect(src, dst);
|
|
346
|
-
|
|
347
|
-
expect(result).toEqual([
|
|
348
|
-
{ translateX: 30 },
|
|
349
|
-
{ translateY: 45 },
|
|
350
|
-
{ scaleX: 2 },
|
|
351
|
-
{ scaleY: 2 },
|
|
352
|
-
]);
|
|
353
|
-
});
|
|
354
|
-
|
|
355
|
-
test("very small dimensions", () => {
|
|
356
|
-
const { Skia, rect2rect } = importSkia();
|
|
357
|
-
const src = Skia.XYWHRect(0, 0, 0.1, 0.1);
|
|
358
|
-
const dst = Skia.XYWHRect(0, 0, 1, 1);
|
|
359
|
-
const result = rect2rect(src, dst);
|
|
360
|
-
|
|
361
|
-
expect(result[0]).toEqual({ translateX: 0 });
|
|
362
|
-
expect(result[1]).toEqual({ translateY: 0 });
|
|
363
|
-
expect(result[2].scaleX).toBeCloseTo(10, 5);
|
|
364
|
-
expect(result[3].scaleY).toBeCloseTo(10, 5);
|
|
365
|
-
});
|
|
366
|
-
});
|
|
367
|
-
|
|
368
|
-
describe("fitRects", () => {
|
|
369
|
-
test("fill mode - source fills destination completely", () => {
|
|
370
|
-
const { Skia, fitRects } = importSkia();
|
|
371
|
-
const srcRect = Skia.XYWHRect(0, 0, 100, 50);
|
|
372
|
-
const dstRect = Skia.XYWHRect(10, 20, 200, 100);
|
|
373
|
-
const result = fitRects("fill", srcRect, dstRect);
|
|
374
|
-
|
|
375
|
-
expect(result.src).toEqual({
|
|
376
|
-
x: 0,
|
|
377
|
-
y: 0,
|
|
378
|
-
width: 100,
|
|
379
|
-
height: 50,
|
|
380
|
-
});
|
|
381
|
-
expect(result.dst).toEqual({
|
|
382
|
-
x: 10,
|
|
383
|
-
y: 20,
|
|
384
|
-
width: 200,
|
|
385
|
-
height: 100,
|
|
386
|
-
});
|
|
387
|
-
});
|
|
388
|
-
|
|
389
|
-
test("contain mode - source fits inside destination maintaining aspect ratio", () => {
|
|
390
|
-
const { Skia, fitRects } = importSkia();
|
|
391
|
-
const srcRect = Skia.XYWHRect(0, 0, 100, 50);
|
|
392
|
-
const dstRect = Skia.XYWHRect(0, 0, 200, 200);
|
|
393
|
-
const result = fitRects("contain", srcRect, dstRect);
|
|
394
|
-
|
|
395
|
-
expect(result.src).toEqual({
|
|
396
|
-
x: 0,
|
|
397
|
-
y: 0,
|
|
398
|
-
width: 100,
|
|
399
|
-
height: 50,
|
|
400
|
-
});
|
|
401
|
-
// Should maintain aspect ratio 2:1, so width=200, height=100, centered
|
|
402
|
-
expect(result.dst.width).toBe(200);
|
|
403
|
-
expect(result.dst.height).toBe(100);
|
|
404
|
-
expect(result.dst.x).toBe(0);
|
|
405
|
-
expect(result.dst.y).toBe(50); // Centered vertically
|
|
406
|
-
});
|
|
407
|
-
|
|
408
|
-
test("cover mode - source covers destination completely", () => {
|
|
409
|
-
const { Skia, fitRects } = importSkia();
|
|
410
|
-
const srcRect = Skia.XYWHRect(0, 0, 100, 50);
|
|
411
|
-
const dstRect = Skia.XYWHRect(0, 0, 100, 100);
|
|
412
|
-
const result = fitRects("cover", srcRect, dstRect);
|
|
413
|
-
|
|
414
|
-
// Source should be cropped to fit destination aspect ratio
|
|
415
|
-
expect(result.src.width).toBe(50); // Cropped to maintain 1:1 aspect ratio
|
|
416
|
-
expect(result.src.height).toBe(50);
|
|
417
|
-
expect(result.src.x).toBe(25); // Centered horizontally in original rect
|
|
418
|
-
expect(result.src.y).toBe(0);
|
|
419
|
-
|
|
420
|
-
expect(result.dst).toEqual({
|
|
421
|
-
x: 0,
|
|
422
|
-
y: 0,
|
|
423
|
-
width: 100,
|
|
424
|
-
height: 100,
|
|
425
|
-
});
|
|
426
|
-
});
|
|
427
|
-
|
|
428
|
-
test("fitWidth mode - fits to width, adjusts height", () => {
|
|
429
|
-
const { Skia, fitRects } = importSkia();
|
|
430
|
-
const srcRect = Skia.XYWHRect(0, 0, 100, 50);
|
|
431
|
-
const dstRect = Skia.XYWHRect(0, 0, 200, 200);
|
|
432
|
-
const result = fitRects("fitWidth", srcRect, dstRect);
|
|
433
|
-
|
|
434
|
-
// Source is scaled to fit the destination width aspect ratio
|
|
435
|
-
expect(result.src.width).toBe(100);
|
|
436
|
-
expect(result.src.height).toBe(100);
|
|
437
|
-
expect(result.src.x).toBe(0);
|
|
438
|
-
expect(result.src.y).toBe(-25); // Extends beyond original rect to maintain aspect ratio
|
|
439
|
-
|
|
440
|
-
// Destination uses the full destination rectangle
|
|
441
|
-
expect(result.dst.width).toBe(200);
|
|
442
|
-
expect(result.dst.height).toBe(200);
|
|
443
|
-
expect(result.dst.x).toBe(0);
|
|
444
|
-
expect(result.dst.y).toBe(0);
|
|
445
|
-
});
|
|
446
|
-
|
|
447
|
-
test("fitHeight mode - fits to height, adjusts width", () => {
|
|
448
|
-
const { Skia, fitRects } = importSkia();
|
|
449
|
-
const srcRect = Skia.XYWHRect(0, 0, 100, 50);
|
|
450
|
-
const dstRect = Skia.XYWHRect(0, 0, 200, 200);
|
|
451
|
-
const result = fitRects("fitHeight", srcRect, dstRect);
|
|
452
|
-
|
|
453
|
-
// Source is cropped to fit the destination height aspect ratio
|
|
454
|
-
expect(result.src.width).toBe(50);
|
|
455
|
-
expect(result.src.height).toBe(50);
|
|
456
|
-
expect(result.src.x).toBe(25); // Centered horizontally in original rect
|
|
457
|
-
expect(result.src.y).toBe(0);
|
|
458
|
-
|
|
459
|
-
// Destination uses the full destination rectangle
|
|
460
|
-
expect(result.dst.width).toBe(200);
|
|
461
|
-
expect(result.dst.height).toBe(200);
|
|
462
|
-
expect(result.dst.x).toBe(0);
|
|
463
|
-
expect(result.dst.y).toBe(0);
|
|
464
|
-
});
|
|
465
|
-
|
|
466
|
-
test("none mode - uses minimum dimensions", () => {
|
|
467
|
-
const { Skia, fitRects } = importSkia();
|
|
468
|
-
const srcRect = Skia.XYWHRect(0, 0, 100, 50);
|
|
469
|
-
const dstRect = Skia.XYWHRect(0, 0, 80, 120);
|
|
470
|
-
const result = fitRects("none", srcRect, dstRect);
|
|
471
|
-
|
|
472
|
-
// Should use minimum of source and destination dimensions
|
|
473
|
-
expect(result.src.width).toBe(80); // min(100, 80)
|
|
474
|
-
expect(result.src.height).toBe(50); // min(50, 120)
|
|
475
|
-
expect(result.src.x).toBe(10); // Centered in source rect
|
|
476
|
-
expect(result.src.y).toBe(0);
|
|
477
|
-
|
|
478
|
-
expect(result.dst.width).toBe(80);
|
|
479
|
-
expect(result.dst.height).toBe(50);
|
|
480
|
-
expect(result.dst.x).toBe(0);
|
|
481
|
-
expect(result.dst.y).toBe(35); // Centered in destination rect
|
|
482
|
-
});
|
|
483
|
-
|
|
484
|
-
test("scaleDown mode - scales down if needed", () => {
|
|
485
|
-
const { Skia, fitRects } = importSkia();
|
|
486
|
-
const srcRect = Skia.XYWHRect(0, 0, 200, 100);
|
|
487
|
-
const dstRect = Skia.XYWHRect(0, 0, 100, 80);
|
|
488
|
-
const result = fitRects("scaleDown", srcRect, dstRect);
|
|
489
|
-
|
|
490
|
-
expect(result.src).toEqual({
|
|
491
|
-
x: 0,
|
|
492
|
-
y: 0,
|
|
493
|
-
width: 200,
|
|
494
|
-
height: 100,
|
|
495
|
-
});
|
|
496
|
-
|
|
497
|
-
// Should scale down to fit within destination
|
|
498
|
-
expect(result.dst.width).toBe(100);
|
|
499
|
-
expect(result.dst.height).toBe(50); // Maintains aspect ratio 2:1
|
|
500
|
-
expect(result.dst.x).toBe(0);
|
|
501
|
-
expect(result.dst.y).toBe(15); // Centered vertically
|
|
502
|
-
});
|
|
503
|
-
|
|
504
|
-
test("scaleDown mode - no scaling if source is smaller", () => {
|
|
505
|
-
const { Skia, fitRects } = importSkia();
|
|
506
|
-
const srcRect = Skia.XYWHRect(0, 0, 50, 25);
|
|
507
|
-
const dstRect = Skia.XYWHRect(0, 0, 100, 100);
|
|
508
|
-
const result = fitRects("scaleDown", srcRect, dstRect);
|
|
509
|
-
|
|
510
|
-
expect(result.src).toEqual({
|
|
511
|
-
x: 0,
|
|
512
|
-
y: 0,
|
|
513
|
-
width: 50,
|
|
514
|
-
height: 25,
|
|
515
|
-
});
|
|
516
|
-
|
|
517
|
-
// Should not scale up, keep original size
|
|
518
|
-
expect(result.dst.width).toBe(50);
|
|
519
|
-
expect(result.dst.height).toBe(25);
|
|
520
|
-
expect(result.dst.x).toBe(25); // Centered horizontally
|
|
521
|
-
expect(result.dst.y).toBe(37.5); // Centered vertically
|
|
522
|
-
});
|
|
523
|
-
|
|
524
|
-
test("with offset source rectangle", () => {
|
|
525
|
-
const { Skia, fitRects } = importSkia();
|
|
526
|
-
const srcRect = Skia.XYWHRect(50, 100, 100, 50);
|
|
527
|
-
const dstRect = Skia.XYWHRect(10, 20, 200, 100);
|
|
528
|
-
const result = fitRects("fill", srcRect, dstRect);
|
|
529
|
-
|
|
530
|
-
expect(result.src).toEqual({
|
|
531
|
-
x: 50,
|
|
532
|
-
y: 100,
|
|
533
|
-
width: 100,
|
|
534
|
-
height: 50,
|
|
535
|
-
});
|
|
536
|
-
expect(result.dst).toEqual({
|
|
537
|
-
x: 10,
|
|
538
|
-
y: 20,
|
|
539
|
-
width: 200,
|
|
540
|
-
height: 100,
|
|
541
|
-
});
|
|
542
|
-
});
|
|
543
|
-
|
|
544
|
-
test("with very small source rectangle", () => {
|
|
545
|
-
const { Skia, fitRects } = importSkia();
|
|
546
|
-
const srcRect = Skia.XYWHRect(0, 0, 1, 1);
|
|
547
|
-
const dstRect = Skia.XYWHRect(0, 0, 100, 100);
|
|
548
|
-
const result = fitRects("contain", srcRect, dstRect);
|
|
549
|
-
|
|
550
|
-
expect(result.src).toEqual({
|
|
551
|
-
x: 0,
|
|
552
|
-
y: 0,
|
|
553
|
-
width: 1,
|
|
554
|
-
height: 1,
|
|
555
|
-
});
|
|
556
|
-
expect(result.dst).toEqual({
|
|
557
|
-
x: 0,
|
|
558
|
-
y: 0,
|
|
559
|
-
width: 100,
|
|
560
|
-
height: 100,
|
|
561
|
-
});
|
|
562
|
-
});
|
|
563
|
-
|
|
564
|
-
test("with zero dimensions - should return empty sizes", () => {
|
|
565
|
-
const { Skia, fitRects } = importSkia();
|
|
566
|
-
const srcRect = Skia.XYWHRect(0, 0, 0, 100);
|
|
567
|
-
const dstRect = Skia.XYWHRect(0, 0, 100, 100);
|
|
568
|
-
const result = fitRects("fill", srcRect, dstRect);
|
|
569
|
-
|
|
570
|
-
expect(result.src).toEqual({
|
|
571
|
-
x: 0,
|
|
572
|
-
y: 50,
|
|
573
|
-
width: 0,
|
|
574
|
-
height: 0,
|
|
575
|
-
});
|
|
576
|
-
expect(result.dst).toEqual({
|
|
577
|
-
x: 50,
|
|
578
|
-
y: 50,
|
|
579
|
-
width: 0,
|
|
580
|
-
height: 0,
|
|
581
|
-
});
|
|
582
|
-
});
|
|
583
|
-
|
|
584
|
-
test("cover mode with wide source rectangle", () => {
|
|
585
|
-
const { Skia, fitRects } = importSkia();
|
|
586
|
-
const srcRect = Skia.XYWHRect(0, 0, 200, 50);
|
|
587
|
-
const dstRect = Skia.XYWHRect(0, 0, 100, 100);
|
|
588
|
-
const result = fitRects("cover", srcRect, dstRect);
|
|
589
|
-
|
|
590
|
-
// Source should be cropped to square aspect ratio
|
|
591
|
-
expect(result.src.width).toBe(50); // Cropped width
|
|
592
|
-
expect(result.src.height).toBe(50);
|
|
593
|
-
expect(result.src.x).toBe(75); // Centered horizontally
|
|
594
|
-
expect(result.src.y).toBe(0);
|
|
595
|
-
|
|
596
|
-
expect(result.dst).toEqual({
|
|
597
|
-
x: 0,
|
|
598
|
-
y: 0,
|
|
599
|
-
width: 100,
|
|
600
|
-
height: 100,
|
|
601
|
-
});
|
|
602
|
-
});
|
|
603
|
-
|
|
604
|
-
test("cover mode with tall destination rectangle", () => {
|
|
605
|
-
const { Skia, fitRects } = importSkia();
|
|
606
|
-
const srcRect = Skia.XYWHRect(0, 0, 100, 100);
|
|
607
|
-
const dstRect = Skia.XYWHRect(0, 0, 50, 200);
|
|
608
|
-
const result = fitRects("cover", srcRect, dstRect);
|
|
609
|
-
|
|
610
|
-
// Source should be cropped to 1:4 aspect ratio
|
|
611
|
-
expect(result.src.width).toBe(25); // Cropped to match destination aspect ratio
|
|
612
|
-
expect(result.src.height).toBe(100);
|
|
613
|
-
expect(result.src.x).toBe(37.5); // Centered horizontally
|
|
614
|
-
expect(result.src.y).toBe(0);
|
|
615
|
-
|
|
616
|
-
expect(result.dst).toEqual({
|
|
617
|
-
x: 0,
|
|
618
|
-
y: 0,
|
|
619
|
-
width: 50,
|
|
620
|
-
height: 200,
|
|
621
|
-
});
|
|
622
|
-
});
|
|
623
|
-
});
|
|
624
|
-
describe("Path bounds", () => {
|
|
625
|
-
test("computes bounds for cubic with extreme control points", () => {
|
|
626
|
-
const { Skia } = importSkia();
|
|
627
|
-
const path = Skia.Path.Make();
|
|
628
|
-
path.moveTo(0, 0);
|
|
629
|
-
path.cubicTo(-50, 100, 150, -50, 100, 100);
|
|
630
|
-
const bounds = path.computeTightBounds();
|
|
631
|
-
// bounds is -8.09475040435791 0 116.1894998550415 100
|
|
632
|
-
expect(bounds.x).toBeCloseTo(-8.09475, 2);
|
|
633
|
-
expect(bounds.y).toBeCloseTo(0, 2);
|
|
634
|
-
expect(bounds.width).toBeCloseTo(116.1895, 2);
|
|
635
|
-
expect(bounds.height).toBeCloseTo(100, 2);
|
|
636
|
-
});
|
|
637
|
-
test("computes bounds for cubic forming loop", () => {
|
|
638
|
-
const { Skia } = importSkia();
|
|
639
|
-
const path = Skia.Path.Make();
|
|
640
|
-
path.moveTo(0, 0);
|
|
641
|
-
path.cubicTo(100, 0, 100, 100, 0, 50);
|
|
642
|
-
const bounds = path.computeTightBounds();
|
|
643
|
-
expect(bounds.x).toBeCloseTo(0, 2);
|
|
644
|
-
expect(bounds.y).toBeCloseTo(0, 2);
|
|
645
|
-
expect(bounds.width).toBeCloseTo(75, 2);
|
|
646
|
-
expect(bounds.height).toBeCloseTo(64, 2);
|
|
647
|
-
});
|
|
648
|
-
test("computes bounds for multiple cubics forming complex path", () => {
|
|
649
|
-
const { Skia } = importSkia();
|
|
650
|
-
const path = Skia.Path.Make();
|
|
651
|
-
path.moveTo(0, 50);
|
|
652
|
-
path.cubicTo(25, 0, 75, 100, 100, 50);
|
|
653
|
-
path.moveTo(100, 50);
|
|
654
|
-
path.cubicTo(125, 0, 175, 100, 200, 50);
|
|
655
|
-
path.moveTo(200, 50);
|
|
656
|
-
path.cubicTo(225, 100, 275, 0, 300, 50);
|
|
657
|
-
|
|
658
|
-
const bounds = path.computeTightBounds();
|
|
659
|
-
expect(bounds.x).toBeCloseTo(0, 2);
|
|
660
|
-
expect(bounds.y).toBeCloseTo(35.56624221801758, 2);
|
|
661
|
-
expect(bounds.width).toBeCloseTo(300, 2);
|
|
662
|
-
expect(bounds.height).toBeCloseTo(28.867511749267578, 2);
|
|
663
|
-
});
|
|
664
|
-
test("draw Skia logo", () => {
|
|
665
|
-
const skiaLogo =
|
|
666
|
-
"M465.63 273.956C409.11 212.516 348.87 258.846 362.34 310.646C367.09 328.936 381.05 347.906 407.6 363.056C444.3 383.986 460.05 408.286 461.42 430.426C464.57 481.036 392.6 520.356 324 482.376M490 430.426C589.17 299.226 590.11 228.576 568.77 222.366C554.04 218.586 529.13 244.036 518 301.366C505.52 367.526 500.67 405.066 490 494.956C505.58 451.676 514.49 414.746 545.45 389.956C554.589 382.551 565.818 378.197 577.56 377.506C628.71 374.806 621.17 446.096 541.95 430.406M541.95 430.426C575.55 436.726 571.27 458.036 580.75 482.326C582.111 485.913 584.445 489.051 587.49 491.386C607.49 506.386 643.49 476.616 654.36 457.216C671.21 432.636 684.24 404.916 697.36 378.486M697.38 378.486C684.12 411.766 675.597 437.196 671.81 454.776C668.54 481.546 675.24 493.636 686.32 496.256C710.7 502.016 756.23 461.896 763.13 431.256C776.37 372.396 862.18 350.556 881.97 419.656M881.97 419.636C862.18 350.536 776.21 372.376 763.13 431.236C759.37 455.676 766.85 473.336 779.67 483.966C786.621 489.63 794.908 493.417 803.74 494.966C818.132 497.496 832.957 495.178 845.89 488.376C846.69 487.956 847.49 487.516 848.29 487.056C856.441 482.27 863.382 475.672 868.574 467.773C873.765 459.875 877.069 450.887 878.23 441.506C881.09 419.196 888.04 394.656 892.59 378.086M892.59 378.076C885.36 404.426 872.1 449.746 878.77 476.156C880.283 482.292 884.122 487.599 889.475 490.958C894.828 494.316 901.277 495.463 907.46 494.156C925.39 490.256 943.78 472.156 955.09 454.336M714.5 338C714.5 339.933 712.933 341.5 711 341.5C709.067 341.5 707.5 339.933 707.5 338C707.5 336.067 709.067 334.5 711 334.5C712.933 334.5 714.5 336.067 714.5 338Z";
|
|
667
|
-
const { Skia } = importSkia();
|
|
668
|
-
const path = Skia.Path.MakeFromSVGString(skiaLogo)!;
|
|
669
|
-
const bounds = path.computeTightBounds();
|
|
670
|
-
console.log(bounds.x, bounds.y, bounds.width, bounds.height);
|
|
671
|
-
expect(bounds.x).toBeCloseTo(324, 2);
|
|
672
|
-
expect(bounds.y).toBeCloseTo(222, 2);
|
|
673
|
-
expect(bounds.width).toBeCloseTo(631.09, 2);
|
|
674
|
-
expect(bounds.height).toBeCloseTo(275.55, 2);
|
|
675
|
-
});
|
|
676
|
-
});
|
|
677
|
-
});
|