@shopify/react-native-skia 0.1.157 → 0.1.159
Sign up to get free protection for your applications and to get access to all the features.
- package/android/CMakeLists.txt +35 -11
- package/android/build.gradle +31 -30
- package/android/cpp/jni/JniLoad.cpp +2 -0
- package/android/cpp/jni/include/JniSkiaDomView.h +89 -0
- package/android/cpp/rnskia-android/SkiaOpenGLRenderer.cpp +4 -3
- package/android/cpp/rnskia-android/SkiaOpenGLRenderer.h +4 -3
- package/android/src/main/java/com/shopify/reactnative/skia/RNSkiaPackage.java +2 -1
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaDomView.java +45 -0
- package/android/src/main/java/com/shopify/reactnative/skia/SkiaDomViewManager.java +64 -0
- package/cpp/api/JsiSkContourMeasure.h +7 -5
- package/cpp/api/JsiSkHostObjects.h +6 -0
- package/cpp/api/JsiSkImageFilterFactory.h +1 -1
- package/cpp/api/JsiSkPaint.h +9 -2
- package/cpp/api/JsiSkPath.h +1 -0
- package/cpp/api/JsiSkRuntimeEffect.h +36 -36
- package/cpp/jsi/JsiHostObject.cpp +16 -28
- package/cpp/jsi/JsiHostObject.h +127 -7
- package/cpp/jsi/JsiValue.cpp +346 -0
- package/cpp/jsi/JsiValue.h +222 -0
- package/cpp/jsi/JsiValueWrapper.h +33 -5
- package/cpp/rnskia/RNSkDomView.cpp +220 -0
- package/cpp/rnskia/RNSkDomView.h +140 -0
- package/cpp/rnskia/RNSkJsView.cpp +0 -4
- package/cpp/rnskia/RNSkJsView.h +6 -4
- package/cpp/rnskia/RNSkManager.cpp +7 -0
- package/cpp/rnskia/RNSkPictureView.h +5 -8
- package/cpp/rnskia/RNSkView.h +113 -5
- package/cpp/rnskia/dom/JsiDomApi.h +167 -0
- package/cpp/rnskia/dom/base/BaseNodeProp.h +72 -0
- package/cpp/rnskia/dom/base/DerivedNodeProp.h +187 -0
- package/cpp/rnskia/dom/base/DrawingContext.cpp +227 -0
- package/cpp/rnskia/dom/base/DrawingContext.h +136 -0
- package/cpp/rnskia/dom/base/JsiDependencyManager.h +294 -0
- package/cpp/rnskia/dom/base/JsiDomDeclarationNode.h +176 -0
- package/cpp/rnskia/dom/base/JsiDomDrawingNode.h +50 -0
- package/cpp/rnskia/dom/base/JsiDomNode.h +361 -0
- package/cpp/rnskia/dom/base/JsiDomRenderNode.h +267 -0
- package/cpp/rnskia/dom/base/NodeProp.h +130 -0
- package/cpp/rnskia/dom/base/NodePropsContainer.h +119 -0
- package/cpp/rnskia/dom/nodes/JsiBackdropFilterNode.h +38 -0
- package/cpp/rnskia/dom/nodes/JsiBlendNode.h +112 -0
- package/cpp/rnskia/dom/nodes/JsiBlurMaskNode.h +78 -0
- package/cpp/rnskia/dom/nodes/JsiBoxNode.h +104 -0
- package/cpp/rnskia/dom/nodes/JsiBoxShadowNode.h +33 -0
- package/cpp/rnskia/dom/nodes/JsiCircleNode.h +38 -0
- package/cpp/rnskia/dom/nodes/JsiColorFilterNodes.h +192 -0
- package/cpp/rnskia/dom/nodes/JsiCustomDrawingNode.h +123 -0
- package/cpp/rnskia/dom/nodes/JsiDiffRectNode.h +42 -0
- package/cpp/rnskia/dom/nodes/JsiFillNode.h +22 -0
- package/cpp/rnskia/dom/nodes/JsiGlyphsNode.h +56 -0
- package/cpp/rnskia/dom/nodes/JsiGroupNode.h +26 -0
- package/cpp/rnskia/dom/nodes/JsiImageFilterNodes.h +415 -0
- package/cpp/rnskia/dom/nodes/JsiImageNode.h +34 -0
- package/cpp/rnskia/dom/nodes/JsiImageSvgNode.h +44 -0
- package/cpp/rnskia/dom/nodes/JsiLayerNode.h +64 -0
- package/cpp/rnskia/dom/nodes/JsiLineNode.h +43 -0
- package/cpp/rnskia/dom/nodes/JsiOvalNode.h +34 -0
- package/cpp/rnskia/dom/nodes/JsiPaintNode.h +77 -0
- package/cpp/rnskia/dom/nodes/JsiPatchNode.h +54 -0
- package/cpp/rnskia/dom/nodes/JsiPathEffectNodes.h +315 -0
- package/cpp/rnskia/dom/nodes/JsiPathNode.h +181 -0
- package/cpp/rnskia/dom/nodes/JsiPictureNode.h +32 -0
- package/cpp/rnskia/dom/nodes/JsiPointsNode.h +51 -0
- package/cpp/rnskia/dom/nodes/JsiRRectNode.h +34 -0
- package/cpp/rnskia/dom/nodes/JsiRectNode.h +34 -0
- package/cpp/rnskia/dom/nodes/JsiShaderNodes.h +517 -0
- package/cpp/rnskia/dom/nodes/JsiTextBlobNode.h +47 -0
- package/cpp/rnskia/dom/nodes/JsiTextNode.h +54 -0
- package/cpp/rnskia/dom/nodes/JsiTextPathNode.h +32 -0
- package/cpp/rnskia/dom/nodes/JsiVerticesNode.h +43 -0
- package/cpp/rnskia/dom/props/BezierProps.h +63 -0
- package/cpp/rnskia/dom/props/BlendModeProp.h +101 -0
- package/cpp/rnskia/dom/props/BoxShadowProps.h +61 -0
- package/cpp/rnskia/dom/props/CircleProp.h +46 -0
- package/cpp/rnskia/dom/props/ClipProp.h +62 -0
- package/cpp/rnskia/dom/props/ColorProp.h +80 -0
- package/cpp/rnskia/dom/props/DrawingProp.h +33 -0
- package/cpp/rnskia/dom/props/FontProp.h +34 -0
- package/cpp/rnskia/dom/props/GlyphsProp.h +53 -0
- package/cpp/rnskia/dom/props/ImageProps.h +173 -0
- package/cpp/rnskia/dom/props/LayerProp.h +50 -0
- package/cpp/rnskia/dom/props/MatrixProp.h +33 -0
- package/cpp/rnskia/dom/props/NumbersProp.h +63 -0
- package/cpp/rnskia/dom/props/PaintProps.h +172 -0
- package/cpp/rnskia/dom/props/PathProp.h +55 -0
- package/cpp/rnskia/dom/props/PictureProp.h +38 -0
- package/cpp/rnskia/dom/props/PointProp.h +72 -0
- package/cpp/rnskia/dom/props/PointsProp.h +83 -0
- package/cpp/rnskia/dom/props/RRectProp.h +134 -0
- package/cpp/rnskia/dom/props/RadiusProp.h +43 -0
- package/cpp/rnskia/dom/props/RectProp.h +118 -0
- package/cpp/rnskia/dom/props/StrokeProps.h +75 -0
- package/cpp/rnskia/dom/props/SvgProp.h +37 -0
- package/cpp/rnskia/dom/props/TextBlobProp.h +128 -0
- package/cpp/rnskia/dom/props/TileModeProp.h +50 -0
- package/cpp/rnskia/dom/props/TransformProp.h +80 -0
- package/cpp/rnskia/dom/props/TransformsProps.h +68 -0
- package/cpp/rnskia/dom/props/UniformsProp.h +194 -0
- package/cpp/rnskia/dom/props/VertexModeProp.h +47 -0
- package/cpp/rnskia/dom/props/VerticesProps.h +67 -0
- package/cpp/rnskia/values/RNSkReadonlyValue.h +13 -4
- package/cpp/skia/include/android/SkAndroidFrameworkUtils.h +35 -1
- package/cpp/skia/include/codec/SkAndroidCodec.h +17 -1
- package/cpp/skia/include/codec/SkCodec.h +8 -5
- package/cpp/skia/include/core/SkAnnotation.h +2 -0
- package/cpp/skia/include/core/SkBitmap.h +52 -1
- package/cpp/skia/include/core/SkBlendMode.h +2 -0
- package/cpp/skia/include/core/SkCanvas.h +52 -31
- package/cpp/skia/include/core/SkCapabilities.h +44 -0
- package/cpp/skia/include/core/SkColor.h +7 -0
- package/cpp/skia/include/core/SkColorFilter.h +37 -0
- package/cpp/skia/include/core/SkColorSpace.h +1 -1
- package/cpp/skia/include/core/SkFont.h +4 -0
- package/cpp/skia/include/core/SkFontMgr.h +3 -0
- package/cpp/skia/include/core/SkGraphics.h +9 -0
- package/cpp/skia/include/core/SkImage.h +77 -17
- package/cpp/skia/include/core/SkImageEncoder.h +5 -3
- package/cpp/skia/include/core/SkImageGenerator.h +27 -17
- package/cpp/skia/include/core/SkM44.h +1 -0
- package/cpp/skia/include/core/SkMesh.h +120 -34
- package/cpp/skia/include/core/SkMilestone.h +1 -1
- package/cpp/skia/include/core/SkOverdrawCanvas.h +2 -1
- package/cpp/skia/include/core/SkPaint.h +15 -2
- package/cpp/skia/include/core/SkPath.h +4 -0
- package/cpp/skia/include/core/SkPathBuilder.h +1 -1
- package/cpp/skia/include/core/SkPicture.h +0 -3
- package/cpp/skia/include/core/SkPictureRecorder.h +0 -2
- package/cpp/skia/include/core/SkPixmap.h +19 -0
- package/cpp/skia/include/core/SkRasterHandleAllocator.h +3 -1
- package/cpp/skia/include/core/SkRect.h +11 -4
- package/cpp/skia/include/core/SkRefCnt.h +13 -1
- package/cpp/skia/include/core/SkRegion.h +6 -0
- package/cpp/skia/include/core/SkSamplingOptions.h +8 -6
- package/cpp/skia/include/core/SkScalar.h +6 -25
- package/cpp/skia/include/core/SkShader.h +20 -12
- package/cpp/skia/include/core/SkSpan.h +51 -19
- package/cpp/skia/include/core/SkStream.h +2 -2
- package/cpp/skia/include/core/SkString.h +11 -3
- package/cpp/skia/include/core/SkSurface.h +85 -8
- package/cpp/skia/include/core/SkTextBlob.h +5 -2
- package/cpp/skia/include/core/SkTypes.h +11 -10
- package/cpp/skia/include/docs/SkPDFDocument.h +0 -5
- package/cpp/skia/include/effects/Sk1DPathEffect.h +6 -1
- package/cpp/skia/include/effects/Sk2DPathEffect.h +4 -1
- package/cpp/skia/include/effects/SkColorMatrix.h +1 -0
- package/cpp/skia/include/effects/SkColorMatrixFilter.h +5 -8
- package/cpp/skia/include/effects/SkCornerPathEffect.h +5 -1
- package/cpp/skia/include/effects/SkDashPathEffect.h +5 -1
- package/cpp/skia/include/effects/SkGradientShader.h +68 -38
- package/cpp/skia/include/effects/SkHighContrastFilter.h +5 -1
- package/cpp/skia/include/effects/SkImageFilters.h +5 -4
- package/cpp/skia/include/effects/SkLumaColorFilter.h +4 -1
- package/cpp/skia/include/effects/SkOpPathEffect.h +6 -2
- package/cpp/skia/include/effects/SkOverdrawColorFilter.h +5 -2
- package/cpp/skia/include/effects/SkRuntimeEffect.h +54 -62
- package/cpp/skia/include/effects/SkShaderMaskFilter.h +3 -1
- package/cpp/skia/include/effects/SkTableColorFilter.h +8 -21
- package/cpp/skia/include/effects/SkTableMaskFilter.h +5 -1
- package/cpp/skia/include/effects/SkTrimPathEffect.h +5 -1
- package/cpp/skia/include/encode/SkEncoder.h +17 -0
- package/cpp/skia/include/encode/SkWebpEncoder.h +17 -0
- package/cpp/skia/include/gpu/GpuTypes.h +18 -0
- package/cpp/skia/include/gpu/GrBackendSurface.h +38 -17
- package/cpp/skia/include/gpu/GrBackendSurfaceMutableState.h +6 -71
- package/cpp/skia/include/gpu/GrContextOptions.h +1 -1
- package/cpp/skia/include/gpu/GrContextThreadSafeProxy.h +10 -9
- package/cpp/skia/include/gpu/GrDirectContext.h +42 -22
- package/cpp/skia/include/gpu/GrRecordingContext.h +6 -3
- package/cpp/skia/include/gpu/GrTypes.h +11 -11
- package/cpp/skia/include/gpu/MutableTextureState.h +122 -0
- package/cpp/skia/include/gpu/gl/GrGLFunctions.h +1 -0
- package/cpp/skia/include/gpu/gl/GrGLInterface.h +1 -0
- package/cpp/skia/include/gpu/graphite/BackendTexture.h +7 -0
- package/cpp/skia/include/gpu/graphite/CombinationBuilder.h +195 -0
- package/cpp/skia/include/gpu/graphite/Context.h +47 -55
- package/cpp/skia/include/gpu/graphite/ContextOptions.h +85 -0
- package/cpp/skia/include/gpu/graphite/GraphiteTypes.h +1 -17
- package/cpp/skia/include/gpu/graphite/ImageProvider.h +61 -0
- package/cpp/skia/include/gpu/graphite/Recorder.h +87 -8
- package/cpp/skia/include/gpu/graphite/Recording.h +19 -9
- package/cpp/skia/include/gpu/graphite/TextureInfo.h +40 -8
- package/cpp/skia/include/gpu/graphite/dawn/DawnBackendContext.h +25 -0
- package/cpp/skia/include/gpu/graphite/mtl/MtlBackendContext.h +3 -2
- package/cpp/skia/include/gpu/graphite/vk/VulkanGraphiteTypes.h +69 -0
- package/cpp/skia/include/gpu/mtl/MtlMemoryAllocator.h +39 -0
- package/cpp/skia/include/gpu/vk/GrVkBackendContext.h +21 -19
- package/cpp/skia/include/gpu/vk/GrVkExtensions.h +2 -50
- package/cpp/skia/include/gpu/vk/GrVkMemoryAllocator.h +2 -127
- package/cpp/skia/include/gpu/vk/GrVkTypes.h +5 -43
- package/cpp/skia/include/gpu/vk/VulkanBackendContext.h +46 -0
- package/cpp/skia/include/gpu/vk/VulkanExtensions.h +67 -0
- package/cpp/skia/include/gpu/vk/VulkanMemoryAllocator.h +116 -0
- package/cpp/skia/include/gpu/vk/VulkanTypes.h +59 -0
- package/cpp/skia/include/pathops/SkPathOps.h +1 -1
- package/cpp/skia/include/private/SkColorData.h +10 -40
- package/cpp/skia/include/private/SkEncodedInfo.h +9 -3
- package/cpp/skia/include/private/SkFloatingPoint.h +9 -6
- package/cpp/skia/include/private/SkHalf.h +5 -52
- package/cpp/skia/include/private/SkMacros.h +1 -1
- package/cpp/skia/include/private/SkMalloc.h +4 -0
- package/cpp/skia/include/private/SkPathRef.h +10 -10
- package/cpp/skia/include/private/SkSLModifiers.h +59 -23
- package/cpp/skia/include/private/SkSLProgramKind.h +1 -0
- package/cpp/skia/include/private/SkSLSymbol.h +7 -3
- package/cpp/skia/include/private/SkStringView.h +4 -0
- package/cpp/skia/include/private/SkTArray.h +21 -7
- package/cpp/skia/include/private/SkTDArray.h +173 -285
- package/cpp/skia/include/private/SkTHash.h +33 -32
- package/cpp/skia/include/private/SkTemplates.h +24 -26
- package/cpp/skia/include/private/SkVx.h +218 -135
- package/cpp/skia/include/private/chromium/GrSlug.h +3 -65
- package/cpp/skia/include/private/chromium/SkChromeRemoteGlyphCache.h +6 -3
- package/cpp/skia/include/private/chromium/Slug.h +76 -0
- package/cpp/skia/include/private/gpu/ganesh/GrTypesPriv.h +6 -1
- package/cpp/skia/include/private/gpu/ganesh/GrVkTypesPriv.h +5 -39
- package/cpp/skia/include/private/gpu/graphite/VulkanGraphiteTypesPriv.h +63 -0
- package/cpp/skia/include/{gpu/vk/GrVkVulkan.h → private/gpu/vk/SkiaVulkan.h} +2 -2
- package/cpp/skia/include/private/gpu/vk/VulkanTypesPriv.h +57 -0
- package/cpp/skia/include/sksl/DSL.h +0 -1
- package/cpp/skia/include/sksl/DSLBlock.h +4 -18
- package/cpp/skia/include/sksl/DSLCase.h +2 -8
- package/cpp/skia/include/sksl/DSLCore.h +8 -15
- package/cpp/skia/include/sksl/DSLExpression.h +51 -142
- package/cpp/skia/include/sksl/DSLFunction.h +7 -15
- package/cpp/skia/include/sksl/DSLModifiers.h +5 -2
- package/cpp/skia/include/sksl/DSLStatement.h +4 -39
- package/cpp/skia/include/sksl/DSLSymbols.h +1 -11
- package/cpp/skia/include/sksl/DSLType.h +20 -12
- package/cpp/skia/include/sksl/DSLVar.h +56 -146
- package/cpp/skia/include/sksl/SkSLErrorReporter.h +2 -15
- package/cpp/skia/include/sksl/SkSLOperator.h +62 -59
- package/cpp/skia/include/sksl/SkSLPosition.h +2 -0
- package/cpp/skia/include/sksl/SkSLVersion.h +27 -0
- package/cpp/skia/include/svg/SkSVGCanvas.h +1 -0
- package/cpp/skia/include/utils/SkAnimCodecPlayer.h +1 -1
- package/cpp/skia/include/utils/SkBase64.h +2 -0
- package/cpp/skia/include/utils/SkCustomTypeface.h +24 -11
- package/cpp/skia/include/utils/SkEventTracer.h +12 -1
- package/cpp/skia/include/utils/SkNWayCanvas.h +11 -4
- package/cpp/skia/include/utils/SkPaintFilterCanvas.h +9 -4
- package/cpp/skia/include/utils/SkParse.h +3 -0
- package/cpp/skia/include/utils/SkShadowUtils.h +2 -0
- package/cpp/skia/include/utils/SkTextUtils.h +2 -1
- package/cpp/skia/{include/third_party → modules}/skcms/skcms.h +10 -0
- package/cpp/skia/modules/skcms/skcms_internal.h +56 -0
- package/cpp/skia/modules/skcms/src/Transform_inl.h +1609 -0
- package/cpp/skia/modules/skparagraph/include/DartTypes.h +153 -0
- package/cpp/skia/modules/skparagraph/include/FontArguments.h +46 -0
- package/cpp/skia/modules/skparagraph/include/FontCollection.h +84 -0
- package/cpp/skia/modules/skparagraph/include/Metrics.h +98 -0
- package/cpp/skia/modules/skparagraph/include/Paragraph.h +111 -0
- package/cpp/skia/modules/skparagraph/include/ParagraphBuilder.h +69 -0
- package/cpp/skia/modules/skparagraph/include/ParagraphCache.h +77 -0
- package/cpp/skia/modules/skparagraph/include/ParagraphStyle.h +143 -0
- package/cpp/skia/modules/skparagraph/include/TextShadow.h +30 -0
- package/cpp/skia/modules/skparagraph/include/TextStyle.h +352 -0
- package/cpp/skia/modules/skparagraph/include/TypefaceFontProvider.h +81 -0
- package/cpp/skia/modules/svg/include/SkSVGAttributeParser.h +1 -1
- package/cpp/skia/modules/svg/include/SkSVGTypes.h +3 -3
- package/cpp/skia/src/core/SkLRUCache.h +126 -0
- package/cpp/skia/src/core/SkTInternalLList.h +302 -0
- package/cpp/utils/RNSkTimingInfo.h +1 -0
- package/ios/RNSkia-iOS/RNSkMetalCanvasProvider.h +15 -4
- package/ios/RNSkia-iOS/RNSkMetalCanvasProvider.mm +40 -54
- package/ios/RNSkia-iOS/SkiaDomViewManager.h +8 -0
- package/ios/RNSkia-iOS/SkiaDomViewManager.mm +51 -0
- package/lib/commonjs/dom/nodes/DrawingNode.js +1 -5
- package/lib/commonjs/dom/nodes/DrawingNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/JsiSkDOM.js +56 -56
- package/lib/commonjs/dom/nodes/JsiSkDOM.js.map +1 -1
- package/lib/commonjs/dom/nodes/RenderNode.js +3 -9
- package/lib/commonjs/dom/nodes/RenderNode.js.map +1 -1
- package/lib/commonjs/dom/nodes/drawings/Text.js +4 -9
- package/lib/commonjs/dom/nodes/drawings/Text.js.map +1 -1
- package/lib/commonjs/dom/types/Common.js.map +1 -1
- package/lib/commonjs/dom/types/Drawings.js.map +1 -1
- package/lib/commonjs/mock/index.js +0 -1
- package/lib/commonjs/mock/index.js.map +1 -1
- package/lib/commonjs/renderer/Canvas.js +21 -57
- package/lib/commonjs/renderer/Canvas.js.map +1 -1
- package/lib/commonjs/renderer/DependencyManager.js +0 -5
- package/lib/commonjs/renderer/DependencyManager.js.map +1 -1
- package/lib/commonjs/renderer/HostComponents.js.map +1 -1
- package/lib/commonjs/renderer/components/Mask.js +1 -3
- package/lib/commonjs/renderer/components/Mask.js.map +1 -1
- package/lib/commonjs/renderer/components/Paint.js +5 -18
- package/lib/commonjs/renderer/components/Paint.js.map +1 -1
- package/lib/commonjs/renderer/useCanvas.js +8 -6
- package/lib/commonjs/renderer/useCanvas.js.map +1 -1
- package/lib/commonjs/skia/core/Picture.js +1 -24
- package/lib/commonjs/skia/core/Picture.js.map +1 -1
- package/lib/commonjs/skia/core/Rect.js +1 -1
- package/lib/commonjs/skia/core/Rect.js.map +1 -1
- package/lib/commonjs/skia/types/ContourMeasure.js.map +1 -1
- package/lib/commonjs/skia/types/Size.js +2 -0
- package/lib/commonjs/skia/types/Size.js.map +1 -0
- package/lib/commonjs/skia/types/index.js +13 -0
- package/lib/commonjs/skia/types/index.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkColor.js +8 -0
- package/lib/commonjs/skia/web/JsiSkColor.js.map +1 -1
- package/lib/commonjs/skia/web/JsiSkContourMeasure.js +4 -7
- package/lib/commonjs/skia/web/JsiSkContourMeasure.js.map +1 -1
- package/lib/commonjs/values/web/RNSkReadonlyValue.js +4 -2
- package/lib/commonjs/values/web/RNSkReadonlyValue.js.map +1 -1
- package/lib/commonjs/views/SkiaBaseWebView.js +9 -2
- package/lib/commonjs/views/SkiaBaseWebView.js.map +1 -1
- package/lib/commonjs/views/SkiaDomView.js +152 -0
- package/lib/commonjs/views/SkiaDomView.js.map +1 -0
- package/lib/commonjs/views/SkiaDomView.web.js +55 -0
- package/lib/commonjs/views/SkiaDomView.web.js.map +1 -0
- package/lib/commonjs/views/SkiaPictureView.js +16 -2
- package/lib/commonjs/views/SkiaPictureView.js.map +1 -1
- package/lib/commonjs/views/SkiaView.js +17 -2
- package/lib/commonjs/views/SkiaView.js.map +1 -1
- package/lib/commonjs/views/index.js +13 -0
- package/lib/commonjs/views/index.js.map +1 -1
- package/lib/commonjs/views/types.js.map +1 -1
- package/lib/module/dom/nodes/DrawingNode.js +2 -6
- package/lib/module/dom/nodes/DrawingNode.js.map +1 -1
- package/lib/module/dom/nodes/JsiSkDOM.js +56 -56
- package/lib/module/dom/nodes/JsiSkDOM.js.map +1 -1
- package/lib/module/dom/nodes/RenderNode.js +2 -5
- package/lib/module/dom/nodes/RenderNode.js.map +1 -1
- package/lib/module/dom/nodes/drawings/Text.js +4 -9
- package/lib/module/dom/nodes/drawings/Text.js.map +1 -1
- package/lib/module/dom/types/Common.js.map +1 -1
- package/lib/module/dom/types/Drawings.js.map +1 -1
- package/lib/module/mock/index.js +0 -1
- package/lib/module/mock/index.js.map +1 -1
- package/lib/module/renderer/Canvas.js +22 -58
- package/lib/module/renderer/Canvas.js.map +1 -1
- package/lib/module/renderer/DependencyManager.js +0 -5
- package/lib/module/renderer/DependencyManager.js.map +1 -1
- package/lib/module/renderer/HostComponents.js.map +1 -1
- package/lib/module/renderer/components/Mask.js +2 -4
- package/lib/module/renderer/components/Mask.js.map +1 -1
- package/lib/module/renderer/components/Paint.js +3 -14
- package/lib/module/renderer/components/Paint.js.map +1 -1
- package/lib/module/renderer/useCanvas.js +6 -4
- package/lib/module/renderer/useCanvas.js.map +1 -1
- package/lib/module/skia/core/Picture.js +0 -18
- package/lib/module/skia/core/Picture.js.map +1 -1
- package/lib/module/skia/core/Rect.js +1 -1
- package/lib/module/skia/core/Rect.js.map +1 -1
- package/lib/module/skia/types/ContourMeasure.js.map +1 -1
- package/lib/module/skia/types/Size.js +2 -0
- package/lib/module/skia/types/Size.js.map +1 -0
- package/lib/module/skia/types/index.js +1 -0
- package/lib/module/skia/types/index.js.map +1 -1
- package/lib/module/skia/web/JsiSkColor.js +8 -0
- package/lib/module/skia/web/JsiSkColor.js.map +1 -1
- package/lib/module/skia/web/JsiSkContourMeasure.js +3 -7
- package/lib/module/skia/web/JsiSkContourMeasure.js.map +1 -1
- package/lib/module/values/web/RNSkReadonlyValue.js +4 -2
- package/lib/module/values/web/RNSkReadonlyValue.js.map +1 -1
- package/lib/module/views/SkiaBaseWebView.js +9 -2
- package/lib/module/views/SkiaBaseWebView.js.map +1 -1
- package/lib/module/views/SkiaDomView.js +128 -0
- package/lib/module/views/SkiaDomView.js.map +1 -0
- package/lib/module/views/SkiaDomView.web.js +41 -0
- package/lib/module/views/SkiaDomView.web.js.map +1 -0
- package/lib/module/views/SkiaPictureView.js +14 -2
- package/lib/module/views/SkiaPictureView.js.map +1 -1
- package/lib/module/views/SkiaView.js +15 -2
- package/lib/module/views/SkiaView.js.map +1 -1
- package/lib/module/views/index.js +1 -0
- package/lib/module/views/index.js.map +1 -1
- package/lib/module/views/types.js.map +1 -1
- package/lib/typescript/src/dom/nodes/JsiSkDOM.d.ts +57 -64
- package/lib/typescript/src/dom/nodes/RenderNode.d.ts +1 -3
- package/lib/typescript/src/dom/types/Common.d.ts +2 -3
- package/lib/typescript/src/dom/types/Drawings.d.ts +1 -3
- package/lib/typescript/src/renderer/Canvas.d.ts +5 -5
- package/lib/typescript/src/renderer/DependencyManager.d.ts +0 -2
- package/lib/typescript/src/renderer/HostComponents.d.ts +67 -8
- package/lib/typescript/src/renderer/components/Paint.d.ts +3 -4
- package/lib/typescript/src/renderer/useCanvas.d.ts +1 -6
- package/lib/typescript/src/skia/core/Picture.d.ts +0 -8
- package/lib/typescript/src/skia/types/ContourMeasure.d.ts +3 -2
- package/lib/typescript/src/skia/types/Size.d.ts +4 -0
- package/lib/typescript/src/skia/types/index.d.ts +1 -0
- package/lib/typescript/src/skia/web/JsiSkContourMeasure.d.ts +2 -6
- package/lib/typescript/src/views/SkiaBaseWebView.d.ts +4 -0
- package/lib/typescript/src/views/SkiaDomView.d.ts +31 -0
- package/lib/typescript/src/views/SkiaDomView.web.d.ts +7 -0
- package/lib/typescript/src/views/index.d.ts +1 -0
- package/lib/typescript/src/views/types.d.ts +12 -2
- 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.a +0 -0
- package/libs/android/arm64-v8a/libsvg.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.a +0 -0
- package/libs/android/armeabi-v7a/libsvg.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.a +0 -0
- package/libs/android/x86/libsvg.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.a +0 -0
- package/libs/android/x86_64/libsvg.a +0 -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/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 +42 -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 +5 -5
- 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/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 +42 -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/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 +6 -4
- package/react-native-skia.podspec +3 -1
- package/src/dom/nodes/DrawingNode.ts +2 -4
- package/src/dom/nodes/JsiSkDOM.ts +170 -56
- package/src/dom/nodes/RenderNode.ts +2 -14
- package/src/dom/nodes/drawings/Text.ts +4 -4
- package/src/dom/types/Common.ts +2 -4
- package/src/dom/types/Drawings.ts +1 -4
- package/src/mock/index.ts +0 -1
- package/src/renderer/Canvas.tsx +32 -51
- package/src/renderer/DependencyManager.tsx +0 -5
- package/src/renderer/HostComponents.ts +153 -5
- package/src/renderer/components/Mask.tsx +2 -2
- package/src/renderer/components/Paint.tsx +3 -14
- package/src/renderer/useCanvas.ts +5 -5
- package/src/skia/core/Picture.ts +0 -24
- package/src/skia/core/Rect.ts +1 -1
- package/src/skia/types/ContourMeasure.tsx +3 -2
- package/src/skia/types/Size.ts +4 -0
- package/src/skia/types/index.ts +1 -0
- package/src/skia/web/JsiSkColor.ts +11 -0
- package/src/skia/web/JsiSkContourMeasure.ts +7 -3
- package/src/values/web/RNSkReadonlyValue.ts +4 -2
- package/src/views/SkiaBaseWebView.tsx +6 -2
- package/src/views/SkiaDomView.tsx +120 -0
- package/src/views/SkiaDomView.web.tsx +37 -0
- package/src/views/SkiaPictureView.tsx +10 -2
- package/src/views/SkiaView.tsx +11 -3
- package/src/views/index.ts +1 -0
- package/src/views/types.ts +19 -2
- package/cpp/jsi/JsiSimpleValueWrapper.h +0 -99
- package/cpp/skia/include/c/sk_canvas.h +0 -159
- package/cpp/skia/include/c/sk_colorspace.h +0 -25
- package/cpp/skia/include/c/sk_data.h +0 -65
- package/cpp/skia/include/c/sk_image.h +0 -71
- package/cpp/skia/include/c/sk_imageinfo.h +0 -62
- package/cpp/skia/include/c/sk_maskfilter.h +0 -47
- package/cpp/skia/include/c/sk_matrix.h +0 -49
- package/cpp/skia/include/c/sk_paint.h +0 -145
- package/cpp/skia/include/c/sk_path.h +0 -102
- package/cpp/skia/include/c/sk_picture.h +0 -70
- package/cpp/skia/include/c/sk_shader.h +0 -143
- package/cpp/skia/include/c/sk_surface.h +0 -73
- package/cpp/skia/include/c/sk_types.h +0 -278
- package/cpp/skia/include/gpu/graphite/SkStuff.h +0 -47
- package/cpp/skia/include/private/SkNx.h +0 -430
- package/cpp/skia/include/private/SkNx_neon.h +0 -713
- package/cpp/skia/include/private/SkNx_sse.h +0 -823
- package/cpp/skia/include/sksl/DSLRuntimeEffects.h +0 -32
- package/cpp/skia/include/sksl/DSLWrapper.h +0 -77
@@ -1,73 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* Copyright 2014 Google Inc.
|
3
|
-
*
|
4
|
-
* Use of this source code is governed by a BSD-style license that can be
|
5
|
-
* found in the LICENSE file.
|
6
|
-
*/
|
7
|
-
|
8
|
-
// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
|
9
|
-
// DO NOT USE -- FOR INTERNAL TESTING ONLY
|
10
|
-
|
11
|
-
#ifndef sk_surface_DEFINED
|
12
|
-
#define sk_surface_DEFINED
|
13
|
-
|
14
|
-
#include "include/c/sk_types.h"
|
15
|
-
|
16
|
-
SK_C_PLUS_PLUS_BEGIN_GUARD
|
17
|
-
|
18
|
-
/**
|
19
|
-
Return a new surface, with the memory for the pixels automatically
|
20
|
-
allocated. If the requested surface cannot be created, or the
|
21
|
-
request is not a supported configuration, NULL will be returned.
|
22
|
-
|
23
|
-
@param sk_imageinfo_t* Specify the width, height, color type, and
|
24
|
-
alpha type for the surface.
|
25
|
-
|
26
|
-
@param sk_surfaceprops_t* If not NULL, specify additional non-default
|
27
|
-
properties of the surface.
|
28
|
-
*/
|
29
|
-
SK_API sk_surface_t* sk_surface_new_raster(const sk_imageinfo_t*, const sk_surfaceprops_t*);
|
30
|
-
|
31
|
-
/**
|
32
|
-
Create a new surface which will draw into the specified pixels
|
33
|
-
with the specified rowbytes. If the requested surface cannot be
|
34
|
-
created, or the request is not a supported configuration, NULL
|
35
|
-
will be returned.
|
36
|
-
|
37
|
-
@param sk_imageinfo_t* Specify the width, height, color type, and
|
38
|
-
alpha type for the surface.
|
39
|
-
@param void* pixels Specify the location in memory where the
|
40
|
-
destination pixels are. This memory must
|
41
|
-
outlast this surface.
|
42
|
-
@param size_t rowBytes Specify the difference, in bytes, between
|
43
|
-
each adjacent row. Should be at least
|
44
|
-
(width * sizeof(one pixel)).
|
45
|
-
@param sk_surfaceprops_t* If not NULL, specify additional non-default
|
46
|
-
properties of the surface.
|
47
|
-
*/
|
48
|
-
SK_API sk_surface_t* sk_surface_new_raster_direct(const sk_imageinfo_t*,
|
49
|
-
void* pixels, size_t rowBytes,
|
50
|
-
const sk_surfaceprops_t* props);
|
51
|
-
|
52
|
-
/**
|
53
|
-
Decrement the reference count. If the reference count is 1 before
|
54
|
-
the decrement, then release both the memory holding the
|
55
|
-
sk_surface_t and any pixel memory it may be managing. New
|
56
|
-
sk_surface_t are created with a reference count of 1.
|
57
|
-
*/
|
58
|
-
SK_API void sk_surface_unref(sk_surface_t*);
|
59
|
-
|
60
|
-
/**
|
61
|
-
* Return the canvas associated with this surface. Note: the canvas is owned by the surface,
|
62
|
-
* so the returned object is only valid while the owning surface is valid.
|
63
|
-
*/
|
64
|
-
SK_API sk_canvas_t* sk_surface_get_canvas(sk_surface_t*);
|
65
|
-
|
66
|
-
/**
|
67
|
-
* Call sk_image_unref() when the returned image is no longer used.
|
68
|
-
*/
|
69
|
-
SK_API sk_image_t* sk_surface_new_image_snapshot(sk_surface_t*);
|
70
|
-
|
71
|
-
SK_C_PLUS_PLUS_END_GUARD
|
72
|
-
|
73
|
-
#endif
|
@@ -1,278 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* Copyright 2014 Google Inc.
|
3
|
-
*
|
4
|
-
* Use of this source code is governed by a BSD-style license that can be
|
5
|
-
* found in the LICENSE file.
|
6
|
-
*/
|
7
|
-
|
8
|
-
// EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL EXPERIMENTAL
|
9
|
-
// DO NOT USE -- FOR INTERNAL TESTING ONLY
|
10
|
-
|
11
|
-
#ifndef sk_types_DEFINED
|
12
|
-
#define sk_types_DEFINED
|
13
|
-
|
14
|
-
#include <stdint.h>
|
15
|
-
#include <stddef.h>
|
16
|
-
|
17
|
-
#ifdef __cplusplus
|
18
|
-
#define SK_C_PLUS_PLUS_BEGIN_GUARD extern "C" {
|
19
|
-
#define SK_C_PLUS_PLUS_END_GUARD }
|
20
|
-
#else
|
21
|
-
#include <stdbool.h>
|
22
|
-
#define SK_C_PLUS_PLUS_BEGIN_GUARD
|
23
|
-
#define SK_C_PLUS_PLUS_END_GUARD
|
24
|
-
#endif
|
25
|
-
|
26
|
-
#if !defined(SK_API)
|
27
|
-
#if defined(SKIA_DLL)
|
28
|
-
#if defined(_MSC_VER)
|
29
|
-
#if SKIA_IMPLEMENTATION
|
30
|
-
#define SK_API __declspec(dllexport)
|
31
|
-
#else
|
32
|
-
#define SK_API __declspec(dllimport)
|
33
|
-
#endif
|
34
|
-
#else
|
35
|
-
#define SK_API __attribute__((visibility("default")))
|
36
|
-
#endif
|
37
|
-
#else
|
38
|
-
#define SK_API
|
39
|
-
#endif
|
40
|
-
#endif
|
41
|
-
|
42
|
-
///////////////////////////////////////////////////////////////////////////////////////
|
43
|
-
|
44
|
-
SK_C_PLUS_PLUS_BEGIN_GUARD
|
45
|
-
|
46
|
-
typedef uint32_t sk_color_t;
|
47
|
-
|
48
|
-
/* This macro assumes all arguments are >=0 and <=255. */
|
49
|
-
#define sk_color_set_argb(a, r, g, b) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b))
|
50
|
-
#define sk_color_get_a(c) (((c) >> 24) & 0xFF)
|
51
|
-
#define sk_color_get_r(c) (((c) >> 16) & 0xFF)
|
52
|
-
#define sk_color_get_g(c) (((c) >> 8) & 0xFF)
|
53
|
-
#define sk_color_get_b(c) (((c) >> 0) & 0xFF)
|
54
|
-
|
55
|
-
typedef enum {
|
56
|
-
INTERSECT_SK_CLIPTYPE,
|
57
|
-
DIFFERENCE_SK_CLIPTYPE,
|
58
|
-
} sk_cliptype_t;
|
59
|
-
|
60
|
-
typedef enum {
|
61
|
-
UNKNOWN_SK_PIXELGEOMETRY,
|
62
|
-
RGB_H_SK_PIXELGEOMETRY,
|
63
|
-
BGR_H_SK_PIXELGEOMETRY,
|
64
|
-
RGB_V_SK_PIXELGEOMETRY,
|
65
|
-
BGR_V_SK_PIXELGEOMETRY,
|
66
|
-
} sk_pixelgeometry_t;
|
67
|
-
|
68
|
-
typedef struct {
|
69
|
-
sk_pixelgeometry_t pixelGeometry;
|
70
|
-
} sk_surfaceprops_t;
|
71
|
-
|
72
|
-
typedef struct {
|
73
|
-
float x;
|
74
|
-
float y;
|
75
|
-
} sk_point_t;
|
76
|
-
|
77
|
-
typedef struct {
|
78
|
-
int32_t left;
|
79
|
-
int32_t top;
|
80
|
-
int32_t right;
|
81
|
-
int32_t bottom;
|
82
|
-
} sk_irect_t;
|
83
|
-
|
84
|
-
typedef struct {
|
85
|
-
float left;
|
86
|
-
float top;
|
87
|
-
float right;
|
88
|
-
float bottom;
|
89
|
-
} sk_rect_t;
|
90
|
-
|
91
|
-
/**
|
92
|
-
The sk_matrix_t struct holds a 3x3 perspective matrix for
|
93
|
-
transforming coordinates:
|
94
|
-
|
95
|
-
(X,Y) = T[M]((x,y))
|
96
|
-
X = (M[0] * x + M[1] * y + M[2]) / (M[6] * x + M[7] * y + M[8]);
|
97
|
-
Y = (M[3] * x + M[4] * y + M[5]) / (M[6] * x + M[7] * y + M[8]);
|
98
|
-
|
99
|
-
Therefore, the identity matrix is
|
100
|
-
|
101
|
-
sk_matrix_t identity = {{1, 0, 0,
|
102
|
-
0, 1, 0,
|
103
|
-
0, 0, 1}};
|
104
|
-
|
105
|
-
A matrix that scales by sx and sy is:
|
106
|
-
|
107
|
-
sk_matrix_t scale = {{sx, 0, 0,
|
108
|
-
0, sy, 0,
|
109
|
-
0, 0, 1}};
|
110
|
-
|
111
|
-
A matrix that translates by tx and ty is:
|
112
|
-
|
113
|
-
sk_matrix_t translate = {{1, 0, tx,
|
114
|
-
0, 1, ty,
|
115
|
-
0, 0, 1}};
|
116
|
-
|
117
|
-
A matrix that rotates around the origin by A radians:
|
118
|
-
|
119
|
-
sk_matrix_t rotate = {{cos(A), -sin(A), 0,
|
120
|
-
sin(A), cos(A), 0,
|
121
|
-
0, 0, 1}};
|
122
|
-
|
123
|
-
Two matrixes can be concatinated by:
|
124
|
-
|
125
|
-
void concat_matrices(sk_matrix_t* dst,
|
126
|
-
const sk_matrix_t* matrixU,
|
127
|
-
const sk_matrix_t* matrixV) {
|
128
|
-
const float* u = matrixU->mat;
|
129
|
-
const float* v = matrixV->mat;
|
130
|
-
sk_matrix_t result = {{
|
131
|
-
u[0] * v[0] + u[1] * v[3] + u[2] * v[6],
|
132
|
-
u[0] * v[1] + u[1] * v[4] + u[2] * v[7],
|
133
|
-
u[0] * v[2] + u[1] * v[5] + u[2] * v[8],
|
134
|
-
u[3] * v[0] + u[4] * v[3] + u[5] * v[6],
|
135
|
-
u[3] * v[1] + u[4] * v[4] + u[5] * v[7],
|
136
|
-
u[3] * v[2] + u[4] * v[5] + u[5] * v[8],
|
137
|
-
u[6] * v[0] + u[7] * v[3] + u[8] * v[6],
|
138
|
-
u[6] * v[1] + u[7] * v[4] + u[8] * v[7],
|
139
|
-
u[6] * v[2] + u[7] * v[5] + u[8] * v[8]
|
140
|
-
}};
|
141
|
-
*dst = result;
|
142
|
-
}
|
143
|
-
*/
|
144
|
-
typedef struct {
|
145
|
-
float mat[9];
|
146
|
-
} sk_matrix_t;
|
147
|
-
|
148
|
-
/**
|
149
|
-
A sk_canvas_t encapsulates all of the state about drawing into a
|
150
|
-
destination This includes a reference to the destination itself,
|
151
|
-
and a stack of matrix/clip values.
|
152
|
-
*/
|
153
|
-
typedef struct sk_canvas_t sk_canvas_t;
|
154
|
-
/**
|
155
|
-
A sk_data_ holds an immutable data buffer.
|
156
|
-
*/
|
157
|
-
typedef struct sk_data_t sk_data_t;
|
158
|
-
/**
|
159
|
-
A sk_image_t is an abstraction for drawing a rectagle of pixels.
|
160
|
-
The content of the image is always immutable, though the actual
|
161
|
-
storage may change, if for example that image can be re-created via
|
162
|
-
encoded data or other means.
|
163
|
-
*/
|
164
|
-
typedef struct sk_image_t sk_image_t;
|
165
|
-
|
166
|
-
/**
|
167
|
-
* Describes the color components. See ICC Profiles.
|
168
|
-
*/
|
169
|
-
typedef struct sk_colorspace_t sk_colorspace_t;
|
170
|
-
|
171
|
-
/**
|
172
|
-
* Describes an image buffer : width, height, pixel type, colorspace, etc.
|
173
|
-
*/
|
174
|
-
typedef struct sk_imageinfo_t sk_imageinfo_t;
|
175
|
-
|
176
|
-
/**
|
177
|
-
A sk_maskfilter_t is an object that perform transformations on an
|
178
|
-
alpha-channel mask before drawing it; it may be installed into a
|
179
|
-
sk_paint_t. Each time a primitive is drawn, it is first
|
180
|
-
scan-converted into a alpha mask, which os handed to the
|
181
|
-
maskfilter, which may create a new mask is to render into the
|
182
|
-
destination.
|
183
|
-
*/
|
184
|
-
typedef struct sk_maskfilter_t sk_maskfilter_t;
|
185
|
-
/**
|
186
|
-
A sk_paint_t holds the style and color information about how to
|
187
|
-
draw geometries, text and bitmaps.
|
188
|
-
*/
|
189
|
-
typedef struct sk_paint_t sk_paint_t;
|
190
|
-
/**
|
191
|
-
A sk_path_t encapsulates compound (multiple contour) geometric
|
192
|
-
paths consisting of straight line segments, quadratic curves, and
|
193
|
-
cubic curves.
|
194
|
-
*/
|
195
|
-
typedef struct sk_path_t sk_path_t;
|
196
|
-
/**
|
197
|
-
A sk_picture_t holds recorded canvas drawing commands to be played
|
198
|
-
back at a later time.
|
199
|
-
*/
|
200
|
-
typedef struct sk_picture_t sk_picture_t;
|
201
|
-
/**
|
202
|
-
A sk_picture_recorder_t holds a sk_canvas_t that records commands
|
203
|
-
to create a sk_picture_t.
|
204
|
-
*/
|
205
|
-
typedef struct sk_picture_recorder_t sk_picture_recorder_t;
|
206
|
-
/**
|
207
|
-
A sk_shader_t specifies the source color(s) for what is being drawn. If a
|
208
|
-
paint has no shader, then the paint's color is used. If the paint
|
209
|
-
has a shader, then the shader's color(s) are use instead, but they
|
210
|
-
are modulated by the paint's alpha.
|
211
|
-
*/
|
212
|
-
typedef struct sk_shader_t sk_shader_t;
|
213
|
-
/**
|
214
|
-
A sk_surface_t holds the destination for drawing to a canvas. For
|
215
|
-
raster drawing, the destination is an array of pixels in memory.
|
216
|
-
For GPU drawing, the destination is a texture or a framebuffer.
|
217
|
-
*/
|
218
|
-
typedef struct sk_surface_t sk_surface_t;
|
219
|
-
|
220
|
-
typedef enum {
|
221
|
-
NEAREST_SK_FILTER_MODE,
|
222
|
-
LINEAR_SK_FILTER_MODE,
|
223
|
-
} sk_filter_mode_t;
|
224
|
-
|
225
|
-
typedef enum {
|
226
|
-
NONE_SK_MIPMAP_MODE,
|
227
|
-
NEAREST_SK_MIPMAP_MODE,
|
228
|
-
LINEAR_SK_MIPMAP_MODE,
|
229
|
-
} sk_mipmap_mode_t;
|
230
|
-
|
231
|
-
typedef struct {
|
232
|
-
float B, C;
|
233
|
-
} sk_cubic_resampler_t;
|
234
|
-
|
235
|
-
typedef struct {
|
236
|
-
bool useCubic;
|
237
|
-
sk_cubic_resampler_t cubic;
|
238
|
-
sk_filter_mode_t filter;
|
239
|
-
sk_mipmap_mode_t mipmap;
|
240
|
-
} sk_sampling_options_t;
|
241
|
-
|
242
|
-
typedef enum {
|
243
|
-
CLEAR_SK_XFERMODE_MODE,
|
244
|
-
SRC_SK_XFERMODE_MODE,
|
245
|
-
DST_SK_XFERMODE_MODE,
|
246
|
-
SRCOVER_SK_XFERMODE_MODE,
|
247
|
-
DSTOVER_SK_XFERMODE_MODE,
|
248
|
-
SRCIN_SK_XFERMODE_MODE,
|
249
|
-
DSTIN_SK_XFERMODE_MODE,
|
250
|
-
SRCOUT_SK_XFERMODE_MODE,
|
251
|
-
DSTOUT_SK_XFERMODE_MODE,
|
252
|
-
SRCATOP_SK_XFERMODE_MODE,
|
253
|
-
DSTATOP_SK_XFERMODE_MODE,
|
254
|
-
XOR_SK_XFERMODE_MODE,
|
255
|
-
PLUS_SK_XFERMODE_MODE,
|
256
|
-
MODULATE_SK_XFERMODE_MODE,
|
257
|
-
SCREEN_SK_XFERMODE_MODE,
|
258
|
-
OVERLAY_SK_XFERMODE_MODE,
|
259
|
-
DARKEN_SK_XFERMODE_MODE,
|
260
|
-
LIGHTEN_SK_XFERMODE_MODE,
|
261
|
-
COLORDODGE_SK_XFERMODE_MODE,
|
262
|
-
COLORBURN_SK_XFERMODE_MODE,
|
263
|
-
HARDLIGHT_SK_XFERMODE_MODE,
|
264
|
-
SOFTLIGHT_SK_XFERMODE_MODE,
|
265
|
-
DIFFERENCE_SK_XFERMODE_MODE,
|
266
|
-
EXCLUSION_SK_XFERMODE_MODE,
|
267
|
-
MULTIPLY_SK_XFERMODE_MODE,
|
268
|
-
HUE_SK_XFERMODE_MODE,
|
269
|
-
SATURATION_SK_XFERMODE_MODE,
|
270
|
-
COLOR_SK_XFERMODE_MODE,
|
271
|
-
LUMINOSITY_SK_XFERMODE_MODE,
|
272
|
-
} sk_xfermode_mode_t;
|
273
|
-
|
274
|
-
//////////////////////////////////////////////////////////////////////////////////////////
|
275
|
-
|
276
|
-
SK_C_PLUS_PLUS_END_GUARD
|
277
|
-
|
278
|
-
#endif
|
@@ -1,47 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* Copyright 2021 Google LLC
|
3
|
-
*
|
4
|
-
* Use of this source code is governed by a BSD-style license that can be
|
5
|
-
* found in the LICENSE file.
|
6
|
-
*/
|
7
|
-
|
8
|
-
#ifndef SkStuff_DEFINED
|
9
|
-
#define SkStuff_DEFINED
|
10
|
-
|
11
|
-
#include "include/core/SkImageInfo.h"
|
12
|
-
#include "include/core/SkRefCnt.h"
|
13
|
-
|
14
|
-
class SkColorSpace;
|
15
|
-
class SkSurface;
|
16
|
-
class SkSurfaceProps;
|
17
|
-
|
18
|
-
namespace skgpu::graphite {
|
19
|
-
class BackendTexture;
|
20
|
-
class Recorder;
|
21
|
-
}
|
22
|
-
|
23
|
-
// TODO: Should be in SkSurface.h
|
24
|
-
sk_sp<SkSurface> MakeGraphite(skgpu::graphite::Recorder*, const SkImageInfo&);
|
25
|
-
|
26
|
-
/**
|
27
|
-
* Wraps a GPU-backed texture into SkSurface. Depending on the backend gpu API, the caller may be
|
28
|
-
* required to ensure the texture is valid for the lifetime of returned SkSurface. The required
|
29
|
-
* lifetimes for the specific apis are:
|
30
|
-
* Metal: Skia will call retain on the underlying MTLTexture so the caller can drop it once this
|
31
|
-
* call returns.
|
32
|
-
*
|
33
|
-
* SkSurface is returned if all parameters are valid. BackendTexture is valid if its format agrees
|
34
|
-
* with colorSpace and context; for instance, if backendTexture has an sRGB configuration, then
|
35
|
-
* context must support sRGB, and colorSpace must be present. Further, backendTexture width and
|
36
|
-
* height must not exceed context capabilities, and the context must be able to support back-end
|
37
|
-
* textures.
|
38
|
-
*
|
39
|
-
* If SK_ENABLE_GRAPHITE is not defined, this has no effect and returns nullptr.
|
40
|
-
*/
|
41
|
-
sk_sp<SkSurface> MakeGraphiteFromBackendTexture(skgpu::graphite::Recorder*,
|
42
|
-
const skgpu::graphite::BackendTexture&,
|
43
|
-
SkColorType colorType,
|
44
|
-
sk_sp<SkColorSpace> colorSpace,
|
45
|
-
const SkSurfaceProps* props);
|
46
|
-
|
47
|
-
#endif // SkStuff_DEFINED
|