Skip to content

Commit

Permalink
fix: running on both platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
triniwiz committed Oct 16, 2023
1 parent 900f5be commit 991972a
Show file tree
Hide file tree
Showing 25 changed files with 5,896 additions and 562 deletions.
9 changes: 7 additions & 2 deletions apps/demo/src/app.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Helpers } from '@nativescript/canvas/helpers';
/*import { Helpers } from '@nativescript/canvas/helpers';
Helpers.initialize();
require('@nativescript/canvas-polyfill');
*/
// import { CanvasRenderingContext2D } from '@nativescript/canvas';
declare const jp, GDPerformanceMonitor;
let monitor;
import { Canvas } from '@nativescript/canvas';
import { Application, path as filePath, knownFolders, Utils, path as nsPath, ImageSource, Trace } from '@nativescript/core';

Application.on('discardedError', (args) => {
Expand Down Expand Up @@ -43,6 +43,11 @@ JSI
// eval(call);

// : CONSOLE TIME: data: 4.250ms image data

Application.on('uncaughtError', (args) => {
console.log('uncaughtError: error', args.error);
console.log('uncaughtError: platform error', args.android ?? args.ios);
});
Application.on('launch', (args) => {
require('@nativescript/canvas-polyfill');
if (global.isAndroid) {
Expand Down
Binary file modified packages/canvas/platforms/android/canvas-release.aar
Binary file not shown.
225 changes: 120 additions & 105 deletions packages/canvas/platforms/ios/src/cpp/CanvasJSIModule.cpp

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions packages/canvas/platforms/ios/src/cpp/Common.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ extern "C" {

#ifdef __ANDROID__
#include "include/v8.h"
#include "include/canvas_android.h"
#include <android/log.h>
#include <thread>
#endif
Expand Down
Loading

0 comments on commit 991972a

Please sign in to comment.