[roll] Roll fuchsia [carnelian] Add layout system

This CL implements the first version of a layout system for Carnelian.

The goal of layout in Carnelian is to provide some of the same
capability of layout in Flutter in a manner that makes sense when
writing in Rust.

The implementation here diverges from Flutter in that layout is not a
responsibility of Facet, but of a new concept, Group, and an associated
trait, Arranger. This approach seemed better for Rust since the data
and implementation inheritance in Dart that Flutter uses is not
available in Rust. This makes have a single type hierarchy that handles
rendering and layout less attractive.

In this first step there are two group arrangers, Stack and Flex. Each
is a subset of the same named widgets in Flutter.

While this CL provides layout, it does not implement the dynamic sizing
that is found in Flutter. Right now, all facets are fixed sized so it
isn't required. A next step in this implementation will be to implement
dynamically sized facets and adopt Flutter's box constraint system.

In order to implement layout, location information had to be moved from
individual facets and stored in the scene. All facets now render their
layers relative to the zero point and the scene takes care of
translating their rasters based on the facet's location.

I've modified two samples to use this new layout feature;
spinning_square and button. Button has the most extensive use, with the
'c', 'm' and 'r' keys cycling alignment options so one can see how they
work.

As part of this change I've added documentation comments to a lot of
places where they were missing. I'll get the rest soon and hopefully we
can make sure everything public is documented in the future.

As I was documenting I found a few things that were unnecessarily
public or unused. I made them private or deleted them.

For testing purposes I fixed up Fargo.toml for the recent Rive example.

Testing: added one layout test, with more intended. Also manual.

Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/483467
Original-Revision: f97816a50370783d6bc6d8b327348127710e29ab
GitOrigin-RevId: 9dd1c89a2aa16b0b347077eb27f79ad57b73e256
Change-Id: I81bca6109d04b61149fd0bf7da59b6a837561c23
1 file changed
tree: 2a1388a267e147a206aaa4cd89b6ae90d5a73c9f
  1. garnet/
  2. infra/
  3. peridot/
  4. third_party/
  5. topaz/
  6. zircon/
  7. firmware
  8. flower
  9. jiri.lock
  10. minimal
  11. prebuilts
  12. README.md
  13. stem
  14. test_durations
README.md

Integration

This repository contains Fuchsia's Global Integration manifest files.

Making changes

All changes should be made to the internal version of this repository. Our infrastructure automatically updates this version when the internal one changes.

Currently all changes must be made by a Google employee. Non-Google employees wishing to make a change can ask for assistance via the IRC channel #fuchsia on Freenode.

Obtaining the source

First install Jiri.

Next run:

$ jiri init
$ jiri import minimal https://fuchsia.googlesource.com/integration
$ jiri update

Third party

Third party projects should have their own subdirectory in ./third_party.