@xterm/addon-webgl 0.20.0-beta.265 → 0.20.0-beta.267
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/README.md +1 -1
- package/lib/addon-webgl.js +1 -1
- package/lib/addon-webgl.js.map +1 -1
- package/lib/addon-webgl.mjs +1 -1
- package/lib/addon-webgl.mjs.map +1 -1
- package/package.json +3 -3
- package/src/GlyphRenderer.ts +1 -1
- package/src/TextureAtlas.ts +3 -3
- package/src/WebglAddon.ts +1 -1
- package/src/WebglRenderer.ts +2 -2
- package/typings/addon-webgl.d.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xterm/addon-webgl",
|
|
3
|
-
"version": "0.20.0-beta.
|
|
3
|
+
"version": "0.20.0-beta.267",
|
|
4
4
|
"author": {
|
|
5
5
|
"name": "The xterm.js authors",
|
|
6
6
|
"url": "https://xtermjs.org/"
|
|
@@ -23,8 +23,8 @@
|
|
|
23
23
|
"prepublishOnly": "npm run package",
|
|
24
24
|
"start": "node ../../demo/start"
|
|
25
25
|
},
|
|
26
|
-
"commit": "
|
|
26
|
+
"commit": "4226e64245bbf0612a94d81c907fe11cf1065b9a",
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@xterm/xterm": "^6.1.0-beta.
|
|
28
|
+
"@xterm/xterm": "^6.1.0-beta.268"
|
|
29
29
|
}
|
|
30
30
|
}
|
package/src/GlyphRenderer.ts
CHANGED
|
@@ -220,7 +220,7 @@ export class GlyphRenderer extends Disposable {
|
|
|
220
220
|
public updateCell(x: number, y: number, code: number, bg: number, fg: number, ext: number, chars: string, width: number, lastBg: number): void {
|
|
221
221
|
// Since this function is called for every cell (`rows*cols`), it must be very optimized. It
|
|
222
222
|
// should not instantiate any variables unless a new glyph is drawn to the cache where the
|
|
223
|
-
// slight slowdown is acceptable for the developer ergonomics provided as it's a
|
|
223
|
+
// slight slowdown is acceptable for the developer ergonomics provided as it's a one-off for
|
|
224
224
|
// each glyph.
|
|
225
225
|
this._updateCell(this._vertices.attributes, x, y, code, bg, fg, ext, chars, width, lastBg);
|
|
226
226
|
}
|
package/src/TextureAtlas.ts
CHANGED
|
@@ -69,7 +69,7 @@ export class TextureAtlas implements ITextureAtlas {
|
|
|
69
69
|
private _overflowSizePage: AtlasPage | undefined;
|
|
70
70
|
|
|
71
71
|
private _tmpCanvas: HTMLCanvasElement;
|
|
72
|
-
// A temporary context that glyphs are drawn to before being
|
|
72
|
+
// A temporary context that glyphs are drawn to before being transferred to the atlas.
|
|
73
73
|
private _tmpCtx: CanvasRenderingContext2D;
|
|
74
74
|
|
|
75
75
|
private _workBoundingBox: IBoundingBox = { top: 0, left: 0, bottom: 0, right: 0 };
|
|
@@ -152,7 +152,7 @@ export class TextureAtlas implements ITextureAtlas {
|
|
|
152
152
|
}
|
|
153
153
|
|
|
154
154
|
private _createNewPage(): AtlasPage {
|
|
155
|
-
// Try merge the set of the 4 most used pages of the largest size. This is
|
|
155
|
+
// Try merge the set of the 4 most used pages of the largest size. This is deferred to a
|
|
156
156
|
// microtask to ensure it does not interrupt textures that will be rendered in the current
|
|
157
157
|
// animation frame which would result in blank rendered areas. This is actually not that
|
|
158
158
|
// expensive relative to drawing the glyphs, so there is no need to wait for an idle callback.
|
|
@@ -1125,7 +1125,7 @@ function clearColor(imageData: ImageData, bg: IColor, fg: IColor, enableThreshol
|
|
|
1125
1125
|
// were covered (fg=#8ae234, bg=#c4a000).
|
|
1126
1126
|
const threshold = Math.floor((Math.abs(r - fgR) + Math.abs(g - fgG) + Math.abs(b - fgB)) / 12);
|
|
1127
1127
|
|
|
1128
|
-
// Set alpha channel of
|
|
1128
|
+
// Set alpha channel of relevant pixels to 0
|
|
1129
1129
|
let isEmpty = true;
|
|
1130
1130
|
for (let offset = 0; offset < imageData.data.length; offset += 4) {
|
|
1131
1131
|
// Check exact match
|
package/src/WebglAddon.ts
CHANGED
|
@@ -40,7 +40,7 @@ export class WebglAddon extends Disposable implements ITerminalAddon, IWebglApi
|
|
|
40
40
|
};
|
|
41
41
|
const gl = document.createElement('canvas').getContext('webgl2', contextAttributes) as IWebGL2RenderingContext;
|
|
42
42
|
if (!gl) {
|
|
43
|
-
throw new Error('
|
|
43
|
+
throw new Error('WebGL2 is only supported on Safari 16 and above');
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
super();
|
package/src/WebglRenderer.ts
CHANGED
|
@@ -664,10 +664,10 @@ export class WebglRenderer extends Disposable implements IRenderer {
|
|
|
664
664
|
this.dimensions.device.canvas.height = this._terminal.rows * this.dimensions.device.cell.height;
|
|
665
665
|
this.dimensions.device.canvas.width = this._terminal.cols * this.dimensions.device.cell.width;
|
|
666
666
|
|
|
667
|
-
// The
|
|
667
|
+
// The size of the canvas on the page. It's important that this rounds to nearest integer
|
|
668
668
|
// and not ceils as browsers often have floating point precision issues where
|
|
669
669
|
// `window.devicePixelRatio` ends up being something like `1.100000023841858` for example, when
|
|
670
|
-
// it's actually 1.1. Ceiling may
|
|
670
|
+
// it's actually 1.1. Ceiling may cause blurriness as the backing canvas image is 1 pixel too
|
|
671
671
|
// large for the canvas element size.
|
|
672
672
|
this.dimensions.css.canvas.height = Math.round(this.dimensions.device.canvas.height / this._devicePixelRatio);
|
|
673
673
|
this.dimensions.css.canvas.width = Math.round(this.dimensions.device.canvas.width / this._devicePixelRatio);
|
package/typings/addon-webgl.d.ts
CHANGED
|
@@ -23,12 +23,12 @@ declare module '@xterm/addon-webgl' {
|
|
|
23
23
|
public readonly onChangeTextureAtlas: IEvent<HTMLCanvasElement>;
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
* An event that is fired when
|
|
26
|
+
* An event that is fired when a new page is added to the texture atlas.
|
|
27
27
|
*/
|
|
28
28
|
public readonly onAddTextureAtlasCanvas: IEvent<HTMLCanvasElement>;
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
-
* An event that is fired when
|
|
31
|
+
* An event that is fired when a page is removed from the texture atlas.
|
|
32
32
|
*/
|
|
33
33
|
public readonly onRemoveTextureAtlasCanvas: IEvent<HTMLCanvasElement>;
|
|
34
34
|
|