w23 / alacritty

A cross-platform, GPU-accelerated terminal emulator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rendering order needs rework

w23 opened this issue · comments

Currently simple renderer forces full screen text rendering when with_api returns. However, display.rs calls with_api many times for various things like message overlays, etc. This makes it render text more than once and actively interferes with rects rendering (they get overwritten).

For example the sequence could be:

  1. Clear with background color
  2. Fill internal render buffers with actual terminal text data. Don't render anything yet.
  3. Add "overlay" text to render buffers: messages, debug timers, etc. Don't add any background color rects, do this with text background color property instead.
  4. Paint entire screen with basic text. This will paint both content and messages
  5. Draw rects that do undreline/strike. Don't draw any message background rects at all.
  6. Swap buffers

Alternatively, text rendering could be organized as "Draw this text into this quad", so that we could draw different parts of screen with different rects in any order we want:

  • one text-renderer instance for main content
  • second is for messages and stuff