@nativescript/canvas 2.0.0-webgpu.1 → 2.0.0-webgpu.3
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/Canvas/common.d.ts +2 -16
- package/Canvas/common.js +1 -62
- package/Canvas/common.js.map +1 -1
- package/Canvas/index.android.d.ts +6 -7
- package/Canvas/index.android.js +87 -42
- package/Canvas/index.android.js.map +1 -1
- package/Canvas/index.d.ts +7 -8
- package/Canvas/index.ios.d.ts +3 -2
- package/Canvas/index.ios.js +87 -46
- package/Canvas/index.ios.js.map +1 -1
- package/Canvas2D/CanvasRenderingContext2D/index.js +71 -72
- package/Canvas2D/CanvasRenderingContext2D/index.js.map +1 -1
- package/Canvas2D/DOMMatrix/index.js +1 -1
- package/Canvas2D/DOMMatrix/index.js.map +1 -1
- package/Canvas2D/ImageData/index.js.map +1 -1
- package/Canvas2D/Path2D/index.js.map +1 -1
- package/Dom/Dom.js +8 -1
- package/Dom/Dom.js.map +1 -1
- package/Dom/Group.js.map +1 -1
- package/Dom/Image.d.ts +4 -1
- package/Dom/Image.js +16 -2
- package/Dom/Image.js.map +1 -1
- package/Dom/Paint.js.map +1 -1
- package/Dom/Text.js.map +1 -1
- package/Dom/shaders/LinearGradient.js.map +1 -1
- package/Dom/shaders/TwoPointConicalGradient.js.map +1 -1
- package/Dom/shapes/Atlas.js.map +1 -1
- package/Dom/shapes/Circle.js.map +1 -1
- package/Dom/shapes/Line.js.map +1 -1
- package/Dom/shapes/Oval.js.map +1 -1
- package/Dom/shapes/Path.js.map +1 -1
- package/Dom/shapes/Rect.js.map +1 -1
- package/Dom/shapes/RoundedRect.js.map +1 -1
- package/Dom/shapes/index.js.map +1 -1
- package/ImageAsset/index.d.ts +3 -1
- package/ImageAsset/index.js +38 -6
- package/ImageAsset/index.js.map +1 -1
- package/ImageBitmap/index.js +3 -3
- package/ImageBitmap/index.js.map +1 -1
- package/README.md +64 -3
- package/TextDecoder/index.js +3 -3
- package/TextDecoder/index.js.map +1 -1
- package/TextEncoder/index.js +3 -3
- package/TextEncoder/index.js.map +1 -1
- package/WebGL/WebGLExtensions/index.js +5 -5
- package/WebGL/WebGLExtensions/index.js.map +1 -1
- package/WebGL/WebGLRenderingContext/common.js.map +1 -1
- package/WebGL/WebGLRenderingContext/index.js.map +1 -1
- package/WebGL2/WebGL2RenderingContext/index.js.map +1 -1
- package/WebGPU/Constants.js.map +1 -1
- package/WebGPU/GPU.js.map +1 -1
- package/WebGPU/GPUAdapter.js.map +1 -1
- package/WebGPU/GPUAdapterInfo.js.map +1 -1
- package/WebGPU/GPUBindGroup.js.map +1 -1
- package/WebGPU/GPUBindGroupLayout.js.map +1 -1
- package/WebGPU/GPUBuffer.js +5 -1
- package/WebGPU/GPUBuffer.js.map +1 -1
- package/WebGPU/GPUCanvasContext.js.map +1 -1
- package/WebGPU/GPUCommandBuffer.js.map +1 -1
- package/WebGPU/GPUCommandEncoder.js.map +1 -1
- package/WebGPU/GPUComputePassEncoder.js.map +1 -1
- package/WebGPU/GPUComputePipeline.js.map +1 -1
- package/WebGPU/GPUDevice.d.ts +2 -2
- package/WebGPU/GPUDevice.js +4 -3
- package/WebGPU/GPUDevice.js.map +1 -1
- package/WebGPU/GPUExternalTexture.js.map +1 -1
- package/WebGPU/GPUPipelineLayout.js.map +1 -1
- package/WebGPU/GPUQuerySet.js.map +1 -1
- package/WebGPU/GPUQueue.js.map +1 -1
- package/WebGPU/GPURenderBundle.js.map +1 -1
- package/WebGPU/GPURenderBundleEncoder.js.map +1 -1
- package/WebGPU/GPURenderPassEncoder.js +2 -2
- package/WebGPU/GPURenderPassEncoder.js.map +1 -1
- package/WebGPU/GPURenderPipeline.js.map +1 -1
- package/WebGPU/GPUSampler.js.map +1 -1
- package/WebGPU/GPUShaderModule.js.map +1 -1
- package/WebGPU/GPUTexture.js.map +1 -1
- package/WebGPU/GPUTextureView.js.map +1 -1
- package/WebGPU/Types.d.ts +27 -27
- package/WebGPU/Utils.d.ts +1 -1
- package/WebGPU/Utils.js.map +1 -1
- package/angular/{esm2020 → esm2022}/index.mjs +5 -5
- package/angular/{fesm2015 → fesm2022}/nativescript-canvas-angular.mjs +4 -4
- package/angular/{fesm2020 → fesm2022}/nativescript-canvas-angular.mjs.map +1 -1
- package/angular/package.json +4 -10
- package/helpers.js.map +1 -1
- package/package.json +2 -2
- package/platforms/android/canvas-release.aar +0 -0
- package/platforms/ios/CanvasNative.xcframework/Info.plist +5 -5
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/CanvasNative-Swift.h +21 -9
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_native.h +2049 -2061
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.abi.json +752 -108
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.private.swiftinterface +35 -9
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftinterface +35 -9
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/NSCCanvas.nib +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/aarch64/CanvasNative.yml +644 -602
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/CanvasNative-Swift.h +42 -18
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_native.h +2049 -2061
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.abi.json +752 -108
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +35 -9
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftinterface +35 -9
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.abi.json +752 -108
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +35 -9
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +35 -9
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/NSCCanvas.nib +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/_CodeSignature/CodeResources +24 -24
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/aarch64/CanvasNative.yml +646 -604
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/x86_64/CanvasNative.yml +684 -638
- package/platforms/ios/src/NSOperationQueueWrapper.h +2 -0
- package/platforms/ios/src/cpp/AsyncCallback.h +206 -0
- package/platforms/ios/src/cpp/CanvasJSIModule.cpp +13 -13
- package/platforms/ios/src/cpp/Helpers.h +2 -164
- package/platforms/ios/src/cpp/ImageAssetImpl.cpp +13 -13
- package/platforms/ios/src/cpp/ImageBitmapImpl.cpp +1 -1
- package/platforms/ios/src/cpp/ImageBitmapImpl.h +2 -1
- package/platforms/ios/src/cpp/JSIReadFileCallback.h +4 -4
- package/platforms/ios/src/cpp/NativeType.h +87 -0
- package/platforms/ios/src/cpp/ObjectWrapperImpl.h +50 -0
- package/platforms/ios/src/cpp/OneByteStringResource.cpp +2 -2
- package/platforms/ios/src/cpp/PromiseCallback.h +198 -0
- package/platforms/ios/src/cpp/RafImpl.h +2 -2
- package/platforms/ios/src/cpp/TextDecoderImpl.cpp +0 -6
- package/platforms/ios/src/cpp/TextDecoderImpl.h +3 -3
- package/platforms/ios/src/cpp/TextEncoderImpl.cpp +1 -1
- package/platforms/ios/src/cpp/TextEncoderImpl.h +3 -3
- package/platforms/ios/src/cpp/canvas2d/CanvasGradient.h +8 -7
- package/platforms/ios/src/cpp/canvas2d/CanvasPattern.cpp +1 -1
- package/platforms/ios/src/cpp/canvas2d/CanvasPattern.h +3 -3
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.cpp +145 -75
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.h +74 -20
- package/platforms/ios/src/cpp/canvas2d/ImageDataImpl.cpp +5 -6
- package/platforms/ios/src/cpp/canvas2d/ImageDataImpl.h +4 -4
- package/platforms/ios/src/cpp/canvas2d/MatrixImpl.cpp +10 -10
- package/platforms/ios/src/cpp/canvas2d/MatrixImpl.h +2 -2
- package/platforms/ios/src/cpp/canvas2d/Path2D.cpp +6 -3
- package/platforms/ios/src/cpp/canvas2d/Path2D.h +2 -2
- package/platforms/ios/src/cpp/canvas2d/TextMetricsImpl.h +3 -3
- package/platforms/ios/src/cpp/webgl/WebGLActiveInfoImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/WebGLBuffer.h +1 -1
- package/platforms/ios/src/cpp/webgl/WebGLFramebuffer.h +1 -1
- package/platforms/ios/src/cpp/webgl/WebGLProgram.h +3 -3
- package/platforms/ios/src/cpp/webgl/WebGLRenderbuffer.h +3 -3
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.cpp +8 -8
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.h +1 -1
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContextBase.cpp +1 -1
- package/platforms/ios/src/cpp/webgl/WebGLShader.h +1 -1
- package/platforms/ios/src/cpp/webgl/WebGLShaderPrecisionFormatImpl.h +5 -5
- package/platforms/ios/src/cpp/webgl/WebGLTexture.h +3 -2
- package/platforms/ios/src/cpp/webgl/WebGLUniformLocation.h +2 -2
- package/platforms/ios/src/cpp/webgl/extensions/ANGLE_instanced_arraysImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/EXT_blend_minmaxImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/EXT_color_buffer_half_floatImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/EXT_disjoint_timer_queryImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/EXT_sRGBImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/EXT_shader_texture_lodImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/EXT_texture_filter_anisotropicImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/OES_element_index_uintImpl.h +2 -2
- package/platforms/ios/src/cpp/webgl/extensions/OES_fbo_render_mipmap.h +5 -5
- package/platforms/ios/src/cpp/webgl/extensions/OES_standard_derivativesImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/OES_texture_floatImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/OES_texture_float_linearImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/OES_texture_half_floatImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/OES_texture_half_float_linearImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/OES_vertex_array_objectImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_color_buffer_floatImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_atcImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etc1Impl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etcImpl.h +2 -2
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_pvrtcImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tcImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tc_srgbImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_depth_textureImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_draw_buffersImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_lose_contextImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.cpp +722 -722
- package/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.h +1 -1
- package/platforms/ios/src/cpp/webgl2/WebGLQuery.h +1 -1
- package/platforms/ios/src/cpp/webgl2/WebGLSampler.h +1 -1
- package/platforms/ios/src/cpp/webgl2/WebGLSyncImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl2/WebGLTransformFeedback.h +1 -1
- package/platforms/ios/src/cpp/webgl2/WebGLVertexArrayObject.h +2 -2
- package/platforms/ios/src/cpp/webgpu/GPUAdapterImpl.cpp +124 -58
- package/platforms/ios/src/cpp/webgpu/GPUAdapterImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUAdapterInfoImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUAdapterInfoImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.cpp +44 -30
- package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.h +4 -4
- package/platforms/ios/src/cpp/webgpu/GPUCanvasContextImpl.cpp +11 -11
- package/platforms/ios/src/cpp/webgpu/GPUCanvasContextImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.cpp +30 -31
- package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.cpp +99 -73
- package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.h +2 -2
- package/platforms/ios/src/cpp/webgpu/GPUImpl.cpp +54 -41
- package/platforms/ios/src/cpp/webgpu/GPUImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.h +5 -4
- package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.cpp +38 -23
- package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleEncoderImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.cpp +4 -3
- package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.h +2 -2
- package/platforms/ios/src/cpp/webgpu/GPUSupportedLimitsImpl.cpp +2 -2
- package/platforms/ios/src/cpp/webgpu/GPUSupportedLimitsImpl.h +2 -2
- package/platforms/ios/src/cpp/webgpu/GPUTextureImpl.h +4 -4
- package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.h +2 -2
- package/react/index.d.ts +1 -1
- package/utils.js.map +1 -1
- package/angular/fesm2015/nativescript-canvas-angular.mjs.map +0 -1
- package/angular/fesm2020/nativescript-canvas-angular.mjs +0 -24
- package/typings/objc!CanvasNative.d.ts +0 -2038
- package/typings/objc!CanvasNative.js +0 -1
- package/typings/objc!CanvasNative.js.map +0 -1
- /package/angular/{esm2020 → esm2022}/nativescript-canvas-angular.mjs +0 -0
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Created by Osei Fortune on 06/08/2024.
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
#ifndef CANVAS_ANDROID_NATIVETYPE_H
|
|
6
|
+
#define CANVAS_ANDROID_NATIVETYPE_H
|
|
7
|
+
|
|
8
|
+
enum class NativeType {
|
|
9
|
+
None,
|
|
10
|
+
CanvasGradient,
|
|
11
|
+
CanvasPattern,
|
|
12
|
+
ImageData,
|
|
13
|
+
ImageAsset,
|
|
14
|
+
CanvasRenderingContext2D,
|
|
15
|
+
WebGLRenderingContextBase,
|
|
16
|
+
Path2D,
|
|
17
|
+
Matrix,
|
|
18
|
+
ImageBitmap,
|
|
19
|
+
TextMetrics,
|
|
20
|
+
|
|
21
|
+
WebGLQuery,
|
|
22
|
+
WebGLProgram,
|
|
23
|
+
WebGLShader,
|
|
24
|
+
WebGLBuffer,
|
|
25
|
+
WebGLFramebuffer,
|
|
26
|
+
WebGLRenderbuffer,
|
|
27
|
+
WebGLTexture,
|
|
28
|
+
WebGLActiveInfo,
|
|
29
|
+
OES_fbo_render_mipmap,
|
|
30
|
+
EXT_blend_minmax,
|
|
31
|
+
EXT_color_buffer_half_float,
|
|
32
|
+
EXT_disjoint_timer_query,
|
|
33
|
+
EXT_sRGB,
|
|
34
|
+
EXT_shader_texture_lod,
|
|
35
|
+
EXT_texture_filter_anisotropic,
|
|
36
|
+
OES_element_index_uint,
|
|
37
|
+
OES_standard_derivatives,
|
|
38
|
+
OES_texture_float,
|
|
39
|
+
OES_texture_float_linear,
|
|
40
|
+
OES_texture_half_float_linear,
|
|
41
|
+
OES_texture_half_float,
|
|
42
|
+
WEBGL_color_buffer_float,
|
|
43
|
+
OES_vertex_array_object,
|
|
44
|
+
WebGLVertexArrayObject,
|
|
45
|
+
WEBGL_compressed_texture_atc,
|
|
46
|
+
WEBGL_compressed_texture_etc1,
|
|
47
|
+
WEBGL_compressed_texture_s3tc,
|
|
48
|
+
WEBGL_compressed_texture_s3tc_srgb,
|
|
49
|
+
WEBGL_compressed_texture_etc,
|
|
50
|
+
WEBGL_compressed_texture_pvrtc,
|
|
51
|
+
WEBGL_lose_context,
|
|
52
|
+
ANGLE_instanced_arrays,
|
|
53
|
+
WEBGL_depth_texture,
|
|
54
|
+
WEBGL_draw_buffers,
|
|
55
|
+
WebGLShaderPrecisionFormat,
|
|
56
|
+
WebGLUniformLocation,
|
|
57
|
+
WebGLSampler,
|
|
58
|
+
WebGLTransformFeedback,
|
|
59
|
+
WebGLSync,
|
|
60
|
+
|
|
61
|
+
GPUAdapter,
|
|
62
|
+
GPUSupportedLimits,
|
|
63
|
+
GPUDevice,
|
|
64
|
+
GPUQueue,
|
|
65
|
+
GPUBuffer,
|
|
66
|
+
GPUInstance,
|
|
67
|
+
GPUCanvasContext,
|
|
68
|
+
GPUTexture,
|
|
69
|
+
GPUAdapterInfo,
|
|
70
|
+
GPUCommandEncoder,
|
|
71
|
+
GPUComputePass,
|
|
72
|
+
GPUQuerySet,
|
|
73
|
+
GPUShaderModule,
|
|
74
|
+
GPUPipelineLayout,
|
|
75
|
+
GPURenderPipeline,
|
|
76
|
+
GPUBindGroupLayout,
|
|
77
|
+
GPUTextureView,
|
|
78
|
+
GPURenderPassEncoder,
|
|
79
|
+
GPUCommandBuffer,
|
|
80
|
+
GPUBindGroup,
|
|
81
|
+
GPUComputePipeline,
|
|
82
|
+
GPUSampler,
|
|
83
|
+
GPURenderBundleEncoder,
|
|
84
|
+
GPURenderBundle
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
#endif //CANVAS_ANDROID_NATIVETYPE_H
|
|
@@ -9,9 +9,11 @@
|
|
|
9
9
|
#define ObjectWrapperImpl_h
|
|
10
10
|
|
|
11
11
|
#include "Common.h"
|
|
12
|
+
#include "NativeType.h"
|
|
12
13
|
|
|
13
14
|
class ObjectWrapperImpl {
|
|
14
15
|
public:
|
|
16
|
+
NativeType type_ = NativeType::None;
|
|
15
17
|
|
|
16
18
|
static void Finalizer(const v8::WeakCallbackInfo<ObjectWrapperImpl> &data) {
|
|
17
19
|
auto *pThis = data.GetParameter();
|
|
@@ -25,6 +27,54 @@ public:
|
|
|
25
27
|
weakHandle_.SetWeak(this, Finalizer, v8::WeakCallbackType::kParameter);
|
|
26
28
|
}
|
|
27
29
|
|
|
30
|
+
|
|
31
|
+
/*
|
|
32
|
+
static void SetNativeType(const v8::Local<v8::Object> &obj, NativeType type) {
|
|
33
|
+
if (!obj.IsEmpty() && !obj->IsNullOrUndefined() && obj->IsObject() &&
|
|
34
|
+
obj.As<v8::Object>()->InternalFieldCount() > 1) {
|
|
35
|
+
auto wrapper = obj.As<v8::Object>()->GetAlignedPointerFromInternalField(0);
|
|
36
|
+
if (wrapper != nullptr) {
|
|
37
|
+
((ObjectWrapperImpl *) wrapper)->type_ = type;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
inline static NativeType GetNativeType(const v8::Local<v8::Value> &obj) {
|
|
44
|
+
if (!obj.IsEmpty() && !obj->IsNullOrUndefined() && obj->IsObject() &&
|
|
45
|
+
obj.As<v8::Object>()->InternalFieldCount() > 1) {
|
|
46
|
+
auto info = obj.As<v8::Object>()->GetAlignedPointerFromInternalField(0);
|
|
47
|
+
|
|
48
|
+
if (info != nullptr) {
|
|
49
|
+
auto value = static_cast<ObjectWrapperImpl *>(info);
|
|
50
|
+
return value->type_;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return NativeType::None;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
static void SetNativeType(ObjectWrapperImpl *obj, NativeType type) {
|
|
58
|
+
if (obj != nullptr) {
|
|
59
|
+
obj->type_ = type;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
static NativeType GetNativeType(const ObjectWrapperImpl *obj) {
|
|
64
|
+
if (obj != nullptr) {
|
|
65
|
+
return obj->type_;
|
|
66
|
+
}
|
|
67
|
+
return NativeType::None;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
static void SetNativeType(ObjectWrapperImpl &obj, NativeType type) {
|
|
71
|
+
obj.type_ = type;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
static NativeType GetNativeType(const ObjectWrapperImpl &obj) {
|
|
75
|
+
return obj.type_;
|
|
76
|
+
}
|
|
77
|
+
|
|
28
78
|
private:
|
|
29
79
|
v8::Global<v8::Object> weakHandle_;
|
|
30
80
|
|
|
@@ -27,11 +27,11 @@ OneByteStringResource::OneByteStringResource(std::string string) : stdString_(st
|
|
|
27
27
|
|
|
28
28
|
OneByteStringResource::~OneByteStringResource() {
|
|
29
29
|
if (usingBuffer_) {
|
|
30
|
-
|
|
30
|
+
canvas_native_u8_buffer_release(buffer_);
|
|
31
31
|
this->string_ = nullptr;
|
|
32
32
|
this->length_ = 0;
|
|
33
33
|
}else if(usingCow_){
|
|
34
|
-
|
|
34
|
+
canvas_native_ccow_release(cow_);
|
|
35
35
|
this->string_ = nullptr;
|
|
36
36
|
this->length_ = 0;
|
|
37
37
|
}else if(usingString){
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Created by Osei Fortune on 05/08/2024.
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
#pragma once
|
|
6
|
+
|
|
7
|
+
#include "Common.h"
|
|
8
|
+
#include <thread>
|
|
9
|
+
|
|
10
|
+
#ifdef __ANDROID__
|
|
11
|
+
|
|
12
|
+
#include <android/looper.h>
|
|
13
|
+
#include <cassert>
|
|
14
|
+
|
|
15
|
+
#endif
|
|
16
|
+
|
|
17
|
+
#ifdef __APPLE__
|
|
18
|
+
#include "NSOperationQueueWrapper.h"
|
|
19
|
+
#endif
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
#include <unistd.h>
|
|
23
|
+
#include <fcntl.h>
|
|
24
|
+
|
|
25
|
+
typedef void(*CompleteCallback)(bool success, void *data);
|
|
26
|
+
|
|
27
|
+
#ifdef __APPLE__
|
|
28
|
+
struct PromiseCallback {
|
|
29
|
+
struct Inner {
|
|
30
|
+
NSOperationQueueWrapper* current_queue = nullptr;
|
|
31
|
+
v8::Isolate *isolate_;
|
|
32
|
+
v8::Persistent<v8::Promise::Resolver> callback_;
|
|
33
|
+
v8::Persistent<v8::Value> error_;
|
|
34
|
+
CompleteCallback completeCallback_;
|
|
35
|
+
CompleteCallback completeCallbackWrapper_;
|
|
36
|
+
bool isPrepared_ = false;
|
|
37
|
+
void* data;
|
|
38
|
+
|
|
39
|
+
Inner(v8::Isolate *isolate, v8::Local<v8::Promise::Resolver> callback,
|
|
40
|
+
CompleteCallback completeCallback) : isolate_(isolate),
|
|
41
|
+
callback_(v8::Persistent<v8::Promise::Resolver>(
|
|
42
|
+
isolate,
|
|
43
|
+
callback)) {
|
|
44
|
+
this->completeCallback_ = completeCallback;
|
|
45
|
+
this->completeCallbackWrapper_ = [](bool success, void *data){
|
|
46
|
+
if(data != nullptr){
|
|
47
|
+
auto* callback = static_cast<PromiseCallback*>(data);
|
|
48
|
+
auto inner = callback->inner_.get();
|
|
49
|
+
if(inner == nullptr || inner->current_queue != nullptr){
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
inner->current_queue->addOperation([success, data, inner, callback](){
|
|
54
|
+
inner->completeCallback_(success, data);
|
|
55
|
+
// delete callback;
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
void prepare(){
|
|
62
|
+
current_queue = new NSOperationQueueWrapper(true);
|
|
63
|
+
isPrepared_ = true;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
void execute(bool complete, PromiseCallback* callback){
|
|
67
|
+
completeCallbackWrapper_(complete, callback);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
~Inner(){
|
|
71
|
+
callback_.Reset();
|
|
72
|
+
error_.Reset();
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
std::shared_ptr<Inner> inner_;
|
|
77
|
+
|
|
78
|
+
void prepare(){
|
|
79
|
+
auto inner = this->inner_.get();
|
|
80
|
+
if(inner == nullptr){return;}
|
|
81
|
+
inner->prepare();
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
void execute(bool complete) {
|
|
85
|
+
auto inner = this->inner_.get();
|
|
86
|
+
if (inner == nullptr) { return; }
|
|
87
|
+
inner->execute(complete, this);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
explicit PromiseCallback(std::shared_ptr<Inner> inner) : inner_(std::move(inner)) {}
|
|
91
|
+
|
|
92
|
+
PromiseCallback(v8::Isolate *isolate, v8::Local<v8::Promise::Resolver> callback,
|
|
93
|
+
CompleteCallback completeCallback) : inner_(
|
|
94
|
+
std::make_shared<Inner>(isolate, callback, completeCallback)) {}
|
|
95
|
+
};
|
|
96
|
+
#endif
|
|
97
|
+
|
|
98
|
+
#ifdef __ANDROID__
|
|
99
|
+
|
|
100
|
+
struct PromiseCallback {
|
|
101
|
+
struct Inner {
|
|
102
|
+
int fd_[2];
|
|
103
|
+
ALooper *looper_ = nullptr;
|
|
104
|
+
v8::Isolate *isolate_;
|
|
105
|
+
v8::Persistent<v8::Promise::Resolver> callback_;
|
|
106
|
+
void *data = nullptr;
|
|
107
|
+
CompleteCallback completeCallback_;
|
|
108
|
+
bool isPrepared_ = false;
|
|
109
|
+
|
|
110
|
+
Inner(v8::Isolate *isolate, v8::Local<v8::Promise::Resolver> callback,
|
|
111
|
+
CompleteCallback completeCallback) : isolate_(isolate),
|
|
112
|
+
callback_(v8::Persistent<v8::Promise::Resolver>(
|
|
113
|
+
isolate,
|
|
114
|
+
callback)) {
|
|
115
|
+
this->completeCallback_ = completeCallback;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
void prepare() {
|
|
119
|
+
// release previous looper
|
|
120
|
+
if (isPrepared_) {
|
|
121
|
+
ALooper_removeFd(looper_, fd_[0]);
|
|
122
|
+
close(fd_[0]);
|
|
123
|
+
fd_[0] = -1;
|
|
124
|
+
fd_[1] = -1;
|
|
125
|
+
ALooper_release(looper_);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
auto res = pipe(fd_);
|
|
129
|
+
assert(res != -1);
|
|
130
|
+
res = fcntl(fd_[1], F_SETFL, O_NONBLOCK);
|
|
131
|
+
assert(res != -1);
|
|
132
|
+
looper_ = ALooper_prepare(0);
|
|
133
|
+
ALooper_acquire(looper_);
|
|
134
|
+
|
|
135
|
+
isPrepared_ = true;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
void execute(bool complete) const {
|
|
139
|
+
if (!isPrepared_) { return; }
|
|
140
|
+
write(fd_[1],
|
|
141
|
+
&complete,
|
|
142
|
+
sizeof(bool));
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
~Inner() {
|
|
147
|
+
if (!isPrepared_) {
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
ALooper_removeFd(looper_, fd_[0]);
|
|
151
|
+
close(fd_[0]);
|
|
152
|
+
ALooper_release(looper_);
|
|
153
|
+
callback_.Reset();
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
void prepare() const {
|
|
158
|
+
auto inner = this->inner_.get();
|
|
159
|
+
if (inner == nullptr) { return; }
|
|
160
|
+
inner->prepare();
|
|
161
|
+
auto looper = inner->looper_;
|
|
162
|
+
auto fd = inner->fd_[0];
|
|
163
|
+
auto data = new PromiseCallback(this->inner_);
|
|
164
|
+
ALooper_addFd(looper,
|
|
165
|
+
fd,
|
|
166
|
+
ALOOPER_POLL_CALLBACK,
|
|
167
|
+
ALOOPER_EVENT_INPUT,
|
|
168
|
+
[](int fd, int events,
|
|
169
|
+
void *data) {
|
|
170
|
+
auto cb = static_cast<PromiseCallback *>(data);
|
|
171
|
+
bool done = false;
|
|
172
|
+
read(fd, &done,
|
|
173
|
+
sizeof(bool));
|
|
174
|
+
cb->inner_->completeCallback_(done, data);
|
|
175
|
+
return 0;
|
|
176
|
+
}, (void *) data);
|
|
177
|
+
|
|
178
|
+
ALooper_wake(looper);
|
|
179
|
+
inner->isPrepared_ = true;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
void execute(bool complete) const {
|
|
183
|
+
auto inner = this->inner_.get();
|
|
184
|
+
if (inner == nullptr) { return; }
|
|
185
|
+
inner->execute(complete);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
std::shared_ptr<Inner> inner_;
|
|
189
|
+
|
|
190
|
+
explicit PromiseCallback(std::shared_ptr<Inner> inner) : inner_(std::move(inner)) {}
|
|
191
|
+
|
|
192
|
+
PromiseCallback(v8::Isolate *isolate, v8::Local<v8::Promise::Resolver> callback,
|
|
193
|
+
CompleteCallback completeCallback) : inner_(
|
|
194
|
+
std::make_shared<Inner>(isolate, callback, completeCallback)) {}
|
|
195
|
+
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
#endif
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
class RafImpl {
|
|
13
13
|
public:
|
|
14
14
|
RafImpl(OnRafCallback *rafCallback, intptr_t callback, Raf* raf);
|
|
15
|
-
|
|
15
|
+
|
|
16
16
|
~RafImpl(){
|
|
17
|
-
|
|
17
|
+
canvas_native_raf_release(this->GetRaf());
|
|
18
18
|
this->raf_ = nullptr;
|
|
19
19
|
delete rafCallback_;
|
|
20
20
|
}
|
|
@@ -57,12 +57,6 @@ v8::Local<v8::FunctionTemplate> TextDecoderImpl::GetCtor(v8::Isolate *isolate) {
|
|
|
57
57
|
return ctorTmpl;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
void MyWeakCallback(const v8::WeakCallbackInfo<TextDecoderImpl>& info) {
|
|
61
|
-
TextDecoderImpl* obj = info.GetParameter();
|
|
62
|
-
// Perform cleanup or any necessary actions when the object is no longer reachable
|
|
63
|
-
delete obj;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
60
|
void TextDecoderImpl::Ctor(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
67
61
|
auto count = args.Length();
|
|
68
62
|
auto value = args[0];
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
|
|
11
11
|
class TextDecoderImpl: ObjectWrapperImpl {
|
|
12
12
|
public:
|
|
13
|
-
|
|
14
|
-
TextDecoderImpl(TextDecoder *decoder);
|
|
13
|
+
|
|
14
|
+
explicit TextDecoderImpl(TextDecoder *decoder);
|
|
15
15
|
|
|
16
16
|
~TextDecoderImpl() {
|
|
17
|
-
|
|
17
|
+
canvas_native_text_decoder_release(this->GetTextDecoder());
|
|
18
18
|
this->decoder_ = nullptr;
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -122,7 +122,7 @@ void TextEncoderImpl::Encode(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
|
122
122
|
[](void *data, size_t length,
|
|
123
123
|
void *deleter_data) {
|
|
124
124
|
if (deleter_data != nullptr) {
|
|
125
|
-
|
|
125
|
+
canvas_native_u8_buffer_release((U8Buffer *)deleter_data);
|
|
126
126
|
}
|
|
127
127
|
},
|
|
128
128
|
encoded);
|
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
class TextEncoderImpl: ObjectWrapperImpl {
|
|
12
12
|
|
|
13
13
|
public:
|
|
14
|
-
TextEncoderImpl(TextEncoder* encoder);
|
|
14
|
+
explicit TextEncoderImpl(TextEncoder* encoder);
|
|
15
15
|
~TextEncoderImpl() {
|
|
16
|
-
|
|
16
|
+
canvas_native_text_encoder_release(this->GetTextEncoder());
|
|
17
17
|
this->encoder_ = nullptr;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
TextEncoder* GetTextEncoder();
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
static void Init(const v8::Local<v8::Object>& canvasModule, v8::Isolate *isolate);
|
|
23
23
|
|
|
24
24
|
static TextEncoderImpl *GetPointer(v8::Local<v8::Object> object);
|
|
@@ -3,21 +3,22 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
#pragma once
|
|
6
|
+
|
|
6
7
|
#include <vector>
|
|
7
8
|
#include "Common.h"
|
|
8
9
|
#include "Helpers.h"
|
|
9
10
|
#include "ObjectWrapperImpl.h"
|
|
10
11
|
|
|
11
|
-
class CanvasGradient: ObjectWrapperImpl {
|
|
12
|
+
class CanvasGradient : ObjectWrapperImpl {
|
|
12
13
|
public:
|
|
13
|
-
CanvasGradient(PaintStyle*style);
|
|
14
|
+
explicit CanvasGradient(PaintStyle *style);
|
|
14
15
|
|
|
15
|
-
~CanvasGradient(){
|
|
16
|
-
|
|
16
|
+
~CanvasGradient() {
|
|
17
|
+
canvas_native_paint_style_release(this->GetPaintStyle());
|
|
17
18
|
this->style_ = nullptr;
|
|
18
19
|
}
|
|
19
20
|
|
|
20
|
-
PaintStyle *
|
|
21
|
+
PaintStyle *GetPaintStyle();
|
|
21
22
|
|
|
22
23
|
static void Init(v8::Local<v8::Object> canvasModule, v8::Isolate *isolate);
|
|
23
24
|
|
|
@@ -30,7 +31,7 @@ public:
|
|
|
30
31
|
v8::EscapableHandleScope scope(isolate);
|
|
31
32
|
auto object = CanvasGradient::GetCtor(isolate)->GetFunction(
|
|
32
33
|
context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
|
|
33
|
-
SetNativeType(
|
|
34
|
+
SetNativeType(gradient, NativeType::CanvasGradient);
|
|
34
35
|
object->SetAlignedPointerInInternalField(0, gradient);
|
|
35
36
|
gradient->BindFinalizer(isolate, object);
|
|
36
37
|
return scope.Escape(object);
|
|
@@ -39,6 +40,6 @@ public:
|
|
|
39
40
|
static void AddColorStop(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
40
41
|
|
|
41
42
|
private:
|
|
42
|
-
PaintStyle*
|
|
43
|
+
PaintStyle *style_;
|
|
43
44
|
};
|
|
44
45
|
|
|
@@ -17,7 +17,7 @@ void CanvasPattern::Init(const v8::Local<v8::Object> &canvasModule, v8::Isolate
|
|
|
17
17
|
auto context = isolate->GetCurrentContext();
|
|
18
18
|
auto func = ctor->GetFunction(context).ToLocalChecked();
|
|
19
19
|
|
|
20
|
-
canvasModule->Set(context, ConvertToV8String(isolate, "CanvasPattern"), func);
|
|
20
|
+
canvasModule->Set(context, ConvertToV8String(isolate, "CanvasPattern"), func).FromJust();
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
v8::CFunction CanvasPattern::fast_set_transform_(
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
|
|
11
11
|
class CanvasPattern : ObjectWrapperImpl {
|
|
12
12
|
public:
|
|
13
|
-
CanvasPattern(PaintStyle *style);
|
|
13
|
+
explicit CanvasPattern(PaintStyle *style);
|
|
14
14
|
|
|
15
15
|
~CanvasPattern() {
|
|
16
|
-
|
|
16
|
+
canvas_native_paint_style_release(this->GetPaintStyle());
|
|
17
17
|
this->style_ = nullptr;
|
|
18
18
|
}
|
|
19
19
|
|
|
@@ -30,7 +30,7 @@ public:
|
|
|
30
30
|
v8::EscapableHandleScope scope(isolate);
|
|
31
31
|
auto object = CanvasPattern::GetCtor(isolate)->GetFunction(
|
|
32
32
|
context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
|
|
33
|
-
SetNativeType(
|
|
33
|
+
SetNativeType(pattern, NativeType::CanvasPattern);
|
|
34
34
|
object->SetAlignedPointerInInternalField(0, pattern);
|
|
35
35
|
pattern->BindFinalizer(isolate, object);
|
|
36
36
|
return scope.Escape(object);
|