@nativescript/canvas 2.0.0-beta.9 → 2.0.0-rc.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/Canvas/common.d.ts +15 -24
- package/Canvas/common.js +147 -203
- package/Canvas/common.js.map +1 -1
- package/Canvas/index.android.d.ts +13 -15
- package/Canvas/index.android.js +152 -151
- package/Canvas/index.android.js.map +1 -1
- package/Canvas/index.d.ts +23 -11
- package/Canvas/index.ios.d.ts +14 -6
- package/Canvas/index.ios.js +213 -124
- package/Canvas/index.ios.js.map +1 -1
- package/Canvas/utils.d.ts +3 -0
- package/Canvas/utils.js +85 -0
- package/Canvas/utils.js.map +1 -0
- package/Canvas2D/CanvasRenderingContext2D/index.d.ts +4 -2
- package/Canvas2D/CanvasRenderingContext2D/index.js +79 -85
- package/Canvas2D/CanvasRenderingContext2D/index.js.map +1 -1
- package/Canvas2D/DOMMatrix/index.d.ts +14 -0
- package/Canvas2D/DOMMatrix/index.js +62 -0
- package/Canvas2D/DOMMatrix/index.js.map +1 -1
- package/Canvas2D/ImageData/index.js +4 -6
- 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.d.ts +1 -2
- package/Dom/Group.js.map +1 -1
- package/Dom/Image.d.ts +4 -1
- package/Dom/Image.js +15 -2
- package/Dom/Image.js.map +1 -1
- package/Dom/Paint.d.ts +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.d.ts +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/Fonts/FontFace.android.d.ts +46 -0
- package/Fonts/FontFace.android.js +197 -0
- package/Fonts/FontFace.android.js.map +1 -0
- package/Fonts/FontFace.ios.d.ts +45 -0
- package/Fonts/FontFace.ios.js +169 -0
- package/Fonts/FontFace.ios.js.map +1 -0
- package/Fonts/FontFaceSet.android.d.ts +31 -0
- package/Fonts/FontFaceSet.android.js +119 -0
- package/Fonts/FontFaceSet.android.js.map +1 -0
- package/Fonts/FontFaceSet.ios.d.ts +31 -0
- package/Fonts/FontFaceSet.ios.js +109 -0
- package/Fonts/FontFaceSet.ios.js.map +1 -0
- package/Fonts/index.d.ts +2 -0
- package/Fonts/index.js +3 -0
- package/Fonts/index.js.map +1 -0
- package/ImageAsset/index.d.ts +8 -3
- package/ImageAsset/index.js +206 -11
- package/ImageAsset/index.js.map +1 -1
- package/ImageBitmap/index.js +110 -23
- package/ImageBitmap/index.js.map +1 -1
- package/README.md +62 -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.d.ts +1 -1
- package/WebGL/WebGLRenderingContext/common.js.map +1 -1
- package/WebGL/WebGLRenderingContext/index.d.ts +1 -0
- package/WebGL/WebGLRenderingContext/index.js +144 -46
- package/WebGL/WebGLRenderingContext/index.js.map +1 -1
- package/WebGL2/WebGL2RenderingContext/index.d.ts +1 -0
- package/WebGL2/WebGL2RenderingContext/index.js +7 -8
- package/WebGL2/WebGL2RenderingContext/index.js.map +1 -1
- package/WebGPU/Constants.d.ts +36 -0
- package/WebGPU/Constants.js +42 -0
- package/WebGPU/Constants.js.map +1 -0
- package/WebGPU/Errors.d.ts +18 -0
- package/WebGPU/Errors.js +21 -0
- package/WebGPU/Errors.js.map +1 -0
- package/WebGPU/GPU.d.ts +13 -0
- package/WebGPU/GPU.js +36 -0
- package/WebGPU/GPU.js.map +1 -0
- package/WebGPU/GPUAdapter.d.ts +26 -0
- package/WebGPU/GPUAdapter.js +93 -0
- package/WebGPU/GPUAdapter.js.map +1 -0
- package/WebGPU/GPUAdapterInfo.d.ts +9 -0
- package/WebGPU/GPUAdapterInfo.js +24 -0
- package/WebGPU/GPUAdapterInfo.js.map +1 -0
- package/WebGPU/GPUBindGroup.d.ts +6 -0
- package/WebGPU/GPUBindGroup.js +15 -0
- package/WebGPU/GPUBindGroup.js.map +1 -0
- package/WebGPU/GPUBindGroupLayout.d.ts +6 -0
- package/WebGPU/GPUBindGroupLayout.js +15 -0
- package/WebGPU/GPUBindGroupLayout.js.map +1 -0
- package/WebGPU/GPUBuffer.d.ts +15 -0
- package/WebGPU/GPUBuffer.js +66 -0
- package/WebGPU/GPUBuffer.js.map +1 -0
- package/WebGPU/GPUCanvasContext.d.ts +42 -0
- package/WebGPU/GPUCanvasContext.js +149 -0
- package/WebGPU/GPUCanvasContext.js.map +1 -0
- package/WebGPU/GPUCommandBuffer.d.ts +6 -0
- package/WebGPU/GPUCommandBuffer.js +15 -0
- package/WebGPU/GPUCommandBuffer.js.map +1 -0
- package/WebGPU/GPUCommandEncoder.d.ts +35 -0
- package/WebGPU/GPUCommandEncoder.js +163 -0
- package/WebGPU/GPUCommandEncoder.js.map +1 -0
- package/WebGPU/GPUComputePassEncoder.d.ts +17 -0
- package/WebGPU/GPUComputePassEncoder.js +53 -0
- package/WebGPU/GPUComputePassEncoder.js.map +1 -0
- package/WebGPU/GPUComputePipeline.d.ts +8 -0
- package/WebGPU/GPUComputePipeline.js +19 -0
- package/WebGPU/GPUComputePipeline.js.map +1 -0
- package/WebGPU/GPUDevice.d.ts +111 -0
- package/WebGPU/GPUDevice.js +341 -0
- package/WebGPU/GPUDevice.js.map +1 -0
- package/WebGPU/GPUDeviceLostInfo.d.ts +1 -0
- package/WebGPU/GPUDeviceLostInfo.js +10 -0
- package/WebGPU/GPUDeviceLostInfo.js.map +1 -0
- package/WebGPU/GPUExternalTexture.d.ts +6 -0
- package/WebGPU/GPUExternalTexture.js +15 -0
- package/WebGPU/GPUExternalTexture.js.map +1 -0
- package/WebGPU/GPUPipelineLayout.d.ts +6 -0
- package/WebGPU/GPUPipelineLayout.js +15 -0
- package/WebGPU/GPUPipelineLayout.js.map +1 -0
- package/WebGPU/GPUQuerySet.d.ts +6 -0
- package/WebGPU/GPUQuerySet.js +15 -0
- package/WebGPU/GPUQuerySet.js.map +1 -0
- package/WebGPU/GPUQueue.d.ts +15 -0
- package/WebGPU/GPUQueue.js +128 -0
- package/WebGPU/GPUQueue.js.map +1 -0
- package/WebGPU/GPURenderBundle.d.ts +6 -0
- package/WebGPU/GPURenderBundle.js +15 -0
- package/WebGPU/GPURenderBundle.js.map +1 -0
- package/WebGPU/GPURenderBundleEncoder.d.ts +22 -0
- package/WebGPU/GPURenderBundleEncoder.js +65 -0
- package/WebGPU/GPURenderBundleEncoder.js.map +1 -0
- package/WebGPU/GPURenderPassEncoder.d.ts +33 -0
- package/WebGPU/GPURenderPassEncoder.js +106 -0
- package/WebGPU/GPURenderPassEncoder.js.map +1 -0
- package/WebGPU/GPURenderPipeline.d.ts +8 -0
- package/WebGPU/GPURenderPipeline.js +19 -0
- package/WebGPU/GPURenderPipeline.js.map +1 -0
- package/WebGPU/GPUSampler.d.ts +6 -0
- package/WebGPU/GPUSampler.js +15 -0
- package/WebGPU/GPUSampler.js.map +1 -0
- package/WebGPU/GPUShaderModule.d.ts +6 -0
- package/WebGPU/GPUShaderModule.js +15 -0
- package/WebGPU/GPUShaderModule.js.map +1 -0
- package/WebGPU/GPUTexture.d.ts +18 -0
- package/WebGPU/GPUTexture.js +47 -0
- package/WebGPU/GPUTexture.js.map +1 -0
- package/WebGPU/GPUTextureView.d.ts +6 -0
- package/WebGPU/GPUTextureView.js +15 -0
- package/WebGPU/GPUTextureView.js.map +1 -0
- package/WebGPU/Interfaces.d.ts +246 -0
- package/WebGPU/Interfaces.js +2 -0
- package/WebGPU/Interfaces.js.map +1 -0
- package/WebGPU/Types.d.ts +47 -0
- package/WebGPU/Types.js +2 -0
- package/WebGPU/Types.js.map +1 -0
- package/WebGPU/Utils.d.ts +7 -0
- package/WebGPU/Utils.js +301 -0
- package/WebGPU/Utils.js.map +1 -0
- package/WebGPU/index.d.ts +28 -0
- package/WebGPU/index.js +29 -0
- package/WebGPU/index.js.map +1 -0
- package/angular/{esm2020 → esm2022}/index.mjs +5 -5
- package/angular/{fesm2015 → fesm2022}/nativescript-canvas-angular.mjs +4 -4
- package/angular/{fesm2015 → fesm2022}/nativescript-canvas-angular.mjs.map +1 -1
- package/angular/package.json +4 -10
- package/common.d.ts +0 -3
- package/common.js +1 -5
- package/common.js.map +1 -1
- package/helpers.js.map +1 -1
- package/index.d.ts +4 -2
- package/index.js +37 -3
- package/index.js.map +1 -1
- package/package.json +2 -5
- package/platforms/android/canvas-release.aar +0 -0
- 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 +194 -56
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/CanvasNative.h +1 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/NSCMTLView.h +32 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_ios.h +152 -151
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_native.h +2901 -411
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Info.plist +0 -0
- 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 +10901 -8099
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.private.swiftinterface +259 -52
- 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 +259 -52
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-Black.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-Bold.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-ExtraBold.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-ExtraLight.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-Light.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-Medium.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-Regular.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-SemiBold.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoMath-Regular.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-Bold.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-BoldItalic.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-Italic.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-Medium.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-MediumItalic.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-Regular.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-SemiBold.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-SemiBoldItalic.ttf +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 +994 -663
- 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 +388 -112
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/CanvasNative.h +1 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/NSCMTLView.h +32 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_ios.h +152 -151
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_native.h +2901 -411
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Info.plist +0 -0
- 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 +10901 -8099
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +259 -52
- 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 +259 -52
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.abi.json +10901 -8099
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +259 -52
- 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 +259 -52
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/_CodeSignature/CodeResources +143 -33
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-Black.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-Bold.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-ExtraBold.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-ExtraLight.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-Light.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-Medium.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-Regular.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/Noto_Serif_CJK/NotoSerifTC-SemiBold.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoMath-Regular.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-Bold.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-BoldItalic.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-Italic.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-Medium.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-MediumItalic.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-Regular.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-SemiBold.ttf +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/fonts/STIXTwoMath/STIXTwoText-SemiBoldItalic.ttf +0 -0
- 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 +993 -662
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/x86_64/CanvasNative.yml +1037 -641
- package/platforms/ios/build.xcconfig +3 -1
- package/platforms/ios/src/NSOperationQueueWrapper.h +3 -1
- package/platforms/ios/src/NSOperationQueueWrapper.mm +41 -9
- package/platforms/ios/src/cpp/AsyncCallback.h +214 -0
- package/platforms/ios/src/cpp/Caches.h +69 -1
- package/platforms/ios/src/cpp/CanvasJSIModule.cpp +647 -1166
- package/platforms/ios/src/cpp/CanvasJSIModule.h +11 -1
- package/platforms/ios/src/cpp/Helpers.h +2 -129
- package/platforms/ios/src/cpp/ImageAssetImpl.cpp +600 -437
- package/platforms/ios/src/cpp/ImageAssetImpl.h +18 -10
- package/platforms/ios/src/cpp/ImageBitmapImpl.cpp +63 -6
- package/platforms/ios/src/cpp/ImageBitmapImpl.h +12 -4
- 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 +197 -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 -11
- package/platforms/ios/src/cpp/canvas2d/CanvasPattern.h +3 -3
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.cpp +193 -90
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.h +77 -23
- 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 +409 -3
- package/platforms/ios/src/cpp/canvas2d/MatrixImpl.h +29 -2
- package/platforms/ios/src/cpp/canvas2d/Path2D.cpp +6 -3
- package/platforms/ios/src/cpp/canvas2d/Path2D.h +7 -7
- 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 +247 -160
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.h +1 -1
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContextBase.cpp +6 -6
- 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 +1067 -960
- 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 +371 -0
- package/platforms/ios/src/cpp/webgpu/GPUAdapterImpl.h +63 -0
- package/platforms/ios/src/cpp/webgpu/GPUAdapterInfoImpl.cpp +174 -0
- package/platforms/ios/src/cpp/webgpu/GPUAdapterInfoImpl.h +58 -0
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupImpl.cpp +79 -0
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupImpl.h +48 -0
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.cpp +79 -0
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.h +48 -0
- package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.cpp +277 -0
- package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.h +63 -0
- package/platforms/ios/src/cpp/webgpu/GPUCanvasContextImpl.cpp +379 -0
- package/platforms/ios/src/cpp/webgpu/GPUCanvasContextImpl.h +57 -0
- package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.cpp +81 -0
- package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.h +48 -0
- package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.cpp +1217 -0
- package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.h +73 -0
- package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.cpp +293 -0
- package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.h +65 -0
- package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.cpp +109 -0
- package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.h +51 -0
- package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.cpp +3701 -0
- package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.h +97 -0
- package/platforms/ios/src/cpp/webgpu/GPUImpl.cpp +200 -0
- package/platforms/ios/src/cpp/webgpu/GPUImpl.h +55 -0
- package/platforms/ios/src/cpp/webgpu/GPULabel.h +33 -0
- package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.cpp +80 -0
- package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.h +49 -0
- package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.cpp +136 -0
- package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.h +55 -0
- package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.cpp +605 -0
- package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.h +59 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleEncoderImpl.cpp +501 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleEncoderImpl.h +74 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.cpp +78 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.h +48 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.cpp +723 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.h +92 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.cpp +109 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.h +52 -0
- package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.cpp +79 -0
- package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.h +48 -0
- package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.cpp +80 -0
- package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.h +48 -0
- package/platforms/ios/src/cpp/webgpu/GPUSupportedLimitsImpl.cpp +1304 -0
- package/platforms/ios/src/cpp/webgpu/GPUSupportedLimitsImpl.h +288 -0
- package/platforms/ios/src/cpp/webgpu/GPUTextureImpl.cpp +386 -0
- package/platforms/ios/src/cpp/webgpu/GPUTextureImpl.h +77 -0
- package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.cpp +79 -0
- package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.h +48 -0
- package/platforms/ios/src/cpp/webgpu/GPUUtils.h +756 -0
- package/react/index.d.ts +1 -1
- package/utils.d.ts +1 -1
- package/utils.js.map +1 -1
- package/SVG/Circle.d.ts +0 -11
- package/SVG/Circle.js +0 -21
- package/SVG/Circle.js.map +0 -1
- package/SVG/ClipPath.d.ts +0 -4
- package/SVG/ClipPath.js +0 -9
- package/SVG/ClipPath.js.map +0 -1
- package/SVG/Defs.d.ts +0 -4
- package/SVG/Defs.js +0 -9
- package/SVG/Defs.js.map +0 -1
- package/SVG/Ellipse.d.ts +0 -13
- package/SVG/Ellipse.js +0 -26
- package/SVG/Ellipse.js.map +0 -1
- package/SVG/G.d.ts +0 -7
- package/SVG/G.js +0 -9
- package/SVG/G.js.map +0 -1
- package/SVG/Image.d.ts +0 -11
- package/SVG/Image.js +0 -40
- package/SVG/Image.js.map +0 -1
- package/SVG/Line.d.ts +0 -13
- package/SVG/Line.js +0 -26
- package/SVG/Line.js.map +0 -1
- package/SVG/LinearGradient.d.ts +0 -10
- package/SVG/LinearGradient.js +0 -13
- package/SVG/LinearGradient.js.map +0 -1
- package/SVG/Path.d.ts +0 -7
- package/SVG/Path.js +0 -14
- package/SVG/Path.js.map +0 -1
- package/SVG/Pattern.d.ts +0 -4
- package/SVG/Pattern.js +0 -9
- package/SVG/Pattern.js.map +0 -1
- package/SVG/Polygon.d.ts +0 -7
- package/SVG/Polygon.js +0 -14
- package/SVG/Polygon.js.map +0 -1
- package/SVG/Polyline.d.ts +0 -7
- package/SVG/Polyline.js +0 -14
- package/SVG/Polyline.js.map +0 -1
- package/SVG/Rect.d.ts +0 -8
- package/SVG/Rect.js +0 -13
- package/SVG/Rect.js.map +0 -1
- package/SVG/SVG.d.ts +0 -32
- package/SVG/SVG.js +0 -204
- package/SVG/SVG.js.map +0 -1
- package/SVG/SVGItem.d.ts +0 -5
- package/SVG/SVGItem.js +0 -8
- package/SVG/SVGItem.js.map +0 -1
- package/SVG/Stop.d.ts +0 -5
- package/SVG/Stop.js +0 -9
- package/SVG/Stop.js.map +0 -1
- package/SVG/Symbol.d.ts +0 -4
- package/SVG/Symbol.js +0 -9
- package/SVG/Symbol.js.map +0 -1
- package/SVG/Text.d.ts +0 -14
- package/SVG/Text.js +0 -26
- package/SVG/Text.js.map +0 -1
- package/SVG/Use.d.ts +0 -4
- package/SVG/Use.js +0 -9
- package/SVG/Use.js.map +0 -1
- package/SVG/index.d.ts +0 -18
- package/SVG/index.js +0 -19
- package/SVG/index.js.map +0 -1
- package/angular/fesm2020/nativescript-canvas-angular.mjs +0 -24
- package/angular/fesm2020/nativescript-canvas-angular.mjs.map +0 -1
- package/platforms/ios/src/cpp/PerIsolateData.cpp +0 -49
- package/platforms/ios/src/cpp/PerIsolateData.h +0 -54
- package/platforms/ios/src/cpp/URLImpl.cpp +0 -464
- package/platforms/ios/src/cpp/URLImpl.h +0 -121
- 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
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
#include "Helpers.h"
|
|
12
12
|
#include "Common.h"
|
|
13
13
|
|
|
14
|
-
ImageAssetImpl::ImageAssetImpl(ImageAsset *asset) : asset_(asset) {
|
|
14
|
+
ImageAssetImpl::ImageAssetImpl(const ImageAsset *asset) : asset_(asset) {
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
ImageAssetImpl::~ImageAssetImpl() {
|
|
18
|
-
|
|
18
|
+
canvas_native_image_asset_release(this->GetImageAsset());
|
|
19
19
|
asset_ = nullptr;
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -23,12 +23,12 @@ void ImageAssetImpl::Init(v8::Local<v8::Object> canvasModule, v8::Isolate *isola
|
|
|
23
23
|
v8::Locker locker(isolate);
|
|
24
24
|
v8::Isolate::Scope isolate_scope(isolate);
|
|
25
25
|
v8::HandleScope handle_scope(isolate);
|
|
26
|
-
|
|
26
|
+
|
|
27
27
|
auto ctor = GetCtor(isolate);
|
|
28
28
|
auto context = isolate->GetCurrentContext();
|
|
29
29
|
auto func = ctor->GetFunction(context).ToLocalChecked();
|
|
30
|
-
|
|
31
|
-
canvasModule->Set(context, ConvertToV8String(isolate, "ImageAsset"), func);
|
|
30
|
+
|
|
31
|
+
canvasModule->Set(context, ConvertToV8String(isolate, "ImageAsset"), func).IsJust();
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
ImageAssetImpl *ImageAssetImpl::GetPointer(const v8::Local<v8::Object> &object) {
|
|
@@ -45,87 +45,102 @@ v8::Local<v8::FunctionTemplate> ImageAssetImpl::GetCtor(v8::Isolate *isolate) {
|
|
|
45
45
|
if (ctor != nullptr) {
|
|
46
46
|
return ctor->Get(isolate);
|
|
47
47
|
}
|
|
48
|
-
|
|
48
|
+
|
|
49
49
|
v8::Local<v8::FunctionTemplate> ctorTmpl = v8::FunctionTemplate::New(isolate, Ctor);
|
|
50
50
|
ctorTmpl->InstanceTemplate()->SetInternalFieldCount(2);
|
|
51
51
|
ctorTmpl->SetClassName(ConvertToV8String(isolate, "ImageAsset"));
|
|
52
|
-
|
|
52
|
+
|
|
53
53
|
auto tmpl = ctorTmpl->InstanceTemplate();
|
|
54
54
|
tmpl->SetInternalFieldCount(2);
|
|
55
55
|
tmpl->SetAccessor(
|
|
56
|
-
|
|
57
|
-
|
|
56
|
+
ConvertToV8String(isolate, "width"),
|
|
57
|
+
GetWidth);
|
|
58
58
|
tmpl->SetAccessor(
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
ConvertToV8String(isolate, "height"),
|
|
60
|
+
GetHeight);
|
|
61
61
|
tmpl->SetAccessor(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
ConvertToV8String(isolate, "error"),
|
|
63
|
+
GetError);
|
|
64
|
+
|
|
65
65
|
tmpl->SetAccessor(
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
ConvertToV8String(isolate, "__addr"),
|
|
67
|
+
GetAddr);
|
|
68
|
+
|
|
69
69
|
tmpl->Set(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
ConvertToV8String(isolate, "__getRef"),
|
|
71
|
+
v8::FunctionTemplate::New(isolate, GetReference));
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
// tmpl->Set(
|
|
76
|
+
// ConvertToV8String(isolate, "scale"),
|
|
77
|
+
// v8::FunctionTemplate::New(isolate, &Scale));
|
|
78
|
+
|
|
73
79
|
tmpl->Set(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
80
|
+
ConvertToV8String(isolate, "fromUrlSync"),
|
|
81
|
+
v8::FunctionTemplate::New(isolate, &FromUrlSync));
|
|
82
|
+
|
|
77
83
|
tmpl->Set(
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
84
|
+
ConvertToV8String(isolate, "fromUrlCb"),
|
|
85
|
+
v8::FunctionTemplate::New(isolate, &FromUrlCb));
|
|
86
|
+
|
|
87
|
+
|
|
82
88
|
tmpl->Set(
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
89
|
+
ConvertToV8String(isolate, "fromFileSync"),
|
|
90
|
+
v8::FunctionTemplate::New(isolate, &FromFileSync));
|
|
91
|
+
|
|
86
92
|
tmpl->Set(
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
93
|
+
ConvertToV8String(isolate, "fromFileCb"),
|
|
94
|
+
v8::FunctionTemplate::New(isolate, &FromFileCb));
|
|
95
|
+
|
|
96
|
+
|
|
91
97
|
tmpl->Set(
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
98
|
+
ConvertToV8String(isolate, "fromBytesSync"),
|
|
99
|
+
v8::FunctionTemplate::New(isolate, &FromBytesSync));
|
|
100
|
+
|
|
95
101
|
tmpl->Set(
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
102
|
+
ConvertToV8String(isolate, "fromBytesCb"),
|
|
103
|
+
v8::FunctionTemplate::New(isolate, &FromBytesCb));
|
|
104
|
+
|
|
105
|
+
|
|
100
106
|
tmpl->Set(
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
107
|
+
ConvertToV8String(isolate, "fromEncodedBytesSync"),
|
|
108
|
+
v8::FunctionTemplate::New(isolate, &FromEncodedBytesSync));
|
|
109
|
+
|
|
104
110
|
tmpl->Set(
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
111
|
+
ConvertToV8String(isolate, "fromEncodedBytesCb"),
|
|
112
|
+
v8::FunctionTemplate::New(isolate, &FromEncodedBytesCb));
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
/* tmpl->Set(
|
|
116
|
+
ConvertToV8String(isolate, "saveSync"),
|
|
117
|
+
v8::FunctionTemplate::New(isolate, &SaveSync));
|
|
118
|
+
|
|
119
|
+
tmpl->Set(
|
|
120
|
+
ConvertToV8String(isolate, "saveCb"),
|
|
121
|
+
v8::FunctionTemplate::New(isolate, &SaveCb));
|
|
122
|
+
*/
|
|
123
|
+
|
|
109
124
|
cache->ImageAssetTmpl =
|
|
110
|
-
|
|
125
|
+
std::make_unique<v8::Persistent<v8::FunctionTemplate>>(isolate, ctorTmpl);
|
|
111
126
|
return ctorTmpl;
|
|
112
127
|
}
|
|
113
128
|
|
|
114
129
|
void ImageAssetImpl::Ctor(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
115
130
|
auto isolate = args.GetIsolate();
|
|
116
|
-
|
|
131
|
+
|
|
117
132
|
auto ret = args.This();
|
|
118
|
-
|
|
119
|
-
SetNativeType(ret, NativeType::ImageAsset);
|
|
120
|
-
|
|
133
|
+
|
|
121
134
|
auto image_asset = canvas_native_image_asset_create();
|
|
122
|
-
|
|
135
|
+
|
|
123
136
|
auto object = new ImageAssetImpl(image_asset);
|
|
124
|
-
|
|
137
|
+
|
|
138
|
+
SetNativeType(object, NativeType::ImageAsset);
|
|
139
|
+
|
|
125
140
|
ret->SetAlignedPointerInInternalField(0, object);
|
|
126
|
-
|
|
141
|
+
|
|
127
142
|
object->BindFinalizer(isolate, ret);
|
|
128
|
-
|
|
143
|
+
|
|
129
144
|
args.GetReturnValue().Set(ret);
|
|
130
145
|
}
|
|
131
146
|
|
|
@@ -160,14 +175,28 @@ ImageAssetImpl::GetAddr(v8::Local<v8::String> name,
|
|
|
160
175
|
auto ptr = GetPointer(info.This());
|
|
161
176
|
if (ptr != nullptr) {
|
|
162
177
|
auto isolate = info.GetIsolate();
|
|
163
|
-
auto
|
|
164
|
-
|
|
165
|
-
info.GetReturnValue().Set(ConvertToV8String(isolate, ret.c_str()));
|
|
178
|
+
auto ret = std::to_string(canvas_native_image_asset_get_addr(ptr->GetImageAsset()));
|
|
179
|
+
info.GetReturnValue().Set(ConvertToV8String(isolate, ret));
|
|
166
180
|
return;
|
|
167
181
|
}
|
|
168
182
|
info.GetReturnValue().SetEmptyString();
|
|
169
183
|
}
|
|
170
184
|
|
|
185
|
+
|
|
186
|
+
void
|
|
187
|
+
ImageAssetImpl::GetReference(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
188
|
+
auto ptr = GetPointer(args.This());
|
|
189
|
+
if (ptr != nullptr) {
|
|
190
|
+
auto isolate = args.GetIsolate();
|
|
191
|
+
auto reference = canvas_native_image_asset_reference(ptr->GetImageAsset());
|
|
192
|
+
auto ret = std::to_string(canvas_native_image_asset_get_addr(reference));
|
|
193
|
+
args.GetReturnValue().Set(ConvertToV8String(isolate, ret));
|
|
194
|
+
return;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
args.GetReturnValue().SetEmptyString();
|
|
198
|
+
}
|
|
199
|
+
|
|
171
200
|
void
|
|
172
201
|
ImageAssetImpl::GetError(v8::Local<v8::String> name,
|
|
173
202
|
const v8::PropertyCallbackInfo<v8::Value> &info) {
|
|
@@ -182,26 +211,6 @@ ImageAssetImpl::GetError(v8::Local<v8::String> name,
|
|
|
182
211
|
info.GetReturnValue().SetEmptyString();
|
|
183
212
|
}
|
|
184
213
|
|
|
185
|
-
void ImageAssetImpl::Scale(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
186
|
-
ImageAssetImpl *ptr = GetPointer(args.This());
|
|
187
|
-
if (ptr == nullptr) {
|
|
188
|
-
args.GetReturnValue().SetUndefined();
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
|
-
auto isolate = args.GetIsolate();
|
|
192
|
-
auto context = isolate->GetCurrentContext();
|
|
193
|
-
|
|
194
|
-
if (args.Length() > 1) {
|
|
195
|
-
auto x = args[0]->Uint32Value(context).ToChecked();
|
|
196
|
-
auto y = args[1]->Uint32Value(context).ToChecked();
|
|
197
|
-
if (x > 0 && y > 0) {
|
|
198
|
-
canvas_native_image_asset_scale(
|
|
199
|
-
ptr->GetImageAsset(), x,
|
|
200
|
-
y);
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
|
|
205
214
|
void ImageAssetImpl::FromUrlSync(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
206
215
|
ImageAssetImpl *ptr = GetPointer(args.This());
|
|
207
216
|
if (ptr == nullptr) {
|
|
@@ -210,9 +219,9 @@ void ImageAssetImpl::FromUrlSync(const v8::FunctionCallbackInfo<v8::Value> &args
|
|
|
210
219
|
}
|
|
211
220
|
auto isolate = args.GetIsolate();
|
|
212
221
|
auto url = ConvertFromV8String(isolate, args[0]);
|
|
213
|
-
|
|
222
|
+
|
|
214
223
|
auto done = canvas_native_image_asset_load_from_url(ptr->GetImageAsset(), url.c_str());
|
|
215
|
-
|
|
224
|
+
|
|
216
225
|
args.GetReturnValue().Set(done);
|
|
217
226
|
}
|
|
218
227
|
|
|
@@ -221,92 +230,90 @@ void ImageAssetImpl::FromUrlCb(const v8::FunctionCallbackInfo<v8::Value> &args)
|
|
|
221
230
|
if (ptr == nullptr) {
|
|
222
231
|
return;
|
|
223
232
|
}
|
|
224
|
-
|
|
233
|
+
|
|
225
234
|
auto isolate = args.GetIsolate();
|
|
226
|
-
|
|
235
|
+
|
|
227
236
|
if (args.Length() < 2) {
|
|
228
237
|
return;
|
|
229
238
|
}
|
|
230
|
-
|
|
239
|
+
|
|
231
240
|
auto url = ConvertFromV8String(isolate, args[0]);
|
|
232
|
-
|
|
233
|
-
auto asset =
|
|
234
|
-
|
|
241
|
+
|
|
242
|
+
auto asset = canvas_native_image_asset_reference(ptr->asset_);
|
|
243
|
+
|
|
235
244
|
auto callback = args[1].As<v8::Function>();
|
|
236
|
-
|
|
245
|
+
|
|
237
246
|
auto jsi_callback = new JSICallback(isolate, callback);
|
|
238
|
-
|
|
247
|
+
|
|
239
248
|
#ifdef __ANDROID__
|
|
240
|
-
|
|
249
|
+
|
|
241
250
|
ALooper_addFd(jsi_callback->looper_,
|
|
242
251
|
jsi_callback->fd_[0],
|
|
243
|
-
|
|
252
|
+
0,
|
|
244
253
|
ALOOPER_EVENT_INPUT,
|
|
245
254
|
[](int fd, int events,
|
|
246
255
|
void *data) {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
256
|
+
auto cb = static_cast<JSICallback *>(data);
|
|
257
|
+
bool done;
|
|
258
|
+
read(fd, &done,
|
|
259
|
+
sizeof(bool));
|
|
260
|
+
|
|
261
|
+
v8::Isolate *isolate = cb->isolate_;
|
|
262
|
+
v8::Locker locker(isolate);
|
|
263
|
+
v8::Isolate::Scope isolate_scope(isolate);
|
|
264
|
+
v8::HandleScope handle_scope(isolate);
|
|
265
|
+
v8::Local<v8::Function> callback = cb->callback_->Get(isolate);
|
|
266
|
+
v8::Local<v8::Context> context = callback->GetCreationContextChecked();
|
|
267
|
+
v8::Context::Scope context_scope(context);
|
|
268
|
+
|
|
269
|
+
v8::Local<v8::Value> args[1] = {v8::Boolean::New(isolate, done)};
|
|
270
|
+
|
|
271
|
+
// v8::TryCatch tc(isolate);
|
|
272
|
+
|
|
273
|
+
callback->Call(context, context->Global(), 1,
|
|
274
|
+
args); // ignore JS return value
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
delete static_cast<JSICallback *>(data);
|
|
278
|
+
return 0;
|
|
279
|
+
}, jsi_callback);
|
|
280
|
+
|
|
281
|
+
|
|
275
282
|
std::thread thread(
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
283
|
+
[jsi_callback, asset](
|
|
284
|
+
const std::string &url) {
|
|
285
|
+
auto done = canvas_native_image_asset_load_from_url(asset, url.c_str());
|
|
286
|
+
|
|
287
|
+
canvas_native_image_asset_release(asset);
|
|
288
|
+
|
|
289
|
+
write(jsi_callback->fd_[1],
|
|
290
|
+
&done,
|
|
291
|
+
sizeof(bool));
|
|
292
|
+
|
|
293
|
+
}, std::move(url));
|
|
294
|
+
|
|
288
295
|
thread.detach();
|
|
289
|
-
|
|
296
|
+
|
|
290
297
|
#endif
|
|
291
|
-
|
|
292
|
-
|
|
298
|
+
|
|
299
|
+
|
|
293
300
|
#ifdef __APPLE__
|
|
294
|
-
|
|
301
|
+
|
|
295
302
|
auto current_queue = new NSOperationQueueWrapper(true);
|
|
296
|
-
|
|
303
|
+
|
|
297
304
|
auto queue = new NSOperationQueueWrapper(false);
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
305
|
+
|
|
306
|
+
|
|
307
|
+
|
|
301
308
|
/* std::thread task([jsi_callback, current_queue, asset](std::string url) {
|
|
302
|
-
|
|
303
|
-
|
|
309
|
+
|
|
310
|
+
|
|
304
311
|
auto done = canvas_native_image_asset_load_from_url(asset, url.c_str());
|
|
305
|
-
|
|
306
|
-
|
|
312
|
+
|
|
313
|
+
|
|
307
314
|
auto main_task = [jsi_callback, current_queue, url, done]() {
|
|
308
|
-
|
|
309
|
-
|
|
315
|
+
|
|
316
|
+
|
|
310
317
|
v8::Isolate *isolate = jsi_callback->isolate_;
|
|
311
318
|
v8::Locker locker(isolate);
|
|
312
319
|
v8::Isolate::Scope isolate_scope(isolate);
|
|
@@ -314,43 +321,43 @@ void ImageAssetImpl::FromUrlCb(const v8::FunctionCallbackInfo<v8::Value> &args)
|
|
|
314
321
|
v8::Local<v8::Function> callback = jsi_callback->callback_->Get(isolate);
|
|
315
322
|
v8::Local<v8::Context> context = callback->GetCreationContextChecked();
|
|
316
323
|
v8::Context::Scope context_scope(context);
|
|
317
|
-
|
|
324
|
+
|
|
318
325
|
v8::Local<v8::Value> args[1] = {v8::Boolean::New(isolate, done)};
|
|
319
|
-
|
|
326
|
+
|
|
320
327
|
// v8::TryCatch tc(isolate);
|
|
321
|
-
|
|
328
|
+
|
|
322
329
|
callback->Call(context, context->Global(), 1,
|
|
323
330
|
args); // ignore JS return value
|
|
324
|
-
|
|
325
|
-
|
|
331
|
+
|
|
332
|
+
|
|
326
333
|
delete jsi_callback;
|
|
327
334
|
// delete queue;
|
|
328
335
|
delete current_queue;
|
|
329
|
-
|
|
330
|
-
|
|
336
|
+
|
|
337
|
+
|
|
331
338
|
};
|
|
332
|
-
|
|
339
|
+
|
|
333
340
|
current_queue->addOperation(main_task);
|
|
334
|
-
|
|
335
|
-
|
|
341
|
+
|
|
342
|
+
|
|
336
343
|
}, std::move(url));
|
|
337
|
-
|
|
344
|
+
|
|
338
345
|
task.detach();
|
|
339
|
-
|
|
346
|
+
|
|
340
347
|
*/
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
348
|
+
|
|
349
|
+
|
|
350
|
+
|
|
351
|
+
|
|
352
|
+
|
|
346
353
|
auto task = [jsi_callback, current_queue, queue, asset, url]() {
|
|
347
|
-
|
|
354
|
+
|
|
348
355
|
auto done = canvas_native_image_asset_load_from_url(asset, url.c_str());
|
|
349
|
-
|
|
350
|
-
|
|
356
|
+
canvas_native_image_asset_release(asset);
|
|
357
|
+
|
|
351
358
|
auto main_task = [jsi_callback, current_queue, queue, url, done]() {
|
|
352
|
-
|
|
353
|
-
|
|
359
|
+
|
|
360
|
+
|
|
354
361
|
v8::Isolate *isolate = jsi_callback->isolate_;
|
|
355
362
|
v8::Locker locker(isolate);
|
|
356
363
|
v8::Isolate::Scope isolate_scope(isolate);
|
|
@@ -358,31 +365,31 @@ void ImageAssetImpl::FromUrlCb(const v8::FunctionCallbackInfo<v8::Value> &args)
|
|
|
358
365
|
v8::Local<v8::Function> callback = jsi_callback->callback_->Get(isolate);
|
|
359
366
|
v8::Local<v8::Context> context = callback->GetCreationContextChecked();
|
|
360
367
|
v8::Context::Scope context_scope(context);
|
|
361
|
-
|
|
368
|
+
|
|
362
369
|
v8::Local<v8::Value> args[1] = {v8::Boolean::New(isolate, done)};
|
|
363
|
-
|
|
370
|
+
|
|
364
371
|
// v8::TryCatch tc(isolate);
|
|
365
|
-
|
|
372
|
+
|
|
366
373
|
callback->Call(context, context->Global(), 1,
|
|
367
374
|
args); // ignore JS return value
|
|
368
|
-
|
|
369
|
-
|
|
375
|
+
|
|
376
|
+
|
|
370
377
|
delete jsi_callback;
|
|
371
378
|
delete queue;
|
|
372
379
|
delete current_queue;
|
|
373
|
-
|
|
374
|
-
|
|
380
|
+
|
|
381
|
+
|
|
375
382
|
};
|
|
376
|
-
|
|
383
|
+
|
|
377
384
|
current_queue->addOperation(main_task);
|
|
378
|
-
|
|
385
|
+
|
|
379
386
|
};
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
|
|
383
390
|
queue->addOperation(task);
|
|
384
391
|
#endif
|
|
385
|
-
|
|
392
|
+
|
|
386
393
|
}
|
|
387
394
|
|
|
388
395
|
void ImageAssetImpl::FromFileSync(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
@@ -393,10 +400,9 @@ void ImageAssetImpl::FromFileSync(const v8::FunctionCallbackInfo<v8::Value> &arg
|
|
|
393
400
|
}
|
|
394
401
|
auto isolate = args.GetIsolate();
|
|
395
402
|
auto path = ConvertFromV8String(isolate, args[0]);
|
|
396
|
-
|
|
403
|
+
|
|
397
404
|
auto done = canvas_native_image_asset_load_from_path(ptr->GetImageAsset(), path.c_str());
|
|
398
|
-
|
|
399
|
-
|
|
405
|
+
|
|
400
406
|
args.GetReturnValue().Set(done);
|
|
401
407
|
}
|
|
402
408
|
|
|
@@ -406,90 +412,85 @@ void ImageAssetImpl::FromFileCb(const v8::FunctionCallbackInfo<v8::Value> &args)
|
|
|
406
412
|
return;
|
|
407
413
|
}
|
|
408
414
|
auto isolate = args.GetIsolate();
|
|
409
|
-
|
|
415
|
+
|
|
410
416
|
if (args.Length() < 2) {
|
|
411
417
|
return;
|
|
412
418
|
}
|
|
413
|
-
|
|
414
|
-
|
|
419
|
+
|
|
415
420
|
auto path = ConvertFromV8String(isolate, args[0]);
|
|
416
|
-
|
|
417
|
-
auto asset =
|
|
418
|
-
|
|
419
|
-
|
|
421
|
+
|
|
422
|
+
auto asset = canvas_native_image_asset_reference(ptr->GetImageAsset());
|
|
423
|
+
|
|
420
424
|
auto callback = args[1].As<v8::Function>();
|
|
421
|
-
|
|
422
|
-
|
|
425
|
+
|
|
423
426
|
auto jsi_callback = new JSICallback(isolate, callback);
|
|
424
|
-
|
|
427
|
+
|
|
425
428
|
#ifdef __ANDROID__
|
|
426
|
-
|
|
429
|
+
|
|
427
430
|
ALooper_addFd(jsi_callback->looper_,
|
|
428
431
|
jsi_callback->fd_[0],
|
|
429
|
-
|
|
432
|
+
0,
|
|
430
433
|
ALOOPER_EVENT_INPUT,
|
|
431
434
|
[](int fd, int events,
|
|
432
435
|
void *data) {
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
436
|
+
auto cb = static_cast<JSICallback *>(data);
|
|
437
|
+
bool done;
|
|
438
|
+
read(fd, &done,
|
|
439
|
+
sizeof(bool));
|
|
440
|
+
|
|
441
|
+
v8::Isolate *isolate = cb->isolate_;
|
|
442
|
+
v8::Locker locker(isolate);
|
|
443
|
+
v8::Isolate::Scope isolate_scope(isolate);
|
|
444
|
+
v8::HandleScope handle_scope(isolate);
|
|
445
|
+
v8::Local<v8::Function> callback = cb->callback_->Get(isolate);
|
|
446
|
+
v8::Local<v8::Context> context = callback->GetCreationContextChecked();
|
|
447
|
+
v8::Context::Scope context_scope(context);
|
|
448
|
+
|
|
449
|
+
v8::Local<v8::Value> args[1] = {v8::Boolean::New(isolate, done)};
|
|
450
|
+
|
|
451
|
+
v8::TryCatch tc(isolate);
|
|
452
|
+
|
|
453
|
+
callback->Call(context, context->Global(), 1,
|
|
454
|
+
args); // ignore JS return value
|
|
455
|
+
|
|
456
|
+
delete static_cast<JSICallback *>(data);
|
|
457
|
+
return 0;
|
|
458
|
+
}, jsi_callback);
|
|
459
|
+
|
|
460
|
+
|
|
460
461
|
std::thread thread(
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
462
|
+
[jsi_callback, asset](
|
|
463
|
+
const std::string path) {
|
|
464
|
+
|
|
465
|
+
auto done = canvas_native_image_asset_load_from_path(asset, path.c_str());
|
|
466
|
+
|
|
467
|
+
write(jsi_callback->fd_[1],
|
|
468
|
+
&done,
|
|
469
|
+
sizeof(bool));
|
|
470
|
+
|
|
471
|
+
canvas_native_image_asset_release(asset);
|
|
472
|
+
|
|
473
|
+
}, std::move(path));
|
|
474
|
+
|
|
474
475
|
thread.detach();
|
|
475
|
-
|
|
476
|
+
|
|
476
477
|
#endif
|
|
477
|
-
|
|
478
|
-
|
|
478
|
+
|
|
479
|
+
|
|
479
480
|
#ifdef __APPLE__
|
|
480
|
-
|
|
481
|
+
|
|
481
482
|
auto current_queue = new NSOperationQueueWrapper(true);
|
|
482
|
-
|
|
483
|
+
|
|
483
484
|
auto queue = new NSOperationQueueWrapper(false);
|
|
484
|
-
|
|
485
|
+
|
|
485
486
|
auto task = [jsi_callback, current_queue, queue, asset, path]() {
|
|
486
|
-
|
|
487
|
+
|
|
487
488
|
auto done = canvas_native_image_asset_load_from_path(asset, path.c_str());
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
489
|
+
|
|
490
|
+
canvas_native_image_asset_release(asset);
|
|
491
|
+
|
|
491
492
|
auto main_task = [jsi_callback, current_queue, queue, done]() {
|
|
492
|
-
|
|
493
|
+
|
|
493
494
|
v8::Isolate *isolate = jsi_callback->isolate_;
|
|
494
495
|
v8::Locker locker(isolate);
|
|
495
496
|
v8::Isolate::Scope isolate_scope(isolate);
|
|
@@ -497,27 +498,27 @@ void ImageAssetImpl::FromFileCb(const v8::FunctionCallbackInfo<v8::Value> &args)
|
|
|
497
498
|
v8::Local<v8::Function> callback = jsi_callback->callback_->Get(isolate);
|
|
498
499
|
v8::Local<v8::Context> context = callback->GetCreationContextChecked();
|
|
499
500
|
v8::Context::Scope context_scope(context);
|
|
500
|
-
|
|
501
|
+
|
|
501
502
|
v8::Local<v8::Value> args[1] = {v8::Boolean::New(isolate, done)};
|
|
502
|
-
|
|
503
|
+
|
|
503
504
|
// v8::TryCatch tc(isolate);
|
|
504
|
-
|
|
505
|
+
|
|
505
506
|
callback->Call(context, context->Global(), 1,
|
|
506
507
|
args); // ignore JS return value
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
delete jsi_callback;
|
|
508
|
+
|
|
510
509
|
delete queue;
|
|
511
510
|
delete current_queue;
|
|
512
|
-
|
|
513
|
-
|
|
511
|
+
delete jsi_callback;
|
|
512
|
+
|
|
514
513
|
};
|
|
515
|
-
|
|
514
|
+
|
|
516
515
|
current_queue->addOperation(main_task);
|
|
517
|
-
|
|
516
|
+
|
|
518
517
|
};
|
|
519
|
-
|
|
518
|
+
|
|
520
519
|
queue->addOperation(task);
|
|
520
|
+
|
|
521
|
+
|
|
521
522
|
#endif
|
|
522
523
|
}
|
|
523
524
|
|
|
@@ -527,24 +528,32 @@ void ImageAssetImpl::FromBytesSync(const v8::FunctionCallbackInfo<v8::Value> &ar
|
|
|
527
528
|
args.GetReturnValue().Set(false);
|
|
528
529
|
return;
|
|
529
530
|
}
|
|
530
|
-
|
|
531
|
-
auto value = args[
|
|
532
|
-
|
|
531
|
+
auto context = args.GetIsolate()->GetCurrentContext();
|
|
532
|
+
auto value = args[2];
|
|
533
|
+
|
|
533
534
|
if (value->IsObject()) {
|
|
534
535
|
if (!value->IsArrayBuffer()) {
|
|
535
536
|
args.GetReturnValue().Set(false);
|
|
536
537
|
return;
|
|
537
538
|
}
|
|
538
539
|
auto buf = value.As<v8::ArrayBuffer>();
|
|
539
|
-
|
|
540
|
+
|
|
540
541
|
auto size = (uintptr_t) buf->ByteLength();
|
|
541
542
|
auto data = (uint8_t *) buf->GetBackingStore()->Data();
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
543
|
+
|
|
544
|
+
uint32_t width;
|
|
545
|
+
uint32_t height;
|
|
546
|
+
bool done = false;
|
|
547
|
+
if(args[0]->Uint32Value(context).To(&width)
|
|
548
|
+
&& args[1]->Uint32Value(context).To(&height)
|
|
549
|
+
) {
|
|
550
|
+
done = canvas_native_image_asset_load_from_raw(ptr->GetImageAsset(), width, height, data, size);
|
|
551
|
+
}
|
|
552
|
+
|
|
545
553
|
args.GetReturnValue().Set(done);
|
|
554
|
+
return;
|
|
546
555
|
}
|
|
547
|
-
|
|
556
|
+
|
|
548
557
|
args.GetReturnValue().Set(false);
|
|
549
558
|
}
|
|
550
559
|
|
|
@@ -554,92 +563,96 @@ void ImageAssetImpl::FromBytesCb(const v8::FunctionCallbackInfo<v8::Value> &args
|
|
|
554
563
|
return;
|
|
555
564
|
}
|
|
556
565
|
auto isolate = args.GetIsolate();
|
|
557
|
-
|
|
566
|
+
|
|
558
567
|
if (args.Length() < 2) {
|
|
559
568
|
return;
|
|
560
569
|
}
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
auto bytes = args[
|
|
564
|
-
|
|
570
|
+
|
|
571
|
+
|
|
572
|
+
auto bytes = args[2].As<v8::ArrayBuffer>();
|
|
573
|
+
|
|
565
574
|
auto size = bytes->ByteLength();
|
|
566
|
-
|
|
575
|
+
|
|
567
576
|
auto data = (uint8_t *) bytes->GetBackingStore()->Data();
|
|
568
|
-
|
|
569
|
-
auto asset =
|
|
570
|
-
|
|
571
|
-
auto
|
|
572
|
-
|
|
577
|
+
|
|
578
|
+
auto asset = canvas_native_image_asset_reference(ptr->GetImageAsset());
|
|
579
|
+
|
|
580
|
+
auto context = args.GetIsolate()->GetCurrentContext();
|
|
581
|
+
|
|
582
|
+
uint32_t width;
|
|
583
|
+
uint32_t height;
|
|
584
|
+
args[0]->Uint32Value(context).To(&width);
|
|
585
|
+
args[1]->Uint32Value(context).To(&height);
|
|
586
|
+
|
|
587
|
+
auto callback = args[3].As<v8::Function>();
|
|
588
|
+
|
|
573
589
|
auto jsi_callback = new JSICallback(isolate, callback);
|
|
574
|
-
|
|
590
|
+
|
|
575
591
|
#ifdef __ANDROID__
|
|
576
|
-
|
|
592
|
+
|
|
577
593
|
ALooper_addFd(jsi_callback->looper_,
|
|
578
594
|
jsi_callback->fd_[0],
|
|
579
|
-
|
|
595
|
+
0,
|
|
580
596
|
ALOOPER_EVENT_INPUT,
|
|
581
597
|
[](int fd, int events,
|
|
582
598
|
void *data) {
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
ALooper_wake(jsi_callback->looper_);
|
|
608
|
-
|
|
609
|
-
|
|
599
|
+
auto cb = static_cast<JSICallback *>(data);
|
|
600
|
+
bool done;
|
|
601
|
+
read(fd, &done,
|
|
602
|
+
sizeof(bool));
|
|
603
|
+
|
|
604
|
+
v8::Isolate *isolate = cb->isolate_;
|
|
605
|
+
v8::Locker locker(isolate);
|
|
606
|
+
v8::Isolate::Scope isolate_scope(isolate);
|
|
607
|
+
v8::HandleScope handle_scope(isolate);
|
|
608
|
+
v8::Local<v8::Function> callback = cb->callback_->Get(isolate);
|
|
609
|
+
v8::Local<v8::Context> context = callback->GetCreationContextChecked();
|
|
610
|
+
v8::Context::Scope context_scope(context);
|
|
611
|
+
|
|
612
|
+
v8::Local<v8::Value> args[1] = {v8::Boolean::New(isolate, done)};
|
|
613
|
+
|
|
614
|
+
// v8::TryCatch tc(isolate);
|
|
615
|
+
|
|
616
|
+
callback->Call(context, context->Global(), 1,
|
|
617
|
+
args); // ignore JS return value
|
|
618
|
+
|
|
619
|
+
delete static_cast<JSICallback *>(data);
|
|
620
|
+
return 0;
|
|
621
|
+
}, jsi_callback);
|
|
622
|
+
|
|
610
623
|
std::thread thread(
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
624
|
+
[jsi_callback, asset, width, height, data, size]() {
|
|
625
|
+
|
|
626
|
+
auto done = canvas_native_image_asset_load_from_raw(asset, width, height, data, size);
|
|
627
|
+
|
|
628
|
+
canvas_native_image_asset_release(asset);
|
|
629
|
+
|
|
630
|
+
write(jsi_callback->fd_[1],
|
|
631
|
+
&done,
|
|
632
|
+
sizeof(bool));
|
|
633
|
+
|
|
634
|
+
});
|
|
635
|
+
|
|
623
636
|
thread.detach();
|
|
624
|
-
|
|
637
|
+
|
|
625
638
|
#endif
|
|
626
|
-
|
|
627
|
-
|
|
639
|
+
|
|
640
|
+
|
|
628
641
|
#ifdef __APPLE__
|
|
629
|
-
|
|
642
|
+
|
|
630
643
|
auto current_queue = new NSOperationQueueWrapper(true);
|
|
631
|
-
|
|
644
|
+
|
|
632
645
|
auto queue = new NSOperationQueueWrapper(false);
|
|
633
|
-
|
|
634
|
-
auto task = [jsi_callback, current_queue, queue, asset, data, size]() {
|
|
635
|
-
|
|
636
|
-
auto done = canvas_native_image_asset_load_from_raw(asset, data, size);
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
646
|
+
|
|
647
|
+
auto task = [jsi_callback, current_queue, queue, asset, width, height,data, size]() {
|
|
648
|
+
|
|
649
|
+
auto done = canvas_native_image_asset_load_from_raw(asset, width, height, data, size);
|
|
650
|
+
|
|
651
|
+
canvas_native_image_asset_release(asset);
|
|
652
|
+
|
|
640
653
|
auto main_task = [jsi_callback, current_queue, queue, done]() {
|
|
641
|
-
|
|
642
|
-
|
|
654
|
+
|
|
655
|
+
|
|
643
656
|
v8::Isolate *isolate = jsi_callback->isolate_;
|
|
644
657
|
v8::Locker locker(isolate);
|
|
645
658
|
v8::Isolate::Scope isolate_scope(isolate);
|
|
@@ -647,143 +660,150 @@ void ImageAssetImpl::FromBytesCb(const v8::FunctionCallbackInfo<v8::Value> &args
|
|
|
647
660
|
v8::Local<v8::Function> callback = jsi_callback->callback_->Get(isolate);
|
|
648
661
|
v8::Local<v8::Context> context = callback->GetCreationContextChecked();
|
|
649
662
|
v8::Context::Scope context_scope(context);
|
|
650
|
-
|
|
663
|
+
|
|
651
664
|
v8::Local<v8::Value> args[1] = {v8::Boolean::New(isolate, done)};
|
|
652
|
-
|
|
665
|
+
|
|
653
666
|
// v8::TryCatch tc(isolate);
|
|
654
|
-
|
|
667
|
+
|
|
655
668
|
callback->Call(context, context->Global(), 1,
|
|
656
669
|
args); // ignore JS return value
|
|
657
|
-
|
|
658
|
-
|
|
670
|
+
|
|
671
|
+
|
|
659
672
|
delete jsi_callback;
|
|
660
673
|
delete queue;
|
|
661
674
|
delete current_queue;
|
|
662
|
-
|
|
663
|
-
|
|
675
|
+
|
|
676
|
+
|
|
664
677
|
};
|
|
665
|
-
|
|
678
|
+
|
|
666
679
|
current_queue->addOperation(main_task);
|
|
667
|
-
|
|
680
|
+
|
|
668
681
|
};
|
|
669
|
-
|
|
682
|
+
|
|
670
683
|
queue->addOperation(task);
|
|
671
684
|
#endif
|
|
672
|
-
|
|
685
|
+
|
|
673
686
|
}
|
|
674
687
|
|
|
675
|
-
|
|
688
|
+
|
|
689
|
+
void ImageAssetImpl::FromEncodedBytesSync(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
676
690
|
ImageAssetImpl *ptr = GetPointer(args.This());
|
|
677
691
|
if (ptr == nullptr) {
|
|
678
692
|
args.GetReturnValue().Set(false);
|
|
679
693
|
return;
|
|
680
694
|
}
|
|
681
|
-
|
|
682
|
-
auto
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
695
|
+
|
|
696
|
+
auto value = args[0];
|
|
697
|
+
|
|
698
|
+
if (value->IsObject()) {
|
|
699
|
+
if (!value->IsArrayBuffer()) {
|
|
700
|
+
args.GetReturnValue().Set(false);
|
|
701
|
+
return;
|
|
702
|
+
}
|
|
703
|
+
auto buf = value.As<v8::ArrayBuffer>();
|
|
704
|
+
|
|
705
|
+
auto size = (uintptr_t) buf->ByteLength();
|
|
706
|
+
auto data = (uint8_t *) buf->GetBackingStore()->Data();
|
|
707
|
+
|
|
708
|
+
auto done = canvas_native_image_asset_load_from_raw_encoded(ptr->GetImageAsset(), data,
|
|
709
|
+
size);
|
|
710
|
+
|
|
711
|
+
args.GetReturnValue().Set(done);
|
|
712
|
+
return;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
args.GetReturnValue().Set(false);
|
|
689
716
|
}
|
|
690
717
|
|
|
691
|
-
void ImageAssetImpl::
|
|
718
|
+
void ImageAssetImpl::FromEncodedBytesCb(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
692
719
|
ImageAssetImpl *ptr = GetPointer(args.This());
|
|
693
720
|
if (ptr == nullptr) {
|
|
694
721
|
return;
|
|
695
722
|
}
|
|
696
723
|
auto isolate = args.GetIsolate();
|
|
697
|
-
|
|
724
|
+
|
|
698
725
|
if (args.Length() < 2) {
|
|
699
726
|
return;
|
|
700
727
|
}
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
auto
|
|
704
|
-
|
|
705
|
-
auto
|
|
706
|
-
|
|
707
|
-
auto
|
|
708
|
-
|
|
709
|
-
|
|
728
|
+
|
|
729
|
+
|
|
730
|
+
auto bytes = args[0].As<v8::ArrayBuffer>();
|
|
731
|
+
|
|
732
|
+
auto size = bytes->ByteLength();
|
|
733
|
+
|
|
734
|
+
auto data = (uint8_t *) bytes->GetBackingStore()->Data();
|
|
735
|
+
|
|
736
|
+
auto asset = canvas_native_image_asset_reference(ptr->GetImageAsset());
|
|
737
|
+
|
|
710
738
|
auto callback = args[1].As<v8::Function>();
|
|
711
|
-
|
|
739
|
+
|
|
712
740
|
auto jsi_callback = new JSICallback(isolate, callback);
|
|
713
|
-
|
|
714
|
-
|
|
741
|
+
|
|
715
742
|
#ifdef __ANDROID__
|
|
716
|
-
|
|
743
|
+
|
|
717
744
|
ALooper_addFd(jsi_callback->looper_,
|
|
718
745
|
jsi_callback->fd_[0],
|
|
719
|
-
|
|
746
|
+
0,
|
|
720
747
|
ALOOPER_EVENT_INPUT,
|
|
721
748
|
[](int fd, int events,
|
|
722
749
|
void *data) {
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
ALooper_wake(jsi_callback->looper_);
|
|
748
|
-
|
|
749
|
-
|
|
750
|
+
auto cb = static_cast<JSICallback *>(data);
|
|
751
|
+
bool done;
|
|
752
|
+
read(fd, &done,
|
|
753
|
+
sizeof(bool));
|
|
754
|
+
|
|
755
|
+
v8::Isolate *isolate = cb->isolate_;
|
|
756
|
+
v8::Locker locker(isolate);
|
|
757
|
+
v8::Isolate::Scope isolate_scope(isolate);
|
|
758
|
+
v8::HandleScope handle_scope(isolate);
|
|
759
|
+
v8::Local<v8::Function> callback = cb->callback_->Get(isolate);
|
|
760
|
+
v8::Local<v8::Context> context = callback->GetCreationContextChecked();
|
|
761
|
+
v8::Context::Scope context_scope(context);
|
|
762
|
+
|
|
763
|
+
v8::Local<v8::Value> args[1] = {v8::Boolean::New(isolate, done)};
|
|
764
|
+
|
|
765
|
+
// v8::TryCatch tc(isolate);
|
|
766
|
+
|
|
767
|
+
callback->Call(context, context->Global(), 1,
|
|
768
|
+
args); // ignore JS return value
|
|
769
|
+
|
|
770
|
+
delete static_cast<JSICallback *>(data);
|
|
771
|
+
return 0;
|
|
772
|
+
}, jsi_callback);
|
|
773
|
+
|
|
750
774
|
std::thread thread(
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
}, std::move(path));
|
|
765
|
-
|
|
766
|
-
|
|
775
|
+
[jsi_callback, asset, data, size]() {
|
|
776
|
+
|
|
777
|
+
auto done = canvas_native_image_asset_load_from_raw_encoded(asset, data, size);
|
|
778
|
+
|
|
779
|
+
canvas_native_image_asset_release(asset);
|
|
780
|
+
|
|
781
|
+
write(jsi_callback->fd_[1],
|
|
782
|
+
&done,
|
|
783
|
+
sizeof(bool));
|
|
784
|
+
|
|
785
|
+
});
|
|
786
|
+
|
|
767
787
|
thread.detach();
|
|
768
|
-
|
|
788
|
+
|
|
769
789
|
#endif
|
|
770
|
-
|
|
771
|
-
|
|
790
|
+
|
|
791
|
+
|
|
772
792
|
#ifdef __APPLE__
|
|
773
|
-
|
|
793
|
+
|
|
774
794
|
auto current_queue = new NSOperationQueueWrapper(true);
|
|
775
|
-
|
|
795
|
+
|
|
776
796
|
auto queue = new NSOperationQueueWrapper(false);
|
|
777
|
-
|
|
778
|
-
auto task = [jsi_callback, current_queue, queue, asset,
|
|
779
|
-
|
|
780
|
-
auto done =
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
797
|
+
|
|
798
|
+
auto task = [jsi_callback, current_queue, queue, asset, data, size]() {
|
|
799
|
+
|
|
800
|
+
auto done = canvas_native_image_asset_load_from_raw_encoded(asset, data, size);
|
|
801
|
+
|
|
802
|
+
canvas_native_image_asset_release(asset);
|
|
803
|
+
|
|
784
804
|
auto main_task = [jsi_callback, current_queue, queue, done]() {
|
|
785
|
-
|
|
786
|
-
|
|
805
|
+
|
|
806
|
+
|
|
787
807
|
v8::Isolate *isolate = jsi_callback->isolate_;
|
|
788
808
|
v8::Locker locker(isolate);
|
|
789
809
|
v8::Isolate::Scope isolate_scope(isolate);
|
|
@@ -791,31 +811,174 @@ void ImageAssetImpl::SaveCb(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
|
791
811
|
v8::Local<v8::Function> callback = jsi_callback->callback_->Get(isolate);
|
|
792
812
|
v8::Local<v8::Context> context = callback->GetCreationContextChecked();
|
|
793
813
|
v8::Context::Scope context_scope(context);
|
|
794
|
-
|
|
814
|
+
|
|
795
815
|
v8::Local<v8::Value> args[1] = {v8::Boolean::New(isolate, done)};
|
|
796
|
-
|
|
816
|
+
|
|
797
817
|
// v8::TryCatch tc(isolate);
|
|
798
|
-
|
|
818
|
+
|
|
799
819
|
callback->Call(context, context->Global(), 1,
|
|
800
820
|
args); // ignore JS return value
|
|
801
|
-
|
|
802
|
-
|
|
821
|
+
|
|
822
|
+
|
|
803
823
|
delete jsi_callback;
|
|
804
824
|
delete queue;
|
|
805
825
|
delete current_queue;
|
|
806
|
-
|
|
807
|
-
|
|
826
|
+
|
|
827
|
+
|
|
808
828
|
};
|
|
829
|
+
|
|
809
830
|
current_queue->addOperation(main_task);
|
|
831
|
+
|
|
810
832
|
};
|
|
811
|
-
|
|
833
|
+
|
|
812
834
|
queue->addOperation(task);
|
|
813
835
|
#endif
|
|
814
|
-
|
|
815
|
-
|
|
836
|
+
|
|
816
837
|
}
|
|
817
838
|
|
|
818
|
-
|
|
839
|
+
/*
|
|
840
|
+
void ImageAssetImpl::SaveSync(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
841
|
+
ImageAssetImpl *ptr = GetPointer(args.This());
|
|
842
|
+
if (ptr == nullptr) {
|
|
843
|
+
args.GetReturnValue().Set(false);
|
|
844
|
+
return;
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
auto isolate = args.GetIsolate();
|
|
848
|
+
auto context = isolate->GetCurrentContext();
|
|
849
|
+
auto path = ConvertFromV8String(isolate, args[0]);
|
|
850
|
+
auto format = args[1]->Uint32Value(context).ToChecked();
|
|
851
|
+
auto done = canvas_native_image_asset_save_path(ptr->GetImageAsset(), path.c_str(), format);
|
|
852
|
+
|
|
853
|
+
args.GetReturnValue().Set(done);
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
void ImageAssetImpl::SaveCb(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
857
|
+
ImageAssetImpl *ptr = GetPointer(args.This());
|
|
858
|
+
if (ptr == nullptr) {
|
|
859
|
+
return;
|
|
860
|
+
}
|
|
861
|
+
auto isolate = args.GetIsolate();
|
|
862
|
+
auto context = isolate->GetCurrentContext();
|
|
863
|
+
if (args.Length() < 2) {
|
|
864
|
+
return;
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
|
|
868
|
+
auto path = ConvertFromV8String(isolate, args[0]);
|
|
869
|
+
|
|
870
|
+
auto format = args[1]->Uint32Value(context).ToChecked();
|
|
871
|
+
|
|
872
|
+
auto asset = canvas_native_image_asset_shared_clone(
|
|
873
|
+
ptr->GetImageAsset());
|
|
874
|
+
|
|
875
|
+
auto callback = args[1].As<v8::Function>();
|
|
876
|
+
|
|
877
|
+
auto jsi_callback = new JSICallback(isolate, callback);
|
|
878
|
+
|
|
879
|
+
|
|
880
|
+
#ifdef __ANDROID__
|
|
881
|
+
|
|
882
|
+
ALooper_addFd(jsi_callback->looper_,
|
|
883
|
+
jsi_callback->fd_[0],
|
|
884
|
+
0,
|
|
885
|
+
ALOOPER_EVENT_INPUT,
|
|
886
|
+
[](int fd, int events,
|
|
887
|
+
void *data) {
|
|
888
|
+
auto cb = static_cast<JSICallback *>(data);
|
|
889
|
+
bool done;
|
|
890
|
+
read(fd, &done,
|
|
891
|
+
sizeof(bool));
|
|
892
|
+
|
|
893
|
+
v8::Isolate *isolate = cb->isolate_;
|
|
894
|
+
v8::Locker locker(isolate);
|
|
895
|
+
v8::Isolate::Scope isolate_scope(isolate);
|
|
896
|
+
v8::HandleScope handle_scope(isolate);
|
|
897
|
+
v8::Local<v8::Function> callback = cb->callback_->Get(isolate);
|
|
898
|
+
v8::Local<v8::Context> context = callback->GetCreationContextChecked();
|
|
899
|
+
v8::Context::Scope context_scope(context);
|
|
900
|
+
|
|
901
|
+
v8::Local<v8::Value> args[1] = {v8::Boolean::New(isolate, done)};
|
|
902
|
+
|
|
903
|
+
// v8::TryCatch tc(isolate);
|
|
904
|
+
|
|
905
|
+
callback->Call(context, context->Global(), 1,
|
|
906
|
+
args); // ignore JS return value
|
|
907
|
+
|
|
908
|
+
delete static_cast<JSICallback *>(data);
|
|
909
|
+
return 0;
|
|
910
|
+
}, jsi_callback);
|
|
911
|
+
|
|
912
|
+
std::thread thread(
|
|
913
|
+
[jsi_callback, asset, format](
|
|
914
|
+
const std::string &path) {
|
|
915
|
+
|
|
916
|
+
auto done = canvas_native_image_asset_save_path(asset,
|
|
917
|
+
path.c_str(),
|
|
918
|
+
format);
|
|
919
|
+
|
|
920
|
+
canvas_native_image_asset_destroy(asset);
|
|
921
|
+
|
|
922
|
+
write(jsi_callback->fd_[1],
|
|
923
|
+
&done,
|
|
924
|
+
sizeof(bool));
|
|
925
|
+
|
|
926
|
+
}, std::move(path));
|
|
927
|
+
|
|
928
|
+
|
|
929
|
+
thread.detach();
|
|
930
|
+
|
|
931
|
+
#endif
|
|
932
|
+
|
|
933
|
+
|
|
934
|
+
#ifdef __APPLE__
|
|
935
|
+
|
|
936
|
+
auto current_queue = new NSOperationQueueWrapper(true);
|
|
937
|
+
|
|
938
|
+
auto queue = new NSOperationQueueWrapper(false);
|
|
939
|
+
|
|
940
|
+
auto task = [jsi_callback, current_queue, queue, asset, path, format]() {
|
|
941
|
+
|
|
942
|
+
auto done = canvas_native_image_asset_save_path(asset, path.c_str(), format);
|
|
943
|
+
|
|
944
|
+
canvas_native_image_asset_destroy(asset);
|
|
945
|
+
|
|
946
|
+
auto main_task = [jsi_callback, current_queue, queue, done]() {
|
|
947
|
+
|
|
948
|
+
|
|
949
|
+
v8::Isolate *isolate = jsi_callback->isolate_;
|
|
950
|
+
v8::Locker locker(isolate);
|
|
951
|
+
v8::Isolate::Scope isolate_scope(isolate);
|
|
952
|
+
v8::HandleScope handle_scope(isolate);
|
|
953
|
+
v8::Local<v8::Function> callback = jsi_callback->callback_->Get(isolate);
|
|
954
|
+
v8::Local<v8::Context> context = callback->GetCreationContextChecked();
|
|
955
|
+
v8::Context::Scope context_scope(context);
|
|
956
|
+
|
|
957
|
+
v8::Local<v8::Value> args[1] = {v8::Boolean::New(isolate, done)};
|
|
958
|
+
|
|
959
|
+
// v8::TryCatch tc(isolate);
|
|
960
|
+
|
|
961
|
+
callback->Call(context, context->Global(), 1,
|
|
962
|
+
args); // ignore JS return value
|
|
963
|
+
|
|
964
|
+
|
|
965
|
+
delete jsi_callback;
|
|
966
|
+
delete queue;
|
|
967
|
+
delete current_queue;
|
|
968
|
+
|
|
969
|
+
|
|
970
|
+
};
|
|
971
|
+
current_queue->addOperation(main_task);
|
|
972
|
+
};
|
|
973
|
+
|
|
974
|
+
queue->addOperation(task);
|
|
975
|
+
#endif
|
|
976
|
+
|
|
977
|
+
|
|
978
|
+
}
|
|
979
|
+
*/
|
|
980
|
+
|
|
981
|
+
const ImageAsset *ImageAssetImpl::GetImageAsset() {
|
|
819
982
|
return this->asset_;
|
|
820
983
|
}
|
|
821
984
|
|