@nativescript/canvas 2.0.0-beta.11 → 2.0.0-beta.13
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 +8 -5
- package/Canvas/common.js +64 -40
- package/Canvas/common.js.map +1 -1
- package/Canvas/index.android.js +33 -70
- package/Canvas/index.android.js.map +1 -1
- package/Canvas/index.ios.d.ts +1 -0
- package/Canvas/index.ios.js +43 -48
- package/Canvas/index.ios.js.map +1 -1
- package/Canvas2D/CanvasRenderingContext2D/index.js +1 -10
- package/Canvas2D/CanvasRenderingContext2D/index.js.map +1 -1
- package/Canvas2D/ImageData/index.js +4 -6
- package/Canvas2D/ImageData/index.js.map +1 -1
- package/WebGL/WebGLRenderingContext/index.js +43 -26
- package/WebGL/WebGLRenderingContext/index.js.map +1 -1
- package/WebGL2/WebGL2RenderingContext/index.js +0 -2
- package/WebGL2/WebGL2RenderingContext/index.js.map +1 -1
- package/package.json +1 -1
- package/platforms/android/canvas-release.aar +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/CanvasNative +0 -0
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/CanvasNative-Swift.h +8 -10
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_ios.h +4 -4
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Headers/canvas_native.h +58 -16
- 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 +286 -316
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.private.swiftinterface +8 -10
- package/platforms/ios/CanvasNative.xcframework/ios-arm64/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios.swiftinterface +8 -10
- 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 +659 -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 +16 -20
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_ios.h +4 -4
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Headers/canvas_native.h +58 -16
- 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 +286 -316
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.private.swiftinterface +8 -10
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/arm64-apple-ios-simulator.swiftinterface +8 -10
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.abi.json +286 -316
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.private.swiftinterface +8 -10
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/Modules/CanvasNative.swiftmodule/x86_64-apple-ios-simulator.swiftinterface +8 -10
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/CanvasNative.framework/_CodeSignature/CodeResources +27 -27
- 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 +661 -662
- package/platforms/ios/CanvasNative.xcframework/ios-arm64_x86_64-simulator/dSYMs/CanvasNative.framework.dSYM/Contents/Resources/Relocations/x86_64/CanvasNative.yml +646 -641
- package/platforms/ios/src/cpp/CanvasJSIModule.cpp +297 -397
- package/platforms/ios/src/cpp/Helpers.h +3 -4
- package/platforms/ios/src/cpp/ImageAssetImpl.cpp +8 -27
- package/platforms/ios/src/cpp/ImageAssetImpl.h +3 -3
- package/platforms/ios/src/cpp/URLImpl.cpp +73 -0
- package/platforms/ios/src/cpp/canvas2d/CanvasRenderingContext2DImpl.cpp +41 -4
- package/platforms/ios/src/cpp/webgl/WebGLRenderingContext.cpp +101 -120
- package/platforms/ios/src/cpp/webgl2/WebGL2RenderingContext.cpp +1766 -1659
- package/platforms/ios/src/cpp/PerIsolateData.cpp +0 -49
- package/platforms/ios/src/cpp/PerIsolateData.h +0 -54
|
@@ -7,7 +7,6 @@
|
|
|
7
7
|
#include <memory>
|
|
8
8
|
#include "Common.h"
|
|
9
9
|
#include "OneByteStringResource.h"
|
|
10
|
-
#include "PerIsolateData.h"
|
|
11
10
|
#include "v8-fast-api-calls.h"
|
|
12
11
|
//#ifdef __APPLE__
|
|
13
12
|
//#ifdef __OBJC__
|
|
@@ -176,7 +175,7 @@ static void SetPrivateValue(v8::Isolate *isolate, const v8::Local<v8::Object> &o
|
|
|
176
175
|
const v8::Local<v8::String> &propName,
|
|
177
176
|
const v8::Local<v8::Value> &value) {
|
|
178
177
|
v8::Local<v8::Context> context;
|
|
179
|
-
obj->GetCreationContext().ToLocal(&context);
|
|
178
|
+
auto succcess = obj->GetCreationContext().ToLocal(&context);
|
|
180
179
|
v8::Local<v8::Private> privateKey = v8::Private::ForApi(isolate, propName);
|
|
181
180
|
obj->SetPrivate(context, privateKey, value);
|
|
182
181
|
}
|
|
@@ -185,7 +184,7 @@ static v8::Local<v8::Value>
|
|
|
185
184
|
GetPrivateValue(v8::Isolate *isolate, const v8::Local<v8::Object> &obj,
|
|
186
185
|
const v8::Local<v8::String> &propName) {
|
|
187
186
|
v8::Local<v8::Context> context;
|
|
188
|
-
obj->GetCreationContext().ToLocal(&context);
|
|
187
|
+
auto succcess = obj->GetCreationContext().ToLocal(&context);
|
|
189
188
|
v8::Local<v8::Private> privateKey = v8::Private::ForApi(isolate, propName);
|
|
190
189
|
|
|
191
190
|
v8::Maybe<bool> hasPrivate = obj->HasPrivate(context, privateKey);
|
|
@@ -196,7 +195,7 @@ GetPrivateValue(v8::Isolate *isolate, const v8::Local<v8::Object> &obj,
|
|
|
196
195
|
|
|
197
196
|
v8::Local<v8::Value> result;
|
|
198
197
|
|
|
199
|
-
obj->GetPrivate(context, privateKey).ToLocal(&result);
|
|
198
|
+
succcess = obj->GetPrivate(context, privateKey).ToLocal(&result);
|
|
200
199
|
|
|
201
200
|
return result;
|
|
202
201
|
}
|
|
@@ -28,7 +28,7 @@ void ImageAssetImpl::Init(v8::Local<v8::Object> canvasModule, v8::Isolate *isola
|
|
|
28
28
|
auto context = isolate->GetCurrentContext();
|
|
29
29
|
auto func = ctor->GetFunction(context).ToLocalChecked();
|
|
30
30
|
|
|
31
|
-
canvasModule->Set(context, ConvertToV8String(isolate, "ImageAsset"), func);
|
|
31
|
+
canvasModule->Set(context, ConvertToV8String(isolate, "ImageAsset"), func).IsJust();
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
ImageAssetImpl *ImageAssetImpl::GetPointer(const v8::Local<v8::Object> &object) {
|
|
@@ -66,9 +66,9 @@ v8::Local<v8::FunctionTemplate> ImageAssetImpl::GetCtor(v8::Isolate *isolate) {
|
|
|
66
66
|
ConvertToV8String(isolate, "__addr"),
|
|
67
67
|
GetAddr);
|
|
68
68
|
|
|
69
|
-
tmpl->Set(
|
|
70
|
-
ConvertToV8String(isolate, "scale"),
|
|
71
|
-
v8::FunctionTemplate::New(isolate, &Scale));
|
|
69
|
+
// tmpl->Set(
|
|
70
|
+
// ConvertToV8String(isolate, "scale"),
|
|
71
|
+
// v8::FunctionTemplate::New(isolate, &Scale));
|
|
72
72
|
|
|
73
73
|
tmpl->Set(
|
|
74
74
|
ConvertToV8String(isolate, "fromUrlSync"),
|
|
@@ -97,14 +97,14 @@ v8::Local<v8::FunctionTemplate> ImageAssetImpl::GetCtor(v8::Isolate *isolate) {
|
|
|
97
97
|
v8::FunctionTemplate::New(isolate, &FromBytesCb));
|
|
98
98
|
|
|
99
99
|
|
|
100
|
-
|
|
100
|
+
/* tmpl->Set(
|
|
101
101
|
ConvertToV8String(isolate, "saveSync"),
|
|
102
102
|
v8::FunctionTemplate::New(isolate, &SaveSync));
|
|
103
103
|
|
|
104
104
|
tmpl->Set(
|
|
105
105
|
ConvertToV8String(isolate, "saveCb"),
|
|
106
106
|
v8::FunctionTemplate::New(isolate, &SaveCb));
|
|
107
|
-
|
|
107
|
+
*/
|
|
108
108
|
|
|
109
109
|
cache->ImageAssetTmpl =
|
|
110
110
|
std::make_unique<v8::Persistent<v8::FunctionTemplate>>(isolate, ctorTmpl);
|
|
@@ -182,26 +182,6 @@ ImageAssetImpl::GetError(v8::Local<v8::String> name,
|
|
|
182
182
|
info.GetReturnValue().SetEmptyString();
|
|
183
183
|
}
|
|
184
184
|
|
|
185
|
-
void ImageAssetImpl::Scale(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
186
|
-
ImageAssetImpl *ptr = GetPointer(args.This());
|
|
187
|
-
if (ptr == nullptr) {
|
|
188
|
-
args.GetReturnValue().SetUndefined();
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
|
-
auto isolate = args.GetIsolate();
|
|
192
|
-
auto context = isolate->GetCurrentContext();
|
|
193
|
-
|
|
194
|
-
if (args.Length() > 1) {
|
|
195
|
-
auto x = args[0]->Uint32Value(context).ToChecked();
|
|
196
|
-
auto y = args[1]->Uint32Value(context).ToChecked();
|
|
197
|
-
if (x > 0 && y > 0) {
|
|
198
|
-
canvas_native_image_asset_scale(
|
|
199
|
-
ptr->GetImageAsset(), x,
|
|
200
|
-
y);
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
|
|
205
185
|
void ImageAssetImpl::FromUrlSync(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
206
186
|
ImageAssetImpl *ptr = GetPointer(args.This());
|
|
207
187
|
if (ptr == nullptr) {
|
|
@@ -671,7 +651,7 @@ void ImageAssetImpl::FromBytesCb(const v8::FunctionCallbackInfo<v8::Value> &args
|
|
|
671
651
|
#endif
|
|
672
652
|
|
|
673
653
|
}
|
|
674
|
-
|
|
654
|
+
/*
|
|
675
655
|
void ImageAssetImpl::SaveSync(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
676
656
|
ImageAssetImpl *ptr = GetPointer(args.This());
|
|
677
657
|
if (ptr == nullptr) {
|
|
@@ -814,6 +794,7 @@ void ImageAssetImpl::SaveCb(const v8::FunctionCallbackInfo<v8::Value> &args) {
|
|
|
814
794
|
|
|
815
795
|
|
|
816
796
|
}
|
|
797
|
+
*/
|
|
817
798
|
|
|
818
799
|
ImageAsset *ImageAssetImpl::GetImageAsset() {
|
|
819
800
|
return this->asset_;
|
|
@@ -43,7 +43,7 @@ public:
|
|
|
43
43
|
static void GetError(v8::Local<v8::String> name,
|
|
44
44
|
const v8::PropertyCallbackInfo<v8::Value> &info);
|
|
45
45
|
|
|
46
|
-
static void Scale(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
46
|
+
// static void Scale(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
47
47
|
|
|
48
48
|
static void FromUrlSync(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
49
49
|
|
|
@@ -57,9 +57,9 @@ public:
|
|
|
57
57
|
|
|
58
58
|
static void FromBytesCb(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
59
59
|
|
|
60
|
-
|
|
60
|
+
/* static void SaveSync(const v8::FunctionCallbackInfo<v8::Value> &args);
|
|
61
61
|
|
|
62
|
-
static void SaveCb(const v8::FunctionCallbackInfo<v8::Value> &args)
|
|
62
|
+
static void SaveCb(const v8::FunctionCallbackInfo<v8::Value> &args);*/
|
|
63
63
|
|
|
64
64
|
|
|
65
65
|
private:
|
|
@@ -141,6 +141,14 @@ void URLImpl::GetHash(v8::Local<v8::String> property,
|
|
|
141
141
|
auto isolate = info.GetIsolate();
|
|
142
142
|
|
|
143
143
|
auto value = canvas_url_hash(ptr->GetURL());
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
if (value == nullptr) {
|
|
147
|
+
info.GetReturnValue().SetEmptyString();
|
|
148
|
+
return;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
|
|
144
152
|
info.GetReturnValue().Set(ConvertToV8String(isolate, value));
|
|
145
153
|
canvas_native_string_destroy((char *) value);
|
|
146
154
|
|
|
@@ -170,6 +178,12 @@ void URLImpl::GetHost(v8::Local<v8::String> property,
|
|
|
170
178
|
auto isolate = info.GetIsolate();
|
|
171
179
|
|
|
172
180
|
auto value = canvas_url_host(ptr->GetURL());
|
|
181
|
+
|
|
182
|
+
if (value == nullptr) {
|
|
183
|
+
info.GetReturnValue().SetEmptyString();
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
|
|
173
187
|
info.GetReturnValue().Set(ConvertToV8String(isolate, value));
|
|
174
188
|
canvas_native_string_destroy((char *) value);
|
|
175
189
|
|
|
@@ -199,6 +213,10 @@ void URLImpl::GetHostName(v8::Local<v8::String> property,
|
|
|
199
213
|
auto isolate = info.GetIsolate();
|
|
200
214
|
|
|
201
215
|
auto value = canvas_url_host_name(ptr->GetURL());
|
|
216
|
+
if (value == nullptr) {
|
|
217
|
+
info.GetReturnValue().SetEmptyString();
|
|
218
|
+
return;
|
|
219
|
+
}
|
|
202
220
|
info.GetReturnValue().Set(ConvertToV8String(isolate, value));
|
|
203
221
|
canvas_native_string_destroy((char *) value);
|
|
204
222
|
|
|
@@ -228,6 +246,14 @@ void URLImpl::GetHref(v8::Local<v8::String> property,
|
|
|
228
246
|
auto isolate = info.GetIsolate();
|
|
229
247
|
|
|
230
248
|
auto value = canvas_url_href(ptr->GetURL());
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
if (value == nullptr) {
|
|
252
|
+
info.GetReturnValue().SetEmptyString();
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
|
|
231
257
|
info.GetReturnValue().Set(ConvertToV8String(isolate, value));
|
|
232
258
|
canvas_native_string_destroy((char *) value);
|
|
233
259
|
|
|
@@ -256,6 +282,14 @@ void URLImpl::GetOrigin(v8::Local<v8::String> property,
|
|
|
256
282
|
auto isolate = info.GetIsolate();
|
|
257
283
|
|
|
258
284
|
auto value = canvas_url_origin(ptr->GetURL());
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
if (value == nullptr) {
|
|
288
|
+
info.GetReturnValue().SetEmptyString();
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
|
|
259
293
|
info.GetReturnValue().Set(ConvertToV8String(isolate, value));
|
|
260
294
|
canvas_native_string_destroy((char *) value);
|
|
261
295
|
|
|
@@ -271,6 +305,13 @@ void URLImpl::GetPassword(v8::Local<v8::String> property,
|
|
|
271
305
|
auto isolate = info.GetIsolate();
|
|
272
306
|
|
|
273
307
|
auto value = canvas_url_password(ptr->GetURL());
|
|
308
|
+
|
|
309
|
+
if (value == nullptr) {
|
|
310
|
+
info.GetReturnValue().SetEmptyString();
|
|
311
|
+
return;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
|
|
274
315
|
info.GetReturnValue().Set(ConvertToV8String(isolate, value));
|
|
275
316
|
canvas_native_string_destroy((char *) value);
|
|
276
317
|
|
|
@@ -299,6 +340,12 @@ void URLImpl::GetPathName(v8::Local<v8::String> property,
|
|
|
299
340
|
auto isolate = info.GetIsolate();
|
|
300
341
|
|
|
301
342
|
auto value = canvas_url_pathname(ptr->GetURL());
|
|
343
|
+
|
|
344
|
+
if (value == nullptr) {
|
|
345
|
+
info.GetReturnValue().SetEmptyString();
|
|
346
|
+
return;
|
|
347
|
+
}
|
|
348
|
+
|
|
302
349
|
info.GetReturnValue().Set(ConvertToV8String(isolate, value));
|
|
303
350
|
canvas_native_string_destroy((char *) value);
|
|
304
351
|
|
|
@@ -327,6 +374,13 @@ void URLImpl::GetPort(v8::Local<v8::String> property,
|
|
|
327
374
|
auto isolate = info.GetIsolate();
|
|
328
375
|
|
|
329
376
|
auto value = canvas_url_port(ptr->GetURL());
|
|
377
|
+
|
|
378
|
+
|
|
379
|
+
if (value == nullptr) {
|
|
380
|
+
info.GetReturnValue().SetEmptyString();
|
|
381
|
+
return;
|
|
382
|
+
}
|
|
383
|
+
|
|
330
384
|
info.GetReturnValue().Set(ConvertToV8String(isolate, value));
|
|
331
385
|
canvas_native_string_destroy((char *) value);
|
|
332
386
|
|
|
@@ -355,6 +409,13 @@ void URLImpl::GetProtocol(v8::Local<v8::String> property,
|
|
|
355
409
|
auto isolate = info.GetIsolate();
|
|
356
410
|
|
|
357
411
|
auto value = canvas_url_protocol(ptr->GetURL());
|
|
412
|
+
|
|
413
|
+
|
|
414
|
+
if (value == nullptr) {
|
|
415
|
+
info.GetReturnValue().SetEmptyString();
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
|
|
358
419
|
info.GetReturnValue().Set(ConvertToV8String(isolate, value));
|
|
359
420
|
canvas_native_string_destroy((char *) value);
|
|
360
421
|
|
|
@@ -384,6 +445,12 @@ void URLImpl::GetSearch(v8::Local<v8::String> property,
|
|
|
384
445
|
auto isolate = info.GetIsolate();
|
|
385
446
|
|
|
386
447
|
auto value = canvas_url_search(ptr->GetURL());
|
|
448
|
+
|
|
449
|
+
if (value == nullptr) {
|
|
450
|
+
info.GetReturnValue().SetEmptyString();
|
|
451
|
+
return;
|
|
452
|
+
}
|
|
453
|
+
|
|
387
454
|
info.GetReturnValue().Set(ConvertToV8String(isolate, value));
|
|
388
455
|
canvas_native_string_destroy((char *) value);
|
|
389
456
|
|
|
@@ -413,6 +480,12 @@ void URLImpl::GetUserName(v8::Local<v8::String> property,
|
|
|
413
480
|
auto isolate = info.GetIsolate();
|
|
414
481
|
|
|
415
482
|
auto value = canvas_url_username(ptr->GetURL());
|
|
483
|
+
|
|
484
|
+
if (value == nullptr) {
|
|
485
|
+
info.GetReturnValue().SetEmptyString();
|
|
486
|
+
return;
|
|
487
|
+
}
|
|
488
|
+
|
|
416
489
|
info.GetReturnValue().Set(ConvertToV8String(isolate, value));
|
|
417
490
|
canvas_native_string_destroy((char *) value);
|
|
418
491
|
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
#include "CanvasRenderingContext2DImpl.h"
|
|
6
6
|
#include "Caches.h"
|
|
7
7
|
#include "OneByteStringResource.h"
|
|
8
|
+
#include "WebGLRenderingContextBase.h"
|
|
8
9
|
|
|
9
10
|
v8::CFunction CanvasRenderingContext2DImpl::fast_start_raf_(
|
|
10
11
|
v8::CFunction::Make(CanvasRenderingContext2DImpl::__FastStartRaf));
|
|
@@ -254,7 +255,7 @@ void CanvasRenderingContext2DImpl::Init(v8::Local<v8::Object> canvasModule, v8::
|
|
|
254
255
|
auto context = isolate->GetCurrentContext();
|
|
255
256
|
auto func = ctor->GetFunction(context).ToLocalChecked();
|
|
256
257
|
|
|
257
|
-
canvasModule->Set(context, ConvertToV8String(isolate, "CanvasRenderingContext2D"), func);
|
|
258
|
+
canvasModule->Set(context, ConvertToV8String(isolate, "CanvasRenderingContext2D"), func).FromJust();
|
|
258
259
|
}
|
|
259
260
|
|
|
260
261
|
CanvasRenderingContext2DImpl *
|
|
@@ -1380,7 +1381,7 @@ void CanvasRenderingContext2DImpl::GetLineDash(v8::Local<v8::String> property,
|
|
|
1380
1381
|
auto ret = v8::Array::New(isolate, (int) size);
|
|
1381
1382
|
for (int i = 0; i < size; i++) {
|
|
1382
1383
|
auto item = buf[i];
|
|
1383
|
-
ret->Set(context, i, v8::Number::New(isolate, (double) item));
|
|
1384
|
+
ret->Set(context, i, v8::Number::New(isolate, (double) item)).FromJust();
|
|
1384
1385
|
}
|
|
1385
1386
|
|
|
1386
1387
|
}
|
|
@@ -1943,7 +1944,7 @@ CanvasRenderingContext2DImpl::DrawAtlas(const v8::FunctionCallbackInfo<v8::Value
|
|
|
1943
1944
|
int32_t mode = 4;
|
|
1944
1945
|
|
|
1945
1946
|
if (blendValue->IsInt32()) {
|
|
1946
|
-
blendValue->Int32Value(context).To(&mode);
|
|
1947
|
+
auto val = blendValue->Int32Value(context).To(&mode);
|
|
1947
1948
|
}
|
|
1948
1949
|
|
|
1949
1950
|
if (colorsValue->IsArray()) {
|
|
@@ -2081,6 +2082,17 @@ CanvasRenderingContext2DImpl::DrawImage(const v8::FunctionCallbackInfo<v8::Value
|
|
|
2081
2082
|
}
|
|
2082
2083
|
}
|
|
2083
2084
|
break;
|
|
2085
|
+
case NativeType::WebGLRenderingContextBase: {
|
|
2086
|
+
auto gl = WebGLRenderingContextBase::GetPointer(image);
|
|
2087
|
+
if (gl != nullptr) {
|
|
2088
|
+
canvas_native_context_draw_image_dx_dy_webgl(
|
|
2089
|
+
ptr->GetContext(),
|
|
2090
|
+
gl->GetState(),
|
|
2091
|
+
dx, dy
|
|
2092
|
+
);
|
|
2093
|
+
}
|
|
2094
|
+
}
|
|
2095
|
+
break;
|
|
2084
2096
|
default:
|
|
2085
2097
|
break;
|
|
2086
2098
|
}
|
|
@@ -2131,6 +2143,17 @@ CanvasRenderingContext2DImpl::DrawImage(const v8::FunctionCallbackInfo<v8::Value
|
|
|
2131
2143
|
}
|
|
2132
2144
|
}
|
|
2133
2145
|
break;
|
|
2146
|
+
case NativeType::WebGLRenderingContextBase: {
|
|
2147
|
+
auto gl = WebGLRenderingContextBase::GetPointer(image);
|
|
2148
|
+
if (gl != nullptr) {
|
|
2149
|
+
canvas_native_context_draw_image_dx_dy_dw_dh_webgl(
|
|
2150
|
+
ptr->GetContext(),
|
|
2151
|
+
gl->GetState(),
|
|
2152
|
+
dx, dy, dWidth, dHeight
|
|
2153
|
+
);
|
|
2154
|
+
}
|
|
2155
|
+
}
|
|
2156
|
+
break;
|
|
2134
2157
|
default:
|
|
2135
2158
|
break;
|
|
2136
2159
|
}
|
|
@@ -2189,6 +2212,20 @@ CanvasRenderingContext2DImpl::DrawImage(const v8::FunctionCallbackInfo<v8::Value
|
|
|
2189
2212
|
}
|
|
2190
2213
|
}
|
|
2191
2214
|
break;
|
|
2215
|
+
case NativeType::WebGLRenderingContextBase: {
|
|
2216
|
+
auto gl = WebGLRenderingContextBase::GetPointer(image);
|
|
2217
|
+
if (gl != nullptr) {
|
|
2218
|
+
canvas_native_context_draw_image_webgl(
|
|
2219
|
+
ptr->GetContext(),
|
|
2220
|
+
gl->GetState(),
|
|
2221
|
+
sx,
|
|
2222
|
+
sy, sWidth, sHeight,
|
|
2223
|
+
dx,
|
|
2224
|
+
dy, dWidth, dHeight
|
|
2225
|
+
);
|
|
2226
|
+
}
|
|
2227
|
+
}
|
|
2228
|
+
break;
|
|
2192
2229
|
default:
|
|
2193
2230
|
break;
|
|
2194
2231
|
}
|
|
@@ -2402,7 +2439,7 @@ CanvasRenderingContext2DImpl::GetLineDash(const v8::FunctionCallbackInfo<v8::Val
|
|
|
2402
2439
|
for (int i = 0; i < size; ++i) {
|
|
2403
2440
|
array->Set(context, i,
|
|
2404
2441
|
v8::Number::New(isolate,
|
|
2405
|
-
(double) buf[i]));
|
|
2442
|
+
(double) buf[i])).FromJust();
|
|
2406
2443
|
}
|
|
2407
2444
|
|
|
2408
2445
|
args.GetReturnValue().Set(array);
|