@nativescript/canvas 2.0.0-alpha.48 → 2.0.0-alpha.49

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nativescript/canvas",
3
- "version": "2.0.0-alpha.48",
3
+ "version": "2.0.0-alpha.49",
4
4
  "description": "DOM Canvas API for NativeScript",
5
5
  "main": "index",
6
6
  "typings": "index.d.ts",
@@ -8,32 +8,32 @@
8
8
  <key>DebugSymbolsPath</key>
9
9
  <string>dSYMs</string>
10
10
  <key>LibraryIdentifier</key>
11
- <string>ios-arm64</string>
11
+ <string>ios-arm64_x86_64-simulator</string>
12
12
  <key>LibraryPath</key>
13
13
  <string>CanvasNative.framework</string>
14
14
  <key>SupportedArchitectures</key>
15
15
  <array>
16
16
  <string>arm64</string>
17
+ <string>x86_64</string>
17
18
  </array>
18
19
  <key>SupportedPlatform</key>
19
20
  <string>ios</string>
21
+ <key>SupportedPlatformVariant</key>
22
+ <string>simulator</string>
20
23
  </dict>
21
24
  <dict>
22
25
  <key>DebugSymbolsPath</key>
23
26
  <string>dSYMs</string>
24
27
  <key>LibraryIdentifier</key>
25
- <string>ios-arm64_x86_64-simulator</string>
28
+ <string>ios-arm64</string>
26
29
  <key>LibraryPath</key>
27
30
  <string>CanvasNative.framework</string>
28
31
  <key>SupportedArchitectures</key>
29
32
  <array>
30
33
  <string>arm64</string>
31
- <string>x86_64</string>
32
34
  </array>
33
35
  <key>SupportedPlatform</key>
34
36
  <string>ios</string>
35
- <key>SupportedPlatformVariant</key>
36
- <string>simulator</string>
37
37
  </dict>
38
38
  </array>
39
39
  <key>CFBundlePackageType</key>
@@ -1461,18 +1461,48 @@ void canvas_native_webgl_buffer_data(uint32_t target,
1461
1461
  uint32_t usage,
1462
1462
  struct WebGLState *state);
1463
1463
 
1464
+ void canvas_native_webgl_buffer_data_i8(uint32_t target,
1465
+ const int8_t *src_data,
1466
+ uintptr_t size,
1467
+ uint32_t usage,
1468
+ struct WebGLState *state);
1469
+
1464
1470
  void canvas_native_webgl_buffer_data_u16(uint32_t target,
1465
1471
  const uint16_t *src_data,
1466
1472
  uintptr_t size,
1467
1473
  uint32_t usage,
1468
1474
  struct WebGLState *state);
1469
1475
 
1476
+ void canvas_native_webgl_buffer_data_i16(uint32_t target,
1477
+ const int16_t *src_data,
1478
+ uintptr_t size,
1479
+ uint32_t usage,
1480
+ struct WebGLState *state);
1481
+
1482
+ void canvas_native_webgl_buffer_data_u32(uint32_t target,
1483
+ const uint32_t *src_data,
1484
+ uintptr_t size,
1485
+ uint32_t usage,
1486
+ struct WebGLState *state);
1487
+
1488
+ void canvas_native_webgl_buffer_data_i32(uint32_t target,
1489
+ const int32_t *src_data,
1490
+ uintptr_t size,
1491
+ uint32_t usage,
1492
+ struct WebGLState *state);
1493
+
1470
1494
  void canvas_native_webgl_buffer_data_f32(uint32_t target,
1471
1495
  const float *src_data,
1472
1496
  uintptr_t size,
1473
1497
  uint32_t usage,
1474
1498
  struct WebGLState *state);
1475
1499
 
1500
+ void canvas_native_webgl_buffer_data_f64(uint32_t target,
1501
+ const double *src_data,
1502
+ uintptr_t size,
1503
+ uint32_t usage,
1504
+ struct WebGLState *state);
1505
+
1476
1506
  void canvas_native_webgl_buffer_data_none(uint32_t target,
1477
1507
  intptr_t size,
1478
1508
  uint32_t usage,
@@ -1484,6 +1514,48 @@ void canvas_native_webgl_buffer_sub_data(uint32_t target,
1484
1514
  uintptr_t size,
1485
1515
  struct WebGLState *state);
1486
1516
 
1517
+ void canvas_native_webgl_buffer_sub_data_i8(uint32_t target,
1518
+ intptr_t offset,
1519
+ const int8_t *src_data,
1520
+ uintptr_t size,
1521
+ struct WebGLState *state);
1522
+
1523
+ void canvas_native_webgl_buffer_sub_data_i16(uint32_t target,
1524
+ intptr_t offset,
1525
+ const int16_t *src_data,
1526
+ uintptr_t size,
1527
+ struct WebGLState *state);
1528
+
1529
+ void canvas_native_webgl_buffer_sub_data_u16(uint32_t target,
1530
+ intptr_t offset,
1531
+ const uint16_t *src_data,
1532
+ uintptr_t size,
1533
+ struct WebGLState *state);
1534
+
1535
+ void canvas_native_webgl_buffer_sub_data_i32(uint32_t target,
1536
+ intptr_t offset,
1537
+ const int32_t *src_data,
1538
+ uintptr_t size,
1539
+ struct WebGLState *state);
1540
+
1541
+ void canvas_native_webgl_buffer_sub_data_u32(uint32_t target,
1542
+ intptr_t offset,
1543
+ const uint32_t *src_data,
1544
+ uintptr_t size,
1545
+ struct WebGLState *state);
1546
+
1547
+ void canvas_native_webgl_buffer_sub_data_f32(uint32_t target,
1548
+ intptr_t offset,
1549
+ const float *src_data,
1550
+ uintptr_t size,
1551
+ struct WebGLState *state);
1552
+
1553
+ void canvas_native_webgl_buffer_sub_data_f64(uint32_t target,
1554
+ intptr_t offset,
1555
+ const double *src_data,
1556
+ uintptr_t size,
1557
+ struct WebGLState *state);
1558
+
1487
1559
  void canvas_native_webgl_buffer_sub_data_none(uint32_t target,
1488
1560
  intptr_t offset,
1489
1561
  struct WebGLState *state);
@@ -1461,18 +1461,48 @@ void canvas_native_webgl_buffer_data(uint32_t target,
1461
1461
  uint32_t usage,
1462
1462
  struct WebGLState *state);
1463
1463
 
1464
+ void canvas_native_webgl_buffer_data_i8(uint32_t target,
1465
+ const int8_t *src_data,
1466
+ uintptr_t size,
1467
+ uint32_t usage,
1468
+ struct WebGLState *state);
1469
+
1464
1470
  void canvas_native_webgl_buffer_data_u16(uint32_t target,
1465
1471
  const uint16_t *src_data,
1466
1472
  uintptr_t size,
1467
1473
  uint32_t usage,
1468
1474
  struct WebGLState *state);
1469
1475
 
1476
+ void canvas_native_webgl_buffer_data_i16(uint32_t target,
1477
+ const int16_t *src_data,
1478
+ uintptr_t size,
1479
+ uint32_t usage,
1480
+ struct WebGLState *state);
1481
+
1482
+ void canvas_native_webgl_buffer_data_u32(uint32_t target,
1483
+ const uint32_t *src_data,
1484
+ uintptr_t size,
1485
+ uint32_t usage,
1486
+ struct WebGLState *state);
1487
+
1488
+ void canvas_native_webgl_buffer_data_i32(uint32_t target,
1489
+ const int32_t *src_data,
1490
+ uintptr_t size,
1491
+ uint32_t usage,
1492
+ struct WebGLState *state);
1493
+
1470
1494
  void canvas_native_webgl_buffer_data_f32(uint32_t target,
1471
1495
  const float *src_data,
1472
1496
  uintptr_t size,
1473
1497
  uint32_t usage,
1474
1498
  struct WebGLState *state);
1475
1499
 
1500
+ void canvas_native_webgl_buffer_data_f64(uint32_t target,
1501
+ const double *src_data,
1502
+ uintptr_t size,
1503
+ uint32_t usage,
1504
+ struct WebGLState *state);
1505
+
1476
1506
  void canvas_native_webgl_buffer_data_none(uint32_t target,
1477
1507
  intptr_t size,
1478
1508
  uint32_t usage,
@@ -1484,6 +1514,48 @@ void canvas_native_webgl_buffer_sub_data(uint32_t target,
1484
1514
  uintptr_t size,
1485
1515
  struct WebGLState *state);
1486
1516
 
1517
+ void canvas_native_webgl_buffer_sub_data_i8(uint32_t target,
1518
+ intptr_t offset,
1519
+ const int8_t *src_data,
1520
+ uintptr_t size,
1521
+ struct WebGLState *state);
1522
+
1523
+ void canvas_native_webgl_buffer_sub_data_i16(uint32_t target,
1524
+ intptr_t offset,
1525
+ const int16_t *src_data,
1526
+ uintptr_t size,
1527
+ struct WebGLState *state);
1528
+
1529
+ void canvas_native_webgl_buffer_sub_data_u16(uint32_t target,
1530
+ intptr_t offset,
1531
+ const uint16_t *src_data,
1532
+ uintptr_t size,
1533
+ struct WebGLState *state);
1534
+
1535
+ void canvas_native_webgl_buffer_sub_data_i32(uint32_t target,
1536
+ intptr_t offset,
1537
+ const int32_t *src_data,
1538
+ uintptr_t size,
1539
+ struct WebGLState *state);
1540
+
1541
+ void canvas_native_webgl_buffer_sub_data_u32(uint32_t target,
1542
+ intptr_t offset,
1543
+ const uint32_t *src_data,
1544
+ uintptr_t size,
1545
+ struct WebGLState *state);
1546
+
1547
+ void canvas_native_webgl_buffer_sub_data_f32(uint32_t target,
1548
+ intptr_t offset,
1549
+ const float *src_data,
1550
+ uintptr_t size,
1551
+ struct WebGLState *state);
1552
+
1553
+ void canvas_native_webgl_buffer_sub_data_f64(uint32_t target,
1554
+ intptr_t offset,
1555
+ const double *src_data,
1556
+ uintptr_t size,
1557
+ struct WebGLState *state);
1558
+
1487
1559
  void canvas_native_webgl_buffer_sub_data_none(uint32_t target,
1488
1560
  intptr_t offset,
1489
1561
  struct WebGLState *state);
@@ -18,7 +18,7 @@
18
18
  </data>
19
19
  <key>Headers/canvas_native.h</key>
20
20
  <data>
21
- pRAw58hbawyHmNg47MpPInfGUXE=
21
+ OGCSEenyrzd3RyVAV445VyaSuSQ=
22
22
  </data>
23
23
  <key>Info.plist</key>
24
24
  <data>
@@ -108,7 +108,7 @@
108
108
  <dict>
109
109
  <key>hash2</key>
110
110
  <data>
111
- +uJrcducrhwiNwtZ6wBUM2xpn2cfp1O2gq8/4NtuBVU=
111
+ 4ynTl1zPCBzVAd/oTD4NPvJlB6B79gIJMszZCwNazPg=
112
112
  </data>
113
113
  </dict>
114
114
  <key>Modules/CanvasNative.swiftmodule/Project/arm64-apple-ios-simulator.swiftsourceinfo</key>
@@ -1,4 +1,4 @@
1
- platform :ios, '11.0'
1
+ platform :ios, '12.0'
2
2
  #pod 'CanvasNative' , '~> 1.0.0.alpha.11'
3
3
  #pod 'CanvasNative', :path => "$(SRCROOT)/../../../../../"
4
4
  #pod 'CanvasNative', :git => 'https://github.com/NativeScript/canvas.git', :tag => '1.0.0-alpha.2'
@@ -6,7 +6,7 @@
6
6
  #include "Helpers.h"
7
7
  #include "Caches.h"
8
8
 
9
- CanvasPattern::CanvasPattern(PaintStyle* style) : style_(style) {}
9
+ CanvasPattern::CanvasPattern(PaintStyle *style) : style_(style) {}
10
10
 
11
11
  void CanvasPattern::Init(const v8::Local<v8::Object> &canvasModule, v8::Isolate *isolate) {
12
12
  v8::Locker locker(isolate);
@@ -20,6 +20,9 @@ void CanvasPattern::Init(const v8::Local<v8::Object> &canvasModule, v8::Isolate
20
20
  canvasModule->Set(context, ConvertToV8String(isolate, "CanvasPattern"), func);
21
21
  }
22
22
 
23
+ v8::CFunction CanvasPattern::fast_set_transform_(
24
+ v8::CFunction::Make(CanvasPattern::FastSetTransform));
25
+
23
26
  CanvasPattern *CanvasPattern::GetPointer(const v8::Local<v8::Object> &object) {
24
27
  auto ptr = object->GetAlignedPointerFromInternalField(0);
25
28
  if (ptr == nullptr) {
@@ -33,7 +36,7 @@ static v8::Local<v8::Object> NewInstance(v8::Isolate *isolate, CanvasPattern *pa
33
36
  v8::EscapableHandleScope scope(isolate);
34
37
  auto object = CanvasPattern::GetCtor(isolate)->GetFunction(
35
38
  context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
36
- SetNativeType( object, NativeType::CanvasPattern);
39
+ SetNativeType(object, NativeType::CanvasPattern);
37
40
  object->SetAlignedPointerInInternalField(0, pattern);
38
41
  return scope.Escape(object);
39
42
  }
@@ -51,9 +54,9 @@ v8::Local<v8::FunctionTemplate> CanvasPattern::GetCtor(v8::Isolate *isolate) {
51
54
 
52
55
  auto tmpl = ctorTmpl->InstanceTemplate();
53
56
  tmpl->SetInternalFieldCount(2);
54
- tmpl->Set(
55
- ConvertToV8String(isolate, "SetTransform"),
56
- v8::FunctionTemplate::New(isolate, &SetTransform));
57
+
58
+ SetFastMethod(isolate, tmpl, "setTransform", SetTransform, &fast_set_transform_,
59
+ v8::Local<v8::Value>());
57
60
 
58
61
  cache->CanvasPatternTmpl =
59
62
  std::make_unique<v8::Persistent<v8::FunctionTemplate>>(isolate, ctorTmpl);
@@ -67,7 +70,7 @@ void CanvasPattern::SetTransform(const v8::FunctionCallbackInfo<v8::Value> &args
67
70
  }
68
71
 
69
72
  auto value = args[0];
70
- auto type = GetNativeType( value);
73
+ auto type = GetNativeType(value);
71
74
 
72
75
  if (type == NativeType::Matrix) {
73
76
 
@@ -81,6 +84,6 @@ void CanvasPattern::SetTransform(const v8::FunctionCallbackInfo<v8::Value> &args
81
84
 
82
85
  }
83
86
 
84
- PaintStyle* CanvasPattern::GetPaintStyle() {
87
+ PaintStyle *CanvasPattern::GetPaintStyle() {
85
88
  return this->style_;
86
89
  }
@@ -3,20 +3,23 @@
3
3
  //
4
4
 
5
5
  #pragma once
6
+
6
7
  #include "MatrixImpl.h"
7
8
  #include <vector>
8
9
  #include "ObjectWrapperImpl.h"
9
10
 
10
- class CanvasPattern: ObjectWrapperImpl {
11
+ class CanvasPattern : ObjectWrapperImpl {
11
12
  public:
12
- CanvasPattern(PaintStyle* style);
13
+ CanvasPattern(PaintStyle *style);
13
14
 
14
15
  ~CanvasPattern() {
15
16
  canvas_native_paint_style_destroy(this->GetPaintStyle());
16
17
  this->style_ = nullptr;
17
18
  }
18
19
 
19
- PaintStyle* GetPaintStyle();
20
+ PaintStyle *GetPaintStyle();
21
+
22
+ static v8::CFunction fast_set_transform_;
20
23
 
21
24
  static void Init(const v8::Local<v8::Object> &canvasModule, v8::Isolate *isolate);
22
25
 
@@ -27,7 +30,7 @@ public:
27
30
  v8::EscapableHandleScope scope(isolate);
28
31
  auto object = CanvasPattern::GetCtor(isolate)->GetFunction(
29
32
  context).ToLocalChecked()->NewInstance(context).ToLocalChecked();
30
- SetNativeType( object, NativeType::CanvasPattern);
33
+ SetNativeType(object, NativeType::CanvasPattern);
31
34
  object->SetAlignedPointerInInternalField(0, pattern);
32
35
  pattern->BindFinalizer(isolate, object);
33
36
  return scope.Escape(object);
@@ -37,7 +40,27 @@ public:
37
40
 
38
41
  static void SetTransform(const v8::FunctionCallbackInfo<v8::Value> &args);
39
42
 
43
+ static void
44
+ FastSetTransform(v8::Local<v8::Object> receiver_obj, v8::Local<v8::Object> matrix_obj) {
45
+ CanvasPattern *ptr = GetPointer(receiver_obj);
46
+ if (ptr == nullptr) {
47
+ return;
48
+ }
49
+
50
+ auto type = GetNativeType(matrix_obj);
51
+
52
+ if (type == NativeType::Matrix) {
53
+ auto matrix = MatrixImpl::GetPointer(matrix_obj);
54
+ if (matrix != nullptr) {
55
+ canvas_native_pattern_set_transform(
56
+ ptr->GetPaintStyle(),
57
+ matrix->GetMatrix());
58
+ }
59
+ }
60
+
61
+ }
62
+
40
63
  private:
41
- PaintStyle* style_;
64
+ PaintStyle *style_;
42
65
  };
43
66