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

WebGL Renderer #1790

Merged
merged 111 commits into from
Jun 23, 2019
Merged
Show file tree
Hide file tree
Changes from 105 commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
c97feab
Initial webgl renderer implementation
Tyriar Nov 16, 2018
e6d339a
Fix wide char caching in webgl renderer
Tyriar Nov 20, 2018
5c1e5a1
Merge branch 'master' into webgl2
Tyriar Nov 20, 2018
42eda14
Set theme in ctor
Tyriar Nov 22, 2018
928abdb
Merge branch 'master' into webgl2
Tyriar Nov 22, 2018
4372116
Merge branch 'master' into webgl2
Tyriar Nov 22, 2018
1567b41
Merge branch 'master' into webgl2
Tyriar Nov 23, 2018
128b1b0
Use polyfill for TypedArray.fill
Tyriar Nov 23, 2018
53dc2af
Use polyfill for TypedArray.slice
Tyriar Nov 23, 2018
569abde
Merge remote-tracking branch 'ups/master' into webgl2
Tyriar Nov 24, 2018
186b2be
Fix imports
Tyriar Nov 24, 2018
60e3ddb
Update color codes after merging the move to constants
Tyriar Nov 24, 2018
b8b111f
Only pass a subset of the attributes buffer to GPU
Tyriar Nov 25, 2018
fe79410
Merge branch 'master' into webgl2
Tyriar Nov 27, 2018
6bc9b9b
Improve constructor use in sliceFallback
Tyriar Nov 29, 2018
c16d70e
Merge remote-tracking branch 'origin/master' into webgl2
Tyriar Dec 9, 2018
3d8b304
Reduce precision of floats in fragment shader
Tyriar Dec 9, 2018
bb9ccf4
Reduce diff with master
Tyriar Dec 9, 2018
1b1b641
Merge branch 'master' into webgl2
Tyriar Dec 21, 2018
26db71d
Merge branch 'master' into webgl2
Tyriar Dec 26, 2018
0ed0bfa
Merge branch 'master' into webgl2
Tyriar Dec 27, 2018
5f9144d
Fix null/whitespace early exit
Tyriar Dec 28, 2018
9cf3d14
Clean up loop that sets cell coordinates
Tyriar Dec 28, 2018
01b37b2
Document how GlyphRenderer.render works
Tyriar Dec 28, 2018
1227497
Merge branch 'master' into webgl2
Tyriar Dec 28, 2018
4083881
Merge branch 'master' into webgl2
Tyriar Jan 1, 2019
b0e51b9
Fix build error
Tyriar Jan 2, 2019
66735ba
Merge branch 'master' into webgl2
Tyriar Jan 2, 2019
98706aa
Use bg luminance to determine background color
juancampa Jan 8, 2019
1d7a39b
Disable antialiasing and depth buffer for WebGL2 contexts
juancampa Jan 15, 2019
a92c0c1
Merge pull request #4 from juancampa/no-aa-depth
Tyriar Jan 15, 2019
4181321
Add super.dispose to WebglRenderer.dispose
Tyriar Jan 16, 2019
c435682
Merge remote-tracking branch 'origin/master' into webgl2
Tyriar Jan 16, 2019
e387b20
Adding missing parameter to GlyphRenderer
juancampa Jan 18, 2019
62ac714
Merge pull request #3 from juancampa/selection-simple-webgl2
Tyriar Jan 19, 2019
3077ae5
Only apply the selection hack for the WebGL renderer
juancampa Jan 21, 2019
1927bc8
Fix lint
Tyriar Jan 26, 2019
15ef5be
Merge branch 'master' into webgl2
Tyriar Jan 26, 2019
f5d9019
Merge branch 'master' into webgl2
Tyriar Jan 31, 2019
1ecc9dc
Merge branch 'master' into webgl2
Tyriar Mar 4, 2019
9abe46f
Merge branch 'master' into webgl2
Tyriar Mar 8, 2019
b0299ac
Merge remote-tracking branch 'origin/webgl2' into pr/juancampa/6-1
Tyriar Mar 8, 2019
1ce75cd
Encapsulate hacks inside WebglRenderer
Tyriar Mar 8, 2019
5ebb4e8
Clarify comment
Tyriar Mar 8, 2019
4527e92
Merge pull request #6 from juancampa/selection-simple-2
Tyriar Mar 8, 2019
542c109
Merge branch 'master' into webgl2
Tyriar Apr 2, 2019
440e097
Merge commit '25745777c653acb53a7bf3864603c1ad7aaaa637' into webgl2
Tyriar May 18, 2019
72719a6
Fix WebGL rendering after UTF-32 by fixing get chardata attr
Tyriar May 18, 2019
707d8ba
Merge commit 'fa70aa0983947e4444bcc9c1eeaaa516c1f88fe8' into webgl2
Tyriar May 18, 2019
30567ec
Fix event emitter in webgl renderer
Tyriar May 4, 2019
1e564fd
Merge commit 'd261862' into webgl2
Tyriar May 18, 2019
2a155d5
Merge branch 'master' into webgl2
Tyriar May 18, 2019
3df9126
Merge remote-tracking branch 'origin/master' into webgl2
Tyriar May 19, 2019
cf86760
Use IColorSet instead of IColorManager
Tyriar May 19, 2019
e0ff444
Merge remote-tracking branch 'origin/master' into webgl2
Tyriar May 19, 2019
f42e53f
Update for recent changes
Tyriar May 19, 2019
6922156
Move atlas parts into webgl/
Tyriar May 19, 2019
29d3b82
Copy over typed array utils to webgl
Tyriar May 19, 2019
134c2ff
Move parts of webgl renderer to public API
Tyriar May 19, 2019
061854b
Remove more dependencies on rest of project
Tyriar May 19, 2019
20dfaae
Fix runtime error
Tyriar May 19, 2019
510985f
Add a basic test
Tyriar May 19, 2019
2506833
Use more API in WebglRenderer
Tyriar May 19, 2019
4beea9b
Add tests for webgl bg colors
Tyriar May 19, 2019
b79d73d
Add foreground tests
Tyriar May 19, 2019
493e8ad
Remove webgl dependence on DEFAULT_ANSI_COLORS
Tyriar May 20, 2019
10aae5d
Merge branch 'master' into webgl2
Tyriar May 21, 2019
9feaf62
Merge remote-tracking branch 'origin/master' into webgl2
Tyriar Jun 1, 2019
5b86f92
Fix conflicts in webgl renderer
Tyriar Jun 1, 2019
df411c9
Merge branch 'master' into webgl2
Tyriar Jun 1, 2019
eafb322
Merge branch 'master' into webgl2
Tyriar Jun 1, 2019
7c6db2e
Merge branch 'master' into webgl2
Tyriar Jun 13, 2019
ee81f50
Fix conflicts
Tyriar Jun 13, 2019
a5e4668
Fix lint
Tyriar Jun 13, 2019
a19ea1e
Remove forked LifeCycle and TypedArray files
Tyriar Jun 14, 2019
d4169f3
Fix tests
Tyriar Jun 15, 2019
21d07d1
Remove unused portion of CharAtlasGenerator
Tyriar Jun 15, 2019
e959cce
Remove webgl LRUMap
Tyriar Jun 15, 2019
4b4b58e
Fix screen dpr change not refreshing canvas renderer
Tyriar Jun 15, 2019
2584de8
Clear webgl model after theme or dpr change
Tyriar Jun 15, 2019
4daf672
Merge branch 'master' into webgl2
Tyriar Jun 15, 2019
6ff9045
Merge branch 'master' into webgl2
Tyriar Jun 15, 2019
6c232a0
Remove renderer API
Tyriar Jun 15, 2019
3a7aa77
Remove remaining parts of renderer API, fix webgl tests
Tyriar Jun 15, 2019
ddb9fbd
Improve type safety in webgl
Tyriar Jun 15, 2019
b7cdbb9
Remove default exports in webgl char atlas files
Tyriar Jun 15, 2019
535c8a5
Merge branch 'master' into webgl2
Tyriar Jun 15, 2019
d7daa53
Move webgl renderer into addon dir
Tyriar Jun 15, 2019
50d6711
Fix webgl packaging
Tyriar Jun 15, 2019
eae0ab9
Add a webgl button to the demo
Tyriar Jun 15, 2019
d272422
Fix webgl addon version
Tyriar Jun 15, 2019
765297e
Add addon typings
Tyriar Jun 15, 2019
dd9b755
Fix webgl api tests
Tyriar Jun 15, 2019
15647a0
Speed up webgl tests
Tyriar Jun 15, 2019
07b6b69
Remove old comment
Tyriar Jun 15, 2019
05188a9
Merge branch 'master' into webgl2
Tyriar Jun 15, 2019
04ba351
Adopt automated released in webgl addon
Tyriar Jun 15, 2019
6e04058
Reduce diff
Tyriar Jun 15, 2019
45ec3b1
Merge branch 'master' into webgl2
Tyriar Jun 15, 2019
1ebae41
Pull attribute compat stuff into addon
Tyriar Jun 15, 2019
7148358
Prevent crash on true color, add TODOs for it
Tyriar Jun 15, 2019
8b4901e
Reduce diff
Tyriar Jun 15, 2019
bc24a6c
Merge branch 'master' into webgl2
Tyriar Jun 16, 2019
5100c7a
Use Constants from core
Tyriar Jun 16, 2019
1b7862c
Move slice typed array util into webgl addon
Tyriar Jun 17, 2019
5321f03
Fix quote and comma
Tyriar Jun 17, 2019
b7dba18
Merge branch 'master' into webgl2
Tyriar Jun 22, 2019
fb420d7
Merge branch 'master' into webgl2
Tyriar Jun 23, 2019
e10adaf
Have yarn clean also delete addon out/
Tyriar Jun 23, 2019
fdae27e
Remove unused Platform.ts in webgl
Tyriar Jun 23, 2019
533f3bd
Remove unneeded TODOs
Tyriar Jun 23, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions addons/xterm-addon-webgl/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
lib
node_modules
5 changes: 5 additions & 0 deletions addons/xterm-addon-webgl/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
**/*.api.js
**/*.api.ts
tsconfig.json
.yarnrc
webpack.config.js
19 changes: 19 additions & 0 deletions addons/xterm-addon-webgl/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright (c) 2018, The xterm.js authors (https://github.com/xtermjs/xterm.js)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
20 changes: 20 additions & 0 deletions addons/xterm-addon-webgl/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "xterm-addon-webgl",
"version": "0.1.0",
"author": {
"name": "The xterm.js authors",
"url": "https://xtermjs.org/"
},
"main": "lib/xterm-addon-webgl.js",
"types": "typings/xterm-addon-webgl.d.ts",
"license": "MIT",
"scripts": {
"build": "../../node_modules/.bin/tsc -p src",
"prepackage": "npm run build",
"package": "../../node_modules/.bin/webpack",
"prepublishOnly": "npm run package"
},
"peerDependencies": {
"xterm": "^3.14.0"
}
}
28 changes: 28 additions & 0 deletions addons/xterm-addon-webgl/src/CharDataCompat.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* Copyright (c) 2019 The xterm.js authors. All rights reserved.
* @license MIT
*/

import { CellData } from 'common/buffer/CellData';
import { FLAGS } from './Constants';
import { IBufferLine } from 'common/Types';

export function getCompatAttr(bufferLine: IBufferLine, index: number): number {
Tyriar marked this conversation as resolved.
Show resolved Hide resolved
// TODO: Need to move WebGL over to the new system and remove this block
const cell = new CellData();
bufferLine.loadCell(index, cell);
const oldBg = cell.getBgColor() === -1 ? 256 : cell.getBgColor();
const oldFg = cell.getFgColor() === -1 ? 256 : cell.getFgColor();
const oldAttr =
(cell.isBold() ? FLAGS.BOLD : 0) |
(cell.isUnderline() ? FLAGS.UNDERLINE : 0) |
(cell.isBlink() ? FLAGS.BLINK : 0) |
(cell.isInverse() ? FLAGS.INVERSE : 0) |
(cell.isDim() ? FLAGS.DIM : 0) |
(cell.isItalic() ? FLAGS.ITALIC : 0);
const attrCompat =
oldBg |
(oldFg << 9) |
(oldAttr << 18);
return attrCompat;
}
14 changes: 14 additions & 0 deletions addons/xterm-addon-webgl/src/ColorUtils.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* @license MIT
* Copyright (c) 2018 The xterm.js authors. All rights reserved.
*/

import { IColor } from 'browser/Types';

export function getLuminance(color: IColor): number {
// Coefficients taken from: https://www.w3.org/TR/AERT/#color-contrast
const r = color.rgba >> 24 & 0xff;
const g = color.rgba >> 16 & 0xff;
const b = color.rgba >> 8 & 0xff;
return (0.299 * r + 0.587 * g + 0.114 * b) / 255;
}
15 changes: 15 additions & 0 deletions addons/xterm-addon-webgl/src/Constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* Copyright (c) 2019 The xterm.js authors. All rights reserved.
* @license MIT
*/

// TODO: Should be removed after chardata workaround is fixed
export const enum FLAGS {
BOLD = 1,
UNDERLINE = 2,
BLINK = 4,
INVERSE = 8,
INVISIBLE = 16,
DIM = 32,
ITALIC = 64
}
Loading