Currently Webkit implements createImageBitmap() but returns a promise
rejection.
Note that once Webkit implements createImageBitmap() correctly these
changes should be removed.
I did a bunch of testing of various ansi escape codes (including
italics) with all three char atlas implementations (none, static,
dynamic), with and without `drawBoldTextInBrightColors`, and with and
without `enableBold` to test all of the edge cases that I could.
When we remove the background from a glyph, we can keep track of if we
made all the pixels fully transparent. If we did, we can just skip
future calls to _drawFromCache, since it would be a noop anyways.
This adds a very minimal implementation of DynamicCharAtlas using a LRU
cache.
I've got some optimizations that I'll add on top of this, but this
proves the concept.
This adds the logic needed to switch between multiple char atlas
implementations, and an example second implementation to test it out
with.
This also offers an escape hatch if something goes wrong with the char
atlas implementation(s).
This mostly worked before, but clearColor made the assumption that the
colors were always in #RRBBGG format. See the discussion here:
https://github.com/xtermjs/xterm.js/pull/1327#issuecomment-374812842
This changes the internal representation of a color so that we hold onto
into an object containing the original css string along with an RGBA
value encoded as a 32-bit uint. clearColor can then use that RGBA
representation.
Additionally, this deduplicates some code between ColorManager and
Terminal. Terminal was generating the 256 ansi colors the same way
ColorManager was, so this just makes Terminal use the same constant.
ICharAtlasRequest and ICharAtlasConfig need almost exactly the same set
of information, so it's simpler if we just merge the two types.
As an added bonus, this also adds devicePixelRatio to the config, which
helps guarantee that we won't ever accidentally end up with an atlas
using a different pixel ratio than we need.
- Ensures that everything is only defined in one place, and everything
imports from that place.
- Moves CHAR_ATLAS_CELL_SPACING into a subdirectory of shared/ so that
CharAtlasGenerator can pull from it.
This addresses the comments on
https://github.com/xtermjs/xterm.js/pull/1307/files/454fd4bfb1ab5c9ece
This doesn't actually add workers but it separates the code nicely
such that the minimal amount of relevant code can be pulled in by
worker code.
Part of #955