# Rework frame rendering · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/a40515dbb3ed2ec063514357335029f4515a71c9)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: a40515dbb3ed2ec063514357335029f4515a71c9

Requested commit: a40515dbb3ed2ec063514357335029f4515a71c9

Commit: a40515dbb3ed2ec063514357335029f4515a71c9

Tree: 0f3c656ae696b8fb2fdca654d22442c48166aae0

Author: Antonio Scandurra

Committer: Antonio Scandurra

## Message

```
Rework frame rendering

This commit replaces the old `previous_frame` and `current_frame` with
a new pair of `rendered_frame` and `next_frame` that are swapped once
we are ready to draw a finished frame.

This makes it clearer when to use which: `rendered_frame` should be used
to query the existing state, whereas `next_frame` should be used and mutated when
redrawing a dirty window.

The change was prompted by a bug I encountered in `FocusHandle::contains`. The
implementation was reading `current_frame`, but that was the wrong field to
access if e.g. we were reading it inside of a `render` function or any other
time while drawing the window.

```

## Parents

- [edb2f60d9d7fa2eb9f98d0848c70959447707333](https://git.cafe/gitcafe/zed/commit/edb2f60d9d7fa2eb9f98d0848c70959447707333?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/a40515dbb3ed2ec063514357335029f4515a71c9?format=markdown)
