[flatland] Flatland present tokens.

Flatland uses a modified version of "Present2 semantics": instead of
telling clients the total number of presents they have remaining in
various places (the Present() callback, RequestPresentationTimes(),
and OnFramePresented() callbacks all contain this value), Flatland
tells clients they have additional presents through a single
OnPresentTokensReturned() callback.

The general flow is as follows:
- Clients may only call Present() when they have at least one token.
- Calling Present() decrements their token count by one.
- The FrameScheduler will trigger increments of the token count when
  a Present() call is fully process for a Flatland instance.
- Clients will receive additional tokens from the
  OnPresentTokensReturned() event, which is called as soon as a
  present is processed (even if the frame isn't rendered yet).
- Clients may assume they start with one token, allowing a single
  present, primarily for setting up the parent link.

This will have to be reconciled with the "old Present2 semantics".
They return num_presents_allowed in the OnFramePresent() callback,
which we still want to have in Flatland.

Fixed: 57823
TEST=fx test -o flatland_unittests
MULTIPLY: flatland_unittests (fuchsia): 30

Change-Id: I5bde8b292acacb58a90df9fa21a83f38b014a3f3
Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/438959
Commit-Queue: Evan Birenbaum <birenbaum@google.com>
Reviewed-by: Adam Gousetis <adamgousetis@google.com>
Reviewed-by: Mikael Pessa <mikaelpessa@google.com>
API-Review: Adam Gousetis <adamgousetis@google.com>
Testability-Review: Mikael Pessa <mikaelpessa@google.com>
10 files changed
tree: e836fd0bafbcb7bb9da484db35f10a5ddefe17b4
  1. boards/
  2. build/
  3. bundles/
  4. docs/
  5. examples/
  6. garnet/
  7. products/
  8. scripts/
  9. sdk/
  10. src/
  11. third_party/
  12. tools/
  13. zircon/
  14. .clang-format
  15. .clang-tidy
  16. .gitattributes
  17. .gitignore
  18. .gn
  19. .style.yapf
  20. AUTHORS
  21. BUILD.gn
  22. CODE_OF_CONDUCT.md
  23. CONTRIBUTING.md
  24. LICENSE
  25. OWNERS
  26. PATENTS
  27. README.md
  28. rustfmt.toml
README.md

Fuchsia

Pink + Purple == Fuchsia (a new operating system)

What is Fuchsia?

Fuchsia is a modular, capability-based operating system. Fuchsia runs on modern 64-bit Intel and ARM processors.

Fuchsia is an open source project with a code of conduct that we expect everyone who interacts with the project to respect.

Read more about Fuchsia's principles.

How can I build and run Fuchsia?

See Getting Started.

Where can I learn more about Fuchsia?

See fuchsia.dev.