commit | 1e23204209b9231b44ce816bb736df0a5266a1d3 | [log] [tgz] |
---|---|---|
author | Alexander Biggs <akbiggs@google.com> | Wed Jul 27 23:44:08 2022 +0000 |
committer | Alexander Biggs <akbiggs@google.com> | Thu Jul 28 16:23:48 2022 +0000 |
tree | d03f97c9e6840a421c09b0191ced2d3df2b03bb1 | |
parent | 39179825536af1ce52710d2334f48e9c2c7f6d95 [diff] |
[embedder] Software rendering multiple frames. Demo of `scripts/build_and_run_example.sh spinning-cube`: https://photos.google.com/u/1/search/_tra_/photo/AF1QipPs8E3KKxcUAJh3JSTtM4J6qQfEGNoloxfFhfIL Something is still clearly wrong here but it's rendering multiple frames now. - Bring in SoftwareSurface and SoftwareSurfaceProducer from Github. Code is largely unchanged but removes legacy logic from GFX. - Bring in some basic parts of flatland_external_view_embedder.cc. Composition logic and many other things still missing. - Remove software_rendering.h file now that software rendering logic for callbacks is abstracted. Change-Id: Ib99c118e56dc78ca04bd5a3a1889ba9e0a74249b
The Flutter Embedder for Fuchsia is a new in-progress runtime for Flutter apps on Fuchsia. This runtime is built on top of Flutter's embedder platform.
This repository is a work in progress and should be considered experimental.
Install a Bazel version no older than the one defined in the WORKSPACE.bazel file, by following the instructions at https://bazel.build/install. In some Linux distributions, sudo apt-get install bazel
should be enough.
Make sure this repository has the required submodules:
git submodule update --recursive --init
Ensure that there are Fuchsia SSH keys in your host machine. You will need them for running the Fuchsia emulator.
[[ -f "${HOME}/.ssh/fuchsia_ed25519" ]] || ssh-keygen -P "" -t ed25519 -f "${HOME}/.ssh/fuchsia_ed25519" -C "${USER}@$(hostname -f) Shared SSH Key for Fuchsia" [[ -f "${HOME}/.ssh/fuchsia_authorized_keys" ]] || ssh-keygen -y -f "${HOME}/.ssh/fuchsia_ed25519" > "${HOME}/.ssh/fuchsia_authorized_keys"
Set $FUCHSIA_EMBEDDER_DIR
to your flutter-embedder.git checkout location, for example ~/flutter-embedder
.
Now the repository is ready to build the sample.
Fetch an emulator image and start an emulator:
tools/ffx product-bundle get workstation.qemu-x64 # If running in a graphical environment: tools/ffx emu start workstation.qemu-x64 # If running in a terminal environment: tools/ffx emu start --headless workstation.qemu-x64
(optional) Watch the device log in a separate window:
tools/ffx log
Run an example app:
scripts/build_and_run_example.sh hello_flutter
TODO(akbiggs): The app occasionally gets stuck on a loading screen instead of rendering. Re-running the app usually fixes it. We need to fix this.
Occasionally you will need to update the Flutter Engine artifacts (embedder.h and libengine_flutter.so) that are used by the embedder to run Flutter apps. A script is provided for this workflow.
$ENGINE_DIR
to the src
folder of your Flutter Engine checkout location, for example ~/engine/src
.$FUCHSIA_EMBEDDER_DIR
should be set to your flutter-embedder.git checkout location, for example ~/flutter-embedder
.$DEPOT_TOOLS
should be set to your depot_tools
location, for example ~/depot_tools
.git stash
or git commit
any local changes to the Flutter Engine or the script will fail.You can run the script with a flutter/engine
Git commit to sync the Engine artifacts to that revision.
scripts/sync_engine_artifacts_to_revision.sh <ENGINE_COMMIT_SHA>
A common workflow is to sync your Engine commit to the Flutter tool in this repository, for example when updating the Flutter tool to a new version. To do this:
scripts/sync_engine_artifacts_to_revision.sh $(cat $FUCHSIA_EMBEDDER_DIR/third_party/dart-pkg/internal/flutter/flutter/bin/internal/engine.version)