Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
  •  
  •  
  •  
934 changes: 0 additions & 934 deletions .yarn/releases/yarn-4.5.2.cjs

This file was deleted.

1 change: 0 additions & 1 deletion .yarnrc.yml

This file was deleted.

20 changes: 13 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ members = [
"crates/canvas-c",
"crates/canvas-svg",
"crates/canvas-napi",
"crates/canvas-svg-ios",
"crates/canvas-svg-android",
]

[profile.release]
Expand All @@ -27,21 +29,25 @@ strip = true
[workspace.dependencies.wgt]
package = "wgpu-types"
git = "https://github.com/triniwiz/wgpu"
rev = "6f163cdf622bd183fcfc20224294b797312550bb"
rev = "56a46b75f1b400446d0b1139b2435aa95a0d5ab5"




[workspace.dependencies]
env_logger = "0.11.5"
log = "0.4.22"
parking_lot = "0.12.3"
parking_lot = { version = "0.12.3", features = ["deadlock_detection"] }
raw-window-handle = "0.6.2"
canvas-2d = { path = "./crates/canvas-2d" }
canvas-core = { path = "./crates/canvas-core" }
canvas-webgl = { path = "./crates/canvas-webgl" }
canvas-svg = { path = "./crates/canvas-svg" }
gl-bindings = { path = "./crates/gl-bindings" }
canvas-c = { path = "./crates/canvas-c" }
skia-safe = { version = "0.80.0", features = ["textlayout"] }
itertools = "0.13.0"
wgpu-core = { git = "https://github.com/triniwiz/wgpu", rev = "6f163cdf622bd183fcfc20224294b797312550bb", features = ["wgsl", "vulkan", "metal", "raw-window-handle"] }
wgpu-types = { git = "https://github.com/triniwiz/wgpu", rev = "6f163cdf622bd183fcfc20224294b797312550bb" }
skia-safe = { version = "0.87.0", features = ["textlayout"] }
itertools = "0.14.0"
wgpu-core = { git = "https://github.com/triniwiz/wgpu", rev = "56a46b75f1b400446d0b1139b2435aa95a0d5ab5", features = ["wgsl", "vulkan", "metal", "raw-window-handle"] }
wgpu-hal = { git = "https://github.com/triniwiz/wgpu", rev = "56a46b75f1b400446d0b1139b2435aa95a0d5ab5", features = ["metal", "vulkan"] }
ureq = "2.10.1"
jni = "0.21.1"
jni = "0.21.1"
58 changes: 41 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,52 +1,76 @@
ARCHS_IOS = x86_64-apple-ios aarch64-apple-ios aarch64-apple-ios-sim
# ARCHS_IOS = aarch64-apple-ios-sim
ARCHS_ANDROID = i686-linux-android x86_64-linux-android aarch64-linux-android armv7-linux-androideabi
# LIB = libcanvasative.dylib

XCFRAMEWORK = CanvasNative.xcframework
RUST_LIB = canvasnative

all:GENERATE_HEADERS ios android
all: GENERATE_HEADERS ios android

ios: $(XCFRAMEWORK)

android: GENERATE_ANDROID

android_svg: GENERATE_ANDROID_SVG
ios-svg: GENERATE_IOS_SVG

ios_svg: GENERATE_IOS_SVG
android-svg: GENERATE_ANDROID_SVG

.PHONY: GENERATE_HEADERS
GENERATE_HEADERS:
./tools/scripts/build-headers.sh

# PHONY keyword on make means this is not a file, just an identifier for a target
# --- iOS builds ---
.PHONY: $(ARCHS_IOS)
$(ARCHS_IOS): %:
RUSTFLAGS="-Zlocation-detail=none -C panic=abort" cargo +nightly build -Z build-std='std,panic_abort' -Z build-std-features=panic_immediate_abort --target $@ --release -p canvas-ios
RUSTFLAGS="-Zlocation-detail=none -C panic=abort" \
cargo +nightly build -Z build-std='std,panic_abort' \
-Z build-std-features=panic_immediate_abort \
--target $@ --release -p canvas-ios

$(XCFRAMEWORK): $(ARCHS_IOS)

# --- Android builds ---
.PHONY: $(ARCHS_ANDROID)
$(ARCHS_ANDROID): %:
./tools/scripts/build-android.sh $@

.PHONY: GENERATE_ANDROID
GENERATE_ANDROID: $(ARCHS_ANDROID)

# .PHONY: $(ARCHS_IOS)_SVG
# $(ARCHS_IOS)_SVG: %_svg:
# ./tools/scripts/build-svg-ios.sh $* && ./tools/scripts/copy-svg-ios.sh $*
# --- iOS SVG builds ---
.PHONY: $(addsuffix _svg,$(ARCHS_IOS))
$(addsuffix _svg,$(ARCHS_IOS)): %_svg:
RUSTFLAGS="-Zlocation-detail=none -C panic=abort" \
cargo +nightly build -Z build-std='std,panic_abort' \
-Z build-std-features=panic_immediate_abort \
--target $* --release -p canvas-svg-ios

.PHONY: GENERATE_IOS_SVG
GENERATE_IOS_SVG: $(addsuffix _svg,$(ARCHS_IOS))

# --- Android SVG builds ---
.PHONY: $(addsuffix _svg,$(ARCHS_ANDROID))
$(addsuffix _svg,$(ARCHS_ANDROID)): %_svg:
./tools/scripts/build-svg-android.sh $* svg

.PHONY: GENERATE_ANDROID_SVG
GENERATE_ANDROID_SVG: $(addsuffix _svg,$(ARCHS_ANDROID))

# --- Debug targets ---
.PHONY: ios_debug
ios_debug: $(addsuffix _debug,$(ARCHS_IOS))

# .PHONY: GENERATE_IOS_SVG
# GENERATE_IOS_SVG: $(addsuffix _svg,$(ARCHS_IOS))
.PHONY: android_debug
android_debug: $(addsuffix _debug,$(ARCHS_ANDROID))

# .PHONY: $(ARCHS_ANDROID)_SVG
# $(ARCHS_ANDROID)_SVG: %_svg:
# ./tools/scripts/build-svg-android.sh $* && ./tools/scripts/copy-svg-android.sh $*
.PHONY: $(addsuffix _debug,$(ARCHS_IOS))
$(addsuffix _debug,$(ARCHS_IOS)): %_debug:
cargo +nightly build --target $* -p canvas-ios

# .PHONY: GENERATE_ANDROID_SVG
# GENERATE_ANDROID_SVG: $(addsuffix _svg,$(ARCHS_ANDROID))
.PHONY: $(addsuffix _debug,$(ARCHS_ANDROID))
$(addsuffix _debug,$(ARCHS_ANDROID)): %_debug:
./tools/scripts/build-android.sh $* debug

# --- Clean ---
.PHONY: clean
clean:
rm -rf target
45 changes: 14 additions & 31 deletions apps/demo-angular/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,33 +12,8 @@
"production": true,
"uglify": true,
"release": true,
"forDevice": true
},
"dependsOn": [
{
"target": "build.all",
"dependencies": true
}
]
},
"ios": {
"executor": "@nativescript/nx:build",
"options": {
"platform": "ios",
"noHmr": true
},
"dependsOn": [
{
"target": "build.all",
"dependencies": true
}
]
},
"android": {
"executor": "@nativescript/nx:build",
"options": {
"platform": "android",
"noHmr": true
"forDevice": true,
"tsConfig": "apps/demo-angular/tsconfig.json"
},
"dependsOn": [
{
Expand All @@ -48,13 +23,21 @@
]
},
"clean": {
"executor": "@nativescript/nx:build",
"options": {
"clean": true
}
"executor": "@nativescript/nx:clean",
"options": {}
},
"lint": {
"executor": "@nx/eslint:lint"
},
"debug": {
"executor": "@nativescript/nx:debug",
"options": {
"noHmr": true,
"uglify": false,
"release": false,
"forDevice": false,
"prepare": false
}
}
}
}
43 changes: 14 additions & 29 deletions apps/demo-vue/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,8 @@
"production": true,
"uglify": true,
"release": true,
"forDevice": true
},
"dependsOn": [
{
"target": "build.all",
"dependencies": true
}
]
},
"ios": {
"executor": "@nativescript/nx:build",
"options": {
"platform": "ios"
},
"dependsOn": [
{
"target": "build.all",
"dependencies": true
}
]
},
"android": {
"executor": "@nativescript/nx:build",
"options": {
"platform": "android"
"forDevice": true,
"tsConfig": "apps/demo-vue/tsconfig.json"
},
"dependsOn": [
{
Expand All @@ -46,13 +23,21 @@
]
},
"clean": {
"executor": "@nativescript/nx:build",
"options": {
"clean": true
}
"executor": "@nativescript/nx:clean",
"options": {}
},
"lint": {
"executor": "@nx/eslint:lint"
},
"debug": {
"executor": "@nativescript/nx:debug",
"options": {
"noHmr": true,
"uglify": false,
"release": false,
"forDevice": false,
"prepare": false
}
}
}
}
6 changes: 3 additions & 3 deletions apps/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@
"gl-matrix": "file:../../node_modules/gl-matrix"
},
"devDependencies": {
"@nativescript/android": "~8.8.0",
"@nativescript/android": "~8.9.0",
"@nativescript/devtools": "~0.0.1",
"@nativescript/ios": "~8.8.0",
"@nativescript/visionos": "~8.8.0"
"@nativescript/ios": "~8.9.0",
"@nativescript/visionos": "~8.9.0"
}
}
47 changes: 14 additions & 33 deletions apps/demo/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,35 +12,8 @@
"production": true,
"uglify": true,
"release": true,
"forDevice": true
},
"dependsOn": [
{
"target": "build.all",
"dependencies": true
}
]
},
"ios": {
"executor": "@nativescript/nx:build",
"options": {
"platform": "ios",
"noHmr": true,
"flags": "--env.watchNodeModules"
},
"dependsOn": [
{
"target": "build.all",
"dependencies": true
}
]
},
"android": {
"executor": "@nativescript/nx:build",
"options": {
"platform": "android",
"noHmr": true,
"flags": "--env.watchNodeModules"
"forDevice": true,
"tsConfig": "apps/demo/tsconfig.json"
},
"dependsOn": [
{
Expand All @@ -50,13 +23,21 @@
]
},
"clean": {
"executor": "@nativescript/nx:build",
"options": {
"clean": true
}
"executor": "@nativescript/nx:clean",
"options": {}
},
"lint": {
"executor": "@nx/eslint:lint"
},
"debug": {
"executor": "@nativescript/nx:debug",
"options": {
"noHmr": true,
"uglify": false,
"release": false,
"forDevice": false,
"prepare": false
}
}
}
}
2 changes: 1 addition & 1 deletion apps/demo/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class CustomPage extends ProtocolWrapper {
// import { ImageAsset } from '@nativescript/canvas';
declare const jp, GDPerformanceMonitor, android, java, UIColor;
let monitor;
import { Application, path as filePath, knownFolders, Utils, path as nsPath, ImageSource, Trace, Screen } from '@nativescript/core';
import { Application, path as filePath, knownFolders, Utils, path as nsPath, ImageSource, Trace, Screen, Color } from '@nativescript/core';

Canvas.useSurface = false;
// Canvas.forceGL = false;
Expand Down
1 change: 0 additions & 1 deletion apps/demo/src/plugin-demos/canvas-media.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Observable, EventData, Page } from '@nativescript/core';
import { DemoSharedCanvasMedia } from '@demo/shared';
import {} from '@nativescript/canvas-media';

export function navigatingTo(args: EventData) {
const page = <Page>args.object;
Expand Down
12 changes: 6 additions & 6 deletions apps/demo/src/plugin-demos/canvas-media.xml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<Page xmlns="http://schemas.nativescript.org/tns.xsd" xmlns:ui="@nativescript/canvas-media" navigatingTo="navigatingTo"
<Page xmlns="http://schemas.nativescript.org/tns.xsd" xmlns:ui="@nativescript/canvas-media" xmlns:audio="@nativescript/canvas-media/audio" xmlns:video="@nativescript/canvas-media/video" navigatingTo="navigatingTo"
class="page">
<Page.actionBar>
<ActionBar title="canvas-media" icon="" class="action-bar">
</ActionBar>
</Page.actionBar>
<GridLayout rows="*,*" loaded="{{loaded}}">
<!--<ui:Video playsinline="true" height="300">
<ui:source src="https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.webm"
<video:Video id="video" playsinline="true" autoplay="true" loop="true" height="300">
<ui:Source src="https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.webm"
type="video/webm"/>

<ui:source src="https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4"
<ui:Source src="https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.mp4"
type="video/mp4"/>
</ui:Video>
</video:Video>

<ui:Audio margin="0 10" controls="true" row="1" playsinline="true" height="300">
<!-- <ui:Audio margin="0 10" controls="true" row="1" playsinline="true" height="300">
<ui:source src="https://interactive-examples.mdn.mozilla.net/media/cc0-audio/t-rex-roar.mp3"
type="audio/mp3"/>
</ui:Audio> -->
Expand Down
2 changes: 1 addition & 1 deletion apps/demo/src/plugin-demos/canvas-three.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
</ActionBar>
</Page.actionBar>
<GridLayout class="bg-black w-full h-full" iosOverflowSafeArea="true">
<canvas:Canvas style="width:auto100%;height:100%;" id="canvas" ready="{{ canvasLoaded }}" loaded="{{ loaded }}"
<canvas:Canvas style="width:100%;height:100%;" id="canvas" ready="{{ canvasLoaded }}" loaded="{{ loaded }}"
unloaded="{{unloaded}}"/>
</GridLayout>
</Page>
Loading
Loading