@shopify/react-native-skia 2.9.1 → 2.10.0
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 +1 -5
- package/cpp/api/JsiNativeBuffer.h +15 -10
- package/cpp/api/JsiSkAnimatedImage.h +21 -19
- package/cpp/api/JsiSkAnimatedImageFactory.h +13 -14
- package/cpp/api/JsiSkApi.h +246 -92
- package/cpp/api/JsiSkCanvas.h +76 -58
- package/cpp/api/JsiSkColor.h +7 -5
- package/cpp/api/JsiSkColorFilter.h +15 -8
- package/cpp/api/JsiSkColorFilterFactory.h +45 -45
- package/cpp/api/JsiSkContourMeasure.h +24 -21
- package/cpp/api/JsiSkContourMeasureIter.h +18 -21
- package/cpp/api/JsiSkData.h +13 -7
- package/cpp/api/JsiSkDataFactory.h +22 -21
- package/cpp/api/JsiSkFont.h +56 -44
- package/cpp/api/JsiSkFontMgr.h +22 -13
- package/cpp/api/JsiSkFontMgrFactory.h +12 -10
- package/cpp/api/JsiSkFontStyle.h +14 -12
- package/cpp/api/JsiSkImage.h +45 -34
- package/cpp/api/JsiSkImageFactory.h +47 -52
- package/cpp/api/JsiSkImageFilter.h +21 -11
- package/cpp/api/JsiSkImageFilterFactory.h +96 -96
- package/cpp/api/JsiSkImageInfo.h +22 -19
- package/cpp/api/JsiSkMaskFilter.h +21 -11
- package/cpp/api/JsiSkMaskFilterFactory.h +16 -13
- package/cpp/api/JsiSkMatrix.h +31 -31
- package/cpp/api/JsiSkNativeObjects.h +419 -0
- package/cpp/api/JsiSkPaint.h +59 -39
- package/cpp/api/JsiSkParagraph.h +39 -32
- package/cpp/api/JsiSkParagraphBuilder.h +24 -21
- package/cpp/api/JsiSkParagraphBuilderFactory.h +13 -12
- package/cpp/api/JsiSkPath.h +95 -70
- package/cpp/api/JsiSkPathBuilder.h +83 -67
- package/cpp/api/JsiSkPathBuilderFactory.h +16 -17
- package/cpp/api/JsiSkPathEffect.h +21 -11
- package/cpp/api/JsiSkPathEffectFactory.h +33 -32
- package/cpp/api/JsiSkPathFactory.h +79 -103
- package/cpp/api/JsiSkPicture.h +24 -13
- package/cpp/api/JsiSkPictureFactory.h +21 -26
- package/cpp/api/JsiSkPictureRecorder.h +21 -22
- package/cpp/api/JsiSkPoint.h +19 -22
- package/cpp/api/JsiSkRRect.h +22 -29
- package/cpp/api/JsiSkRSXform.h +26 -30
- package/cpp/api/JsiSkRect.h +28 -30
- package/cpp/api/JsiSkRuntimeEffect.h +39 -30
- package/cpp/api/JsiSkRuntimeEffectFactory.h +12 -12
- package/cpp/api/JsiSkRuntimeShaderBuilder.h +25 -18
- package/cpp/api/JsiSkSVG.h +13 -13
- package/cpp/api/JsiSkSVGFactory.h +17 -20
- package/cpp/api/JsiSkShader.h +15 -8
- package/cpp/api/JsiSkShaderFactory.h +41 -48
- package/cpp/api/JsiSkSkottie.h +49 -39
- package/cpp/api/JsiSkSurface.h +24 -24
- package/cpp/api/JsiSkSurfaceFactory.h +15 -16
- package/cpp/api/JsiSkTextBlob.h +15 -8
- package/cpp/api/JsiSkTextBlobFactory.h +25 -28
- package/cpp/api/JsiSkTypeface.h +19 -12
- package/cpp/api/JsiSkTypefaceFactory.h +12 -12
- package/cpp/api/JsiSkTypefaceFontProvider.h +30 -25
- package/cpp/api/JsiSkTypefaceFontProviderFactory.h +14 -12
- package/cpp/api/JsiSkVertices.h +21 -18
- package/cpp/api/JsiSkiaContext.h +17 -17
- package/cpp/api/JsiSkottieFactory.h +16 -17
- package/cpp/api/JsiVideo.h +27 -25
- package/cpp/api/recorder/Convertor.h +31 -61
- package/cpp/api/recorder/DataTypes.h +8 -16
- package/cpp/api/recorder/JsiRecorder.h +83 -55
- package/cpp/api/recorder/RNRecorder.h +1 -1
- package/cpp/jsi/BoxedNativeObject.h +146 -0
- package/cpp/{jsi2 → jsi}/EnumMapper.h +4 -1
- package/cpp/{jsi2 → jsi}/NativeObject.h +120 -146
- package/cpp/jsi/RuntimeAwareCache.cpp +1 -1
- package/cpp/jsi/RuntimeAwareCache.h +26 -8
- package/cpp/jsi/ViewProperty.h +5 -11
- package/cpp/rnskia/RNSkJsiViewApi.h +20 -11
- package/cpp/rnskia/RNSkManager.cpp +23 -25
- package/cpp/rnskia/RNSkPictureView.h +1 -1
- package/cpp/rnwgpu/ArrayBuffer.h +5 -6
- package/cpp/rnwgpu/Canvas.h +4 -2
- package/cpp/rnwgpu/api/GPU.cpp +4 -4
- package/cpp/rnwgpu/api/GPU.h +1 -1
- package/cpp/rnwgpu/api/GPUAdapter.cpp +2 -3
- package/cpp/rnwgpu/api/GPUAdapter.h +4 -4
- package/cpp/rnwgpu/api/GPUAdapterInfo.h +1 -1
- package/cpp/rnwgpu/api/GPUBindGroup.h +1 -1
- package/cpp/rnwgpu/api/GPUBindGroupLayout.h +1 -1
- package/cpp/rnwgpu/api/GPUBuffer.h +1 -1
- package/cpp/rnwgpu/api/GPUCanvasContext.h +1 -1
- package/cpp/rnwgpu/api/GPUCommandBuffer.h +1 -1
- package/cpp/rnwgpu/api/GPUCommandEncoder.h +1 -1
- package/cpp/rnwgpu/api/GPUCompilationInfo.h +1 -1
- package/cpp/rnwgpu/api/GPUCompilationMessage.h +1 -1
- package/cpp/rnwgpu/api/GPUComputePassEncoder.h +1 -1
- package/cpp/rnwgpu/api/GPUComputePipeline.h +1 -1
- package/cpp/rnwgpu/api/GPUDevice.cpp +6 -7
- package/cpp/rnwgpu/api/GPUDevice.h +3 -3
- package/cpp/rnwgpu/api/GPUDeviceLostInfo.h +1 -1
- package/cpp/rnwgpu/api/GPUError.h +1 -1
- package/cpp/rnwgpu/api/GPUExtent3D.h +1 -1
- package/cpp/rnwgpu/api/GPUExternalTexture.h +1 -1
- package/cpp/rnwgpu/api/GPUInternalError.h +1 -1
- package/cpp/rnwgpu/api/GPUOrigin2D.h +1 -1
- package/cpp/rnwgpu/api/GPUOrigin3D.h +1 -1
- package/cpp/rnwgpu/api/GPUOutOfMemoryError.h +1 -1
- package/cpp/rnwgpu/api/GPUPipelineLayout.h +1 -1
- package/cpp/rnwgpu/api/GPUQuerySet.h +1 -1
- package/cpp/rnwgpu/api/GPUQueue.h +1 -1
- package/cpp/rnwgpu/api/GPURenderBundle.h +1 -1
- package/cpp/rnwgpu/api/GPURenderBundleEncoder.h +1 -1
- package/cpp/rnwgpu/api/GPURenderPassEncoder.h +1 -1
- package/cpp/rnwgpu/api/GPURenderPipeline.h +1 -1
- package/cpp/rnwgpu/api/GPUSampler.h +1 -1
- package/cpp/rnwgpu/api/GPUShaderModule.cpp +1 -1
- package/cpp/rnwgpu/api/GPUShaderModule.h +1 -1
- package/cpp/rnwgpu/api/GPUSharedFence.h +1 -1
- package/cpp/rnwgpu/api/GPUSharedTextureMemory.h +1 -1
- package/cpp/rnwgpu/api/GPUSupportedLimits.h +1 -1
- package/cpp/rnwgpu/api/GPUTexture.h +1 -1
- package/cpp/rnwgpu/api/GPUTextureView.h +1 -1
- package/cpp/rnwgpu/api/GPUUncapturedErrorEvent.h +1 -1
- package/cpp/rnwgpu/api/GPUValidationError.h +1 -1
- package/cpp/rnwgpu/api/ImageBitmap.h +1 -1
- package/cpp/rnwgpu/api/RNWebGPU.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUBindGroupDescriptor.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUBindGroupEntry.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUBindGroupLayoutDescriptor.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUBindGroupLayoutEntry.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUBlendComponent.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUBlendState.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUBufferBinding.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUBufferBindingLayout.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUBufferDescriptor.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUCanvasConfiguration.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUColor.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUColorTargetState.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUCommandBufferDescriptor.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUCommandEncoderDescriptor.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUComputePassDescriptor.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUComputePassTimestampWrites.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUComputePipelineDescriptor.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUDawnTogglesDescriptor.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUDepthStencilState.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUDeviceDescriptor.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUExternalTextureBindingLayout.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUExternalTextureDescriptor.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUFragmentState.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUImageCopyBuffer.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUImageCopyExternalImage.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUImageCopyTexture.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUImageCopyTextureTagged.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUImageDataLayout.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUMultisampleState.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUPipelineLayoutDescriptor.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUPrimitiveState.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUProgrammableStage.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUQuerySetDescriptor.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUQueueDescriptor.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPURenderBundleDescriptor.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPURenderBundleEncoderDescriptor.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPURenderPassColorAttachment.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPURenderPassDepthStencilAttachment.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPURenderPassDescriptor.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPURenderPassTimestampWrites.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPURenderPipelineDescriptor.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPURequestAdapterOptions.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUSamplerBindingLayout.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUSamplerDescriptor.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUShaderModuleCompilationHint.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUShaderModuleDescriptor.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUSharedFenceDescriptor.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUSharedFenceState.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUSharedTextureMemoryDescriptor.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUStencilFaceState.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUStorageTextureBindingLayout.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUTextureBindingLayout.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUTextureDescriptor.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUTextureViewDescriptor.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUUncapturedErrorEventInit.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUVertexAttribute.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUVertexBufferLayout.h +1 -1
- package/cpp/rnwgpu/api/descriptors/GPUVertexState.h +1 -1
- package/cpp/rnwgpu/api/descriptors/Unions.h +1 -1
- package/cpp/rnwgpu/async/AsyncTaskHandle.cpp +20 -21
- package/lib/commonjs/external/reanimated/renderHelpers.d.ts +15 -0
- package/lib/commonjs/external/reanimated/renderHelpers.js +30 -1
- package/lib/commonjs/external/reanimated/renderHelpers.js.map +1 -1
- package/lib/commonjs/skia/NativeSetup.js +4 -0
- package/lib/commonjs/skia/NativeSetup.js.map +1 -1
- package/lib/commonjs/skia/SkiaWorkletSerialization.d.ts +1 -0
- package/lib/commonjs/skia/SkiaWorkletSerialization.js +66 -0
- package/lib/commonjs/skia/SkiaWorkletSerialization.js.map +1 -0
- package/lib/commonjs/sksg/Container.native.js +20 -1
- package/lib/commonjs/sksg/Container.native.js.map +1 -1
- package/lib/module/external/reanimated/renderHelpers.d.ts +15 -0
- package/lib/module/external/reanimated/renderHelpers.js +29 -0
- package/lib/module/external/reanimated/renderHelpers.js.map +1 -1
- package/lib/module/skia/NativeSetup.js +4 -0
- package/lib/module/skia/NativeSetup.js.map +1 -1
- package/lib/module/skia/SkiaWorkletSerialization.d.ts +1 -0
- package/lib/module/skia/SkiaWorkletSerialization.js +59 -0
- package/lib/module/skia/SkiaWorkletSerialization.js.map +1 -0
- package/lib/module/sksg/Container.native.js +21 -2
- package/lib/module/sksg/Container.native.js.map +1 -1
- package/lib/typescript/lib/commonjs/external/reanimated/renderHelpers.d.ts +2 -0
- package/lib/typescript/lib/commonjs/skia/SkiaWorkletSerialization.d.ts +2 -0
- package/lib/typescript/lib/module/external/reanimated/renderHelpers.d.ts +15 -0
- package/lib/typescript/lib/module/skia/SkiaWorkletSerialization.d.ts +1 -0
- package/lib/typescript/src/external/reanimated/renderHelpers.d.ts +15 -0
- package/lib/typescript/src/skia/SkiaWorkletSerialization.d.ts +1 -0
- package/package.json +6 -2
- package/react-native-skia.podspec +1 -2
- package/src/external/reanimated/renderHelpers.ts +30 -0
- package/src/skia/NativeSetup.ts +5 -0
- package/src/skia/SkiaWorkletSerialization.ts +67 -0
- package/src/sksg/Container.native.ts +40 -2
- package/cpp/api/JsiSkHostObjects.h +0 -257
- package/cpp/jsi/JsiHostObject.cpp +0 -137
- package/cpp/jsi/JsiHostObject.h +0 -385
- /package/cpp/{jsi2 → jsi}/JSIConverter.h +0 -0
- /package/cpp/{jsi2 → jsi}/Promise.cpp +0 -0
- /package/cpp/{jsi2 → jsi}/Promise.h +0 -0
package/android/CMakeLists.txt
CHANGED
|
@@ -99,10 +99,10 @@ add_library(
|
|
|
99
99
|
"${PROJECT_SOURCE_DIR}/cpp/rnskia-android/AHardwareBufferUtils.cpp"
|
|
100
100
|
"${PROJECT_SOURCE_DIR}/cpp/rnskia-android/RNSkAndroidVideo.cpp"
|
|
101
101
|
|
|
102
|
-
"${PROJECT_SOURCE_DIR}/../cpp/jsi/JsiHostObject.cpp"
|
|
103
102
|
"${PROJECT_SOURCE_DIR}/../cpp/jsi/RuntimeLifecycleMonitor.cpp"
|
|
104
103
|
"${PROJECT_SOURCE_DIR}/../cpp/jsi/RuntimeAwareCache.cpp"
|
|
105
104
|
"${PROJECT_SOURCE_DIR}/../cpp/jsi/JsiPromises.cpp"
|
|
105
|
+
"${PROJECT_SOURCE_DIR}/../cpp/jsi/Promise.cpp"
|
|
106
106
|
|
|
107
107
|
"${PROJECT_SOURCE_DIR}/../cpp/rnskia/RNSkManager.cpp"
|
|
108
108
|
|
|
@@ -115,10 +115,7 @@ add_library(
|
|
|
115
115
|
)
|
|
116
116
|
|
|
117
117
|
if(SK_GRAPHITE)
|
|
118
|
-
# WebGPU JSI infrastructure (jsi2)
|
|
119
118
|
target_sources(${PACKAGE_NAME} PRIVATE
|
|
120
|
-
"${PROJECT_SOURCE_DIR}/../cpp/jsi2/Promise.cpp"
|
|
121
|
-
|
|
122
119
|
# WebGPU async system
|
|
123
120
|
"${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/async/AsyncTaskHandle.cpp"
|
|
124
121
|
"${PROJECT_SOURCE_DIR}/../cpp/rnwgpu/async/RuntimeContext.cpp"
|
|
@@ -181,7 +178,6 @@ target_include_directories(
|
|
|
181
178
|
|
|
182
179
|
# WebGPU bindings
|
|
183
180
|
../cpp
|
|
184
|
-
../cpp/jsi2
|
|
185
181
|
../cpp/rnwgpu
|
|
186
182
|
../cpp/rnwgpu/api
|
|
187
183
|
../cpp/rnwgpu/api/descriptors
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
#include <jsi/jsi.h>
|
|
7
7
|
|
|
8
8
|
#include "JsiSkImage.h"
|
|
9
|
+
#include "JsiSkNativeObjects.h"
|
|
9
10
|
|
|
10
11
|
namespace RNSkia {
|
|
11
12
|
|
|
@@ -15,8 +16,11 @@ namespace jsi = facebook::jsi;
|
|
|
15
16
|
Implementation of the ParagraphBuilderFactory for making ParagraphBuilder JSI
|
|
16
17
|
object
|
|
17
18
|
*/
|
|
18
|
-
class JsiNativeBufferFactory
|
|
19
|
+
class JsiNativeBufferFactory
|
|
20
|
+
: public JsiSkNativeObject<JsiNativeBufferFactory> {
|
|
19
21
|
public:
|
|
22
|
+
static constexpr const char *CLASS_NAME = "NativeBufferFactory";
|
|
23
|
+
|
|
20
24
|
JSI_HOST_FUNCTION(MakeFromImage) {
|
|
21
25
|
auto image = JsiSkImage::fromValue(runtime, arguments[0]);
|
|
22
26
|
image->makeNonTextureImage();
|
|
@@ -40,18 +44,19 @@ public:
|
|
|
40
44
|
return jsi::Value::undefined();
|
|
41
45
|
}
|
|
42
46
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
return "JsiNativeBufferFactory";
|
|
47
|
+
static void definePrototype(jsi::Runtime &runtime, jsi::Object &prototype) {
|
|
48
|
+
installHostMethod(runtime, prototype, "Release",
|
|
49
|
+
&JsiNativeBufferFactory::Release);
|
|
50
|
+
installHostMethod(runtime, prototype, "MakeFromImage",
|
|
51
|
+
&JsiNativeBufferFactory::MakeFromImage);
|
|
52
|
+
installHostMethod(runtime, prototype, "MakeTestBuffer",
|
|
53
|
+
&JsiNativeBufferFactory::MakeTestBuffer);
|
|
51
54
|
}
|
|
52
55
|
|
|
56
|
+
size_t getMemoryPressure() override { return 1024; }
|
|
57
|
+
|
|
53
58
|
explicit JsiNativeBufferFactory(std::shared_ptr<RNSkPlatformContext> context)
|
|
54
|
-
:
|
|
59
|
+
: JsiSkNativeObject<JsiNativeBufferFactory>(std::move(context)) {}
|
|
55
60
|
};
|
|
56
61
|
|
|
57
62
|
} // namespace RNSkia
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
#include <string>
|
|
8
8
|
#include <utility>
|
|
9
9
|
|
|
10
|
-
#include "
|
|
10
|
+
#include "JsiSkNativeObjects.h"
|
|
11
11
|
#include "api/third_party/base64.h"
|
|
12
12
|
|
|
13
13
|
#pragma clang diagnostic push
|
|
@@ -29,15 +29,16 @@ namespace RNSkia {
|
|
|
29
29
|
namespace jsi = facebook::jsi;
|
|
30
30
|
|
|
31
31
|
class JsiSkAnimatedImage
|
|
32
|
-
: public
|
|
32
|
+
: public JsiSkWrappingSkPtrNativeObject<JsiSkAnimatedImage,
|
|
33
|
+
SkAnimatedImage> {
|
|
33
34
|
public:
|
|
35
|
+
static constexpr const char *CLASS_NAME = "AnimatedImage";
|
|
36
|
+
|
|
34
37
|
// TODO-API: Properties?
|
|
35
38
|
JSI_HOST_FUNCTION(getCurrentFrame) {
|
|
36
39
|
auto image = getObject()->getCurrentFrame();
|
|
37
|
-
|
|
38
|
-
std::make_shared<JsiSkImage>(getContext(), std::move(image));
|
|
39
|
-
return JSI_CREATE_HOST_OBJECT_WITH_MEMORY_PRESSURE(
|
|
40
|
-
runtime, hostObjectInstance, getContext());
|
|
40
|
+
return makeJsiObject(
|
|
41
|
+
runtime, std::make_shared<JsiSkImage>(getContext(), std::move(image)));
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
JSI_HOST_FUNCTION(getFrameCount) {
|
|
@@ -52,21 +53,24 @@ public:
|
|
|
52
53
|
return static_cast<int>(getObject()->decodeNextFrame());
|
|
53
54
|
}
|
|
54
55
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
56
|
+
static void definePrototype(jsi::Runtime &runtime, jsi::Object &prototype) {
|
|
57
|
+
installCommon(runtime, prototype);
|
|
58
|
+
installHostMethod(runtime, prototype, "getFrameCount",
|
|
59
|
+
&JsiSkAnimatedImage::getFrameCount);
|
|
60
|
+
installHostMethod(runtime, prototype, "getCurrentFrame",
|
|
61
|
+
&JsiSkAnimatedImage::getCurrentFrame);
|
|
62
|
+
installHostMethod(runtime, prototype, "currentFrameDuration",
|
|
63
|
+
&JsiSkAnimatedImage::currentFrameDuration);
|
|
64
|
+
installHostMethod(runtime, prototype, "decodeNextFrame",
|
|
65
|
+
&JsiSkAnimatedImage::decodeNextFrame);
|
|
66
|
+
}
|
|
63
67
|
|
|
64
68
|
JsiSkAnimatedImage(std::shared_ptr<RNSkPlatformContext> context,
|
|
65
69
|
const sk_sp<SkAnimatedImage> image)
|
|
66
|
-
:
|
|
67
|
-
|
|
70
|
+
: JsiSkWrappingSkPtrNativeObject<JsiSkAnimatedImage, SkAnimatedImage>(
|
|
71
|
+
std::move(context), std::move(image)) {}
|
|
68
72
|
|
|
69
|
-
size_t getMemoryPressure()
|
|
73
|
+
size_t getMemoryPressure() override {
|
|
70
74
|
auto animation = getObject();
|
|
71
75
|
if (!animation) {
|
|
72
76
|
return 0;
|
|
@@ -131,8 +135,6 @@ public:
|
|
|
131
135
|
|
|
132
136
|
return estimated;
|
|
133
137
|
}
|
|
134
|
-
|
|
135
|
-
std::string getObjectType() const override { return "JsiSkAnimatedImage"; }
|
|
136
138
|
};
|
|
137
139
|
|
|
138
140
|
} // namespace RNSkia
|
|
@@ -5,17 +5,20 @@
|
|
|
5
5
|
|
|
6
6
|
#include <jsi/jsi.h>
|
|
7
7
|
|
|
8
|
-
#include "jsi/JsiPromises.h"
|
|
9
8
|
#include "JsiSkAnimatedImage.h"
|
|
10
9
|
#include "JsiSkData.h"
|
|
11
|
-
#include "
|
|
10
|
+
#include "JsiSkNativeObjects.h"
|
|
11
|
+
#include "jsi/JsiPromises.h"
|
|
12
12
|
|
|
13
13
|
namespace RNSkia {
|
|
14
14
|
|
|
15
15
|
namespace jsi = facebook::jsi;
|
|
16
16
|
|
|
17
|
-
class JsiSkAnimatedImageFactory
|
|
17
|
+
class JsiSkAnimatedImageFactory
|
|
18
|
+
: public JsiSkNativeObject<JsiSkAnimatedImageFactory> {
|
|
18
19
|
public:
|
|
20
|
+
static constexpr const char *CLASS_NAME = "AnimatedImageFactory";
|
|
21
|
+
|
|
19
22
|
JSI_HOST_FUNCTION(MakeAnimatedImageFromEncoded) {
|
|
20
23
|
auto data = JsiSkData::fromValue(runtime, arguments[0]);
|
|
21
24
|
auto codec = SkAndroidCodec::MakeFromData(data);
|
|
@@ -23,24 +26,20 @@ public:
|
|
|
23
26
|
if (image == nullptr) {
|
|
24
27
|
return jsi::Value::null();
|
|
25
28
|
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return JSI_CREATE_HOST_OBJECT_WITH_MEMORY_PRESSURE(
|
|
29
|
-
runtime, hostObjectInstance, getContext());
|
|
29
|
+
return makeJsiObject(runtime, std::make_shared<JsiSkAnimatedImage>(
|
|
30
|
+
getContext(), std::move(image)));
|
|
30
31
|
}
|
|
31
32
|
|
|
32
|
-
size_t getMemoryPressure()
|
|
33
|
+
size_t getMemoryPressure() override { return 1024; }
|
|
33
34
|
|
|
34
|
-
|
|
35
|
-
|
|
35
|
+
static void definePrototype(jsi::Runtime &runtime, jsi::Object &prototype) {
|
|
36
|
+
installHostMethod(runtime, prototype, "MakeAnimatedImageFromEncoded",
|
|
37
|
+
&JsiSkAnimatedImageFactory::MakeAnimatedImageFromEncoded);
|
|
36
38
|
}
|
|
37
39
|
|
|
38
|
-
JSI_EXPORT_FUNCTIONS(JSI_EXPORT_FUNC(JsiSkAnimatedImageFactory,
|
|
39
|
-
MakeAnimatedImageFromEncoded))
|
|
40
|
-
|
|
41
40
|
explicit JsiSkAnimatedImageFactory(
|
|
42
41
|
std::shared_ptr<RNSkPlatformContext> context)
|
|
43
|
-
:
|
|
42
|
+
: JsiSkNativeObject<JsiSkAnimatedImageFactory>(std::move(context)) {}
|
|
44
43
|
};
|
|
45
44
|
|
|
46
45
|
} // namespace RNSkia
|
package/cpp/api/JsiSkApi.h
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
#include "rnskia/RNSkPlatformContext.h"
|
|
6
6
|
|
|
7
|
-
#include "
|
|
7
|
+
#include "JsiSkNativeObjects.h"
|
|
8
8
|
|
|
9
9
|
#ifdef SK_GRAPHITE
|
|
10
10
|
#include "rnskia/RNDawnContext.h"
|
|
@@ -67,11 +67,11 @@ namespace RNSkia {
|
|
|
67
67
|
|
|
68
68
|
namespace jsi = facebook::jsi;
|
|
69
69
|
|
|
70
|
-
class JsiSkApi : public
|
|
70
|
+
class JsiSkApi : public JsiSkNativeObject<JsiSkApi> {
|
|
71
71
|
public:
|
|
72
|
-
|
|
72
|
+
static constexpr const char *CLASS_NAME = "Api";
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
size_t getMemoryPressure() override { return 8192; }
|
|
75
75
|
|
|
76
76
|
/**
|
|
77
77
|
* Constructs the Skia Api object that can be installed into a runtime
|
|
@@ -79,104 +79,258 @@ public:
|
|
|
79
79
|
* @param context Platform context
|
|
80
80
|
*/
|
|
81
81
|
explicit JsiSkApi(const std::shared_ptr<RNSkPlatformContext> &context)
|
|
82
|
-
:
|
|
82
|
+
: JsiSkNativeObject<JsiSkApi>(context),
|
|
83
|
+
_svgFactory(std::make_shared<JsiSkSVGFactory>(context)),
|
|
84
|
+
_imageFactory(std::make_shared<JsiSkImageFactory>(context)),
|
|
85
|
+
_animatedImageFactory(
|
|
86
|
+
std::make_shared<JsiSkAnimatedImageFactory>(context)),
|
|
87
|
+
_typefaceFactory(std::make_shared<JsiSkTypefaceFactory>(context)),
|
|
88
|
+
_dataFactory(std::make_shared<JsiSkDataFactory>(context)),
|
|
89
|
+
_imageFilterFactory(std::make_shared<JsiSkImageFilterFactory>(context)),
|
|
90
|
+
_pathEffectFactory(std::make_shared<JsiSkPathEffectFactory>(context)),
|
|
91
|
+
_pathFactory(std::make_shared<JsiSkPathFactory>(context)),
|
|
92
|
+
_pathBuilderFactory(std::make_shared<JsiSkPathBuilderFactory>(context)),
|
|
93
|
+
_colorFilterFactory(std::make_shared<JsiSkColorFilterFactory>(context)),
|
|
94
|
+
_maskFilterFactory(std::make_shared<JsiSkMaskFilterFactory>(context)),
|
|
95
|
+
_runtimeEffectFactory(
|
|
96
|
+
std::make_shared<JsiSkRuntimeEffectFactory>(context)),
|
|
97
|
+
_shaderFactory(std::make_shared<JsiSkShaderFactory>(context)),
|
|
98
|
+
_textBlobFactory(std::make_shared<JsiSkTextBlobFactory>(context)),
|
|
99
|
+
_surfaceFactory(std::make_shared<JsiSkSurfaceFactory>(context)),
|
|
100
|
+
_pictureFactory(std::make_shared<JsiSkPictureFactory>(context)),
|
|
101
|
+
_fontMgrFactory(std::make_shared<JsiSkFontMgrFactory>(context)),
|
|
102
|
+
_skottieFactory(std::make_shared<JsiSkottieFactory>(context)),
|
|
103
|
+
_typefaceFontProviderFactory(
|
|
104
|
+
std::make_shared<JsiSkTypefaceFontProviderFactory>(context)),
|
|
105
|
+
_paragraphBuilderFactory(
|
|
106
|
+
std::make_shared<JsiSkParagraphBuilderFactory>(context)),
|
|
107
|
+
_nativeBufferFactory(
|
|
108
|
+
std::make_shared<JsiNativeBufferFactory>(context)) {
|
|
83
109
|
// We create the system font manager eagerly since it has proven to be too
|
|
84
110
|
// slow to do it on demand
|
|
85
111
|
JsiSkFontMgrFactory::getFontMgr(getContext());
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// Constructor functions: each delegates to the class's createCtor host
|
|
115
|
+
// function using the platform context resolved from native state, so the
|
|
116
|
+
// prototype stays context-free and can be installed on any runtime.
|
|
117
|
+
JSI_HOST_FUNCTION(Video) {
|
|
118
|
+
return JsiVideo::createCtor(getContext())(runtime, thisValue, arguments,
|
|
119
|
+
count);
|
|
120
|
+
}
|
|
121
|
+
JSI_HOST_FUNCTION(Context) {
|
|
122
|
+
return JsiSkiaContext::createCtor(getContext())(runtime, thisValue,
|
|
123
|
+
arguments, count);
|
|
124
|
+
}
|
|
125
|
+
JSI_HOST_FUNCTION(Font) {
|
|
126
|
+
return JsiSkFont::createCtor(getContext())(runtime, thisValue, arguments,
|
|
127
|
+
count);
|
|
128
|
+
}
|
|
129
|
+
JSI_HOST_FUNCTION(Paint) {
|
|
130
|
+
return JsiSkPaint::createCtor(getContext())(runtime, thisValue, arguments,
|
|
131
|
+
count);
|
|
132
|
+
}
|
|
133
|
+
JSI_HOST_FUNCTION(RSXform) {
|
|
134
|
+
return JsiSkRSXform::createCtor(getContext())(runtime, thisValue, arguments,
|
|
135
|
+
count);
|
|
136
|
+
}
|
|
137
|
+
JSI_HOST_FUNCTION(RSXformFromRadians) {
|
|
138
|
+
return JsiSkRSXform::createCtorFromRadians(getContext())(runtime, thisValue,
|
|
139
|
+
arguments, count);
|
|
140
|
+
}
|
|
141
|
+
JSI_HOST_FUNCTION(Matrix) {
|
|
142
|
+
return JsiSkMatrix::createCtor(getContext())(runtime, thisValue, arguments,
|
|
143
|
+
count);
|
|
144
|
+
}
|
|
145
|
+
JSI_HOST_FUNCTION(XYWHRect) {
|
|
146
|
+
return JsiSkRect::createCtor(getContext())(runtime, thisValue, arguments,
|
|
147
|
+
count);
|
|
148
|
+
}
|
|
149
|
+
JSI_HOST_FUNCTION(RRectXY) {
|
|
150
|
+
return JsiSkRRect::createCtor(getContext())(runtime, thisValue, arguments,
|
|
151
|
+
count);
|
|
152
|
+
}
|
|
153
|
+
JSI_HOST_FUNCTION(Point) {
|
|
154
|
+
return JsiSkPoint::createCtor(getContext())(runtime, thisValue, arguments,
|
|
155
|
+
count);
|
|
156
|
+
}
|
|
157
|
+
JSI_HOST_FUNCTION(RuntimeShaderBuilder) {
|
|
158
|
+
return JsiSkRuntimeShaderBuilder::createCtor(getContext())(
|
|
159
|
+
runtime, thisValue, arguments, count);
|
|
160
|
+
}
|
|
161
|
+
JSI_HOST_FUNCTION(ContourMeasureIter) {
|
|
162
|
+
return JsiSkContourMeasureIter::createCtor(getContext())(runtime, thisValue,
|
|
163
|
+
arguments, count);
|
|
164
|
+
}
|
|
165
|
+
JSI_HOST_FUNCTION(MakeVertices) {
|
|
166
|
+
return JsiSkVertices::createCtor(getContext())(runtime, thisValue,
|
|
167
|
+
arguments, count);
|
|
168
|
+
}
|
|
169
|
+
JSI_HOST_FUNCTION(PictureRecorder) {
|
|
170
|
+
return JsiSkPictureRecorder::createCtor(getContext())(runtime, thisValue,
|
|
171
|
+
arguments, count);
|
|
172
|
+
}
|
|
173
|
+
JSI_HOST_FUNCTION(Color) {
|
|
174
|
+
return JsiSkColor::createCtor()(runtime, thisValue, arguments, count);
|
|
175
|
+
}
|
|
176
|
+
JSI_HOST_FUNCTION(Recorder) {
|
|
177
|
+
return JsiRecorder::createCtor(getContext())(runtime, thisValue, arguments,
|
|
178
|
+
count);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
JSI_HOST_FUNCTION(hasDevice) {
|
|
156
182
|
#ifdef SK_GRAPHITE
|
|
157
|
-
|
|
183
|
+
return jsi::Value(true);
|
|
158
184
|
#else
|
|
159
|
-
|
|
185
|
+
return jsi::Value(false);
|
|
160
186
|
#endif
|
|
161
|
-
|
|
187
|
+
}
|
|
162
188
|
|
|
163
|
-
|
|
164
|
-
"getDevice", JSI_HOST_FUNCTION_LAMBDA {
|
|
189
|
+
JSI_HOST_FUNCTION(getDevice) {
|
|
165
190
|
#ifdef SK_GRAPHITE
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
191
|
+
auto &dawnContext = DawnContext::getInstance();
|
|
192
|
+
// Per-runtime context: async ops on this device resolve on the calling
|
|
193
|
+
// runtime's own thread (via its ProcessEvents pump).
|
|
194
|
+
auto context = rnwgpu::async::RuntimeContext::getOrCreate(
|
|
195
|
+
runtime, dawnContext.getWGPUInstance());
|
|
196
|
+
auto device = std::make_shared<rnwgpu::GPUDevice>(
|
|
197
|
+
dawnContext.getWGPUDevice(), context, "Skia Device");
|
|
198
|
+
return rnwgpu::GPUDevice::create(runtime, device);
|
|
174
199
|
#else
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
200
|
+
throw jsi::JSError(runtime,
|
|
201
|
+
"getDevice() is only available with the Graphite "
|
|
202
|
+
"backend. Rebuild with SK_GRAPHITE enabled.");
|
|
178
203
|
#endif
|
|
179
|
-
});
|
|
180
204
|
}
|
|
205
|
+
|
|
206
|
+
// Factory properties: like the legacy HostObject implementation, each
|
|
207
|
+
// property access returns a fresh JS wrapper around the shared factory
|
|
208
|
+
// instance.
|
|
209
|
+
JSI_PROPERTY_GET(SVG) { return makeJsiObject(runtime, _svgFactory); }
|
|
210
|
+
JSI_PROPERTY_GET(Image) { return makeJsiObject(runtime, _imageFactory); }
|
|
211
|
+
JSI_PROPERTY_GET(AnimatedImage) {
|
|
212
|
+
return makeJsiObject(runtime, _animatedImageFactory);
|
|
213
|
+
}
|
|
214
|
+
JSI_PROPERTY_GET(Typeface) {
|
|
215
|
+
return makeJsiObject(runtime, _typefaceFactory);
|
|
216
|
+
}
|
|
217
|
+
JSI_PROPERTY_GET(Data) { return makeJsiObject(runtime, _dataFactory); }
|
|
218
|
+
JSI_PROPERTY_GET(ImageFilter) {
|
|
219
|
+
return makeJsiObject(runtime, _imageFilterFactory);
|
|
220
|
+
}
|
|
221
|
+
JSI_PROPERTY_GET(PathEffect) {
|
|
222
|
+
return makeJsiObject(runtime, _pathEffectFactory);
|
|
223
|
+
}
|
|
224
|
+
JSI_PROPERTY_GET(Path) { return makeJsiObject(runtime, _pathFactory); }
|
|
225
|
+
JSI_PROPERTY_GET(PathBuilder) {
|
|
226
|
+
return makeJsiObject(runtime, _pathBuilderFactory);
|
|
227
|
+
}
|
|
228
|
+
JSI_PROPERTY_GET(ColorFilter) {
|
|
229
|
+
return makeJsiObject(runtime, _colorFilterFactory);
|
|
230
|
+
}
|
|
231
|
+
JSI_PROPERTY_GET(MaskFilter) {
|
|
232
|
+
return makeJsiObject(runtime, _maskFilterFactory);
|
|
233
|
+
}
|
|
234
|
+
JSI_PROPERTY_GET(RuntimeEffect) {
|
|
235
|
+
return makeJsiObject(runtime, _runtimeEffectFactory);
|
|
236
|
+
}
|
|
237
|
+
JSI_PROPERTY_GET(Shader) { return makeJsiObject(runtime, _shaderFactory); }
|
|
238
|
+
JSI_PROPERTY_GET(TextBlob) {
|
|
239
|
+
return makeJsiObject(runtime, _textBlobFactory);
|
|
240
|
+
}
|
|
241
|
+
JSI_PROPERTY_GET(Surface) { return makeJsiObject(runtime, _surfaceFactory); }
|
|
242
|
+
JSI_PROPERTY_GET(Picture) { return makeJsiObject(runtime, _pictureFactory); }
|
|
243
|
+
JSI_PROPERTY_GET(FontMgr) { return makeJsiObject(runtime, _fontMgrFactory); }
|
|
244
|
+
JSI_PROPERTY_GET(Skottie) { return makeJsiObject(runtime, _skottieFactory); }
|
|
245
|
+
JSI_PROPERTY_GET(TypefaceFontProvider) {
|
|
246
|
+
return makeJsiObject(runtime, _typefaceFontProviderFactory);
|
|
247
|
+
}
|
|
248
|
+
JSI_PROPERTY_GET(ParagraphBuilder) {
|
|
249
|
+
return makeJsiObject(runtime, _paragraphBuilderFactory);
|
|
250
|
+
}
|
|
251
|
+
JSI_PROPERTY_GET(NativeBuffer) {
|
|
252
|
+
return makeJsiObject(runtime, _nativeBufferFactory);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
static void definePrototype(jsi::Runtime &runtime, jsi::Object &prototype) {
|
|
256
|
+
installHostMethod(runtime, prototype, "Video", &JsiSkApi::Video);
|
|
257
|
+
installHostMethod(runtime, prototype, "Context", &JsiSkApi::Context);
|
|
258
|
+
installHostMethod(runtime, prototype, "Font", &JsiSkApi::Font);
|
|
259
|
+
installHostMethod(runtime, prototype, "Paint", &JsiSkApi::Paint);
|
|
260
|
+
installHostMethod(runtime, prototype, "RSXform", &JsiSkApi::RSXform);
|
|
261
|
+
installHostMethod(runtime, prototype, "RSXformFromRadians",
|
|
262
|
+
&JsiSkApi::RSXformFromRadians);
|
|
263
|
+
installHostMethod(runtime, prototype, "Matrix", &JsiSkApi::Matrix);
|
|
264
|
+
installHostMethod(runtime, prototype, "XYWHRect", &JsiSkApi::XYWHRect);
|
|
265
|
+
installHostMethod(runtime, prototype, "RRectXY", &JsiSkApi::RRectXY);
|
|
266
|
+
installHostMethod(runtime, prototype, "Point", &JsiSkApi::Point);
|
|
267
|
+
installHostMethod(runtime, prototype, "RuntimeShaderBuilder",
|
|
268
|
+
&JsiSkApi::RuntimeShaderBuilder);
|
|
269
|
+
installHostMethod(runtime, prototype, "ContourMeasureIter",
|
|
270
|
+
&JsiSkApi::ContourMeasureIter);
|
|
271
|
+
installHostMethod(runtime, prototype, "MakeVertices",
|
|
272
|
+
&JsiSkApi::MakeVertices);
|
|
273
|
+
installHostMethod(runtime, prototype, "PictureRecorder",
|
|
274
|
+
&JsiSkApi::PictureRecorder);
|
|
275
|
+
installHostMethod(runtime, prototype, "Color", &JsiSkApi::Color);
|
|
276
|
+
installHostMethod(runtime, prototype, "Recorder", &JsiSkApi::Recorder);
|
|
277
|
+
installHostMethod(runtime, prototype, "hasDevice", &JsiSkApi::hasDevice);
|
|
278
|
+
installHostMethod(runtime, prototype, "getDevice", &JsiSkApi::getDevice);
|
|
279
|
+
installHostGetter(runtime, prototype, "SVG", &JsiSkApi::get_SVG);
|
|
280
|
+
installHostGetter(runtime, prototype, "Image", &JsiSkApi::get_Image);
|
|
281
|
+
installHostGetter(runtime, prototype, "AnimatedImage",
|
|
282
|
+
&JsiSkApi::get_AnimatedImage);
|
|
283
|
+
installHostGetter(runtime, prototype, "Typeface", &JsiSkApi::get_Typeface);
|
|
284
|
+
installHostGetter(runtime, prototype, "Data", &JsiSkApi::get_Data);
|
|
285
|
+
installHostGetter(runtime, prototype, "ImageFilter",
|
|
286
|
+
&JsiSkApi::get_ImageFilter);
|
|
287
|
+
installHostGetter(runtime, prototype, "PathEffect",
|
|
288
|
+
&JsiSkApi::get_PathEffect);
|
|
289
|
+
installHostGetter(runtime, prototype, "Path", &JsiSkApi::get_Path);
|
|
290
|
+
installHostGetter(runtime, prototype, "PathBuilder",
|
|
291
|
+
&JsiSkApi::get_PathBuilder);
|
|
292
|
+
installHostGetter(runtime, prototype, "ColorFilter",
|
|
293
|
+
&JsiSkApi::get_ColorFilter);
|
|
294
|
+
installHostGetter(runtime, prototype, "MaskFilter",
|
|
295
|
+
&JsiSkApi::get_MaskFilter);
|
|
296
|
+
installHostGetter(runtime, prototype, "RuntimeEffect",
|
|
297
|
+
&JsiSkApi::get_RuntimeEffect);
|
|
298
|
+
installHostGetter(runtime, prototype, "Shader", &JsiSkApi::get_Shader);
|
|
299
|
+
installHostGetter(runtime, prototype, "TextBlob", &JsiSkApi::get_TextBlob);
|
|
300
|
+
installHostGetter(runtime, prototype, "Surface", &JsiSkApi::get_Surface);
|
|
301
|
+
installHostGetter(runtime, prototype, "Picture", &JsiSkApi::get_Picture);
|
|
302
|
+
installHostGetter(runtime, prototype, "FontMgr", &JsiSkApi::get_FontMgr);
|
|
303
|
+
installHostGetter(runtime, prototype, "Skottie", &JsiSkApi::get_Skottie);
|
|
304
|
+
installHostGetter(runtime, prototype, "TypefaceFontProvider",
|
|
305
|
+
&JsiSkApi::get_TypefaceFontProvider);
|
|
306
|
+
installHostGetter(runtime, prototype, "ParagraphBuilder",
|
|
307
|
+
&JsiSkApi::get_ParagraphBuilder);
|
|
308
|
+
installHostGetter(runtime, prototype, "NativeBuffer",
|
|
309
|
+
&JsiSkApi::get_NativeBuffer);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
private:
|
|
313
|
+
std::shared_ptr<JsiSkSVGFactory> _svgFactory;
|
|
314
|
+
std::shared_ptr<JsiSkImageFactory> _imageFactory;
|
|
315
|
+
std::shared_ptr<JsiSkAnimatedImageFactory> _animatedImageFactory;
|
|
316
|
+
std::shared_ptr<JsiSkTypefaceFactory> _typefaceFactory;
|
|
317
|
+
std::shared_ptr<JsiSkDataFactory> _dataFactory;
|
|
318
|
+
std::shared_ptr<JsiSkImageFilterFactory> _imageFilterFactory;
|
|
319
|
+
std::shared_ptr<JsiSkPathEffectFactory> _pathEffectFactory;
|
|
320
|
+
std::shared_ptr<JsiSkPathFactory> _pathFactory;
|
|
321
|
+
std::shared_ptr<JsiSkPathBuilderFactory> _pathBuilderFactory;
|
|
322
|
+
std::shared_ptr<JsiSkColorFilterFactory> _colorFilterFactory;
|
|
323
|
+
std::shared_ptr<JsiSkMaskFilterFactory> _maskFilterFactory;
|
|
324
|
+
std::shared_ptr<JsiSkRuntimeEffectFactory> _runtimeEffectFactory;
|
|
325
|
+
std::shared_ptr<JsiSkShaderFactory> _shaderFactory;
|
|
326
|
+
std::shared_ptr<JsiSkTextBlobFactory> _textBlobFactory;
|
|
327
|
+
std::shared_ptr<JsiSkSurfaceFactory> _surfaceFactory;
|
|
328
|
+
std::shared_ptr<JsiSkPictureFactory> _pictureFactory;
|
|
329
|
+
std::shared_ptr<JsiSkFontMgrFactory> _fontMgrFactory;
|
|
330
|
+
std::shared_ptr<JsiSkottieFactory> _skottieFactory;
|
|
331
|
+
std::shared_ptr<JsiSkTypefaceFontProviderFactory>
|
|
332
|
+
_typefaceFontProviderFactory;
|
|
333
|
+
std::shared_ptr<JsiSkParagraphBuilderFactory> _paragraphBuilderFactory;
|
|
334
|
+
std::shared_ptr<JsiNativeBufferFactory> _nativeBufferFactory;
|
|
181
335
|
};
|
|
182
336
|
} // namespace RNSkia
|