@nativescript/canvas 2.0.0-beta.9 → 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 +4 -5
- package/Canvas/index.ios.js +72 -82
- 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 +86 -32
- 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/Info.plist +5 -5
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/CanvasNative-Swift.h +23 -23
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_ios.h +41 -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 +1563 -3729
- 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 -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 +46 -46
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_ios.h +41 -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 +1563 -3729
- 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 +1563 -3729
- 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 -662
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/x86_64/CanvasNative.yml +638 -641
- 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
|
@@ -700,7 +700,7 @@ v8::Local<v8::Value> WebGLRenderingContext::GetParameterInternal(v8::Isolate *is
|
|
|
700
700
|
}
|
|
701
701
|
return scope.Escape(v8::Integer::New(isolate, value));
|
|
702
702
|
}
|
|
703
|
-
case (uint32_t) GLConstants::
|
|
703
|
+
case (uint32_t) GLConstants::GLConstantsUnpackColorSpaceConversionWebGL:
|
|
704
704
|
return scope.Escape(v8::Integer::New(isolate,
|
|
705
705
|
canvas_native_webgl_state_get_unpack_colorspace_conversion_webgl(
|
|
706
706
|
this->GetState())));
|
|
@@ -729,10 +729,10 @@ v8::Local<v8::Value> WebGLRenderingContext::GetParameterInternal(v8::Isolate *is
|
|
|
729
729
|
|
|
730
730
|
return scope.Escape(v8::Float32Array::New(arraybuffer, 0, size));
|
|
731
731
|
}
|
|
732
|
-
case (uint32_t) GLConstants::
|
|
732
|
+
case (uint32_t) GLConstants::GLConstantsUnPackFlipYWebGL:
|
|
733
733
|
return scope.Escape(v8::Boolean::New(isolate, canvas_native_webgl_state_get_flip_y(
|
|
734
734
|
this->GetState())));
|
|
735
|
-
case (uint32_t) GLConstants::
|
|
735
|
+
case (uint32_t) GLConstants::GLConstantsUnpackPremultiplyAlphaWebGL:
|
|
736
736
|
return scope.Escape(v8::Boolean::New(isolate,
|
|
737
737
|
canvas_native_webgl_state_get_premultiplied_alpha(
|
|
738
738
|
this->GetState())));
|
|
@@ -754,7 +754,7 @@ v8::Local<v8::Value> WebGLRenderingContext::GetParameterInternal(v8::Isolate *is
|
|
|
754
754
|
auto array = v8::Array::New(isolate, (int) len);
|
|
755
755
|
|
|
756
756
|
for (int j = 0; j < len; ++j) {
|
|
757
|
-
array->Set(context, j, v8::Boolean::New(isolate, buf[j] == 1));
|
|
757
|
+
array->Set(context, j, v8::Boolean::New(isolate, buf[j] == 1)).FromJust();
|
|
758
758
|
}
|
|
759
759
|
return scope.Escape(array);
|
|
760
760
|
}
|
|
@@ -894,8 +894,6 @@ void WebGLRenderingContext::AttachShader(const v8::FunctionCallbackInfo<v8::Valu
|
|
|
894
894
|
return;
|
|
895
895
|
}
|
|
896
896
|
|
|
897
|
-
auto isolate = args.GetIsolate();
|
|
898
|
-
|
|
899
897
|
auto programValue = args[0];
|
|
900
898
|
auto shaderValue = args[1];
|
|
901
899
|
|
|
@@ -1200,59 +1198,24 @@ void WebGLRenderingContext::BufferData(const v8::FunctionCallbackInfo<v8::Value>
|
|
|
1200
1198
|
auto usage = args[2]->Uint32Value(context).ToChecked();
|
|
1201
1199
|
|
|
1202
1200
|
if (args[1]->IsObject()) {
|
|
1203
|
-
|
|
1204
1201
|
auto sizeOrBuf = args[1];
|
|
1205
1202
|
if (sizeOrBuf->IsArrayBufferView()) {
|
|
1206
|
-
|
|
1207
|
-
auto buf = sizeOrBuf.As<v8::Uint16Array>();
|
|
1208
|
-
|
|
1209
|
-
auto array = buf->Buffer();
|
|
1210
|
-
auto offset = buf->ByteOffset();
|
|
1211
|
-
auto size = buf->Length();
|
|
1212
|
-
auto data_ptr =
|
|
1213
|
-
static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
1214
|
-
auto data = static_cast<uint16_t *>((void *) data_ptr);
|
|
1215
|
-
|
|
1216
|
-
canvas_native_webgl_buffer_data_u16(
|
|
1217
|
-
target,
|
|
1218
|
-
data, size,
|
|
1219
|
-
usage,
|
|
1220
|
-
ptr->GetState()
|
|
1221
|
-
);
|
|
1222
|
-
} else if (sizeOrBuf->IsFloat32Array()) {
|
|
1223
|
-
auto buf = sizeOrBuf.As<v8::Float32Array>();
|
|
1224
|
-
|
|
1225
|
-
auto array = buf->Buffer();
|
|
1226
|
-
auto offset = buf->ByteOffset();
|
|
1227
|
-
auto size = buf->Length();
|
|
1228
|
-
auto data_ptr =
|
|
1229
|
-
static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
1230
|
-
auto data = static_cast<float *>((void *) data_ptr);
|
|
1231
|
-
|
|
1232
|
-
canvas_native_webgl_buffer_data_f32(
|
|
1233
|
-
target,
|
|
1234
|
-
data, size,
|
|
1235
|
-
usage,
|
|
1236
|
-
ptr->GetState()
|
|
1237
|
-
);
|
|
1238
|
-
} else {
|
|
1239
|
-
auto buf = sizeOrBuf.As<v8::ArrayBufferView>();
|
|
1203
|
+
auto buf = sizeOrBuf.As<v8::ArrayBufferView>();
|
|
1240
1204
|
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1205
|
+
auto array = buf->Buffer();
|
|
1206
|
+
auto offset = buf->ByteOffset();
|
|
1207
|
+
auto size = buf->ByteLength();
|
|
1208
|
+
auto data_ptr =
|
|
1209
|
+
static_cast<uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
1210
|
+
auto data = static_cast<uint8_t *>((void *) data_ptr);
|
|
1247
1211
|
|
|
1248
1212
|
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
}
|
|
1213
|
+
canvas_native_webgl_buffer_data(
|
|
1214
|
+
target,
|
|
1215
|
+
data, size,
|
|
1216
|
+
usage,
|
|
1217
|
+
ptr->GetState()
|
|
1218
|
+
);
|
|
1256
1219
|
} else if (sizeOrBuf->IsArrayBuffer()) {
|
|
1257
1220
|
auto array = sizeOrBuf.As<v8::ArrayBuffer>();
|
|
1258
1221
|
|
|
@@ -1524,8 +1487,7 @@ void WebGLRenderingContext::CompressedTexImage2D(const v8::FunctionCallbackInfo<
|
|
|
1524
1487
|
auto array = buf->Buffer();
|
|
1525
1488
|
auto offset = buf->ByteOffset();
|
|
1526
1489
|
auto size = buf->ByteLength();
|
|
1527
|
-
auto
|
|
1528
|
-
auto data = static_cast<uint8_t *>((void *) data_ptr);
|
|
1490
|
+
auto data = static_cast<const uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
1529
1491
|
|
|
1530
1492
|
|
|
1531
1493
|
canvas_native_webgl_compressed_tex_image2d(
|
|
@@ -1583,8 +1545,7 @@ WebGLRenderingContext::CompressedTexSubImage2D(const v8::FunctionCallbackInfo<v8
|
|
|
1583
1545
|
auto array = buf->Buffer();
|
|
1584
1546
|
auto offset = buf->ByteOffset();
|
|
1585
1547
|
auto size = array->ByteLength();
|
|
1586
|
-
auto
|
|
1587
|
-
auto data = static_cast<uint8_t *>((void *) data_ptr);
|
|
1548
|
+
auto data = static_cast<const uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
1588
1549
|
|
|
1589
1550
|
canvas_native_webgl_compressed_tex_sub_image2d(
|
|
1590
1551
|
target,
|
|
@@ -1854,9 +1815,6 @@ void WebGLRenderingContext::DeleteBuffer(const v8::FunctionCallbackInfo<v8::Valu
|
|
|
1854
1815
|
return;
|
|
1855
1816
|
}
|
|
1856
1817
|
|
|
1857
|
-
auto isolate = args.GetIsolate();
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
1818
|
auto value = args[0];
|
|
1861
1819
|
auto type = GetNativeType(value);
|
|
1862
1820
|
if (type == NativeType::WebGLBuffer) {
|
|
@@ -1877,8 +1835,6 @@ void WebGLRenderingContext::DeleteFramebuffer(const v8::FunctionCallbackInfo<v8:
|
|
|
1877
1835
|
return;
|
|
1878
1836
|
}
|
|
1879
1837
|
|
|
1880
|
-
auto isolate = args.GetIsolate();
|
|
1881
|
-
|
|
1882
1838
|
auto value = args[0];
|
|
1883
1839
|
auto type = GetNativeType(value);
|
|
1884
1840
|
if (type == NativeType::WebGLFramebuffer) {
|
|
@@ -1899,8 +1855,6 @@ void WebGLRenderingContext::DeleteProgram(const v8::FunctionCallbackInfo<v8::Val
|
|
|
1899
1855
|
return;
|
|
1900
1856
|
}
|
|
1901
1857
|
|
|
1902
|
-
auto isolate = args.GetIsolate();
|
|
1903
|
-
|
|
1904
1858
|
auto value = args[0];
|
|
1905
1859
|
auto type = GetNativeType(value);
|
|
1906
1860
|
|
|
@@ -1923,8 +1877,6 @@ void WebGLRenderingContext::DeleteRenderbuffer(const v8::FunctionCallbackInfo<v8
|
|
|
1923
1877
|
return;
|
|
1924
1878
|
}
|
|
1925
1879
|
|
|
1926
|
-
auto isolate = args.GetIsolate();
|
|
1927
|
-
|
|
1928
1880
|
|
|
1929
1881
|
auto value = args[0];
|
|
1930
1882
|
auto type = GetNativeType(value);
|
|
@@ -1948,8 +1900,6 @@ void WebGLRenderingContext::DeleteShader(const v8::FunctionCallbackInfo<v8::Valu
|
|
|
1948
1900
|
return;
|
|
1949
1901
|
}
|
|
1950
1902
|
|
|
1951
|
-
auto isolate = args.GetIsolate();
|
|
1952
|
-
|
|
1953
1903
|
|
|
1954
1904
|
auto value = args[0];
|
|
1955
1905
|
auto type = GetNativeType(value);
|
|
@@ -1971,8 +1921,6 @@ void WebGLRenderingContext::DeleteTexture(const v8::FunctionCallbackInfo<v8::Val
|
|
|
1971
1921
|
return;
|
|
1972
1922
|
}
|
|
1973
1923
|
|
|
1974
|
-
auto isolate = args.GetIsolate();
|
|
1975
|
-
|
|
1976
1924
|
|
|
1977
1925
|
auto value = args[0];
|
|
1978
1926
|
auto type = GetNativeType(value);
|
|
@@ -2049,8 +1997,6 @@ void WebGLRenderingContext::DetachShader(const v8::FunctionCallbackInfo<v8::Valu
|
|
|
2049
1997
|
return;
|
|
2050
1998
|
}
|
|
2051
1999
|
|
|
2052
|
-
auto isolate = args.GetIsolate();
|
|
2053
|
-
|
|
2054
2000
|
|
|
2055
2001
|
auto programValue = args[0];
|
|
2056
2002
|
auto shaderValue = args[1];
|
|
@@ -2398,7 +2344,7 @@ void WebGLRenderingContext::GetAttachedShaders(const v8::FunctionCallbackInfo<v8
|
|
|
2398
2344
|
for (int i = 0; i < len; ++i) {
|
|
2399
2345
|
auto shader = WebGLShader::NewInstance(isolate, new WebGLShader(
|
|
2400
2346
|
buf[i]));
|
|
2401
|
-
array->Set(context, i, shader);
|
|
2347
|
+
array->Set(context, i, shader).FromJust();
|
|
2402
2348
|
}
|
|
2403
2349
|
args.GetReturnValue().Set(array);
|
|
2404
2350
|
|
|
@@ -2484,63 +2430,81 @@ void WebGLRenderingContext::GetContextAttributes(const v8::FunctionCallbackInfo<
|
|
|
2484
2430
|
attr);
|
|
2485
2431
|
|
|
2486
2432
|
|
|
2487
|
-
ret->Set(context, ConvertToV8String(isolate, "alpha"),
|
|
2433
|
+
ret->Set(context, ConvertToV8String(isolate, "alpha"),
|
|
2434
|
+
v8::Boolean::New(isolate, alpha)).FromJust();
|
|
2488
2435
|
|
|
2489
2436
|
auto antialias = canvas_native_webgl_context_attribute_get_get_antialias(
|
|
2490
2437
|
attr);
|
|
2491
2438
|
|
|
2492
2439
|
ret->Set(context, ConvertToV8String(isolate, "antialias"),
|
|
2493
|
-
v8::Boolean::New(isolate, antialias));
|
|
2440
|
+
v8::Boolean::New(isolate, antialias)).FromJust();
|
|
2494
2441
|
|
|
2495
2442
|
auto depth = canvas_native_webgl_context_attribute_get_get_depth(
|
|
2496
2443
|
attr);
|
|
2497
2444
|
|
|
2498
|
-
ret->Set(context, ConvertToV8String(isolate, "depth"),
|
|
2445
|
+
ret->Set(context, ConvertToV8String(isolate, "depth"),
|
|
2446
|
+
v8::Boolean::New(isolate, depth)).FromJust();
|
|
2499
2447
|
|
|
2500
2448
|
auto fail_if_major_performance_caveat = canvas_native_webgl_context_attribute_get_get_fail_if_major_performance_caveat(
|
|
2501
2449
|
attr);
|
|
2502
2450
|
|
|
2503
2451
|
ret->Set(context,
|
|
2504
2452
|
ConvertToV8String(isolate, "failIfMajorPerformanceCaveat"),
|
|
2505
|
-
v8::Boolean::New(isolate, fail_if_major_performance_caveat));
|
|
2453
|
+
v8::Boolean::New(isolate, fail_if_major_performance_caveat)).FromJust();
|
|
2506
2454
|
|
|
2507
2455
|
auto power_preference = canvas_native_webgl_context_attribute_get_get_power_preference(
|
|
2508
2456
|
attr);
|
|
2509
2457
|
|
|
2458
|
+
std::string powerp;
|
|
2459
|
+
switch (power_preference) {
|
|
2460
|
+
case 0:
|
|
2461
|
+
powerp = std::string("default");
|
|
2462
|
+
break;
|
|
2463
|
+
case 1:
|
|
2464
|
+
powerp = std::string("high-performance");
|
|
2465
|
+
break;
|
|
2466
|
+
case 2:
|
|
2467
|
+
powerp = std::string("low-power");
|
|
2468
|
+
break;
|
|
2469
|
+
default:
|
|
2470
|
+
break;
|
|
2471
|
+
}
|
|
2472
|
+
|
|
2510
2473
|
ret->Set(context, ConvertToV8String(isolate, "powerPreference"),
|
|
2511
|
-
|
|
2474
|
+
ConvertToV8String(isolate, powerp.c_str())).FromJust();
|
|
2475
|
+
|
|
2512
2476
|
|
|
2513
2477
|
auto premultiplied_alpha = canvas_native_webgl_context_attribute_get_get_premultiplied_alpha(
|
|
2514
2478
|
attr);
|
|
2515
2479
|
|
|
2516
2480
|
ret->Set(context,
|
|
2517
2481
|
ConvertToV8String(isolate, "premultipliedAlpha"),
|
|
2518
|
-
v8::Boolean::New(isolate, premultiplied_alpha));
|
|
2482
|
+
v8::Boolean::New(isolate, premultiplied_alpha)).FromJust();
|
|
2519
2483
|
|
|
2520
2484
|
auto preserve_drawing_buffer = canvas_native_webgl_context_attribute_get_get_preserve_drawing_buffer(
|
|
2521
2485
|
attr);
|
|
2522
2486
|
|
|
2523
2487
|
ret->Set(context,
|
|
2524
2488
|
ConvertToV8String(isolate, "preserveDrawingBuffer"),
|
|
2525
|
-
v8::Boolean::New(isolate, preserve_drawing_buffer));
|
|
2489
|
+
v8::Boolean::New(isolate, preserve_drawing_buffer)).FromJust();
|
|
2526
2490
|
|
|
2527
2491
|
auto stencil = canvas_native_webgl_context_attribute_get_get_stencil(
|
|
2528
2492
|
attr);
|
|
2529
2493
|
|
|
2530
2494
|
ret->Set(context, ConvertToV8String(isolate, "stencil"),
|
|
2531
|
-
v8::Boolean::New(isolate, stencil));
|
|
2495
|
+
v8::Boolean::New(isolate, stencil)).FromJust();
|
|
2532
2496
|
|
|
2533
2497
|
auto desynchronized = canvas_native_webgl_context_attribute_get_get_desynchronized(
|
|
2534
2498
|
attr);
|
|
2535
2499
|
|
|
2536
2500
|
ret->Set(context, ConvertToV8String(isolate, "desynchronized"),
|
|
2537
|
-
v8::Boolean::New(isolate, desynchronized));
|
|
2501
|
+
v8::Boolean::New(isolate, desynchronized)).FromJust();
|
|
2538
2502
|
|
|
2539
2503
|
auto xr_compatible = canvas_native_webgl_context_attribute_get_get_xr_compatible(
|
|
2540
2504
|
attr);
|
|
2541
2505
|
|
|
2542
2506
|
ret->Set(context, ConvertToV8String(isolate, "xrCompatible"),
|
|
2543
|
-
v8::Boolean::New(isolate, xr_compatible));
|
|
2507
|
+
v8::Boolean::New(isolate, xr_compatible)).FromJust();
|
|
2544
2508
|
|
|
2545
2509
|
canvas_native_context_attributes_destroy(attr);
|
|
2546
2510
|
|
|
@@ -2595,200 +2559,193 @@ void WebGLRenderingContext::GetExtension(const v8::FunctionCallbackInfo<v8::Valu
|
|
|
2595
2559
|
auto type = canvas_native_webgl_context_extension_get_type(
|
|
2596
2560
|
ext);
|
|
2597
2561
|
switch (type) {
|
|
2598
|
-
case WebGLExtensionType::
|
|
2562
|
+
case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeOES_fbo_render_mipmap: {
|
|
2599
2563
|
auto ret = OES_fbo_render_mipmapImpl::NewInstance(isolate,
|
|
2600
2564
|
new OES_fbo_render_mipmapImpl());
|
|
2601
2565
|
args.GetReturnValue().Set(ret);
|
|
2602
2566
|
canvas_native_webgl_extension_destroy(ext);
|
|
2603
2567
|
return;
|
|
2604
2568
|
}
|
|
2605
|
-
case WebGLExtensionType::
|
|
2569
|
+
case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeEXT_blend_minmax: {
|
|
2606
2570
|
auto ret = EXT_blend_minmaxImpl::NewInstance(isolate, new EXT_blend_minmaxImpl());
|
|
2607
2571
|
args.GetReturnValue().Set(ret);
|
|
2608
2572
|
canvas_native_webgl_extension_destroy(ext);
|
|
2609
2573
|
return;
|
|
2610
2574
|
}
|
|
2611
|
-
case WebGLExtensionType::
|
|
2575
|
+
case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeEXT_color_buffer_half_float: {
|
|
2612
2576
|
auto ret = EXT_color_buffer_half_floatImpl::NewInstance(isolate,
|
|
2613
2577
|
new EXT_color_buffer_half_floatImpl());
|
|
2614
2578
|
args.GetReturnValue().Set(ret);
|
|
2615
2579
|
canvas_native_webgl_extension_destroy(ext);
|
|
2616
2580
|
return;
|
|
2617
2581
|
}
|
|
2618
|
-
case WebGLExtensionType::
|
|
2582
|
+
case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeEXT_disjoint_timer_query: {
|
|
2619
2583
|
auto ret = canvas_native_webgl_context_extension_to_ext_disjoint_timer_query(ext);
|
|
2620
2584
|
auto query = EXT_disjoint_timer_queryImpl::NewInstance(isolate,
|
|
2621
2585
|
new EXT_disjoint_timer_queryImpl(
|
|
2622
2586
|
ret));
|
|
2623
2587
|
|
|
2624
2588
|
args.GetReturnValue().Set(query);
|
|
2625
|
-
canvas_native_webgl_extension_destroy(ext);
|
|
2626
2589
|
return;
|
|
2627
2590
|
}
|
|
2628
|
-
case WebGLExtensionType::
|
|
2591
|
+
case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeEXT_sRGB: {
|
|
2629
2592
|
auto ret = EXT_sRGBImpl::NewInstance(isolate, new EXT_sRGBImpl());
|
|
2630
2593
|
args.GetReturnValue().Set(ret);
|
|
2631
2594
|
canvas_native_webgl_extension_destroy(ext);
|
|
2632
2595
|
return;
|
|
2633
2596
|
}
|
|
2634
|
-
case WebGLExtensionType::
|
|
2597
|
+
case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeEXT_shader_texture_lod: {
|
|
2635
2598
|
auto ret = EXT_shader_texture_lodImpl::NewInstance(isolate,
|
|
2636
2599
|
new EXT_shader_texture_lodImpl());
|
|
2637
2600
|
args.GetReturnValue().Set(ret);
|
|
2638
2601
|
canvas_native_webgl_extension_destroy(ext);
|
|
2639
2602
|
return;
|
|
2640
2603
|
}
|
|
2641
|
-
case WebGLExtensionType::
|
|
2604
|
+
case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeEXT_texture_filter_anisotropic: {
|
|
2642
2605
|
auto ret = EXT_texture_filter_anisotropicImpl::NewInstance(isolate,
|
|
2643
2606
|
new EXT_texture_filter_anisotropicImpl());
|
|
2644
2607
|
args.GetReturnValue().Set(ret);
|
|
2645
2608
|
canvas_native_webgl_extension_destroy(ext);
|
|
2646
2609
|
return;
|
|
2647
2610
|
}
|
|
2648
|
-
case WebGLExtensionType::
|
|
2611
|
+
case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeOES_element_index_uint: {
|
|
2649
2612
|
auto ret = OES_element_index_uintImpl::NewInstance(isolate,
|
|
2650
2613
|
new OES_element_index_uintImpl());
|
|
2651
2614
|
args.GetReturnValue().Set(ret);
|
|
2652
2615
|
canvas_native_webgl_extension_destroy(ext);
|
|
2653
2616
|
return;
|
|
2654
2617
|
}
|
|
2655
|
-
case WebGLExtensionType::
|
|
2618
|
+
case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeOES_standard_derivatives: {
|
|
2656
2619
|
auto ret = OES_standard_derivativesImpl::NewInstance(
|
|
2657
2620
|
isolate, new OES_standard_derivativesImpl());
|
|
2658
2621
|
args.GetReturnValue().Set(ret);
|
|
2659
2622
|
canvas_native_webgl_extension_destroy(ext);
|
|
2660
2623
|
return;
|
|
2661
2624
|
}
|
|
2662
|
-
case WebGLExtensionType::
|
|
2625
|
+
case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeOES_texture_float: {
|
|
2663
2626
|
auto ret = OES_texture_floatImpl::NewInstance(isolate, new OES_texture_floatImpl());
|
|
2664
2627
|
args.GetReturnValue().Set(ret);
|
|
2665
2628
|
canvas_native_webgl_extension_destroy(ext);
|
|
2666
2629
|
return;
|
|
2667
2630
|
}
|
|
2668
|
-
case WebGLExtensionType::
|
|
2631
|
+
case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeOES_texture_float_linear: {
|
|
2669
2632
|
auto ret = OES_texture_float_linearImpl::NewInstance(isolate,
|
|
2670
2633
|
new OES_texture_float_linearImpl());
|
|
2671
2634
|
args.GetReturnValue().Set(ret);
|
|
2672
2635
|
canvas_native_webgl_extension_destroy(ext);
|
|
2673
2636
|
return;
|
|
2674
2637
|
}
|
|
2675
|
-
case WebGLExtensionType::
|
|
2638
|
+
case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeOES_texture_half_float: {
|
|
2676
2639
|
auto ret = OES_texture_half_floatImpl::NewInstance(isolate,
|
|
2677
2640
|
new OES_texture_half_floatImpl());
|
|
2678
2641
|
args.GetReturnValue().Set(ret);
|
|
2679
2642
|
canvas_native_webgl_extension_destroy(ext);
|
|
2680
2643
|
return;
|
|
2681
2644
|
}
|
|
2682
|
-
case WebGLExtensionType::
|
|
2645
|
+
case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeOES_texture_half_float_linear: {
|
|
2683
2646
|
auto ret = OES_texture_half_float_linearImpl::NewInstance(isolate,
|
|
2684
2647
|
new OES_texture_half_float_linearImpl());
|
|
2685
2648
|
args.GetReturnValue().Set(ret);
|
|
2686
2649
|
canvas_native_webgl_extension_destroy(ext);
|
|
2687
2650
|
return;
|
|
2688
2651
|
}
|
|
2689
|
-
case WebGLExtensionType::
|
|
2652
|
+
case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeOES_vertex_array_object: {
|
|
2690
2653
|
auto ret = canvas_native_webgl_context_extension_to_oes_vertex_array_object(ext);
|
|
2691
2654
|
auto array = OES_vertex_array_objectImpl::NewInstance(isolate,
|
|
2692
2655
|
new OES_vertex_array_objectImpl(
|
|
2693
2656
|
ret));
|
|
2694
2657
|
args.GetReturnValue().Set(array);
|
|
2695
|
-
canvas_native_webgl_extension_destroy(ext);
|
|
2696
2658
|
return;
|
|
2697
2659
|
}
|
|
2698
|
-
case WebGLExtensionType::
|
|
2660
|
+
case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeWEBGL_color_buffer_float: {
|
|
2699
2661
|
auto ret = WEBGL_color_buffer_floatImpl::NewInstance(isolate,
|
|
2700
2662
|
new WEBGL_color_buffer_floatImpl());
|
|
2701
2663
|
if (ptr->GetVersion() ==
|
|
2702
2664
|
WebGLRenderingVersion::V2) {
|
|
2703
2665
|
ret->Set(context, ConvertToV8String(isolate, "ext_name"),
|
|
2704
|
-
ConvertToV8String(isolate, "EXT_color_buffer_float"));
|
|
2666
|
+
ConvertToV8String(isolate, "EXT_color_buffer_float")).FromJust();
|
|
2705
2667
|
}
|
|
2706
2668
|
args.GetReturnValue().Set(ret);
|
|
2707
2669
|
canvas_native_webgl_extension_destroy(ext);
|
|
2708
2670
|
return;
|
|
2709
2671
|
}
|
|
2710
|
-
case WebGLExtensionType::
|
|
2672
|
+
case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeWEBGL_compressed_texture_atc: {
|
|
2711
2673
|
auto ret = WEBGL_compressed_texture_atcImpl::NewInstance(isolate,
|
|
2712
2674
|
new WEBGL_compressed_texture_atcImpl());
|
|
2713
2675
|
args.GetReturnValue().Set(ret);
|
|
2714
2676
|
canvas_native_webgl_extension_destroy(ext);
|
|
2715
2677
|
return;
|
|
2716
2678
|
}
|
|
2717
|
-
case WebGLExtensionType::
|
|
2679
|
+
case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeWEBGL_compressed_texture_etc1: {
|
|
2718
2680
|
auto ret = WEBGL_compressed_texture_etc1Impl::NewInstance(isolate,
|
|
2719
2681
|
new WEBGL_compressed_texture_etc1Impl());
|
|
2720
2682
|
args.GetReturnValue().Set(ret);
|
|
2721
2683
|
canvas_native_webgl_extension_destroy(ext);
|
|
2722
2684
|
return;
|
|
2723
2685
|
}
|
|
2724
|
-
case WebGLExtensionType::
|
|
2686
|
+
case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeWEBGL_compressed_texture_s3tc: {
|
|
2725
2687
|
auto ret = WEBGL_compressed_texture_s3tcImpl::NewInstance(isolate,
|
|
2726
2688
|
new WEBGL_compressed_texture_s3tcImpl());
|
|
2727
2689
|
args.GetReturnValue().Set(ret);
|
|
2728
2690
|
canvas_native_webgl_extension_destroy(ext);
|
|
2729
2691
|
return;
|
|
2730
2692
|
}
|
|
2731
|
-
case WebGLExtensionType::
|
|
2693
|
+
case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeWEBGL_compressed_texture_s3tc_srgb: {
|
|
2732
2694
|
auto ret = WEBGL_compressed_texture_s3tc_srgbImpl::NewInstance(isolate,
|
|
2733
2695
|
new WEBGL_compressed_texture_s3tc_srgbImpl());
|
|
2734
2696
|
args.GetReturnValue().Set(ret);
|
|
2735
2697
|
canvas_native_webgl_extension_destroy(ext);
|
|
2736
2698
|
return;
|
|
2737
2699
|
}
|
|
2738
|
-
case WebGLExtensionType::
|
|
2700
|
+
case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeWEBGL_compressed_texture_etc: {
|
|
2739
2701
|
auto ret = WEBGL_compressed_texture_etcImpl::NewInstance(isolate,
|
|
2740
2702
|
new WEBGL_compressed_texture_etcImpl());
|
|
2741
2703
|
args.GetReturnValue().Set(ret);
|
|
2742
2704
|
canvas_native_webgl_extension_destroy(ext);
|
|
2743
2705
|
return;
|
|
2744
2706
|
}
|
|
2745
|
-
case WebGLExtensionType::
|
|
2707
|
+
case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeWEBGL_compressed_texture_pvrtc: {
|
|
2746
2708
|
auto ret = WEBGL_compressed_texture_pvrtcImpl::NewInstance(isolate,
|
|
2747
2709
|
new WEBGL_compressed_texture_pvrtcImpl());
|
|
2748
2710
|
args.GetReturnValue().Set(ret);
|
|
2749
2711
|
canvas_native_webgl_extension_destroy(ext);
|
|
2750
2712
|
return;
|
|
2751
2713
|
}
|
|
2752
|
-
case WebGLExtensionType::
|
|
2714
|
+
case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeWEBGL_lose_context: {
|
|
2753
2715
|
auto ret = canvas_native_webgl_context_extension_to_lose_context(ext);
|
|
2754
2716
|
auto ctx = WEBGL_lose_contextImpl::NewInstance(isolate,
|
|
2755
2717
|
new WEBGL_lose_contextImpl(ret));
|
|
2756
2718
|
|
|
2757
2719
|
args.GetReturnValue().Set(ctx);
|
|
2758
|
-
|
|
2759
|
-
canvas_native_webgl_extension_destroy(ext);
|
|
2760
2720
|
return;
|
|
2761
2721
|
}
|
|
2762
|
-
case WebGLExtensionType::
|
|
2722
|
+
case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeANGLE_instanced_arrays: {
|
|
2763
2723
|
auto ret = canvas_native_webgl_context_extension_to_angle_instanced_arrays(ext);
|
|
2764
2724
|
auto instance = ANGLE_instanced_arraysImpl::NewInstance(isolate,
|
|
2765
2725
|
new ANGLE_instanced_arraysImpl(
|
|
2766
2726
|
ret));
|
|
2767
2727
|
|
|
2768
2728
|
args.GetReturnValue().Set(instance);
|
|
2769
|
-
canvas_native_webgl_extension_destroy(ext);
|
|
2770
2729
|
return;
|
|
2771
2730
|
}
|
|
2772
|
-
case WebGLExtensionType::
|
|
2731
|
+
case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeWEBGL_depth_texture: {
|
|
2773
2732
|
auto ret = WEBGL_depth_textureImpl::NewInstance(isolate, new WEBGL_depth_textureImpl());
|
|
2774
2733
|
args.GetReturnValue().Set(ret);
|
|
2775
2734
|
canvas_native_webgl_extension_destroy(ext);
|
|
2776
2735
|
return;
|
|
2777
2736
|
}
|
|
2778
|
-
case WebGLExtensionType::
|
|
2737
|
+
case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeWEBGL_draw_buffers: {
|
|
2779
2738
|
auto ret = canvas_native_webgl_context_extension_to_draw_buffers(ext);
|
|
2780
2739
|
|
|
2781
2740
|
auto buffers = WEBGL_draw_buffersImpl::NewInstance(isolate,
|
|
2782
2741
|
new WEBGL_draw_buffersImpl(ret));
|
|
2783
2742
|
|
|
2784
2743
|
args.GetReturnValue().Set(buffers);
|
|
2785
|
-
|
|
2786
|
-
canvas_native_webgl_extension_destroy(ext);
|
|
2787
2744
|
return;
|
|
2788
2745
|
|
|
2789
2746
|
|
|
2790
2747
|
}
|
|
2791
|
-
case WebGLExtensionType::
|
|
2748
|
+
case WebGLExtensionType::WebGLExtensionTypeWebGLExtensionTypeNone:
|
|
2792
2749
|
args.GetReturnValue().SetUndefined();
|
|
2793
2750
|
canvas_native_webgl_extension_destroy(ext);
|
|
2794
2751
|
return;
|
|
@@ -2846,7 +2803,7 @@ void WebGLRenderingContext::GetFramebufferAttachmentParameter(
|
|
|
2846
2803
|
object->Set(context,
|
|
2847
2804
|
ConvertToV8String(isolate, "isRenderbuffer"),
|
|
2848
2805
|
v8::Boolean::New(isolate,
|
|
2849
|
-
true));
|
|
2806
|
+
true)).FromJust();
|
|
2850
2807
|
args.GetReturnValue().Set(object);
|
|
2851
2808
|
|
|
2852
2809
|
canvas_native_webgl_framebuffer_attachment_parameter_destroy(ret);
|
|
@@ -2906,7 +2863,6 @@ void WebGLRenderingContext::GetProgramInfoLog(const v8::FunctionCallbackInfo<v8:
|
|
|
2906
2863
|
|
|
2907
2864
|
if (strlen(log) == 0) {
|
|
2908
2865
|
args.GetReturnValue().SetEmptyString();
|
|
2909
|
-
canvas_native_string_destroy((char *) log);
|
|
2910
2866
|
return;
|
|
2911
2867
|
}
|
|
2912
2868
|
|
|
@@ -3015,7 +2971,6 @@ void WebGLRenderingContext::GetShaderInfoLog(const v8::FunctionCallbackInfo<v8::
|
|
|
3015
2971
|
|
|
3016
2972
|
if (strlen(log) == 0) {
|
|
3017
2973
|
args.GetReturnValue().SetEmptyString();
|
|
3018
|
-
canvas_native_string_destroy((char *) log);
|
|
3019
2974
|
return;
|
|
3020
2975
|
}
|
|
3021
2976
|
|
|
@@ -3131,7 +3086,6 @@ void WebGLRenderingContext::GetShaderSource(const v8::FunctionCallbackInfo<v8::V
|
|
|
3131
3086
|
|
|
3132
3087
|
if (strlen(source) == 0) {
|
|
3133
3088
|
args.GetReturnValue().SetEmptyString();
|
|
3134
|
-
canvas_native_string_destroy((char *) source);
|
|
3135
3089
|
return;
|
|
3136
3090
|
}
|
|
3137
3091
|
|
|
@@ -3164,7 +3118,8 @@ WebGLRenderingContext::GetSupportedExtensions(const v8::FunctionCallbackInfo<v8:
|
|
|
3164
3118
|
for (int i = 0; i < len; ++i) {
|
|
3165
3119
|
auto item = canvas_native_string_buffer_get_value_at(exts, i);
|
|
3166
3120
|
if (item != nullptr) {
|
|
3167
|
-
array->Set(context, i, ConvertToV8OneByteString(isolate, (char *) item));
|
|
3121
|
+
array->Set(context, i, ConvertToV8OneByteString(isolate, (char *) item)).FromJust();
|
|
3122
|
+
canvas_native_string_destroy(item);
|
|
3168
3123
|
}
|
|
3169
3124
|
|
|
3170
3125
|
}
|
|
@@ -3314,7 +3269,7 @@ WebGLRenderingContext::GetUniform(const v8::FunctionCallbackInfo<v8::Value> &arg
|
|
|
3314
3269
|
context, i,
|
|
3315
3270
|
v8::Boolean::New(isolate,
|
|
3316
3271
|
item ==
|
|
3317
|
-
1));
|
|
3272
|
+
1)).FromJust();
|
|
3318
3273
|
}
|
|
3319
3274
|
args.GetReturnValue().Set(array);
|
|
3320
3275
|
canvas_native_webgl_WebGLResult_destroy(val);
|
|
@@ -3560,7 +3515,6 @@ WebGLRenderingContext::IsBuffer(const v8::FunctionCallbackInfo<v8::Value> &args)
|
|
|
3560
3515
|
return;
|
|
3561
3516
|
}
|
|
3562
3517
|
|
|
3563
|
-
auto isolate = args.GetIsolate();
|
|
3564
3518
|
|
|
3565
3519
|
auto value = args[0];
|
|
3566
3520
|
auto type = GetNativeType(value);
|
|
@@ -3619,8 +3573,6 @@ WebGLRenderingContext::IsFramebuffer(const v8::FunctionCallbackInfo<v8::Value> &
|
|
|
3619
3573
|
return;
|
|
3620
3574
|
}
|
|
3621
3575
|
|
|
3622
|
-
auto isolate = args.GetIsolate();
|
|
3623
|
-
|
|
3624
3576
|
auto value = args[0];
|
|
3625
3577
|
auto type = GetNativeType(value);
|
|
3626
3578
|
if (type == NativeType::WebGLFramebuffer) {
|
|
@@ -3642,12 +3594,10 @@ void
|
|
|
3642
3594
|
WebGLRenderingContext::IsProgram(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
3643
3595
|
WebGLRenderingContext *ptr = GetPointer(args.This());
|
|
3644
3596
|
if (ptr == nullptr) {
|
|
3645
|
-
args.GetReturnValue().
|
|
3597
|
+
args.GetReturnValue().Set(false);
|
|
3646
3598
|
return;
|
|
3647
3599
|
}
|
|
3648
3600
|
|
|
3649
|
-
auto isolate = args.GetIsolate();
|
|
3650
|
-
|
|
3651
3601
|
auto value = args[0];
|
|
3652
3602
|
auto type = GetNativeType(value);
|
|
3653
3603
|
if (type == NativeType::WebGLProgram) {
|
|
@@ -3674,8 +3624,6 @@ WebGLRenderingContext::IsRenderbuffer(const v8::FunctionCallbackInfo<v8::Value>
|
|
|
3674
3624
|
return;
|
|
3675
3625
|
}
|
|
3676
3626
|
|
|
3677
|
-
auto isolate = args.GetIsolate();
|
|
3678
|
-
|
|
3679
3627
|
auto value = args[0];
|
|
3680
3628
|
auto type = GetNativeType(value);
|
|
3681
3629
|
if (type == NativeType::WebGLRenderbuffer) {
|
|
@@ -3702,8 +3650,6 @@ WebGLRenderingContext::IsShader(const v8::FunctionCallbackInfo<v8::Value> &args)
|
|
|
3702
3650
|
return;
|
|
3703
3651
|
}
|
|
3704
3652
|
|
|
3705
|
-
auto isolate = args.GetIsolate();
|
|
3706
|
-
|
|
3707
3653
|
auto value = args[0];
|
|
3708
3654
|
auto type = GetNativeType(value);
|
|
3709
3655
|
if (type == NativeType::WebGLShader) {
|
|
@@ -3729,8 +3675,6 @@ WebGLRenderingContext::IsTexture(const v8::FunctionCallbackInfo<v8::Value> &args
|
|
|
3729
3675
|
return;
|
|
3730
3676
|
}
|
|
3731
3677
|
|
|
3732
|
-
auto isolate = args.GetIsolate();
|
|
3733
|
-
|
|
3734
3678
|
auto value = args[0];
|
|
3735
3679
|
auto type = GetNativeType(value);
|
|
3736
3680
|
if (type == NativeType::WebGLTexture) {
|
|
@@ -3773,7 +3717,6 @@ WebGLRenderingContext::LinkProgram(const v8::FunctionCallbackInfo<v8::Value> &ar
|
|
|
3773
3717
|
return;
|
|
3774
3718
|
}
|
|
3775
3719
|
|
|
3776
|
-
auto isolate = args.GetIsolate();
|
|
3777
3720
|
auto value = args[0];
|
|
3778
3721
|
auto type = GetNativeType(value);
|
|
3779
3722
|
if (type == NativeType::WebGLProgram) {
|
|
@@ -4215,7 +4158,6 @@ WebGLRenderingContext::TexImage2D(const v8::FunctionCallbackInfo<v8::Value> &arg
|
|
|
4215
4158
|
if (image_asset !=
|
|
4216
4159
|
nullptr) {
|
|
4217
4160
|
|
|
4218
|
-
|
|
4219
4161
|
canvas_native_webgl_tex_image2d_image_asset(
|
|
4220
4162
|
target,
|
|
4221
4163
|
level,
|
|
@@ -4279,6 +4221,30 @@ WebGLRenderingContext::TexImage2D(const v8::FunctionCallbackInfo<v8::Value> &arg
|
|
|
4279
4221
|
}
|
|
4280
4222
|
return;
|
|
4281
4223
|
}
|
|
4224
|
+
case NativeType::ImageData: {
|
|
4225
|
+
auto image_data = ImageDataImpl::GetPointer(pixels.As<v8::Object>());
|
|
4226
|
+
if (image_data != nullptr) {
|
|
4227
|
+
auto width = canvas_native_image_data_get_width(image_data->GetImageData());
|
|
4228
|
+
auto height = canvas_native_image_data_get_height(image_data->GetImageData());
|
|
4229
|
+
auto buffer = canvas_native_image_data_get_data(image_data->GetImageData());
|
|
4230
|
+
auto size = canvas_native_u8_buffer_get_length(buffer);
|
|
4231
|
+
auto data = canvas_native_u8_buffer_get_bytes(buffer);
|
|
4232
|
+
canvas_native_webgl_tex_image2d(
|
|
4233
|
+
target,
|
|
4234
|
+
level,
|
|
4235
|
+
internalformat,
|
|
4236
|
+
width,
|
|
4237
|
+
height,
|
|
4238
|
+
format,
|
|
4239
|
+
type,
|
|
4240
|
+
GL_RGBA,
|
|
4241
|
+
data,
|
|
4242
|
+
size,
|
|
4243
|
+
ptr->GetState()
|
|
4244
|
+
);
|
|
4245
|
+
}
|
|
4246
|
+
|
|
4247
|
+
}
|
|
4282
4248
|
default:
|
|
4283
4249
|
break;
|
|
4284
4250
|
}
|
|
@@ -4348,8 +4314,7 @@ WebGLRenderingContext::TexImage2D(const v8::FunctionCallbackInfo<v8::Value> &arg
|
|
|
4348
4314
|
auto array = buf->Buffer();
|
|
4349
4315
|
auto offset = buf->ByteOffset();
|
|
4350
4316
|
auto size = array->ByteLength();
|
|
4351
|
-
auto
|
|
4352
|
-
auto data = static_cast<uint8_t *>((void *) data_ptr);
|
|
4317
|
+
auto data = static_cast<const uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
4353
4318
|
|
|
4354
4319
|
|
|
4355
4320
|
canvas_native_webgl_tex_image2d(
|
|
@@ -4538,6 +4503,30 @@ WebGLRenderingContext::TexSubImage2D(const v8::FunctionCallbackInfo<v8::Value> &
|
|
|
4538
4503
|
}
|
|
4539
4504
|
return;
|
|
4540
4505
|
}
|
|
4506
|
+
case NativeType::ImageData: {
|
|
4507
|
+
auto image_data = ImageDataImpl::GetPointer(pixels.As<v8::Object>());
|
|
4508
|
+
if (image_data != nullptr) {
|
|
4509
|
+
auto width = canvas_native_image_data_get_width(image_data->GetImageData());
|
|
4510
|
+
auto height = canvas_native_image_data_get_height(image_data->GetImageData());
|
|
4511
|
+
auto buffer = canvas_native_image_data_get_data(image_data->GetImageData());
|
|
4512
|
+
auto size = canvas_native_u8_buffer_get_length(buffer);
|
|
4513
|
+
auto data = canvas_native_u8_buffer_get_bytes(buffer);
|
|
4514
|
+
canvas_native_webgl_tex_sub_image2d(
|
|
4515
|
+
target,
|
|
4516
|
+
level,
|
|
4517
|
+
xoffset,
|
|
4518
|
+
yoffset,
|
|
4519
|
+
width,
|
|
4520
|
+
height,
|
|
4521
|
+
format,
|
|
4522
|
+
GL_RGBA,
|
|
4523
|
+
data,
|
|
4524
|
+
size,
|
|
4525
|
+
ptr->GetState()
|
|
4526
|
+
);
|
|
4527
|
+
}
|
|
4528
|
+
|
|
4529
|
+
}
|
|
4541
4530
|
default:
|
|
4542
4531
|
break;
|
|
4543
4532
|
}
|
|
@@ -4569,8 +4558,7 @@ WebGLRenderingContext::TexSubImage2D(const v8::FunctionCallbackInfo<v8::Value> &
|
|
|
4569
4558
|
auto array = buf->Buffer();
|
|
4570
4559
|
auto offset = buf->ByteOffset();
|
|
4571
4560
|
auto size = array->ByteLength();
|
|
4572
|
-
auto
|
|
4573
|
-
auto data = static_cast<uint8_t *>((void *) data_ptr);
|
|
4561
|
+
auto data = static_cast<const uint8_t *>(array->GetBackingStore()->Data()) + offset;
|
|
4574
4562
|
|
|
4575
4563
|
|
|
4576
4564
|
canvas_native_webgl_tex_sub_image2d(
|
|
@@ -4717,7 +4705,6 @@ WebGLRenderingContext::VertexAttrib1fv(const v8::FunctionCallbackInfo<v8::Value>
|
|
|
4717
4705
|
auto value = args[1];
|
|
4718
4706
|
if (value->IsFloat32Array()) {
|
|
4719
4707
|
auto buf = value.As<v8::Float32Array>();
|
|
4720
|
-
|
|
4721
4708
|
auto array = buf->Buffer();
|
|
4722
4709
|
auto offset = buf->ByteOffset();
|
|
4723
4710
|
auto size = buf->Length();
|
|
@@ -5705,10 +5692,8 @@ WebGLRenderingContext::UseProgram(const v8::FunctionCallbackInfo<v8::Value> &arg
|
|
|
5705
5692
|
return;
|
|
5706
5693
|
}
|
|
5707
5694
|
|
|
5708
|
-
auto isolate = args.GetIsolate();
|
|
5709
|
-
|
|
5710
5695
|
auto value = args[0];
|
|
5711
|
-
if (value->
|
|
5696
|
+
if (value->IsNullOrUndefined()) {
|
|
5712
5697
|
canvas_native_webgl_use_program(0,
|
|
5713
5698
|
ptr->GetState());
|
|
5714
5699
|
|
|
@@ -5735,8 +5720,6 @@ WebGLRenderingContext::ValidateProgram(const v8::FunctionCallbackInfo<v8::Value>
|
|
|
5735
5720
|
return;
|
|
5736
5721
|
}
|
|
5737
5722
|
|
|
5738
|
-
auto isolate = args.GetIsolate();
|
|
5739
|
-
|
|
5740
5723
|
auto value = args[0];
|
|
5741
5724
|
auto type = GetNativeType(value);
|
|
5742
5725
|
if (type == NativeType::WebGLProgram) {
|
|
@@ -6302,7 +6285,6 @@ WebGLRenderingContext::SetMethods(v8::Isolate *isolate, const v8::Local<v8::Obje
|
|
|
6302
6285
|
v8::Local<v8::Value>());
|
|
6303
6286
|
|
|
6304
6287
|
|
|
6305
|
-
|
|
6306
6288
|
tmpl->SetAccessor(ConvertToV8String(isolate, "continuousRenderMode"), GetContinuousRenderMode,
|
|
6307
6289
|
SetContinuousRenderMode);
|
|
6308
6290
|
|