@nativescript/canvas 2.0.0-beta.8 → 2.0.0-webgpu.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 +23 -15
- package/Canvas/common.js +125 -56
- package/Canvas/common.js.map +1 -1
- package/Canvas/index.android.d.ts +5 -7
- package/Canvas/index.android.js +61 -133
- package/Canvas/index.android.js.map +1 -1
- package/Canvas/index.d.ts +4 -1
- package/Canvas/index.ios.d.ts +6 -6
- package/Canvas/index.ios.js +75 -85
- package/Canvas/index.ios.js.map +1 -1
- package/Canvas2D/CanvasRenderingContext2D/index.d.ts +1 -1
- package/Canvas2D/CanvasRenderingContext2D/index.js +8 -11
- 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/ImageAsset/index.d.ts +1 -0
- package/ImageAsset/index.js +49 -0
- package/ImageAsset/index.js.map +1 -1
- package/WebGL/WebGLRenderingContext/index.d.ts +1 -0
- package/WebGL/WebGLRenderingContext/index.js +104 -14
- package/WebGL/WebGLRenderingContext/index.js.map +1 -1
- package/WebGL2/WebGL2RenderingContext/index.d.ts +1 -0
- package/WebGL2/WebGL2RenderingContext/index.js +2 -3
- 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 +35 -0
- package/WebGPU/GPU.js.map +1 -0
- package/WebGPU/GPUAdapter.d.ts +23 -0
- package/WebGPU/GPUAdapter.js +62 -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 +5 -0
- package/WebGPU/GPUBindGroup.js +12 -0
- package/WebGPU/GPUBindGroup.js.map +1 -0
- package/WebGPU/GPUBindGroupLayout.d.ts +5 -0
- package/WebGPU/GPUBindGroupLayout.js +12 -0
- package/WebGPU/GPUBindGroupLayout.js.map +1 -0
- package/WebGPU/GPUBuffer.d.ts +15 -0
- package/WebGPU/GPUBuffer.js +54 -0
- package/WebGPU/GPUBuffer.js.map +1 -0
- package/WebGPU/GPUCanvasContext.d.ts +33 -0
- package/WebGPU/GPUCanvasContext.js +67 -0
- package/WebGPU/GPUCanvasContext.js.map +1 -0
- package/WebGPU/GPUCommandBuffer.d.ts +5 -0
- package/WebGPU/GPUCommandBuffer.js +12 -0
- package/WebGPU/GPUCommandBuffer.js.map +1 -0
- package/WebGPU/GPUCommandEncoder.d.ts +41 -0
- package/WebGPU/GPUCommandEncoder.js +105 -0
- package/WebGPU/GPUCommandEncoder.js.map +1 -0
- package/WebGPU/GPUComputePassEncoder.d.ts +16 -0
- package/WebGPU/GPUComputePassEncoder.js +50 -0
- package/WebGPU/GPUComputePassEncoder.js.map +1 -0
- package/WebGPU/GPUComputePipeline.d.ts +7 -0
- package/WebGPU/GPUComputePipeline.js +16 -0
- package/WebGPU/GPUComputePipeline.js.map +1 -0
- package/WebGPU/GPUDevice.d.ts +173 -0
- package/WebGPU/GPUDevice.js +381 -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 +5 -0
- package/WebGPU/GPUExternalTexture.js +12 -0
- package/WebGPU/GPUExternalTexture.js.map +1 -0
- package/WebGPU/GPUPipelineLayout.d.ts +5 -0
- package/WebGPU/GPUPipelineLayout.js +12 -0
- package/WebGPU/GPUPipelineLayout.js.map +1 -0
- package/WebGPU/GPUQuerySet.d.ts +5 -0
- package/WebGPU/GPUQuerySet.js +12 -0
- package/WebGPU/GPUQuerySet.js.map +1 -0
- package/WebGPU/GPUQueue.d.ts +14 -0
- package/WebGPU/GPUQueue.js +77 -0
- package/WebGPU/GPUQueue.js.map +1 -0
- package/WebGPU/GPURenderBundle.d.ts +5 -0
- package/WebGPU/GPURenderBundle.js +12 -0
- package/WebGPU/GPURenderBundle.js.map +1 -0
- package/WebGPU/GPURenderBundleEncoder.d.ts +20 -0
- package/WebGPU/GPURenderBundleEncoder.js +61 -0
- package/WebGPU/GPURenderBundleEncoder.js.map +1 -0
- package/WebGPU/GPURenderPassEncoder.d.ts +29 -0
- package/WebGPU/GPURenderPassEncoder.js +94 -0
- package/WebGPU/GPURenderPassEncoder.js.map +1 -0
- package/WebGPU/GPURenderPipeline.d.ts +7 -0
- package/WebGPU/GPURenderPipeline.js +16 -0
- package/WebGPU/GPURenderPipeline.js.map +1 -0
- package/WebGPU/GPUSampler.d.ts +5 -0
- package/WebGPU/GPUSampler.js +12 -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 +16 -0
- package/WebGPU/GPUTexture.js +41 -0
- package/WebGPU/GPUTexture.js.map +1 -0
- package/WebGPU/GPUTextureView.d.ts +5 -0
- package/WebGPU/GPUTextureView.js +12 -0
- package/WebGPU/GPUTextureView.js.map +1 -0
- package/WebGPU/Interfaces.d.ts +155 -0
- package/WebGPU/Interfaces.js +2 -0
- package/WebGPU/Interfaces.js.map +1 -0
- package/WebGPU/Types.d.ts +39 -0
- package/WebGPU/Types.js +2 -0
- package/WebGPU/Types.js.map +1 -0
- package/WebGPU/Utils.d.ts +1 -0
- package/WebGPU/Utils.js +75 -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/index.d.ts +1 -1
- package/index.js +22 -1
- package/index.js.map +1 -1
- package/package.json +1 -4
- 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 +23 -23
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_ios.h +47 -8
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_native.h +2280 -103
- 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 +1564 -3814
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.private.swiftinterface +27 -34
- 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 +27 -34
- 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 +602 -664
- 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 +46 -46
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_ios.h +47 -8
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_native.h +2280 -103
- 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 +1564 -3814
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +27 -34
- 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 +27 -34
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.abi.json +1564 -3814
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +27 -34
- 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 +27 -34
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/_CodeSignature/CodeResources +31 -31
- 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 +604 -663
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/x86_64/CanvasNative.yml +638 -642
- package/platforms/ios/build.xcconfig +3 -1
- package/platforms/ios/src/cpp/Caches.h +69 -1
- package/platforms/ios/src/cpp/CanvasJSIModule.cpp +320 -395
- package/platforms/ios/src/cpp/CanvasJSIModule.h +7 -1
- package/platforms/ios/src/cpp/Helpers.h +43 -8
- package/platforms/ios/src/cpp/ImageAssetImpl.cpp +35 -37
- package/platforms/ios/src/cpp/ImageAssetImpl.h +14 -10
- package/platforms/ios/src/cpp/ImageBitmapImpl.cpp +2 -2
- package/platforms/ios/src/cpp/ImageBitmapImpl.h +1 -1
- package/platforms/ios/src/cpp/canvas2d/CanvasPattern.cpp +0 -10
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.cpp +41 -4
- package/platforms/ios/src/cpp/canvas2d/MatrixImpl.cpp +409 -3
- package/platforms/ios/src/cpp/canvas2d/MatrixImpl.h +27 -0
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.cpp +131 -149
- package/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.cpp +1766 -1659
- package/platforms/ios/src/cpp/webgpu/GPUAdapterImpl.cpp +302 -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 +53 -0
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupImpl.h +45 -0
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.cpp +53 -0
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.h +45 -0
- package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.cpp +229 -0
- package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.h +59 -0
- package/platforms/ios/src/cpp/webgpu/GPUCanvasContextImpl.cpp +317 -0
- package/platforms/ios/src/cpp/webgpu/GPUCanvasContextImpl.h +55 -0
- package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.cpp +54 -0
- package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.h +45 -0
- package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.cpp +1087 -0
- package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.h +69 -0
- package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.cpp +260 -0
- package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.h +62 -0
- package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.cpp +84 -0
- package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.h +49 -0
- package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.cpp +2741 -0
- package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.h +95 -0
- package/platforms/ios/src/cpp/webgpu/GPUImpl.cpp +186 -0
- package/platforms/ios/src/cpp/webgpu/GPUImpl.h +55 -0
- package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.cpp +54 -0
- package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.h +46 -0
- package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.cpp +137 -0
- package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.h +55 -0
- package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.cpp +521 -0
- package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.h +56 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleEncoderImpl.cpp +469 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleEncoderImpl.h +71 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.cpp +53 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.h +45 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.cpp +653 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.h +85 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.cpp +84 -0
- package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.h +49 -0
- package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.cpp +53 -0
- package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.h +45 -0
- package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.cpp +56 -0
- package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.h +45 -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 +360 -0
- package/platforms/ios/src/cpp/webgpu/GPUTextureImpl.h +75 -0
- package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.cpp +53 -0
- package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.h +45 -0
- package/platforms/ios/src/cpp/webgpu/GPUUtils.h +178 -0
- 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/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
|
@@ -19,7 +19,11 @@
|
|
|
19
19
|
#include "webgl/WebGLRenderingContext.h"
|
|
20
20
|
#include "webgl2/WebGL2RenderingContext.h"
|
|
21
21
|
|
|
22
|
-
#include "
|
|
22
|
+
#include "webgpu/GPUImpl.h"
|
|
23
|
+
#include "webgpu/GPUSupportedLimitsImpl.h"
|
|
24
|
+
#include "webgpu/GPUDeviceImpl.h"
|
|
25
|
+
#include "webgpu/GPUQueueImpl.h"
|
|
26
|
+
#include "webgpu/GPUCanvasContextImpl.h"
|
|
23
27
|
|
|
24
28
|
class CanvasJSIModule {
|
|
25
29
|
public:
|
|
@@ -37,6 +41,8 @@ public:
|
|
|
37
41
|
|
|
38
42
|
static void CreateWebGL2Context(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
39
43
|
|
|
44
|
+
static void CreateWebGPUContextWithPointer(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
45
|
+
|
|
40
46
|
static void AddFontFamily(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
41
47
|
};
|
|
42
48
|
|
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
#include <memory>
|
|
8
8
|
#include "Common.h"
|
|
9
9
|
#include "OneByteStringResource.h"
|
|
10
|
-
#include "PerIsolateData.h"
|
|
11
10
|
#include "v8-fast-api-calls.h"
|
|
12
11
|
//#ifdef __APPLE__
|
|
13
12
|
//#ifdef __OBJC__
|
|
@@ -19,6 +18,17 @@
|
|
|
19
18
|
//#endif
|
|
20
19
|
|
|
21
20
|
|
|
21
|
+
struct AsyncCallback {
|
|
22
|
+
v8::Isolate *isolate;
|
|
23
|
+
v8::Global<v8::Function> callback;
|
|
24
|
+
void *data;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
struct PromiseCallback {
|
|
28
|
+
v8::Isolate *isolate;
|
|
29
|
+
v8::Global<v8::Promise::Resolver> callback;
|
|
30
|
+
void *data;
|
|
31
|
+
};
|
|
22
32
|
|
|
23
33
|
static const char *LOG_TAG = "JS";
|
|
24
34
|
static int m_maxLogcatObjectSize = 4096;
|
|
@@ -126,7 +136,32 @@ enum class NativeType {
|
|
|
126
136
|
WebGLUniformLocation,
|
|
127
137
|
WebGLSampler,
|
|
128
138
|
WebGLTransformFeedback,
|
|
129
|
-
WebGLSync
|
|
139
|
+
WebGLSync,
|
|
140
|
+
|
|
141
|
+
GPUAdapter,
|
|
142
|
+
GPUSupportedLimits,
|
|
143
|
+
GPUDevice,
|
|
144
|
+
GPUQueue,
|
|
145
|
+
GPUBuffer,
|
|
146
|
+
GPUInstance,
|
|
147
|
+
GPUCanvasContext,
|
|
148
|
+
GPUTexture,
|
|
149
|
+
GPUAdapterInfo,
|
|
150
|
+
GPUCommandEncoder,
|
|
151
|
+
GPUComputePass,
|
|
152
|
+
GPUQuerySet,
|
|
153
|
+
GPUShaderModule,
|
|
154
|
+
GPUPipelineLayout,
|
|
155
|
+
GPURenderPipeline,
|
|
156
|
+
GPUBindGroupLayout,
|
|
157
|
+
GPUTextureView,
|
|
158
|
+
GPURenderPassEncoder,
|
|
159
|
+
GPUCommandBuffer,
|
|
160
|
+
GPUBindGroup,
|
|
161
|
+
GPUComputePipeline,
|
|
162
|
+
GPUSampler,
|
|
163
|
+
GPURenderBundleEncoder,
|
|
164
|
+
GPURenderBundle
|
|
130
165
|
};
|
|
131
166
|
|
|
132
167
|
inline static v8::Local<v8::String>
|
|
@@ -176,7 +211,7 @@ static void SetPrivateValue(v8::Isolate *isolate, const v8::Local<v8::Object> &o
|
|
|
176
211
|
const v8::Local<v8::String> &propName,
|
|
177
212
|
const v8::Local<v8::Value> &value) {
|
|
178
213
|
v8::Local<v8::Context> context;
|
|
179
|
-
obj->GetCreationContext().ToLocal(&context);
|
|
214
|
+
auto succcess = obj->GetCreationContext().ToLocal(&context);
|
|
180
215
|
v8::Local<v8::Private> privateKey = v8::Private::ForApi(isolate, propName);
|
|
181
216
|
obj->SetPrivate(context, privateKey, value);
|
|
182
217
|
}
|
|
@@ -185,18 +220,18 @@ static v8::Local<v8::Value>
|
|
|
185
220
|
GetPrivateValue(v8::Isolate *isolate, const v8::Local<v8::Object> &obj,
|
|
186
221
|
const v8::Local<v8::String> &propName) {
|
|
187
222
|
v8::Local<v8::Context> context;
|
|
188
|
-
obj->GetCreationContext().ToLocal(&context);
|
|
223
|
+
auto succcess = obj->GetCreationContext().ToLocal(&context);
|
|
189
224
|
v8::Local<v8::Private> privateKey = v8::Private::ForApi(isolate, propName);
|
|
190
225
|
|
|
191
226
|
v8::Maybe<bool> hasPrivate = obj->HasPrivate(context, privateKey);
|
|
192
227
|
|
|
193
228
|
if (!hasPrivate.FromMaybe(false)) {
|
|
194
|
-
return
|
|
229
|
+
return {};
|
|
195
230
|
}
|
|
196
231
|
|
|
197
232
|
v8::Local<v8::Value> result;
|
|
198
233
|
|
|
199
|
-
obj->GetPrivate(context, privateKey).ToLocal(&result);
|
|
234
|
+
succcess = obj->GetPrivate(context, privateKey).ToLocal(&result);
|
|
200
235
|
|
|
201
236
|
return result;
|
|
202
237
|
}
|
|
@@ -207,7 +242,7 @@ static void SetNativeType(const v8::Local<v8::Object> &obj, NativeType type) {
|
|
|
207
242
|
}
|
|
208
243
|
|
|
209
244
|
inline static NativeType GetNativeType(const v8::Local<v8::Value> &obj) {
|
|
210
|
-
if (!obj->IsNullOrUndefined() && obj->IsObject() &&
|
|
245
|
+
if (!obj.IsEmpty() && !obj->IsNullOrUndefined() && obj->IsObject() &&
|
|
211
246
|
obj.As<v8::Object>()->InternalFieldCount() > 1) {
|
|
212
247
|
auto info = obj.As<v8::Object>()->GetAlignedPointerFromInternalField(1);
|
|
213
248
|
|
|
@@ -215,7 +250,7 @@ inline static NativeType GetNativeType(const v8::Local<v8::Value> &obj) {
|
|
|
215
250
|
auto value = *static_cast<int32_t *>(info);
|
|
216
251
|
auto ret = value;
|
|
217
252
|
if (ret >= (int) NativeType::CanvasGradient &&
|
|
218
|
-
ret <= (int) NativeType::
|
|
253
|
+
ret <= (int) NativeType::GPURenderBundle) {
|
|
219
254
|
return (NativeType) ret;
|
|
220
255
|
}
|
|
221
256
|
}
|
|
@@ -28,7 +28,7 @@ void ImageAssetImpl::Init(v8::Local<v8::Object> canvasModule, v8::Isolate *isola
|
|
|
28
28
|
auto context = isolate->GetCurrentContext();
|
|
29
29
|
auto func = ctor->GetFunction(context).ToLocalChecked();
|
|
30
30
|
|
|
31
|
-
canvasModule->Set(context, ConvertToV8String(isolate, "ImageAsset"), func);
|
|
31
|
+
canvasModule->Set(context, ConvertToV8String(isolate, "ImageAsset"), func).IsJust();
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
ImageAssetImpl *ImageAssetImpl::GetPointer(const v8::Local<v8::Object> &object) {
|
|
@@ -67,8 +67,14 @@ v8::Local<v8::FunctionTemplate> ImageAssetImpl::GetCtor(v8::Isolate *isolate) {
|
|
|
67
67
|
GetAddr);
|
|
68
68
|
|
|
69
69
|
tmpl->Set(
|
|
70
|
-
ConvertToV8String(isolate, "
|
|
71
|
-
v8::FunctionTemplate::New(isolate,
|
|
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));
|
|
72
78
|
|
|
73
79
|
tmpl->Set(
|
|
74
80
|
ConvertToV8String(isolate, "fromUrlSync"),
|
|
@@ -97,14 +103,14 @@ v8::Local<v8::FunctionTemplate> ImageAssetImpl::GetCtor(v8::Isolate *isolate) {
|
|
|
97
103
|
v8::FunctionTemplate::New(isolate, &FromBytesCb));
|
|
98
104
|
|
|
99
105
|
|
|
100
|
-
tmpl->Set(
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
tmpl->Set(
|
|
105
|
-
ConvertToV8String(isolate, "saveCb"),
|
|
106
|
-
v8::FunctionTemplate::New(isolate, &SaveCb));
|
|
106
|
+
/* tmpl->Set(
|
|
107
|
+
ConvertToV8String(isolate, "saveSync"),
|
|
108
|
+
v8::FunctionTemplate::New(isolate, &SaveSync));
|
|
107
109
|
|
|
110
|
+
tmpl->Set(
|
|
111
|
+
ConvertToV8String(isolate, "saveCb"),
|
|
112
|
+
v8::FunctionTemplate::New(isolate, &SaveCb));
|
|
113
|
+
*/
|
|
108
114
|
|
|
109
115
|
cache->ImageAssetTmpl =
|
|
110
116
|
std::make_unique<v8::Persistent<v8::FunctionTemplate>>(isolate, ctorTmpl);
|
|
@@ -160,14 +166,28 @@ ImageAssetImpl::GetAddr(v8::Local<v8::String> name,
|
|
|
160
166
|
auto ptr = GetPointer(info.This());
|
|
161
167
|
if (ptr != nullptr) {
|
|
162
168
|
auto isolate = info.GetIsolate();
|
|
163
|
-
auto
|
|
164
|
-
|
|
165
|
-
info.GetReturnValue().Set(ConvertToV8String(isolate, ret.c_str()));
|
|
169
|
+
auto ret = std::to_string(canvas_native_image_asset_get_addr(ptr->GetImageAsset()));
|
|
170
|
+
info.GetReturnValue().Set(ConvertToV8String(isolate, ret));
|
|
166
171
|
return;
|
|
167
172
|
}
|
|
168
173
|
info.GetReturnValue().SetEmptyString();
|
|
169
174
|
}
|
|
170
175
|
|
|
176
|
+
|
|
177
|
+
void
|
|
178
|
+
ImageAssetImpl::GetReference(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
179
|
+
auto ptr = GetPointer(args.This());
|
|
180
|
+
if (ptr != nullptr) {
|
|
181
|
+
auto isolate = args.GetIsolate();
|
|
182
|
+
auto reference = canvas_native_image_asset_shared_clone(ptr->GetImageAsset());
|
|
183
|
+
auto ret = std::to_string(canvas_native_image_asset_get_addr(reference));
|
|
184
|
+
args.GetReturnValue().Set(ConvertToV8String(isolate, ret));
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
args.GetReturnValue().SetEmptyString();
|
|
189
|
+
}
|
|
190
|
+
|
|
171
191
|
void
|
|
172
192
|
ImageAssetImpl::GetError(v8::Local<v8::String> name,
|
|
173
193
|
const v8::PropertyCallbackInfo<v8::Value> &info) {
|
|
@@ -182,26 +202,6 @@ ImageAssetImpl::GetError(v8::Local<v8::String> name,
|
|
|
182
202
|
info.GetReturnValue().SetEmptyString();
|
|
183
203
|
}
|
|
184
204
|
|
|
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
205
|
void ImageAssetImpl::FromUrlSync(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
206
206
|
ImageAssetImpl *ptr = GetPointer(args.This());
|
|
207
207
|
if (ptr == nullptr) {
|
|
@@ -396,7 +396,6 @@ void ImageAssetImpl::FromFileSync(const v8::FunctionCallbackInfo<v8::Value> &arg
|
|
|
396
396
|
|
|
397
397
|
auto done = canvas_native_image_asset_load_from_path(ptr->GetImageAsset(), path.c_str());
|
|
398
398
|
|
|
399
|
-
|
|
400
399
|
args.GetReturnValue().Set(done);
|
|
401
400
|
}
|
|
402
401
|
|
|
@@ -411,7 +410,6 @@ void ImageAssetImpl::FromFileCb(const v8::FunctionCallbackInfo<v8::Value> &args)
|
|
|
411
410
|
return;
|
|
412
411
|
}
|
|
413
412
|
|
|
414
|
-
|
|
415
413
|
auto path = ConvertFromV8String(isolate, args[0]);
|
|
416
414
|
|
|
417
415
|
auto asset = canvas_native_image_asset_shared_clone(
|
|
@@ -471,8 +469,6 @@ void ImageAssetImpl::FromFileCb(const v8::FunctionCallbackInfo<v8::Value> &args)
|
|
|
471
469
|
|
|
472
470
|
}, std::move(path));
|
|
473
471
|
|
|
474
|
-
thread.detach();
|
|
475
|
-
|
|
476
472
|
#endif
|
|
477
473
|
|
|
478
474
|
|
|
@@ -672,6 +668,7 @@ void ImageAssetImpl::FromBytesCb(const v8::FunctionCallbackInfo<v8::Value> &args
|
|
|
672
668
|
|
|
673
669
|
}
|
|
674
670
|
|
|
671
|
+
/*
|
|
675
672
|
void ImageAssetImpl::SaveSync(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
676
673
|
ImageAssetImpl *ptr = GetPointer(args.This());
|
|
677
674
|
if (ptr == nullptr) {
|
|
@@ -814,6 +811,7 @@ void ImageAssetImpl::SaveCb(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
|
814
811
|
|
|
815
812
|
|
|
816
813
|
}
|
|
814
|
+
*/
|
|
817
815
|
|
|
818
816
|
ImageAsset *ImageAssetImpl::GetImageAsset() {
|
|
819
817
|
return this->asset_;
|
|
@@ -9,23 +9,25 @@
|
|
|
9
9
|
#include <vector>
|
|
10
10
|
#include "Helpers.h"
|
|
11
11
|
#include "Common.h"
|
|
12
|
+
|
|
12
13
|
#ifdef __APPLE__
|
|
13
14
|
#include "NSOperationQueueWrapper.h"
|
|
14
15
|
#endif
|
|
16
|
+
|
|
15
17
|
#include "ObjectWrapperImpl.h"
|
|
16
18
|
|
|
17
|
-
class ImageAssetImpl: ObjectWrapperImpl{
|
|
19
|
+
class ImageAssetImpl : ObjectWrapperImpl {
|
|
18
20
|
public:
|
|
19
21
|
|
|
20
|
-
ImageAssetImpl(ImageAsset*
|
|
22
|
+
explicit ImageAssetImpl(ImageAsset *asset);
|
|
21
23
|
|
|
22
24
|
~ImageAssetImpl();
|
|
23
25
|
|
|
24
|
-
ImageAsset*
|
|
26
|
+
ImageAsset *GetImageAsset();
|
|
25
27
|
|
|
26
28
|
static void Init(v8::Local<v8::Object> canvasModule, v8::Isolate *isolate);
|
|
27
29
|
|
|
28
|
-
static ImageAssetImpl *GetPointer(const v8::Local<v8::Object
|
|
30
|
+
static ImageAssetImpl *GetPointer(const v8::Local<v8::Object> &object);
|
|
29
31
|
|
|
30
32
|
static v8::Local<v8::FunctionTemplate> GetCtor(v8::Isolate *isolate);
|
|
31
33
|
|
|
@@ -38,12 +40,14 @@ public:
|
|
|
38
40
|
const v8::PropertyCallbackInfo<v8::Value> &info);
|
|
39
41
|
|
|
40
42
|
static void GetAddr(v8::Local<v8::String> name,
|
|
41
|
-
|
|
43
|
+
const v8::PropertyCallbackInfo<v8::Value> &info);
|
|
44
|
+
|
|
45
|
+
static void GetReference(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
42
46
|
|
|
43
47
|
static void GetError(v8::Local<v8::String> name,
|
|
44
|
-
|
|
48
|
+
const v8::PropertyCallbackInfo<v8::Value> &info);
|
|
45
49
|
|
|
46
|
-
static void Scale(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
50
|
+
// static void Scale(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
47
51
|
|
|
48
52
|
static void FromUrlSync(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
49
53
|
|
|
@@ -57,11 +61,11 @@ public:
|
|
|
57
61
|
|
|
58
62
|
static void FromBytesCb(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
59
63
|
|
|
60
|
-
static void SaveSync(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
64
|
+
/* static void SaveSync(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
61
65
|
|
|
62
|
-
|
|
66
|
+
static void SaveCb(const v8::FunctionCallbackInfo<v8::Value> &args);*/
|
|
63
67
|
|
|
64
68
|
|
|
65
69
|
private:
|
|
66
|
-
ImageAsset*
|
|
70
|
+
ImageAsset *asset_;
|
|
67
71
|
};
|
|
@@ -121,11 +121,11 @@ ImageBitmapImpl::HandleOptions(v8::Isolate *isolate, const v8::Local<v8::Value>
|
|
|
121
121
|
auto premultiplyAlpha = ConvertFromV8String(isolate, premultiplyAlphaValue);
|
|
122
122
|
|
|
123
123
|
if (premultiplyAlpha == "premultiply") {
|
|
124
|
-
ret.premultiplyAlpha = ImageBitmapPremultiplyAlphaPremultiply;
|
|
124
|
+
ret.premultiplyAlpha = ImageBitmapPremultiplyAlpha::ImageBitmapPremultiplyAlphaPremultiply;
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
if (premultiplyAlpha == "none") {
|
|
128
|
-
ret.premultiplyAlpha =
|
|
128
|
+
ret.premultiplyAlpha = ImageBitmapPremultiplyAlpha::ImageBitmapPremultiplyAlphaAlphaNone;
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
|
|
@@ -31,16 +31,6 @@ CanvasPattern *CanvasPattern::GetPointer(const v8::Local<v8::Object> &object) {
|
|
|
31
31
|
return static_cast<CanvasPattern *>(ptr);
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
static v8::Local<v8::Object> NewInstance(v8::Isolate *isolate, CanvasPattern *pattern) {
|
|
35
|
-
auto context = isolate->GetCurrentContext();
|
|
36
|
-
v8::EscapableHandleScope scope(isolate);
|
|
37
|
-
auto object = CanvasPattern::GetCtor(isolate)->GetFunction(
|
|
38
|
-
context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
|
|
39
|
-
SetNativeType(object, NativeType::CanvasPattern);
|
|
40
|
-
object->SetAlignedPointerInInternalField(0, pattern);
|
|
41
|
-
return scope.Escape(object);
|
|
42
|
-
}
|
|
43
|
-
|
|
44
34
|
v8::Local<v8::FunctionTemplate> CanvasPattern::GetCtor(v8::Isolate *isolate) {
|
|
45
35
|
auto cache = Caches::Get(isolate);
|
|
46
36
|
auto ctor = cache->CanvasPatternTmpl.get();
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
#include "CanvasRenderingContext2DImpl.h"
|
|
6
6
|
#include "Caches.h"
|
|
7
7
|
#include "OneByteStringResource.h"
|
|
8
|
+
#include "WebGLRenderingContextBase.h"
|
|
8
9
|
|
|
9
10
|
v8::CFunction CanvasRenderingContext2DImpl::fast_start_raf_(
|
|
10
11
|
v8::CFunction::Make(CanvasRenderingContext2DImpl::__FastStartRaf));
|
|
@@ -254,7 +255,7 @@ void CanvasRenderingContext2DImpl::Init(v8::Local<v8::Object> canvasModule, v8::
|
|
|
254
255
|
auto context = isolate->GetCurrentContext();
|
|
255
256
|
auto func = ctor->GetFunction(context).ToLocalChecked();
|
|
256
257
|
|
|
257
|
-
canvasModule->Set(context, ConvertToV8String(isolate, "CanvasRenderingContext2D"), func);
|
|
258
|
+
canvasModule->Set(context, ConvertToV8String(isolate, "CanvasRenderingContext2D"), func).FromJust();
|
|
258
259
|
}
|
|
259
260
|
|
|
260
261
|
CanvasRenderingContext2DImpl *
|
|
@@ -1380,7 +1381,7 @@ void CanvasRenderingContext2DImpl::GetLineDash(v8::Local<v8::String> property,
|
|
|
1380
1381
|
auto ret = v8::Array::New(isolate, (int) size);
|
|
1381
1382
|
for (int i = 0; i < size; i++) {
|
|
1382
1383
|
auto item = buf[i];
|
|
1383
|
-
ret->Set(context, i, v8::Number::New(isolate, (double) item));
|
|
1384
|
+
ret->Set(context, i, v8::Number::New(isolate, (double) item)).FromJust();
|
|
1384
1385
|
}
|
|
1385
1386
|
|
|
1386
1387
|
}
|
|
@@ -1943,7 +1944,7 @@ CanvasRenderingContext2DImpl::DrawAtlas(const v8::FunctionCallbackInfo<v8::Value
|
|
|
1943
1944
|
int32_t mode = 4;
|
|
1944
1945
|
|
|
1945
1946
|
if (blendValue->IsInt32()) {
|
|
1946
|
-
blendValue->Int32Value(context).To(&mode);
|
|
1947
|
+
auto val = blendValue->Int32Value(context).To(&mode);
|
|
1947
1948
|
}
|
|
1948
1949
|
|
|
1949
1950
|
if (colorsValue->IsArray()) {
|
|
@@ -2081,6 +2082,17 @@ CanvasRenderingContext2DImpl::DrawImage(const v8::FunctionCallbackInfo<v8::Value
|
|
|
2081
2082
|
}
|
|
2082
2083
|
}
|
|
2083
2084
|
break;
|
|
2085
|
+
case NativeType::WebGLRenderingContextBase: {
|
|
2086
|
+
auto gl = WebGLRenderingContextBase::GetPointer(image);
|
|
2087
|
+
if (gl != nullptr) {
|
|
2088
|
+
canvas_native_context_draw_image_dx_dy_webgl(
|
|
2089
|
+
ptr->GetContext(),
|
|
2090
|
+
gl->GetState(),
|
|
2091
|
+
dx, dy
|
|
2092
|
+
);
|
|
2093
|
+
}
|
|
2094
|
+
}
|
|
2095
|
+
break;
|
|
2084
2096
|
default:
|
|
2085
2097
|
break;
|
|
2086
2098
|
}
|
|
@@ -2131,6 +2143,17 @@ CanvasRenderingContext2DImpl::DrawImage(const v8::FunctionCallbackInfo<v8::Value
|
|
|
2131
2143
|
}
|
|
2132
2144
|
}
|
|
2133
2145
|
break;
|
|
2146
|
+
case NativeType::WebGLRenderingContextBase: {
|
|
2147
|
+
auto gl = WebGLRenderingContextBase::GetPointer(image);
|
|
2148
|
+
if (gl != nullptr) {
|
|
2149
|
+
canvas_native_context_draw_image_dx_dy_dw_dh_webgl(
|
|
2150
|
+
ptr->GetContext(),
|
|
2151
|
+
gl->GetState(),
|
|
2152
|
+
dx, dy, dWidth, dHeight
|
|
2153
|
+
);
|
|
2154
|
+
}
|
|
2155
|
+
}
|
|
2156
|
+
break;
|
|
2134
2157
|
default:
|
|
2135
2158
|
break;
|
|
2136
2159
|
}
|
|
@@ -2189,6 +2212,20 @@ CanvasRenderingContext2DImpl::DrawImage(const v8::FunctionCallbackInfo<v8::Value
|
|
|
2189
2212
|
}
|
|
2190
2213
|
}
|
|
2191
2214
|
break;
|
|
2215
|
+
case NativeType::WebGLRenderingContextBase: {
|
|
2216
|
+
auto gl = WebGLRenderingContextBase::GetPointer(image);
|
|
2217
|
+
if (gl != nullptr) {
|
|
2218
|
+
canvas_native_context_draw_image_webgl(
|
|
2219
|
+
ptr->GetContext(),
|
|
2220
|
+
gl->GetState(),
|
|
2221
|
+
sx,
|
|
2222
|
+
sy, sWidth, sHeight,
|
|
2223
|
+
dx,
|
|
2224
|
+
dy, dWidth, dHeight
|
|
2225
|
+
);
|
|
2226
|
+
}
|
|
2227
|
+
}
|
|
2228
|
+
break;
|
|
2192
2229
|
default:
|
|
2193
2230
|
break;
|
|
2194
2231
|
}
|
|
@@ -2402,7 +2439,7 @@ CanvasRenderingContext2DImpl::GetLineDash(const v8::FunctionCallbackInfo<v8::Val
|
|
|
2402
2439
|
for (int i = 0; i < size; ++i) {
|
|
2403
2440
|
array->Set(context, i,
|
|
2404
2441
|
v8::Number::New(isolate,
|
|
2405
|
-
(double) buf[i]));
|
|
2442
|
+
(double) buf[i])).FromJust();
|
|
2406
2443
|
}
|
|
2407
2444
|
|
|
2408
2445
|
args.GetReturnValue().Set(array);
|