Commit Graph
325 Commits
Author SHA1 Message Date
Daniel Imms ed15a8e170 Create new event with emitter object to simplify code 2022-10-01 08:45:40 -07:00
Daniel Imms 8e378c07e9 Merge pull request #4165 from Tyriar/4164
Define all events and emitters consistently
2022-10-01 08:28:18 -07:00
Daniel Imms 1a22c44f2b Make all emitters readonly 2022-10-01 08:02:32 -07:00
Daniel Imms cf9949840b Use readonly over getter for exposing events
Fixes #4164
2022-10-01 07:52:26 -07:00
Daniel Imms 52ed65d7bd Move w objects to $ prefix variables
Fixes #4138
2022-10-01 07:26:07 -07:00
Daniel Imms c548977a3e Fix imports 2022-09-24 16:16:14 -07:00
Daniel Imms aec1f2b2be Fix import 2022-09-24 11:58:17 -07:00
Daniel Imms c42f290eb8 Do char atlas warmup via new IdleTaskQueue 2022-09-24 11:10:54 -07:00
Daniel Imms d62b4531c3 Optimize contexts for reading frequently
This was a recommendation from Edge.
Docs here: https://html.spec.whatwg.org/multipage/canvas.html#concept-canvas-will-read-frequently
2022-09-24 06:58:01 -07:00
Daniel Imms 78128762f9 Perform texture atlas warm up in an idle callback
Part of #4103
2022-09-22 13:06:08 -07:00
Mihai Parparita a39a468f19 Make terminal rendering work in popout windows
Add support for the parent element (what is passed to Terminal.open)
being in a different (same origin) window. Accesses to DOM APIs such
as requestAnimationFrame and devicePixelRatio thus need to be scoped
to the corrent window, instead of assuming that it's the same as the
window/global scope where the code is running.

This is done by inferring a parent window at the creation time, and
then storing it in CoreBrowserService, which is already passed to most
places that need it.

To catch future regressions, an ESLint rule that checks for global
accesses is added (it uses AST selectors via the no-restricted-syntax
rule).

This should also be applicable when the parent element is an iframe.

Fixes #3758
2022-09-08 16:59:31 -07:00
Daniel Imms 9ef2397918 Merge pull request #4101 from JasonXJ/render-bug
WebglRenderer always clears _glyphRenderer if _model is cleared
2022-09-07 09:01:41 -07:00
Jason Lin 4752f99e03 Webgl cursor renderer makes sure a char is not drawn outside of the cell 2022-09-06 14:12:15 +10:00
Jason Lin e5ad3ce9b9 Polish 2022-09-05 17:32:02 +10:00
Jason Lin faf5f72c1f Clear glyph render when the webgl model is cleared 2022-09-05 13:32:04 +10:00
Daniel Imms e8e2f16cff Merge remote-tracking branch 'upstream/master' into pr/silamon/4004 2022-09-02 13:05:52 -07:00
Daniel Imms 1b38a004a3 Merge pull request #3992 from SvanT/master
Bump minimum target to es2015
2022-09-02 12:43:40 -07:00
Daniel Imms d673e02afe Merge pull request #4089 from Tyriar/lgtm
Fix lgtm recommendations
2022-08-31 06:26:56 -07:00
Daniel Imms f309affff2 Tweak handling of _contextRestorationTimeout 2022-08-31 05:44:48 -07:00
Kenneth Russell 9459553665 Handle WebGL context loss/restore events in WebGL renderer.
If the context is restored within a brief period of time (3 seconds),
recreate members dependent on WebGL state, and fire onRequestRedraw to
the renderer's listeners.

Handle changes to the char atlas better in the demo client.

Tested in Chrome Canary on macOS by running the demo in one window,
and visiting the internal URL about:gpucrash in another window. The
terminal now recovers and redraws properly.
2022-08-30 19:42:22 -07:00
Daniel Imms 4a6e7bee21 Fix lgtm recommendations 2022-08-30 14:09:39 -07:00
Daniel Imms ef759a6d7b Merge pull request #4086 from Tyriar/padding_powerline
Only remove padding from restricted powerline chars
2022-08-30 08:53:03 -07:00
Daniel Imms 5c6d16ef0a Only remove padding from restricted powerline chars 2022-08-28 13:33:09 -07:00
Daniel Imms f7e0f69598 Fix rounding error gap in webgl renderer
Fixes #4054
Fixes #4076
2022-08-28 13:22:29 -07:00
Daniel Imms 3b4ecd0709 Optimize gc in rectangle renderer 2022-08-28 09:20:24 -07:00
Daniel Imms 4a50ca81c6 Optimize gc for WebglRenderer._updateModel and BufferLine.loadCell
RectangleRenderer not done yet
2022-08-28 09:06:42 -07:00
Daniel Imms 1d945fdffc Create 2 and 4 key map objects, use in color and glyph caches 2022-08-28 08:34:51 -07:00
Daniel Imms 23ee719f6e Remove more garbage collection issues from cell render loop
Part of #4079
2022-08-28 08:02:35 -07:00
Daniel Imms 1b64a09f50 Correct conditions after moving to work object 2022-08-27 21:35:56 -07:00
Daniel Imms 5e3f63e876 Avoid garbage collection in webgl decoration hot code
Part of #4079
2022-08-27 20:06:58 -07:00
Daniel Imms 4ecc098de4 Get width of emoji/combined chars 2022-08-27 06:38:15 -07:00
Daniel Imms e76918eddc Take char width into account when drawing underlines/strokethrough
Fixes #4063
2022-08-27 06:34:38 -07:00
Daniel Imms 2526409ca5 Merge pull request #4074 from Tyriar/4059
Only draw character outline if it has a descent
2022-08-26 14:38:40 -07:00
Daniel Imms 7ffd9e1f7f Only draw character outline if it has a descent
Fixes #4059
2022-08-26 14:16:02 -07:00
Daniel Imms 8bbbc98ac8 Merge pull request #4073 from Tyriar/4072
Show entire glyph for extra powerline symbols
2022-08-26 08:33:53 -07:00
Daniel Imms f6860442fb Show entire glyph for extra powerline symbols
Fixes #4072
2022-08-26 08:12:00 -07:00
Daniel Imms 774ebe40e6 Improve glyph padding, especially in large font sizes
Fixes #4066
2022-08-26 07:26:36 -07:00
Daniel Imms 523de80162 Merge branch 'master' into vscode_158497 2022-08-24 15:36:44 -07:00
Daniel Imms e40cf0684e Properly clear underscore glyph's background
See microsoft/vscode#158497
2022-08-24 15:36:03 -07:00
Daniel Imms 0698afaf12 Only stroke glyph when font size >= 12 2022-08-19 13:24:39 -07:00
Daniel Imms 79d47893df Move webgl underline rendering down
See microsoft/vscode#158326
2022-08-19 13:19:08 -07:00
Simon Lamon a1385f589b Required options 2022-08-05 16:16:12 +00:00
Svante Boberg 14b02b9ad5 Bump minimum target to es2015
Now that we no longer support IE we can raise the minimum ES target a
bit. Changing to es2015 shaves off ~17% from the main bundle size, also
it prevents generators from being transpiled into regular functions etc.
so I would guess it has the potential to give some general performance
improvements too.

For fun I also tried to raise it to es2022, this gave a slightly bigger
bundle than es2015 so I think es2015 could be an ok target unless we
need something newer for some reason.
2022-08-01 10:17:10 +02:00
Daniel Imms 39959c2861 Don't dim default bg in webgl
Fixes #3970
2022-07-31 15:39:34 -07:00
Daniel Imms 1ede106ab4 Fix powerlines not clipped when bg changes 2022-07-31 12:05:20 -07:00
Daniel Imms e7e71dbd3c Merge remote-tracking branch 'upstream/master' into 3969 2022-07-31 11:35:47 -07:00
Daniel Imms d6fe5c7384 Update size when letter spacing changes 2022-07-31 11:21:27 -07:00
Daniel Imms 75ca5006a2 Expose texture atlas change event and use in demo 2022-07-31 11:16:12 -07:00
Daniel Imms 266d795179 Fix line height and letter spacing for custom glyphs 2022-07-31 10:58:04 -07:00
Daniel Imms 889e3ad14b Merge pull request #3980 from Tyriar/3971
Fix underline color and polish width and positioning
2022-07-30 23:50:20 -07:00