aboutsummaryrefslogtreecommitdiff
path: root/src/renderer
Commit message (Collapse)AuthorAge
...
* Add license headers to source filesJoe Wilm2016-06-29
|
* Implement terminal resizingJoe Wilm2016-06-29
| | | | | | | | | | | | | | The resize event is received from glutin on the update thread, but the renderer needs to be informed as well for updating the viewport and projection matrix. This is achieved with an mpsc::channel. To support resizing, the grid now offers methods for growing and shrinking, and there are several implementations available for clear_region based on different Range* types. Core resize logic is all in Term::resize. It attempts to keep as much context as possible when shinking the window. When growing, it's basically just adding rows.
* Refactor Tty and Grid creation into Term::newJoe Wilm2016-06-28
| | | | | | | This moves more logic out of main() and prepares the Term type to handle resizing. By providing all size data to Term, it is now possible to implement a resize function there which handles all resizing logic save for the rendering subsystem.
* Add support for macOSJoe Wilm2016-06-14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Alacritty now runs on macOS using CoreText for font rendering. The font rendering subsystems were moved into a separate crate called `font`. The font crate provides a unified (albeit limited) API which wraps CoreText on macOS and FreeType/FontConfig on other platforms. The unified API differed slightly from what the original Rasterizer for freetype implemented, and it was updated accordingly. The cell separation properties (sep_x and sep_y) are now premultiplied into the cell width and height. They were previously passed through as uniforms to the shaders; removing them prevents a lot of redundant work. `libc` has some differences between Linux and macOS. `__errno_location` is not available on macOS, and the `errno` crate was brought in to provide a cross-platform API for dealing with errno. Differences in `openpty` were handled by implementing a macOS specific version. It would be worth investigating a way to unify the implementations at some point. A type mismatch with TIOCSCTTY was resolved with a cast. Differences in libc::passwd struct fields were resolved by using std::mem::uninitialized instead of zeroing the struct ourselves. This has the benefit of being much cleaner. The thread setup had to be changed to support both macOS and Linux. macOS requires that events from the window be handled on the main thread. Failure to do so will prevent the glutin window from even showing up! For this reason, the renderer and parser were moved to their own thread, and the input is received on the main thread. This is essentially reverse the setup prior to this commit. Renderer initialization (and thus font cache initialization) had to be moved to the rendering thread as well since there's no way to make_context(null) with glx on Linux. Trying to just call make_context a second time on the rendering thread had resulted in a panic!.
* Fix all trivial compiler warningsJoe Wilm2016-06-09
| | | | | | | | | | | Of note are the `ansi` and `grid` modules becoming public. There are several bits of unused code in each of these. In the case of `grid`, the unused parts are generally useful, like some indexing implementations. In ansi, there are pieces that will be used once the parser is more complete. In any case, these modules are fairly generic and mostly usable outside of Alacritty. Unused cargo packages were also removed.
* Add support for drawing background colorsJoe Wilm2016-06-06
|
* Support dynamic character loadingJoe Wilm2016-06-06
| | | | | | | | | The glyph cache was previously initialized with a list of glyphs from INIT_LIST, and never updated again. This meant that code points not included in that list were not displayed. Now, the glyph cache has gained the ability to load new glyphs at render time. This seems to have lightly decreased performance for some reason.
* Batching flushes on texture changeJoe Wilm2016-06-06
| | | | This fixes a bug when multiple atlases are required.
* Refactor Instanced Drawing to use Vertex ArraysJoe Wilm2016-06-06
| | | | | | | | | | Per-instanced data was previously stored in uniforms. This required several OpenGL calls to upload all of the data, and it was more complex to prepare (several vecs vs one). Additionally, drawing APIs are now accessible through a `RenderApi` (obtained through `QuadRenderer::with_api`) which enables some RAII patterns. Specifically, checks for batch flushing are handled in Drop.
* Optimize Rendering with batched draw callsJoe Wilm2016-06-04
| | | | | Draw calls are now batched for performance. Render times on git log at the default size are now ~200usec.
* Add iterator methods to Grid and Row typesJoe Wilm2016-06-04
| | | | | | | The iterator methods simplify logic in the main grid render function. To disambiguate iterator methods from those returning counts (and to free up names), the `rows()` and `cols()` methods on `Grid` have been renamed to `num_rows()` and `num_cols()`, respectively.
* Optimize renderingJoe Wilm2016-06-04
| | | | | | | | This moves some logic that was previously being done per-character into the vertex shader. At this time, we've traded CPU computation for additional gl::Uniform2f calls. This is only a marginal improvement. However, this patch positions the renderer well for instanced drawing, and that will be a huge performance win.
* Add live-reload for shadersJoe Wilm2016-06-04
| | | | | | | Recompiling the entire program whenever a shader changes is slow, and it can interrupt flow. Shader reloads are essentially instantaneous now. If the new shader fails to compile, no state is changed; the previous program continues to be used.
* render: cleanup active_tex handlingJoe Wilm2016-06-03
| | | | | - Removes a spammy printn! - Sets active_tex to zero wherever gl::BindTexture is called with zero
* Move debug timerJoe Wilm2016-06-03
| | | | It was near the left side; it will be less in-the-way on the right.
* Use texture atlas for glyphsJoe Wilm2016-06-02
| | | | | | This dramatically reduces the number of BindTexture calls needed when rendering the grid. Draw times for a moderately full terminal of the default size are ~1ms with this patch.
* Refactor renderer functions out of main.rsJoe Wilm2016-06-02
| | | | | | | | This moves the rendering logic to draw the grid, to draw strings, and to draw the cursor into the renderere module. In addition to being an organizational improvement, this also allowed for some optimizations managing OpenGL state. Render times for a moderate screen of text dropped from ~10ms to ~4ms.
* Initial support for Terminal Emulation (woo!)Joe Wilm2016-06-02
| | | | | | | | | | | | | | | | This patch introduces basic support for terminal emulation. Basic means commands that don't use paging and are not full screen applications like vim or tmux. Some paging applications are working properly, such as as `git log`. Other pagers work reasonably well as long as the help menu is not accessed. There is now a central Rgb color type which is shared by the renderer, terminal emulation, and the pty parser. The parser no longer owns a Handler. Instead, a mutable reference to a Handler is provided whenever advancing the parser. This resolved some potential ownership issues (eg parser owning the `Term` type would've been unworkable).
* Add render time meterJoe Wilm2016-05-21
| | | | Optimization is impossible without measurement!
* Correct sub-pixel font rendering with OpenGLJoe Wilm2016-05-20
| | | | | | | | | Uses the GL_ARB_blend_func_extended to get single-pass, per-channel alpha blending. gl_generator is now used instead of gl to enable the extension. The background color is removed since that presumably needs to run in a separate pass.
* Use subpixel font renderingJoe Wilm2016-04-11
| | | | | | | OpenGL only supports shared alpha blending. Subpixel font rendering requires using the font RGB values as alpha masks for the corresponding RGB channels. To support this, blending is implemented in the fragment shader.
* Cleanup PackedVertex initializationJoe Wilm2016-02-27
|
* Implement per vertex structJoe Wilm2016-02-27
|
* Organize buffer data into structJoe Wilm2016-02-26
|
* Move rendering stuff into renderer modJoe Wilm2016-02-25