Skip to content

Commit

Permalink
chore: perf updates
Browse files Browse the repository at this point in the history
  • Loading branch information
triniwiz committed Jan 16, 2024
1 parent 01d6d00 commit d471deb
Show file tree
Hide file tree
Showing 103 changed files with 2,009 additions and 1,077 deletions.
2 changes: 1 addition & 1 deletion packages/canvas-babylon/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nativescript/canvas-babylon",
"version": "2.0.0-alpha.46",
"version": "2.0.0-alpha.47",
"description": "",
"main": "index",
"typings": "index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/canvas-chartjs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nativescript/canvas-chartjs",
"version": "2.0.0-alpha.46",
"version": "2.0.0-alpha.47",
"description": "ChartJS",
"main": "index",
"typings": "index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/canvas-media/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nativescript/canvas-media",
"version": "2.0.0-alpha.46",
"version": "2.0.0-alpha.47",
"description": "Canvas media",
"main": "index",
"typings": "index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/canvas-phaser-ce/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nativescript/canvas-phaser-ce",
"version": "2.0.0-alpha.46",
"version": "2.0.0-alpha.47",
"description": "Tools for using Phaser-ce to build native 2D games in NativeScript 👾",
"main": "index",
"typings": "index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/canvas-phaser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nativescript/canvas-phaser",
"version": "2.0.0-alpha.46",
"version": "2.0.0-alpha.47",
"description": "Build awesome 2D games with Phaser.js and NativeScript",
"main": "index",
"typings": "index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/canvas-pixi/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nativescript/canvas-pixi",
"version": "2.0.0-alpha.46",
"version": "2.0.0-alpha.47",
"description": "Plugin for using pixi.js in NativeScript",
"main": "index",
"typings": "index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/canvas-polyfill/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nativescript/canvas-polyfill",
"version": "2.0.0-alpha.46",
"version": "2.0.0-alpha.47",
"description": "Polyfill for making NativeScript compatible with web libs like pixi.js, three.js, phaser.js, babylon.js, etc....",
"main": "index",
"typings": "index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion packages/canvas-three/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nativescript/canvas-three",
"version": "2.0.0-alpha.46",
"version": "2.0.0-alpha.47",
"description": "Utilities for using THREE.js on NativeScript",
"main": "index",
"typings": "index.d.ts",
Expand Down
6 changes: 6 additions & 0 deletions packages/canvas/Canvas/index.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,9 @@ export class Canvas extends CanvasBase {
}

set width(value) {
if (this.style.width === value) {
return;
}
this.style.width = value;
this._didLayout = false;
this._layoutNative();
Expand All @@ -148,6 +151,9 @@ export class Canvas extends CanvasBase {
}

set height(value) {
if (this.style.height === value) {
return;
}
this.style.height = value;
this._didLayout = false;
this._layoutNative();
Expand Down
10 changes: 5 additions & 5 deletions packages/canvas/WebGL/WebGLRenderingContext/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,25 +126,25 @@ export class WebGLRenderingContextBase extends WebGLRenderingCommon {

@profile
bindBuffer(target: number, buffer: WebGLBuffer): void {
const value = buffer ? buffer.native : null;
const value = buffer ? buffer.native : 0;
this.native.bindBuffer(target, value);
}

@profile
bindFramebuffer(target: number, framebuffer: WebGLFramebuffer): void {
const value = framebuffer ? framebuffer.native : null;
const value = framebuffer ? framebuffer.native : 0;
this.native.bindFramebuffer(target, value);
}

@profile
bindRenderbuffer(target: number, renderbuffer: WebGLRenderbuffer): void {
const value = renderbuffer ? renderbuffer.native : null;
const value = renderbuffer ? renderbuffer.native : 0;
this.native.bindRenderbuffer(target, value);
}

@profile
bindTexture(target: number, texture: WebGLTexture): void {
const value = texture ? texture.native : null;
const value = texture ? texture.native : 0;
this.native.bindTexture(target, value);
}

Expand Down Expand Up @@ -1035,7 +1035,7 @@ export class WebGLRenderingContextBase extends WebGLRenderingCommon {

@profile
useProgram(program: WebGLProgram): void {
const value = program ? program.native : null;
const value = program ? program.native : 0;
this.native.useProgram(value);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/canvas/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@nativescript/canvas",
"version": "2.0.0-alpha.46",
"version": "2.0.0-alpha.47",
"description": "DOM Canvas API for NativeScript",
"main": "index",
"typings": "index.d.ts",
Expand Down
Loading

0 comments on commit d471deb

Please sign in to comment.