-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into new_parser
- Loading branch information
Showing
21 changed files
with
739 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/** | ||
* Copyright (c) 2017 The xterm.js authors. All rights reserved. | ||
* @license MIT | ||
*/ | ||
|
||
import { IGlyphIdentifier } from './Types'; | ||
|
||
export default abstract class BaseCharAtlas { | ||
private _didWarmUp: boolean = false; | ||
|
||
/** | ||
* Perform any work needed to warm the cache before it can be used. May be called multiple times. | ||
* Implement _doWarmUp instead if you only want to get called once. | ||
*/ | ||
public warmUp(): void { | ||
if (!this._didWarmUp) { | ||
this._doWarmUp(); | ||
this._didWarmUp = true; | ||
} | ||
} | ||
|
||
/** | ||
* Perform any work needed to warm the cache before it can be used. Used by the default | ||
* implementation of warmUp(), and will only be called once. | ||
*/ | ||
protected _doWarmUp(): void { } | ||
|
||
/** | ||
* Called when we start drawing a new frame. | ||
* | ||
* TODO: We rely on this getting called by TextRenderLayer. This should really be called by | ||
* Renderer instead, but we need to make Renderer the source-of-truth for the char atlas, instead | ||
* of BaseRenderLayer. | ||
*/ | ||
public beginFrame(): void { } | ||
|
||
/** | ||
* May be called before warmUp finishes, however it is okay for the implementation to | ||
* do nothing and return false in that case. | ||
* | ||
* @param ctx Where to draw the character onto. | ||
* @param glyph Information about what to draw | ||
* @param x The position on the context to start drawing at | ||
* @param y The position on the context to start drawing at | ||
* @returns The success state. True if we drew the character. | ||
*/ | ||
public abstract draw( | ||
ctx: CanvasRenderingContext2D, | ||
glyph: IGlyphIdentifier, | ||
x: number, | ||
y: number | ||
): boolean; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.