1cb93a386Sopenharmony_ci---
2cb93a386Sopenharmony_cititle: 'Skia in Flutter & Fuchsia'
3cb93a386Sopenharmony_cilinkTitle: 'Skia in Flutter & Fuchsia'
4cb93a386Sopenharmony_ci---
5cb93a386Sopenharmony_ci
6cb93a386Sopenharmony_ciSkia is used by both [Flutter](https://flutter.io/) and
7cb93a386Sopenharmony_ci[Fuchsia](https://fuchsia.googlesource.com/docs/+/main/README.md).
8cb93a386Sopenharmony_ci
9cb93a386Sopenharmony_ciFuchsia has a [roller](https://autoroll.skia.org/) that will continuously roll
10cb93a386Sopenharmony_cilatest Skia into that project. Fuchsia uses an XML
11cb93a386Sopenharmony_ci[manifest](https://fuchsia.googlesource.com/manifest/+/refs/heads/main) to
12cb93a386Sopenharmony_cispecify the Skia revision (as well as other third party libraries).
13cb93a386Sopenharmony_ci
14cb93a386Sopenharmony_ciFlutter does not (yet) have a roller, so developers must manually perform rolls.
15cb93a386Sopenharmony_ciFlutter uses [DEPS](https://github.com/flutter/engine/blob/master/DEPS) to
16cb93a386Sopenharmony_cispecify third party dependencies.
17cb93a386Sopenharmony_ci
18cb93a386Sopenharmony_ciAlthough each project is (almost always) building at a different revision of
19cb93a386Sopenharmony_ciSkia, Fuchsia itself always builds the latest revision of Flutter as one of its
20cb93a386Sopenharmony_cicomponents. Thus, the versions of Skia being used by Flutter and Fuchsia must be
21cb93a386Sopenharmony_ci"source compatible" -- Flutter must be capable of compiling against either
22cb93a386Sopenharmony_cirevision without any change to Flutter itself.
23cb93a386Sopenharmony_ci
24cb93a386Sopenharmony_ci## Making API Changes
25cb93a386Sopenharmony_ci
26cb93a386Sopenharmony_ciIf you need to make a breaking API change, the basic approach is:
27cb93a386Sopenharmony_ci
28cb93a386Sopenharmony_ci- Add new code to Skia, leaving the old code in place.
29cb93a386Sopenharmony_ci- Deprecate the old code path so that it must be enabled with a flag such as
30cb93a386Sopenharmony_ci  'SK_SUPPORT_LEGACY_XXX'.
31cb93a386Sopenharmony_ci- Add that same flag to
32cb93a386Sopenharmony_ci  [flutter_defines.gni](https://skia.googlesource.com/skia/+/main/gn/flutter_defines.gni)
33cb93a386Sopenharmony_ci  in Skia.
34cb93a386Sopenharmony_ci  - Both Flutter and Fuchsia build Skia with a GN argument that enables all the
35cb93a386Sopenharmony_ci    defines listed in that file.
36cb93a386Sopenharmony_ci- Land the Skia change, and test the new API in both Flutter and Fuchsia.
37cb93a386Sopenharmony_ci- Remove the flag and code when the legacy code path is no longer in use.
38