@nativescript/canvas 2.0.0-webgpu.1 → 2.0.0-webgpu.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Canvas/common.d.ts +2 -16
- package/Canvas/common.js +1 -62
- package/Canvas/common.js.map +1 -1
- package/Canvas/index.android.d.ts +6 -7
- package/Canvas/index.android.js +87 -42
- package/Canvas/index.android.js.map +1 -1
- package/Canvas/index.d.ts +7 -8
- package/Canvas/index.ios.d.ts +3 -2
- package/Canvas/index.ios.js +87 -46
- package/Canvas/index.ios.js.map +1 -1
- package/Canvas2D/CanvasRenderingContext2D/index.js +71 -72
- package/Canvas2D/CanvasRenderingContext2D/index.js.map +1 -1
- package/Canvas2D/DOMMatrix/index.js +1 -1
- package/Canvas2D/DOMMatrix/index.js.map +1 -1
- package/Canvas2D/ImageData/index.js.map +1 -1
- package/Canvas2D/Path2D/index.js.map +1 -1
- package/Dom/Dom.js +8 -1
- package/Dom/Dom.js.map +1 -1
- package/Dom/Group.js.map +1 -1
- package/Dom/Image.d.ts +4 -1
- package/Dom/Image.js +16 -2
- package/Dom/Image.js.map +1 -1
- package/Dom/Paint.js.map +1 -1
- package/Dom/Text.js.map +1 -1
- package/Dom/shaders/LinearGradient.js.map +1 -1
- package/Dom/shaders/TwoPointConicalGradient.js.map +1 -1
- package/Dom/shapes/Atlas.js.map +1 -1
- package/Dom/shapes/Circle.js.map +1 -1
- package/Dom/shapes/Line.js.map +1 -1
- package/Dom/shapes/Oval.js.map +1 -1
- package/Dom/shapes/Path.js.map +1 -1
- package/Dom/shapes/Rect.js.map +1 -1
- package/Dom/shapes/RoundedRect.js.map +1 -1
- package/Dom/shapes/index.js.map +1 -1
- package/ImageAsset/index.d.ts +3 -1
- package/ImageAsset/index.js +38 -6
- package/ImageAsset/index.js.map +1 -1
- package/ImageBitmap/index.js +3 -3
- package/ImageBitmap/index.js.map +1 -1
- package/README.md +64 -3
- package/TextDecoder/index.js +3 -3
- package/TextDecoder/index.js.map +1 -1
- package/TextEncoder/index.js +3 -3
- package/TextEncoder/index.js.map +1 -1
- package/WebGL/WebGLExtensions/index.js +5 -5
- package/WebGL/WebGLExtensions/index.js.map +1 -1
- package/WebGL/WebGLRenderingContext/common.js.map +1 -1
- package/WebGL/WebGLRenderingContext/index.js.map +1 -1
- package/WebGL2/WebGL2RenderingContext/index.js.map +1 -1
- package/WebGPU/Constants.js.map +1 -1
- package/WebGPU/GPU.js.map +1 -1
- package/WebGPU/GPUAdapter.js.map +1 -1
- package/WebGPU/GPUAdapterInfo.js.map +1 -1
- package/WebGPU/GPUBindGroup.js.map +1 -1
- package/WebGPU/GPUBindGroupLayout.js.map +1 -1
- package/WebGPU/GPUBuffer.js +5 -1
- package/WebGPU/GPUBuffer.js.map +1 -1
- package/WebGPU/GPUCanvasContext.js.map +1 -1
- package/WebGPU/GPUCommandBuffer.js.map +1 -1
- package/WebGPU/GPUCommandEncoder.js.map +1 -1
- package/WebGPU/GPUComputePassEncoder.js.map +1 -1
- package/WebGPU/GPUComputePipeline.js.map +1 -1
- package/WebGPU/GPUDevice.d.ts +2 -2
- package/WebGPU/GPUDevice.js +4 -3
- package/WebGPU/GPUDevice.js.map +1 -1
- package/WebGPU/GPUExternalTexture.js.map +1 -1
- package/WebGPU/GPUPipelineLayout.js.map +1 -1
- package/WebGPU/GPUQuerySet.js.map +1 -1
- package/WebGPU/GPUQueue.js.map +1 -1
- package/WebGPU/GPURenderBundle.js.map +1 -1
- package/WebGPU/GPURenderBundleEncoder.js.map +1 -1
- package/WebGPU/GPURenderPassEncoder.js +2 -2
- package/WebGPU/GPURenderPassEncoder.js.map +1 -1
- package/WebGPU/GPURenderPipeline.js.map +1 -1
- package/WebGPU/GPUSampler.js.map +1 -1
- package/WebGPU/GPUShaderModule.js.map +1 -1
- package/WebGPU/GPUTexture.js.map +1 -1
- package/WebGPU/GPUTextureView.js.map +1 -1
- package/WebGPU/Types.d.ts +27 -27
- package/WebGPU/Utils.d.ts +1 -1
- package/WebGPU/Utils.js.map +1 -1
- package/angular/{esm2020 → esm2022}/index.mjs +5 -5
- package/angular/{fesm2015 → fesm2022}/nativescript-canvas-angular.mjs +4 -4
- package/angular/{fesm2020 → fesm2022}/nativescript-canvas-angular.mjs.map +1 -1
- package/angular/package.json +4 -10
- package/helpers.js.map +1 -1
- package/package.json +2 -2
- package/platforms/android/canvas-release.aar +0 -0
- package/platforms/ios/CanvasNative.xcframework/Info.plist +5 -5
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/CanvasNative-Swift.h +21 -9
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_native.h +2049 -2061
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.abi.json +752 -108
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.private.swiftinterface +35 -9
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftinterface +35 -9
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/NSCCanvas.nib +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/aarch64/CanvasNative.yml +644 -602
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/CanvasNative-Swift.h +42 -18
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_native.h +2049 -2061
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/Project/x86_64-apple-ios-simulator.swiftsourceinfo +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.abi.json +752 -108
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +35 -9
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftinterface +35 -9
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.abi.json +752 -108
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +35 -9
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftdoc +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +35 -9
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/NSCCanvas.nib +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/_CodeSignature/CodeResources +24 -24
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/DWARF/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/aarch64/CanvasNative.yml +646 -604
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/x86_64/CanvasNative.yml +684 -638
- package/platforms/ios/src/NSOperationQueueWrapper.h +2 -0
- package/platforms/ios/src/cpp/AsyncCallback.h +206 -0
- package/platforms/ios/src/cpp/CanvasJSIModule.cpp +13 -13
- package/platforms/ios/src/cpp/Helpers.h +2 -164
- package/platforms/ios/src/cpp/ImageAssetImpl.cpp +13 -13
- package/platforms/ios/src/cpp/ImageBitmapImpl.cpp +1 -1
- package/platforms/ios/src/cpp/ImageBitmapImpl.h +2 -1
- package/platforms/ios/src/cpp/JSIReadFileCallback.h +4 -4
- package/platforms/ios/src/cpp/NativeType.h +87 -0
- package/platforms/ios/src/cpp/ObjectWrapperImpl.h +50 -0
- package/platforms/ios/src/cpp/OneByteStringResource.cpp +2 -2
- package/platforms/ios/src/cpp/PromiseCallback.h +198 -0
- package/platforms/ios/src/cpp/RafImpl.h +2 -2
- package/platforms/ios/src/cpp/TextDecoderImpl.cpp +0 -6
- package/platforms/ios/src/cpp/TextDecoderImpl.h +3 -3
- package/platforms/ios/src/cpp/TextEncoderImpl.cpp +1 -1
- package/platforms/ios/src/cpp/TextEncoderImpl.h +3 -3
- package/platforms/ios/src/cpp/canvas2d/CanvasGradient.h +8 -7
- package/platforms/ios/src/cpp/canvas2d/CanvasPattern.cpp +1 -1
- package/platforms/ios/src/cpp/canvas2d/CanvasPattern.h +3 -3
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.cpp +145 -75
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.h +74 -20
- package/platforms/ios/src/cpp/canvas2d/ImageDataImpl.cpp +5 -6
- package/platforms/ios/src/cpp/canvas2d/ImageDataImpl.h +4 -4
- package/platforms/ios/src/cpp/canvas2d/MatrixImpl.cpp +10 -10
- package/platforms/ios/src/cpp/canvas2d/MatrixImpl.h +2 -2
- package/platforms/ios/src/cpp/canvas2d/Path2D.cpp +6 -3
- package/platforms/ios/src/cpp/canvas2d/Path2D.h +2 -2
- package/platforms/ios/src/cpp/canvas2d/TextMetricsImpl.h +3 -3
- package/platforms/ios/src/cpp/webgl/WebGLActiveInfoImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/WebGLBuffer.h +1 -1
- package/platforms/ios/src/cpp/webgl/WebGLFramebuffer.h +1 -1
- package/platforms/ios/src/cpp/webgl/WebGLProgram.h +3 -3
- package/platforms/ios/src/cpp/webgl/WebGLRenderbuffer.h +3 -3
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.cpp +8 -8
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.h +1 -1
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContextBase.cpp +1 -1
- package/platforms/ios/src/cpp/webgl/WebGLShader.h +1 -1
- package/platforms/ios/src/cpp/webgl/WebGLShaderPrecisionFormatImpl.h +5 -5
- package/platforms/ios/src/cpp/webgl/WebGLTexture.h +3 -2
- package/platforms/ios/src/cpp/webgl/WebGLUniformLocation.h +2 -2
- package/platforms/ios/src/cpp/webgl/extensions/ANGLE_instanced_arraysImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/EXT_blend_minmaxImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/EXT_color_buffer_half_floatImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/EXT_disjoint_timer_queryImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/EXT_sRGBImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/EXT_shader_texture_lodImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/EXT_texture_filter_anisotropicImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/OES_element_index_uintImpl.h +2 -2
- package/platforms/ios/src/cpp/webgl/extensions/OES_fbo_render_mipmap.h +5 -5
- package/platforms/ios/src/cpp/webgl/extensions/OES_standard_derivativesImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/OES_texture_floatImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/OES_texture_float_linearImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/OES_texture_half_floatImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/OES_texture_half_float_linearImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/OES_vertex_array_objectImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_color_buffer_floatImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_atcImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etc1Impl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_etcImpl.h +2 -2
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_pvrtcImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tcImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_compressed_texture_s3tc_srgbImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_depth_textureImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_draw_buffersImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl/extensions/WEBGL_lose_contextImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.cpp +722 -722
- package/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.h +1 -1
- package/platforms/ios/src/cpp/webgl2/WebGLQuery.h +1 -1
- package/platforms/ios/src/cpp/webgl2/WebGLSampler.h +1 -1
- package/platforms/ios/src/cpp/webgl2/WebGLSyncImpl.h +1 -1
- package/platforms/ios/src/cpp/webgl2/WebGLTransformFeedback.h +1 -1
- package/platforms/ios/src/cpp/webgl2/WebGLVertexArrayObject.h +2 -2
- package/platforms/ios/src/cpp/webgpu/GPUAdapterImpl.cpp +124 -58
- package/platforms/ios/src/cpp/webgpu/GPUAdapterImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUAdapterInfoImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUAdapterInfoImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUBindGroupLayoutImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.cpp +44 -30
- package/platforms/ios/src/cpp/webgpu/GPUBufferImpl.h +4 -4
- package/platforms/ios/src/cpp/webgpu/GPUCanvasContextImpl.cpp +11 -11
- package/platforms/ios/src/cpp/webgpu/GPUCanvasContextImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUCommandBufferImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.cpp +30 -31
- package/platforms/ios/src/cpp/webgpu/GPUCommandEncoderImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUComputePassEncoderImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUComputePipelineImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.cpp +99 -73
- package/platforms/ios/src/cpp/webgpu/GPUDeviceImpl.h +2 -2
- package/platforms/ios/src/cpp/webgpu/GPUImpl.cpp +54 -41
- package/platforms/ios/src/cpp/webgpu/GPUImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUPipelineLayoutImpl.h +5 -4
- package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUQuerySetImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.cpp +38 -23
- package/platforms/ios/src/cpp/webgpu/GPUQueueImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleEncoderImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPURenderBundleImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.cpp +4 -3
- package/platforms/ios/src/cpp/webgpu/GPURenderPassEncoderImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPURenderPipelineImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUSamplerImpl.h +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUShaderModuleImpl.h +2 -2
- package/platforms/ios/src/cpp/webgpu/GPUSupportedLimitsImpl.cpp +2 -2
- package/platforms/ios/src/cpp/webgpu/GPUSupportedLimitsImpl.h +2 -2
- package/platforms/ios/src/cpp/webgpu/GPUTextureImpl.h +4 -4
- package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.cpp +1 -1
- package/platforms/ios/src/cpp/webgpu/GPUTextureViewImpl.h +2 -2
- package/react/index.d.ts +1 -1
- package/utils.js.map +1 -1
- package/angular/fesm2015/nativescript-canvas-angular.mjs.map +0 -1
- package/angular/fesm2020/nativescript-canvas-angular.mjs +0 -24
- package/typings/objc!CanvasNative.d.ts +0 -2038
- package/typings/objc!CanvasNative.js +0 -1
- package/typings/objc!CanvasNative.js.map +0 -1
- /package/angular/{esm2020 → esm2022}/nativescript-canvas-angular.mjs +0 -0
|
@@ -255,7 +255,8 @@ void CanvasRenderingContext2DImpl::Init(v8::Local<v8::Object> canvasModule, v8::
|
|
|
255
255
|
auto context = isolate->GetCurrentContext();
|
|
256
256
|
auto func = ctor->GetFunction(context).ToLocalChecked();
|
|
257
257
|
|
|
258
|
-
canvasModule->Set(context, ConvertToV8String(isolate, "CanvasRenderingContext2D"),
|
|
258
|
+
canvasModule->Set(context, ConvertToV8String(isolate, "CanvasRenderingContext2D"),
|
|
259
|
+
func).FromJust();
|
|
259
260
|
}
|
|
260
261
|
|
|
261
262
|
CanvasRenderingContext2DImpl *
|
|
@@ -1206,10 +1207,6 @@ void CanvasRenderingContext2DImpl::GetFillStyle(v8::Local<v8::String> property,
|
|
|
1206
1207
|
info.GetReturnValue().Set(style);
|
|
1207
1208
|
break;
|
|
1208
1209
|
}
|
|
1209
|
-
case PaintStyleType::PaintStyleTypeNone: {
|
|
1210
|
-
info.GetReturnValue().SetUndefined();
|
|
1211
|
-
break;
|
|
1212
|
-
}
|
|
1213
1210
|
}
|
|
1214
1211
|
|
|
1215
1212
|
}
|
|
@@ -1289,10 +1286,6 @@ void CanvasRenderingContext2DImpl::GetStrokeStyle(v8::Local<v8::String> property
|
|
|
1289
1286
|
info.GetReturnValue().Set(style);
|
|
1290
1287
|
break;
|
|
1291
1288
|
}
|
|
1292
|
-
case PaintStyleType::PaintStyleTypeNone: {
|
|
1293
|
-
info.GetReturnValue().SetUndefined();
|
|
1294
|
-
break;
|
|
1295
|
-
}
|
|
1296
1289
|
}
|
|
1297
1290
|
|
|
1298
1291
|
}
|
|
@@ -1540,13 +1533,13 @@ void CanvasRenderingContext2DImpl::Clip(const v8::FunctionCallbackInfo<v8::Value
|
|
|
1540
1533
|
auto count = args.Length();
|
|
1541
1534
|
if (count == 0) {
|
|
1542
1535
|
canvas_native_context_clip_rule(
|
|
1543
|
-
ptr->GetContext(),
|
|
1536
|
+
ptr->GetContext(), CanvasFillRuleNonZero);
|
|
1544
1537
|
} else if (count == 1 && args[0]->IsUint32()) {
|
|
1545
1538
|
uint32_t val = 0;
|
|
1546
1539
|
|
|
1547
1540
|
if (args[0]->Uint32Value(context).To(&val)) {
|
|
1548
1541
|
canvas_native_context_clip_rule(
|
|
1549
|
-
ptr->GetContext(), val);
|
|
1542
|
+
ptr->GetContext(), val == 0 ? CanvasFillRuleNonZero : CanvasFillRuleEvenOdd);
|
|
1550
1543
|
}
|
|
1551
1544
|
} else if (count == 1 && args[0]->IsObject()) {
|
|
1552
1545
|
auto type = GetNativeType(args[0].As<v8::Object>());
|
|
@@ -1555,7 +1548,7 @@ void CanvasRenderingContext2DImpl::Clip(const v8::FunctionCallbackInfo<v8::Value
|
|
|
1555
1548
|
|
|
1556
1549
|
if (object != nullptr) {
|
|
1557
1550
|
canvas_native_context_clip(
|
|
1558
|
-
ptr->GetContext(), object->GetPath(),
|
|
1551
|
+
ptr->GetContext(), object->GetPath(), CanvasFillRuleNonZero);
|
|
1559
1552
|
}
|
|
1560
1553
|
}
|
|
1561
1554
|
} else if (count >= 2 && args[0]->IsObject() && args[1]->IsUint32()) {
|
|
@@ -1566,7 +1559,8 @@ void CanvasRenderingContext2DImpl::Clip(const v8::FunctionCallbackInfo<v8::Value
|
|
|
1566
1559
|
|
|
1567
1560
|
if (args[1]->Uint32Value(context).To(&rule)) {
|
|
1568
1561
|
canvas_native_context_clip(
|
|
1569
|
-
ptr->GetContext(), object->GetPath(),
|
|
1562
|
+
ptr->GetContext(), object->GetPath(),
|
|
1563
|
+
rule == 0 ? CanvasFillRuleNonZero : CanvasFillRuleEvenOdd);
|
|
1570
1564
|
}
|
|
1571
1565
|
}
|
|
1572
1566
|
}
|
|
@@ -1615,7 +1609,7 @@ CanvasRenderingContext2DImpl::CreateImageData(const v8::FunctionCallbackInfo<v8:
|
|
|
1615
1609
|
|
|
1616
1610
|
ret->SetAlignedPointerInInternalField(0, data);
|
|
1617
1611
|
|
|
1618
|
-
SetNativeType(
|
|
1612
|
+
SetNativeType(data, NativeType::ImageData);
|
|
1619
1613
|
|
|
1620
1614
|
args.GetReturnValue().Set(ret);
|
|
1621
1615
|
|
|
@@ -1635,7 +1629,7 @@ CanvasRenderingContext2DImpl::CreateImageData(const v8::FunctionCallbackInfo<v8:
|
|
|
1635
1629
|
|
|
1636
1630
|
ret->SetAlignedPointerInInternalField(0, data);
|
|
1637
1631
|
|
|
1638
|
-
SetNativeType(
|
|
1632
|
+
SetNativeType(data, NativeType::ImageData);
|
|
1639
1633
|
|
|
1640
1634
|
args.GetReturnValue().Set(ret);
|
|
1641
1635
|
}
|
|
@@ -1661,18 +1655,36 @@ CanvasRenderingContext2DImpl::CreatePattern(const v8::FunctionCallbackInfo<v8::V
|
|
|
1661
1655
|
auto image_asset = ImageAssetImpl::GetPointer(value.As<v8::Object>());
|
|
1662
1656
|
if (image_asset != nullptr) {
|
|
1663
1657
|
auto rep = ConvertFromV8String(isolate, args[1]);
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1658
|
+
|
|
1659
|
+
PaintStyle *style = nullptr;
|
|
1660
|
+
if (rep == "no-repeat") {
|
|
1661
|
+
style = canvas_native_context_create_pattern_asset(
|
|
1662
|
+
ptr->GetContext(),
|
|
1663
|
+
image_asset->GetImageAsset(), CanvasRepetitionNoRepeat);
|
|
1664
|
+
} else if (rep == "repeat") {
|
|
1665
|
+
style = canvas_native_context_create_pattern_asset(
|
|
1666
|
+
ptr->GetContext(),
|
|
1667
|
+
image_asset->GetImageAsset(), CanvasRepetitionRepeat);
|
|
1668
|
+
} else if (rep == "repeat-x") {
|
|
1669
|
+
style = canvas_native_context_create_pattern_asset(
|
|
1670
|
+
ptr->GetContext(),
|
|
1671
|
+
image_asset->GetImageAsset(), CanvasRepetitionRepeatX);
|
|
1672
|
+
} else if (rep == "repeat-y") {
|
|
1673
|
+
style = canvas_native_context_create_pattern_asset(
|
|
1674
|
+
ptr->GetContext(),
|
|
1675
|
+
image_asset->GetImageAsset(), CanvasRepetitionRepeatY);
|
|
1672
1676
|
} else {
|
|
1673
|
-
|
|
1674
|
-
args.GetReturnValue().
|
|
1677
|
+
// todo
|
|
1678
|
+
args.GetReturnValue().SetUndefined();
|
|
1679
|
+
return;
|
|
1680
|
+
}
|
|
1681
|
+
if (style == nullptr) {
|
|
1682
|
+
args.GetReturnValue().SetNull();
|
|
1683
|
+
return;
|
|
1675
1684
|
}
|
|
1685
|
+
|
|
1686
|
+
auto data = CanvasPattern::NewInstance(isolate, new CanvasPattern(style));
|
|
1687
|
+
args.GetReturnValue().Set(data);
|
|
1676
1688
|
}
|
|
1677
1689
|
return;
|
|
1678
1690
|
}
|
|
@@ -1680,18 +1692,37 @@ CanvasRenderingContext2DImpl::CreatePattern(const v8::FunctionCallbackInfo<v8::V
|
|
|
1680
1692
|
auto image_bitmap = ImageBitmapImpl::GetPointer(value.As<v8::Object>());
|
|
1681
1693
|
if (image_bitmap != nullptr) {
|
|
1682
1694
|
auto rep = ConvertFromV8String(isolate, args[1]);
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1695
|
+
PaintStyle *style = nullptr;
|
|
1696
|
+
|
|
1697
|
+
if (rep == "no-repeat") {
|
|
1698
|
+
style = canvas_native_context_create_pattern_asset(
|
|
1699
|
+
ptr->GetContext(),
|
|
1700
|
+
image_bitmap->GetImageAsset(), CanvasRepetitionNoRepeat);
|
|
1701
|
+
} else if (rep == "repeat") {
|
|
1702
|
+
style = canvas_native_context_create_pattern_asset(
|
|
1703
|
+
ptr->GetContext(),
|
|
1704
|
+
image_bitmap->GetImageAsset(), CanvasRepetitionRepeat);
|
|
1705
|
+
} else if (rep == "repeat-x") {
|
|
1706
|
+
style = canvas_native_context_create_pattern_asset(
|
|
1707
|
+
ptr->GetContext(),
|
|
1708
|
+
image_bitmap->GetImageAsset(), CanvasRepetitionRepeatX);
|
|
1709
|
+
} else if (rep == "repeat-y") {
|
|
1710
|
+
style = canvas_native_context_create_pattern_asset(
|
|
1711
|
+
ptr->GetContext(),
|
|
1712
|
+
image_bitmap->GetImageAsset(), CanvasRepetitionRepeatY);
|
|
1691
1713
|
} else {
|
|
1692
|
-
|
|
1693
|
-
args.GetReturnValue().
|
|
1714
|
+
// todo
|
|
1715
|
+
args.GetReturnValue().SetUndefined();
|
|
1716
|
+
return;
|
|
1694
1717
|
}
|
|
1718
|
+
if (style == nullptr) {
|
|
1719
|
+
args.GetReturnValue().SetNull();
|
|
1720
|
+
return;
|
|
1721
|
+
}
|
|
1722
|
+
|
|
1723
|
+
|
|
1724
|
+
auto data = CanvasPattern::NewInstance(isolate, new CanvasPattern(style));
|
|
1725
|
+
args.GetReturnValue().Set(data);
|
|
1695
1726
|
}
|
|
1696
1727
|
return;
|
|
1697
1728
|
}
|
|
@@ -1700,18 +1731,36 @@ CanvasRenderingContext2DImpl::CreatePattern(const v8::FunctionCallbackInfo<v8::V
|
|
|
1700
1731
|
value.As<v8::Object>());
|
|
1701
1732
|
if (canvas_2d != nullptr) {
|
|
1702
1733
|
auto rep = ConvertFromV8String(isolate, args[1]);
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1734
|
+
PaintStyle *style = nullptr;
|
|
1735
|
+
|
|
1736
|
+
if (rep == "no-repeat") {
|
|
1737
|
+
style = canvas_native_context_create_pattern_canvas2d(
|
|
1738
|
+
canvas_2d->GetContext(),
|
|
1739
|
+
ptr->GetContext(), CanvasRepetitionNoRepeat);
|
|
1740
|
+
} else if (rep == "repeat") {
|
|
1741
|
+
style = canvas_native_context_create_pattern_canvas2d(
|
|
1742
|
+
canvas_2d->GetContext(),
|
|
1743
|
+
ptr->GetContext(), CanvasRepetitionRepeat);
|
|
1744
|
+
} else if (rep == "repeat-x") {
|
|
1745
|
+
style = canvas_native_context_create_pattern_canvas2d(
|
|
1746
|
+
canvas_2d->GetContext(),
|
|
1747
|
+
ptr->GetContext(), CanvasRepetitionRepeatX);
|
|
1748
|
+
} else if (rep == "repeat-y") {
|
|
1749
|
+
style = canvas_native_context_create_pattern_canvas2d(
|
|
1750
|
+
canvas_2d->GetContext(),
|
|
1751
|
+
ptr->GetContext(), CanvasRepetitionRepeatY);
|
|
1711
1752
|
} else {
|
|
1712
|
-
|
|
1713
|
-
args.GetReturnValue().
|
|
1753
|
+
// todo
|
|
1754
|
+
args.GetReturnValue().SetUndefined();
|
|
1755
|
+
return;
|
|
1756
|
+
}
|
|
1757
|
+
if (style == nullptr) {
|
|
1758
|
+
args.GetReturnValue().SetNull();
|
|
1759
|
+
return;
|
|
1714
1760
|
}
|
|
1761
|
+
|
|
1762
|
+
auto data = CanvasPattern::NewInstance(isolate, new CanvasPattern(style));
|
|
1763
|
+
args.GetReturnValue().Set(data);
|
|
1715
1764
|
}
|
|
1716
1765
|
return;
|
|
1717
1766
|
}
|
|
@@ -1719,21 +1768,40 @@ CanvasRenderingContext2DImpl::CreatePattern(const v8::FunctionCallbackInfo<v8::V
|
|
|
1719
1768
|
auto webgl = WebGLRenderingContextBase::GetPointer(value.As<v8::Object>());
|
|
1720
1769
|
if (webgl != nullptr) {
|
|
1721
1770
|
auto rep = ConvertFromV8String(isolate, args[1]);
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1771
|
+
|
|
1772
|
+
PaintStyle *style = nullptr;
|
|
1773
|
+
|
|
1774
|
+
if (rep == "no-repeat") {
|
|
1775
|
+
style = canvas_native_context_create_pattern_webgl(
|
|
1776
|
+
webgl->GetState(),
|
|
1777
|
+
ptr->GetContext(), CanvasRepetitionNoRepeat);
|
|
1778
|
+
} else if (rep == "repeat") {
|
|
1779
|
+
style = canvas_native_context_create_pattern_webgl(
|
|
1780
|
+
webgl->GetState(),
|
|
1781
|
+
ptr->GetContext(), CanvasRepetitionRepeat);
|
|
1782
|
+
} else if (rep == "repeat-x") {
|
|
1783
|
+
style = canvas_native_context_create_pattern_webgl(
|
|
1784
|
+
webgl->GetState(),
|
|
1785
|
+
ptr->GetContext(), CanvasRepetitionRepeatX);
|
|
1786
|
+
} else if (rep == "repeat-y") {
|
|
1787
|
+
style = canvas_native_context_create_pattern_webgl(
|
|
1788
|
+
webgl->GetState(),
|
|
1789
|
+
ptr->GetContext(), CanvasRepetitionRepeatY);
|
|
1731
1790
|
} else {
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1791
|
+
// todo
|
|
1792
|
+
args.GetReturnValue().SetUndefined();
|
|
1793
|
+
return;
|
|
1794
|
+
}
|
|
1795
|
+
|
|
1796
|
+
if (style == nullptr) {
|
|
1797
|
+
args.GetReturnValue().SetNull();
|
|
1735
1798
|
return;
|
|
1736
1799
|
}
|
|
1800
|
+
|
|
1801
|
+
auto ret = CanvasPattern::NewInstance(isolate, new CanvasPattern(
|
|
1802
|
+
style));
|
|
1803
|
+
args.GetReturnValue().Set(ret);
|
|
1804
|
+
return;
|
|
1737
1805
|
}
|
|
1738
1806
|
return;
|
|
1739
1807
|
}
|
|
@@ -1831,16 +1899,16 @@ CanvasRenderingContext2DImpl::__CreatePatternWithNative(
|
|
|
1831
1899
|
auto pointer = args[0]->ToBigInt(context).ToLocalChecked();
|
|
1832
1900
|
|
|
1833
1901
|
auto pattern = canvas_native_pattern_from_ptr(pointer->Int64Value());
|
|
1834
|
-
auto type = canvas_native_context_get_style_type(pattern);
|
|
1835
|
-
if (type == PaintStyleType::PaintStyleTypeNone) {
|
|
1836
|
-
args.GetReturnValue().SetUndefined();
|
|
1837
|
-
canvas_native_paint_style_destroy(pattern);
|
|
1838
|
-
} else {
|
|
1839
|
-
auto data = CanvasPattern::NewInstance(isolate, new CanvasPattern(pattern));
|
|
1840
1902
|
|
|
1841
|
-
|
|
1903
|
+
if (pattern == nullptr) {
|
|
1904
|
+
args.GetReturnValue().SetNull();
|
|
1905
|
+
return;
|
|
1842
1906
|
}
|
|
1843
1907
|
|
|
1908
|
+
auto data = CanvasPattern::NewInstance(isolate, new CanvasPattern(pattern));
|
|
1909
|
+
|
|
1910
|
+
args.GetReturnValue().Set(data);
|
|
1911
|
+
|
|
1844
1912
|
}
|
|
1845
1913
|
|
|
1846
1914
|
void
|
|
@@ -2282,7 +2350,8 @@ CanvasRenderingContext2DImpl::Fill(const v8::FunctionCallbackInfo<v8::Value> &ar
|
|
|
2282
2350
|
auto rule = args[1]->Uint32Value(context).ToChecked();
|
|
2283
2351
|
canvas_native_context_fill_with_path(
|
|
2284
2352
|
ptr->GetContext(),
|
|
2285
|
-
object->GetPath(),
|
|
2353
|
+
object->GetPath(),
|
|
2354
|
+
rule == 0 ? CanvasFillRuleNonZero : CanvasFillRuleEvenOdd);
|
|
2286
2355
|
ptr->UpdateInvalidateState();
|
|
2287
2356
|
}
|
|
2288
2357
|
}
|
|
@@ -2291,7 +2360,7 @@ CanvasRenderingContext2DImpl::Fill(const v8::FunctionCallbackInfo<v8::Value> &ar
|
|
|
2291
2360
|
auto rule = value->Uint32Value(context).ToChecked();
|
|
2292
2361
|
canvas_native_context_fill(
|
|
2293
2362
|
ptr->GetContext(),
|
|
2294
|
-
rule);
|
|
2363
|
+
rule == 0 ? CanvasFillRuleNonZero : CanvasFillRuleEvenOdd);
|
|
2295
2364
|
ptr->UpdateInvalidateState();
|
|
2296
2365
|
} else if (value->IsObject()) {
|
|
2297
2366
|
auto type = GetNativeType(value.As<v8::Object>());
|
|
@@ -2300,13 +2369,13 @@ CanvasRenderingContext2DImpl::Fill(const v8::FunctionCallbackInfo<v8::Value> &ar
|
|
|
2300
2369
|
|
|
2301
2370
|
canvas_native_context_fill_with_path(
|
|
2302
2371
|
ptr->GetContext(),
|
|
2303
|
-
object->GetPath(),
|
|
2372
|
+
object->GetPath(), CanvasFillRuleNonZero);
|
|
2304
2373
|
ptr->UpdateInvalidateState();
|
|
2305
2374
|
}
|
|
2306
2375
|
}
|
|
2307
2376
|
} else {
|
|
2308
2377
|
canvas_native_context_fill(
|
|
2309
|
-
ptr->GetContext(),
|
|
2378
|
+
ptr->GetContext(), CanvasFillRuleNonZero);
|
|
2310
2379
|
ptr->UpdateInvalidateState();
|
|
2311
2380
|
}
|
|
2312
2381
|
}
|
|
@@ -2406,7 +2475,7 @@ CanvasRenderingContext2DImpl::GetImageData(const v8::FunctionCallbackInfo<v8::Va
|
|
|
2406
2475
|
|
|
2407
2476
|
ret->SetAlignedPointerInInternalField(0, data);
|
|
2408
2477
|
|
|
2409
|
-
SetNativeType(
|
|
2478
|
+
SetNativeType(data, NativeType::ImageData);
|
|
2410
2479
|
|
|
2411
2480
|
args.GetReturnValue().Set(ret);
|
|
2412
2481
|
return;
|
|
@@ -2457,7 +2526,7 @@ CanvasRenderingContext2DImpl::IsPointInPath(const v8::FunctionCallbackInfo<v8::V
|
|
|
2457
2526
|
auto x = static_cast<float>(args[0]->NumberValue(context).ToChecked());
|
|
2458
2527
|
auto y = static_cast<float>(args[1]->NumberValue(context).ToChecked());
|
|
2459
2528
|
auto ret = canvas_native_context_is_point_in_path(
|
|
2460
|
-
ptr->GetContext(), x, y,
|
|
2529
|
+
ptr->GetContext(), x, y, CanvasFillRuleNonZero);
|
|
2461
2530
|
args.GetReturnValue().Set(ret);
|
|
2462
2531
|
return;
|
|
2463
2532
|
} else if (count == 3 &&
|
|
@@ -2466,7 +2535,7 @@ CanvasRenderingContext2DImpl::IsPointInPath(const v8::FunctionCallbackInfo<v8::V
|
|
|
2466
2535
|
auto y = static_cast<float>(args[1]->NumberValue(context).ToChecked());
|
|
2467
2536
|
auto rule = args[2]->Uint32Value(context).ToChecked();
|
|
2468
2537
|
bool ret = canvas_native_context_is_point_in_path(
|
|
2469
|
-
ptr->GetContext(), x, y, rule);
|
|
2538
|
+
ptr->GetContext(), x, y, rule == 0 ? CanvasFillRuleNonZero : CanvasFillRuleEvenOdd);
|
|
2470
2539
|
args.GetReturnValue().Set(ret);
|
|
2471
2540
|
return;
|
|
2472
2541
|
} else if (count == 4 &&
|
|
@@ -2486,7 +2555,8 @@ CanvasRenderingContext2DImpl::IsPointInPath(const v8::FunctionCallbackInfo<v8::V
|
|
|
2486
2555
|
|
|
2487
2556
|
bool ret = canvas_native_context_is_point_in_path_with_path(
|
|
2488
2557
|
ptr->GetContext(),
|
|
2489
|
-
path->GetPath(), x, y,
|
|
2558
|
+
path->GetPath(), x, y,
|
|
2559
|
+
rule == 0 ? CanvasFillRuleNonZero : CanvasFillRuleEvenOdd);
|
|
2490
2560
|
|
|
2491
2561
|
args.GetReturnValue().Set(ret);
|
|
2492
2562
|
return;
|
|
@@ -2578,7 +2648,7 @@ CanvasRenderingContext2DImpl::MeasureText(const v8::FunctionCallbackInfo<v8::Val
|
|
|
2578
2648
|
|
|
2579
2649
|
data->BindFinalizer(isolate, ret);
|
|
2580
2650
|
|
|
2581
|
-
SetNativeType(
|
|
2651
|
+
SetNativeType(data, NativeType::TextMetrics);
|
|
2582
2652
|
|
|
2583
2653
|
args.GetReturnValue().Set(ret);
|
|
2584
2654
|
|
|
@@ -2887,7 +2957,7 @@ CanvasRenderingContext2DImpl::GetTransform(const v8::FunctionCallbackInfo<v8::Va
|
|
|
2887
2957
|
|
|
2888
2958
|
ret->SetAlignedPointerInInternalField(0, object);
|
|
2889
2959
|
|
|
2890
|
-
SetNativeType(
|
|
2960
|
+
SetNativeType(object, NativeType::Matrix);
|
|
2891
2961
|
|
|
2892
2962
|
object->BindFinalizer(isolate, ret);
|
|
2893
2963
|
|
|
@@ -3061,7 +3131,7 @@ CanvasRenderingContext2DImpl::~CanvasRenderingContext2DImpl() {
|
|
|
3061
3131
|
canvas_native_raf_stop(raf->GetRaf());
|
|
3062
3132
|
}
|
|
3063
3133
|
|
|
3064
|
-
|
|
3134
|
+
canvas_native_context_release(this->GetContext());
|
|
3065
3135
|
this->context_ = nullptr;
|
|
3066
3136
|
}
|
|
3067
3137
|
|
|
@@ -171,7 +171,7 @@ public:
|
|
|
171
171
|
v8::EscapableHandleScope scope(isolate);
|
|
172
172
|
auto object = CanvasRenderingContext2DImpl::GetCtor(isolate)->GetFunction(
|
|
173
173
|
context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
|
|
174
|
-
SetNativeType(
|
|
174
|
+
SetNativeType(renderingContext, NativeType::CanvasRenderingContext2D);
|
|
175
175
|
object->SetAlignedPointerInInternalField(0, renderingContext);
|
|
176
176
|
renderingContext->BindFinalizer(isolate, object);
|
|
177
177
|
return scope.Escape(object);
|
|
@@ -503,9 +503,12 @@ public:
|
|
|
503
503
|
|
|
504
504
|
switch (rule) {
|
|
505
505
|
case 0:
|
|
506
|
+
canvas_native_context_clip_rule(
|
|
507
|
+
ptr->GetContext(), CanvasFillRuleNonZero);
|
|
508
|
+
break;
|
|
506
509
|
case 1:
|
|
507
510
|
canvas_native_context_clip_rule(
|
|
508
|
-
ptr->GetContext(),
|
|
511
|
+
ptr->GetContext(), CanvasFillRuleEvenOdd);
|
|
509
512
|
break;
|
|
510
513
|
default:
|
|
511
514
|
break;
|
|
@@ -521,7 +524,7 @@ public:
|
|
|
521
524
|
if (GetNativeType(path_obj) == NativeType::Path2D) {
|
|
522
525
|
auto path = Path2D::GetPointer(path_obj);
|
|
523
526
|
canvas_native_context_clip(
|
|
524
|
-
ptr->GetContext(), path->GetPath(),
|
|
527
|
+
ptr->GetContext(), path->GetPath(), CanvasFillRuleNonZero);
|
|
525
528
|
}
|
|
526
529
|
|
|
527
530
|
|
|
@@ -536,8 +539,18 @@ public:
|
|
|
536
539
|
|
|
537
540
|
if (GetNativeType(path_obj) == NativeType::Path2D) {
|
|
538
541
|
auto path = Path2D::GetPointer(path_obj);
|
|
539
|
-
|
|
540
|
-
|
|
542
|
+
switch (rule) {
|
|
543
|
+
case 0:
|
|
544
|
+
canvas_native_context_clip(
|
|
545
|
+
ptr->GetContext(), path->GetPath(), CanvasFillRuleNonZero);
|
|
546
|
+
break;
|
|
547
|
+
case 1:
|
|
548
|
+
canvas_native_context_clip(
|
|
549
|
+
ptr->GetContext(), path->GetPath(), CanvasFillRuleEvenOdd);
|
|
550
|
+
break;
|
|
551
|
+
default:
|
|
552
|
+
break;
|
|
553
|
+
}
|
|
541
554
|
}
|
|
542
555
|
|
|
543
556
|
}
|
|
@@ -884,10 +897,23 @@ public:
|
|
|
884
897
|
auto object = Path2D::GetPointer(path);
|
|
885
898
|
|
|
886
899
|
if (object != nullptr) {
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
900
|
+
switch (rule) {
|
|
901
|
+
case 0:
|
|
902
|
+
canvas_native_context_fill_with_path(
|
|
903
|
+
ptr->GetContext(),
|
|
904
|
+
object->GetPath(),
|
|
905
|
+
CanvasFillRuleNonZero);
|
|
906
|
+
break;
|
|
907
|
+
case 1:
|
|
908
|
+
canvas_native_context_fill_with_path(
|
|
909
|
+
ptr->GetContext(),
|
|
910
|
+
object->GetPath(),
|
|
911
|
+
CanvasFillRuleEvenOdd);
|
|
912
|
+
break;
|
|
913
|
+
default:
|
|
914
|
+
break;
|
|
915
|
+
}
|
|
916
|
+
|
|
891
917
|
ptr->UpdateInvalidateState();
|
|
892
918
|
}
|
|
893
919
|
}
|
|
@@ -901,9 +927,10 @@ public:
|
|
|
901
927
|
|
|
902
928
|
auto object = Path2D::GetPointer(path);
|
|
903
929
|
|
|
930
|
+
|
|
904
931
|
canvas_native_context_fill_with_path(
|
|
905
932
|
ptr->GetContext(),
|
|
906
|
-
object->GetPath(),
|
|
933
|
+
object->GetPath(), CanvasFillRuleNonZero);
|
|
907
934
|
ptr->UpdateInvalidateState();
|
|
908
935
|
}
|
|
909
936
|
|
|
@@ -913,8 +940,21 @@ public:
|
|
|
913
940
|
return;
|
|
914
941
|
}
|
|
915
942
|
|
|
916
|
-
|
|
917
|
-
|
|
943
|
+
|
|
944
|
+
switch (rule) {
|
|
945
|
+
case 0:
|
|
946
|
+
canvas_native_context_fill(
|
|
947
|
+
ptr->GetContext(), CanvasFillRuleNonZero);
|
|
948
|
+
break;
|
|
949
|
+
case 1:
|
|
950
|
+
canvas_native_context_fill(
|
|
951
|
+
ptr->GetContext(), CanvasFillRuleEvenOdd);
|
|
952
|
+
break;
|
|
953
|
+
default:
|
|
954
|
+
break;
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
|
|
918
958
|
ptr->UpdateInvalidateState();
|
|
919
959
|
}
|
|
920
960
|
|
|
@@ -925,7 +965,7 @@ public:
|
|
|
925
965
|
}
|
|
926
966
|
|
|
927
967
|
canvas_native_context_fill(
|
|
928
|
-
ptr->GetContext(),
|
|
968
|
+
ptr->GetContext(), CanvasFillRuleNonZero);
|
|
929
969
|
ptr->UpdateInvalidateState();
|
|
930
970
|
}
|
|
931
971
|
|
|
@@ -986,7 +1026,8 @@ public:
|
|
|
986
1026
|
}
|
|
987
1027
|
|
|
988
1028
|
return canvas_native_context_is_point_in_path(
|
|
989
|
-
ptr->GetContext(), static_cast<float>(x), static_cast<float>(y),
|
|
1029
|
+
ptr->GetContext(), static_cast<float>(x), static_cast<float>(y),
|
|
1030
|
+
CanvasFillRuleNonZero);
|
|
990
1031
|
}
|
|
991
1032
|
|
|
992
1033
|
static bool
|
|
@@ -997,8 +1038,10 @@ public:
|
|
|
997
1038
|
return false;
|
|
998
1039
|
}
|
|
999
1040
|
|
|
1041
|
+
|
|
1000
1042
|
return canvas_native_context_is_point_in_path(
|
|
1001
|
-
ptr->GetContext(), static_cast<float>(x), static_cast<float>(y),
|
|
1043
|
+
ptr->GetContext(), static_cast<float>(x), static_cast<float>(y),
|
|
1044
|
+
rule == 0 ? CanvasFillRuleNonZero : CanvasFillRuleEvenOdd);
|
|
1002
1045
|
}
|
|
1003
1046
|
|
|
1004
1047
|
static bool
|
|
@@ -1018,10 +1061,22 @@ public:
|
|
|
1018
1061
|
if (type == NativeType::Path2D) {
|
|
1019
1062
|
auto path = Path2D::GetPointer(path_obj);
|
|
1020
1063
|
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1064
|
+
switch (rule) {
|
|
1065
|
+
case 0:
|
|
1066
|
+
|
|
1067
|
+
ret = canvas_native_context_is_point_in_path_with_path(
|
|
1068
|
+
ptr->GetContext(),
|
|
1069
|
+
path->GetPath(), (float) x, (float) y, CanvasFillRuleNonZero);
|
|
1070
|
+
break;
|
|
1071
|
+
case 1:
|
|
1072
|
+
|
|
1073
|
+
ret = canvas_native_context_is_point_in_path_with_path(
|
|
1074
|
+
ptr->GetContext(),
|
|
1075
|
+
path->GetPath(), (float) x, (float) y, CanvasFillRuleEvenOdd);
|
|
1076
|
+
break;
|
|
1077
|
+
default:
|
|
1078
|
+
break;
|
|
1079
|
+
}
|
|
1025
1080
|
|
|
1026
1081
|
}
|
|
1027
1082
|
return ret;
|
|
@@ -1398,7 +1453,6 @@ public:
|
|
|
1398
1453
|
static void StrokeText(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1399
1454
|
|
|
1400
1455
|
|
|
1401
|
-
|
|
1402
1456
|
static void StrokeOval(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
1403
1457
|
|
|
1404
1458
|
|
|
@@ -23,9 +23,9 @@ public:
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
~ImageDataBuffer() {
|
|
26
|
-
|
|
26
|
+
canvas_native_u8_buffer_release(slice_);
|
|
27
27
|
slice_ = nullptr;
|
|
28
|
-
|
|
28
|
+
canvas_native_image_data_release(imageData_);
|
|
29
29
|
imageData_ = nullptr;
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -115,7 +115,7 @@ void ImageDataImpl::Ctor(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
|
115
115
|
|
|
116
116
|
object->BindFinalizer(isolate, ret);
|
|
117
117
|
|
|
118
|
-
SetNativeType(
|
|
118
|
+
SetNativeType(object, NativeType::ImageData);
|
|
119
119
|
|
|
120
120
|
args.GetReturnValue().Set(ret);
|
|
121
121
|
return;
|
|
@@ -136,7 +136,7 @@ void ImageDataImpl::Ctor(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
|
136
136
|
|
|
137
137
|
ret->SetAlignedPointerInInternalField(0, object);
|
|
138
138
|
|
|
139
|
-
SetNativeType(
|
|
139
|
+
SetNativeType(object, NativeType::ImageData);
|
|
140
140
|
|
|
141
141
|
object->BindFinalizer(isolate, ret);
|
|
142
142
|
|
|
@@ -181,8 +181,7 @@ ImageDataImpl::GetData(v8::Local<v8::Name> name,
|
|
|
181
181
|
if (ptr != nullptr) {
|
|
182
182
|
auto isolate = info.GetIsolate();
|
|
183
183
|
|
|
184
|
-
auto data = new ImageDataBuffer(
|
|
185
|
-
canvas_native_image_data_get_shared_instance(ptr->GetImageData()));
|
|
184
|
+
auto data = new ImageDataBuffer(ptr->GetImageData());
|
|
186
185
|
|
|
187
186
|
auto length = data->size();
|
|
188
187
|
auto store = v8::ArrayBuffer::NewBackingStore(data->data(), length,
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
#include "Common.h"
|
|
9
9
|
#include "ObjectWrapperImpl.h"
|
|
10
10
|
|
|
11
|
-
class ImageDataImpl: ObjectWrapperImpl {
|
|
11
|
+
class ImageDataImpl : public ObjectWrapperImpl {
|
|
12
12
|
public:
|
|
13
|
-
ImageDataImpl(ImageData* imageData);
|
|
14
|
-
|
|
13
|
+
explicit ImageDataImpl(ImageData* imageData);
|
|
14
|
+
|
|
15
15
|
~ImageDataImpl(){
|
|
16
|
-
|
|
16
|
+
canvas_native_image_data_release(this->GetImageData());
|
|
17
17
|
this->imageData_ = nullptr;
|
|
18
18
|
}
|
|
19
19
|
|