Rendering: Difference between revisions
Appearance
No edit summary |
No edit summary |
||
| Line 9: | Line 9: | ||
Rendering text takes a lot of time. To save on time, the content of a tile is cached to a canvas. This avoids the need to re-render all tiles every time the user moves the page. | Rendering text takes a lot of time. To save on time, the content of a tile is cached to a canvas. This avoids the need to re-render all tiles every time the user moves the page. | ||
Prior to July 2021, all tiles had their own dedicated canvas to cache the rendered content. This later proved to be inefficient, since browsers tend to struggle having hundreds of canvas contexts in memory. | Prior to July 2021, all tiles had their own dedicated canvas to cache the rendered content. This later proved to be inefficient, since browsers tend to struggle having hundreds of canvas contexts in memory. The solution was to create large canvases, storing multiple tiles per canvas. Whenever a tile is ready to be placed onto the main screen, the specific region where the tile is located within the canvas is put onto the screen. | ||
==Transparency== | |||
By default, the text rendering canvas has the 'alpha' flag set to true, meaning its background is transparent. This means the tile's background color and cell protections are re-drawn for every frame and are not cached. | |||
In non-transparent mode, the 'alpha' flag is set to false, meaning the background along the text is cached. Thus the tile's background is not redrawn for every frame. This mode also has the added consequence of text having subpixel rendering, which may make the text look crisper on LCD screens. | |||
==Queued rendering== | ==Queued rendering== | ||