ZIm/crates/gpui/src
Antonio Scandurra 45d1690f6e Use 16-bit float to store path windings
Previously, we were using a normalized 8-bit unsigned integer which forced us
to represent each increment of the winding number as a fraction of the max
value (1 / 255) which we would then add up using additive alpha blending.

This had three major drawbacks:

- The max winding number could not be greater than 255.
- Adding up (1 / 255) several times could result in a loss of precision.
- Due to also computing anti-aliasing as a fractional winding number, we had to
  reduce the max winding number to 32. This was still not good enough because
  we would multiply a fractional value with `1 / 32`, thus introducing more and
  more loss of precision.

This commit changes the texture type to an `f16` which doesn't require the
division by 255 and enables greater precision in the computation of the
anti-aliased parts of a curve. Note how this also removes the limitation of 255
windings at most per curve. The tradeoff is paying twice as much memory for
storing the texture, but that seems totally valid to achieve rendering accuracy.

Note that this kind of texture should be compatible with WebGL2 once we start
working on a web version of Zed.
2021-12-05 11:17:26 +01:00
..
elements Associate collaborator avatars with "ribbons" corresponding to their cursor color 2021-11-28 13:25:05 -07:00
platform Use 16-bit float to store path windings 2021-12-05 11:17:26 +01:00
views Introduce weak_handle methods on ModelContext and ViewContext 2021-11-29 14:13:22 -08:00
app.rs Clear pending keystrokes after dispatching an action 2021-12-03 17:59:46 +01:00
assets.rs Move all crates to a top-level crates folder 2021-10-04 13:22:21 -06:00
clipboard.rs Move all crates to a top-level crates folder 2021-10-04 13:22:21 -06:00
color.rs Move all crates to a top-level crates folder 2021-10-04 13:22:21 -06:00
elements.rs Start work on generalizing the BlockMap to allow arbitrary elements 2021-12-01 15:25:55 -08:00
executor.rs Explicitly shut down language servers when quitting the app 2021-11-02 13:16:25 -06:00
font_cache.rs Calculate an overshoot when mousing to build columnar selections 2021-11-24 10:28:32 +01:00
fonts.rs Calculate an overshoot when mousing to build columnar selections 2021-11-24 10:28:32 +01:00
geometry.rs Move all crates to a top-level crates folder 2021-10-04 13:22:21 -06:00
gpui.rs Name the root file of every crate after the crate to ease navigation 2021-11-30 12:46:39 -07:00
image_data.rs Move all crates to a top-level crates folder 2021-10-04 13:22:21 -06:00
json.rs Move all crates to a top-level crates folder 2021-10-04 13:22:21 -06:00
keymap.rs Clear pending keystrokes after dispatching an action 2021-12-03 17:59:46 +01:00
platform.rs Calculate an overshoot when mousing to build columnar selections 2021-11-24 10:28:32 +01:00
presenter.rs Move all crates to a top-level crates folder 2021-10-04 13:22:21 -06:00
scene.rs Move all crates to a top-level crates folder 2021-10-04 13:22:21 -06:00
test.rs Use the same test::run_test function for async gpui::tests 2021-10-05 18:04:22 +02:00
text_layout.rs Paint highlighted lines correctly when horizontally scrolled 2021-11-29 11:28:43 -08:00
util.rs Move all crates to a top-level crates folder 2021-10-04 13:22:21 -06:00
views.rs Move all crates to a top-level crates folder 2021-10-04 13:22:21 -06:00