Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: v2 #98

Merged
merged 89 commits into from
Nov 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
d21f386
chore: updates
triniwiz Mar 18, 2022
05edf71
Merge branch 'master' into chore/perf
triniwiz Mar 18, 2022
92d8cc6
updates
triniwiz Apr 5, 2022
4e20ee8
updates
triniwiz Apr 7, 2022
0ae20bb
updates
triniwiz Apr 18, 2022
112a35b
updates
triniwiz Apr 19, 2022
cf99241
updates
triniwiz Apr 19, 2022
57f2044
2d working
triniwiz Apr 20, 2022
8bb6d36
updates
triniwiz Apr 23, 2022
8c0f706
updates
triniwiz Apr 27, 2022
055d9fa
updates
triniwiz Apr 29, 2022
9698e23
working webgl
triniwiz Apr 30, 2022
1579ca9
updates
triniwiz May 1, 2022
682dfa9
updates
triniwiz May 2, 2022
b422f9c
updates
triniwiz May 4, 2022
ff00634
updates
triniwiz May 5, 2022
bc0cf5b
Update Cargo.toml
triniwiz May 5, 2022
e1718eb
updates
triniwiz May 5, 2022
c3f9c9d
updates
triniwiz May 5, 2022
ee7d53e
updates
triniwiz May 5, 2022
56ab015
updates
triniwiz May 6, 2022
359c6ee
Update webgl.rs
triniwiz May 6, 2022
e132d18
updates
triniwiz May 6, 2022
fdd8cef
updates
triniwiz May 6, 2022
c34d37c
Update .gitignore
triniwiz May 6, 2022
a6b8767
updates
triniwiz May 9, 2022
3e1b334
updates
triniwiz Jul 5, 2022
9b92e6c
updates
triniwiz Jul 6, 2022
d125a3b
working much better :D
triniwiz Jul 8, 2022
5f28781
updates
triniwiz Oct 14, 2022
0c2232f
updates
triniwiz Oct 26, 2022
6bff831
chore: refactor
triniwiz Feb 24, 2023
212c814
chore: clean up
triniwiz Feb 24, 2023
1775f01
chore: clean up
triniwiz Feb 24, 2023
f4ab29d
chore: clean up
triniwiz Feb 25, 2023
2caaf2b
feat: JSI
triniwiz Feb 26, 2023
981b273
chore: updates
triniwiz Feb 28, 2023
d1bcb05
chore: updates
triniwiz Mar 1, 2023
2e4477b
chore: updates
triniwiz Mar 1, 2023
5ce4241
chore: updates
triniwiz Mar 2, 2023
e56f947
chore: updates
triniwiz Mar 3, 2023
a6d9671
chore: updates
triniwiz Mar 3, 2023
b61c890
chore: updates
triniwiz Mar 3, 2023
f37439c
chore: clean up
triniwiz Mar 4, 2023
4095bf5
chore: updates
triniwiz Mar 4, 2023
d04bc92
chore: clean up
triniwiz Mar 4, 2023
00f2b85
chore: clean up
triniwiz Mar 4, 2023
914fd4b
chore: clean up
triniwiz Mar 4, 2023
9314725
chore: updates
triniwiz Mar 5, 2023
874d605
chore: clean up
triniwiz Mar 5, 2023
ad249a1
chore: clean up
triniwiz Mar 5, 2023
f4bb37b
chore: updates
triniwiz Mar 6, 2023
e11c48a
chore: updates
triniwiz Mar 6, 2023
3ba3fbb
chore: updates
triniwiz Mar 6, 2023
ee71096
Update WebGL2RenderingContext.cpp
triniwiz Mar 6, 2023
222c6e0
chore: use namespace
triniwiz Mar 6, 2023
f4bf573
chore: updates
triniwiz Mar 6, 2023
6f87090
chore: updates
triniwiz Mar 6, 2023
9c68df7
chore: fix build
triniwiz Mar 8, 2023
3a24a71
chore: initial 2d support
triniwiz Mar 8, 2023
3058e96
fix: gl alive!!!
triniwiz Mar 9, 2023
2eee24d
fix: updates
triniwiz Mar 10, 2023
98edc36
fix: working 3D
triniwiz Mar 11, 2023
cf227b5
fix: 2d
triniwiz Mar 13, 2023
99f9e53
fix: video rendering
triniwiz Mar 14, 2023
84258ed
fix: 2d context to 2d context drawing
triniwiz Mar 16, 2023
8c7517b
feat: v2 alpha.0
triniwiz Mar 17, 2023
013a50c
chore: updates & trying another op
triniwiz Mar 18, 2023
3383ac4
fix: remove extra conversion
triniwiz Mar 18, 2023
f7da8e4
chore: clean up
triniwiz Mar 18, 2023
67b08b4
chore: updates
triniwiz Mar 19, 2023
ab37c29
chore: updates
triniwiz Mar 19, 2023
eccc208
chore: bump
triniwiz Mar 19, 2023
d1fd313
feat: initial dom view
triniwiz Mar 20, 2023
e51a50a
feat: expose skia dom
triniwiz Mar 21, 2023
f188b7b
chore: ios updates (#99)
triniwiz Apr 2, 2023
02c8206
fix(ios): missing pods
triniwiz Apr 2, 2023
66bdfc9
fix(ios): build
triniwiz Apr 2, 2023
ca38fd9
chore: updates
triniwiz Apr 3, 2023
28f9aa7
chore: updates
triniwiz Apr 3, 2023
84dd946
chore: updates
triniwiz Apr 4, 2023
fda9cd5
fix(ios): improve fileop
triniwiz Apr 4, 2023
0c204de
chore: updates
triniwiz Apr 9, 2023
223f636
chore: updates
triniwiz Apr 9, 2023
c56165e
chore: updates
triniwiz Apr 9, 2023
6807f26
chore: updates
triniwiz Apr 10, 2023
9570d3e
Chore v2 perf op (#104)
triniwiz Nov 4, 2023
d1b7313
Merge branch 'master' into chore-v2-refactor
triniwiz Nov 4, 2023
6be0ae6
chore: updates
triniwiz Nov 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
15 changes: 15 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Canvas Native

on: [workflow_dispatch]

env:
CARGO_TERM_COLOR: always

jobs:
build:

runs-on: ubuntu-18.04

steps:
- name: Checkout
- uses: actions/checkout@v3
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@ Thumbs.db
*.tgz
packages/**/angular/dist
apps/demo/times.html
rust-skia
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ npm run setup
npm start
```

- @nativescript/canvas
- @nativescript/canvas-babylon
- @nativescript/canvas-media
- @nativescript/canvas-phaser
- @nativescript/canvas-phaser-ce
- @nativescript/canvas-pixi
- @nativescript/canvas-polyfill
- @nativescript/canvas-three
- [@nativescript/canvas](packages/canvas/README.md)
- [@nativescript/canvas-babylon](packages/canvas-babylon/README.md)
- [@nativescript/canvas-chartjs](packages/canvas-chartjs/README.md)
- [@nativescript/canvas-media](packages/canvas-media/README.md)
- [@nativescript/canvas-phaser](packages/canvas-phaser/README.md)
- [@nativescript/canvas-phaser-ce](packages/canvas-phaser-ce/README.md)
- [@nativescript/canvas-pixi](packages/canvas-pixi/README.md)
- [@nativescript/canvas-polyfill](packages/canvas-polyfill/README.md)
- [@nativescript/canvas-three](packages/canvas-three/README.md)

# How to use?

Expand Down
35 changes: 18 additions & 17 deletions apps/demo-angular/package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
{
"main": "./src/main.ts",
"dependencies": {
"@nativescript/canvas": "file:../../dist/packages/canvas",
"@nativescript/canvas-babylon": "file:../../dist/packages/canvas-babylon",
"@nativescript/canvas-media": "file:../../dist/packages/canvas-media",
"@nativescript/canvas-phaser": "file:../../dist/packages/canvas-phaser",
"@nativescript/canvas-phaser-ce": "file:../../dist/packages/canvas-phaser-ce",
"@nativescript/canvas-pixi": "file:../../dist/packages/canvas-pixi",
"@nativescript/canvas-polyfill": "file:../../dist/packages/canvas-polyfill",
"@nativescript/canvas-three": "file:../../dist/packages/canvas-three",
"@nativescript/core": "file:../../node_modules/@nativescript/core",
"three": "file:../../node_modules/three"
},
"devDependencies": {
"@nativescript/android": "~8.4.0",
"@nativescript/ios": "~8.4.0"
}
"main": "./src/main.ts",
"dependencies": {
"@nativescript/canvas": "file:../../dist/packages/canvas",
"@nativescript/canvas-babylon": "file:../../dist/packages/canvas-babylon",
"@nativescript/canvas-media": "file:../../dist/packages/canvas-media",
"@nativescript/canvas-phaser": "file:../../dist/packages/canvas-phaser",
"@nativescript/canvas-phaser-ce": "file:../../dist/packages/canvas-phaser-ce",
"@nativescript/canvas-pixi": "file:../../dist/packages/canvas-pixi",
"@nativescript/canvas-polyfill": "file:../../dist/packages/canvas-polyfill",
"@nativescript/canvas-three": "file:../../dist/packages/canvas-three",
"@nativescript/core": "file:../../node_modules/@nativescript/core",
"three": "file:../../node_modules/three",
"@nativescript/canvas-chartjs": "file:../../dist/packages/canvas-chartjs"
},
"devDependencies": {
"@nativescript/android": "~8.5.0",
"@nativescript/ios": "8.5.1-dev.0"
}
}
1 change: 1 addition & 0 deletions apps/demo-angular/src/app-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const routes: Routes = [
{ path: 'home', component: HomeComponent },
{ path: 'canvas', loadChildren: () => import('./plugin-demos/canvas.module').then(m => m.CanvasModule) },
{ path: 'canvas-babylon', loadChildren: () => import('./plugin-demos/canvas-babylon.module').then(m => m.CanvasBabylonModule) },
{ path: 'canvas-chartjs', loadChildren: () => import('./plugin-demos/canvas-chartjs.module').then(m => m.CanvasChartjsModule) },
{ path: 'canvas-media', loadChildren: () => import('./plugin-demos/canvas-media.module').then(m => m.CanvasMediaModule) },
{ path: 'canvas-phaser', loadChildren: () => import('./plugin-demos/canvas-phaser.module').then(m => m.CanvasPhaserModule) },
{ path: 'canvas-phaser-ce', loadChildren: () => import('./plugin-demos/canvas-phaser-ce.module').then(m => m.CanvasPhaserCeModule) },
Expand Down
58 changes: 28 additions & 30 deletions apps/demo-angular/src/home.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,32 @@ export class HomeComponent {
constructor(private router: RouterExtensions){}

demos = [
{
name: 'canvas',
},
{
name: 'canvas-babylon',
},
{
name: 'canvas-media',
},
{
name: 'canvas-phaser',
},
{
name: 'canvas-phaser-ce',
},
{
name: 'canvas-pixi',
},
{
name: 'canvas-polyfill',
},
{
name: 'canvas-three',
},
];

onTap(event){
const item = this.demos[event.index];
this.router.navigate(['/' + item.name]);
{
name: 'canvas'
},
{
name: 'canvas-babylon'
},
{
name: 'canvas-chartjs'
},
{
name: 'canvas-media'
},
{
name: 'canvas-phaser'
},
{
name: 'canvas-phaser-ce'
},
{
name: 'canvas-pixi'
},
{
name: 'canvas-polyfill'
},
{
name: 'canvas-three'
}
}
];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<ActionBar title="canvas-chartjs" class="action-bar"> </ActionBar>
<StackLayout class="p-20">
<ScrollView class="h-full">
<StackLayout>
<Button text="Test canvas-chartjs" (tap)="demoShared.testIt()" class="btn btn-primary"></Button>
</StackLayout>
</ScrollView>
</StackLayout>
19 changes: 19 additions & 0 deletions apps/demo-angular/src/plugin-demos/canvas-chartjs.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Component, NgZone } from '@angular/core';
import { DemoSharedCanvasChartjs } from '@demo/shared';
import { } from '@nativescript/canvas-chartjs';

@Component({
selector: 'demo-canvas-chartjs',
templateUrl: 'canvas-chartjs.component.html',
})
export class CanvasChartjsComponent {

demoShared: DemoSharedCanvasChartjs;

constructor(private _ngZone: NgZone) {}

ngOnInit() {
this.demoShared = new DemoSharedCanvasChartjs();
}

}
10 changes: 10 additions & 0 deletions apps/demo-angular/src/plugin-demos/canvas-chartjs.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
import { NativeScriptCommonModule, NativeScriptRouterModule } from '@nativescript/angular';
import { CanvasChartjsComponent } from './canvas-chartjs.component';

@NgModule({
imports: [NativeScriptCommonModule, NativeScriptRouterModule.forChild([{ path: '', component: CanvasChartjsComponent }])],
declarations: [CanvasChartjsComponent],
schemas: [ NO_ERRORS_SCHEMA]
})
export class CanvasChartjsModule {}
34 changes: 34 additions & 0 deletions apps/demo-vue/app/plugin-demos/canvas-chartjs.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<template>
<Page>
<ActionBar>
<Label text="canvas-chartjs"/>
</ActionBar>

<GridLayout>
<Button class="info" :text="message"/>
</GridLayout>
</Page>
</template>

<script lang="ts">
import Vue from "nativescript-vue";
import { DemoSharedCanvasChartjs } from '@demo/shared';
import { } from '@nativescript/canvas-chartjs';

export default Vue.extend({
computed: {
message() {
return "Test canvas-chartjs";
}
}
});
</script>

<style scoped lang="scss">

.info {
font-size: 20;
horizontal-align: center;
vertical-align: center;
}
</style>
35 changes: 18 additions & 17 deletions apps/demo-vue/package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
{
"main": "./app/app.js",
"dependencies": {
"nativescript-vue": "file:../../node_modules/nativescript-vue",
"@nativescript/core": "file:../../node_modules/@nativescript/core",
"@nativescript/canvas-media": "file:../../packages/canvas-media",
"@nativescript/canvas": "file:../../packages/canvas",
"@nativescript/canvas-babylon": "file:../../packages/canvas-babylon",
"@nativescript/canvas-phaser": "file:../../packages/canvas-phaser",
"@nativescript/canvas-phaser-ce": "file:../../packages/canvas-phaser-ce",
"@nativescript/canvas-pixi": "file:../../packages/canvas-pixi",
"@nativescript/canvas-polyfill": "file:../../packages/canvas-polyfill",
"@nativescript/canvas-three": "file:../../packages/canvas-three"
},
"devDependencies": {
"@nativescript/android": "~8.4.0",
"@nativescript/ios": "~8.4.0"
}
"main": "./app/app.ts",
"dependencies": {
"nativescript-vue": "file:../../node_modules/nativescript-vue",
"@nativescript/core": "file:../../node_modules/@nativescript/core",
"@nativescript/canvas-media": "file:../../packages/canvas-media",
"@nativescript/canvas": "file:../../packages/canvas",
"@nativescript/canvas-babylon": "file:../../packages/canvas-babylon",
"@nativescript/canvas-phaser": "file:../../packages/canvas-phaser",
"@nativescript/canvas-phaser-ce": "file:../../packages/canvas-phaser-ce",
"@nativescript/canvas-pixi": "file:../../packages/canvas-pixi",
"@nativescript/canvas-polyfill": "file:../../packages/canvas-polyfill",
"@nativescript/canvas-three": "file:../../packages/canvas-three",
"@nativescript/canvas-chartjs": "file:../../packages/canvas-chartjs"
},
"devDependencies": {
"@nativescript/android": "~8.5.0",
"@nativescript/ios": "8.5.1-dev.0"
}
}
3 changes: 2 additions & 1 deletion apps/demo/nativescript.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ export default {
id: 'org.nativescript.plugindemo',
appResourcesPath: '../../tools/assets/App_Resources',
android: {
v8Flags: '--expose_gc',
v8Flags: '--expose_gc --allow-natives-syntax --turbo-fast-api-calls',
markingMode: 'none',
discardUncaughtJsExceptions: false,
},
appPath: 'src',
ios: {
Expand Down
61 changes: 31 additions & 30 deletions apps/demo/package.json
Original file line number Diff line number Diff line change
@@ -1,32 +1,33 @@
{
"main": "./src/app.ts",
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"repository": "<fill-your-repository-here>",
"dependencies": {
"@nativescript/canvas": "file:../../packages/canvas",
"@nativescript/canvas-babylon": "file:../../packages/canvas-babylon",
"@nativescript/canvas-media": "file:../../packages/canvas-media",
"@nativescript/canvas-phaser": "file:../../packages/canvas-phaser",
"@nativescript/canvas-phaser-ce": "file:../../packages/canvas-phaser-ce",
"@nativescript/canvas-pixi": "file:../../packages/canvas-pixi",
"@nativescript/canvas-polyfill": "file:../../packages/canvas-polyfill",
"@nativescript/canvas-three": "file:../../packages/canvas-three",
"@nativescript/core": "file:../../node_modules/@nativescript/core",
"babylonjs": "file:../../node_modules/babylonjs",
"babylonjs-materials": "file:../../node_modules/babylonjs-materials",
"chart.js": "file:../../node_modules/chart.js",
"d3": "file:../../node_modules/d3",
"matter-js": "file:../../node_modules/matter-js",
"phaser": "file:../../node_modules/phaser",
"phaser-ce": "file:../../node_modules/phaser-ce",
"pixi.js": "file:../../node_modules/pixi.js",
"three": "file:../../node_modules/three",
"vexflow": "file:../../node_modules/vexflow",
"zen-3d": "file:../../node_modules/zen-3d"
},
"devDependencies": {
"@nativescript/android": "~8.4.0",
"@nativescript/ios": "~8.4.0"
}
"main": "./src/app.ts",
"description": "NativeScript Application",
"license": "SEE LICENSE IN <your-license-filename>",
"repository": "<fill-your-repository-here>",
"dependencies": {
"@nativescript/canvas": "file:../../packages/canvas",
"@nativescript/canvas-babylon": "file:../../packages/canvas-babylon",
"@nativescript/canvas-media": "file:../../packages/canvas-media",
"@nativescript/canvas-phaser": "file:../../packages/canvas-phaser",
"@nativescript/canvas-phaser-ce": "file:../../packages/canvas-phaser-ce",
"@nativescript/canvas-pixi": "file:../../packages/canvas-pixi",
"@nativescript/canvas-polyfill": "file:../../packages/canvas-polyfill",
"@nativescript/canvas-three": "file:../../packages/canvas-three",
"@nativescript/core": "file:../../node_modules/@nativescript/core",
"babylonjs": "file:../../node_modules/babylonjs",
"babylonjs-materials": "file:../../node_modules/babylonjs-materials",
"chart.js": "file:../../node_modules/chart.js",
"d3": "file:../../node_modules/d3",
"matter-js": "file:../../node_modules/matter-js",
"phaser": "file:../../node_modules/phaser",
"phaser-ce": "file:../../node_modules/phaser-ce",
"pixi.js": "file:../../node_modules/pixi.js",
"three": "file:../../node_modules/three",
"vexflow": "file:../../node_modules/vexflow",
"zen-3d": "file:../../node_modules/zen-3d",
"@nativescript/canvas-chartjs": "file:../../packages/canvas-chartjs"
},
"devDependencies": {
"@nativescript/android": "8.6.2",
"@nativescript/ios": "8.6.1"
}
}
5 changes: 3 additions & 2 deletions apps/demo/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"production": true,
"uglify": true,
"release": true,
"forDevice": true
"forDevice": true,
},
"dependsOn": [
{
Expand All @@ -38,7 +38,8 @@
"executor": "@nativescript/nx:build",
"options": {
"platform": "android",
"noHmr": true
"noHmr": true,
"flags": "--env.watchNodeModules"
},
"dependsOn": [
{
Expand Down
Loading