4511c7b7fb
gazelle ended up being more liability than asset for our C++ rules. It required devs to manually run the command frequently (and was easy to forget until the CQ failed). The fact that we still had to edit the source files (e.g. the "srcs" cc_libraries) meant that the mixture between generated and hand-written caused some tension (see include/third_party/vulkan for a good example). The combination of gazelle and our IWYU enforcement added several bits of churn without any real benefit. The generated rules also didn't help identify cases where we were not keeping tight boundaries (e.g. non-gpu code and gpu code). Identifying third_party deps automatically ended up being trickier than anticipated (see the deleted //third_party/file_map_for_bazel.json) Using the "maximum set of dependencies" worked ok, but ended up increasing build time unnecessarily. For example, compiling CanvasKit for WebGL always needed to compile Dawn because SkSLCompiler.cpp sometimes needs to include tint/tint.h. Follow-up CLs will rebuild the BUILD.bazel rules without gazelle. Note to Reviewers: - The only file worth manually reviewing here is bazel/Makefile. Change-Id: I36d6fc3747487fabaf699690780c95f1f6765770 Bug: skia:12541 Reviewed-on: https://skia-review.googlesource.com/c/skia/+/543976 Reviewed-by: Leandro Lovisolo <lovisolo@google.com> Reviewed-by: Ben Wagner <bungeman@google.com> |
||
---|---|---|
.. | ||
BUILD.gn | ||
GrContextHolder.h | ||
GrContextHolder.mm | ||
Info.plist | ||
main.mm | ||
README.md | ||
SkiaContext.h | ||
SkiaContext.mm | ||
SkiaGLContext.mm | ||
SkiaMetalContext.mm | ||
SkiaUIContext.mm | ||
SkiaViewController.h | ||
SkiaViewController.mm | ||
SkMetalViewBridge.h | ||
SkMetalViewBridge.mm | ||
SkottieViewController.h | ||
SkottieViewController.mm |
Skottie iOS Example App
Metal
How to compile for the Metal backend:
cd $SKIA_ROOT_DIRECTORY
mkdir -p out/ios_arm64_mtl
cat > out/ios_arm64_mtl/args.gn <<EOM
target_os="ios"
target_cpu="arm64"
skia_use_metal=true
skia_use_expat=false
skia_enable_pdf=false
EOM
tools/git-sync-deps
bin/gn gen out/ios_arm64_mtl
ninja -C out/ios_arm64_mtl skottie_example
Then install the out/ios_arm64_mtl/skottie_example.app
bundle.
CPU
How to compile for the CPU backend:
cd $SKIA_ROOT_DIRECTORY
mkdir -p out/ios_arm64_cpu
cat > out/ios_arm64_cpu/args.gn <<EOM
target_cpu="arm64"
target_os="ios"
skia_enable_gpu=false
skia_enable_pdf=false
skia_use_expat=false
EOM
tools/git-sync-deps
bin/gn gen out/ios_arm64_cpu
ninja -C out/ios_arm64_cpu skottie_example
Then install the out/ios_arm64_cpu/skottie_example.app
bundle.
OpenGL
How to compile for the OpenGL backend:
cd $SKIA_ROOT_DIRECTORY
mkdir -p out/ios_arm64_gl
cat > out/ios_arm64_gl/args.gn <<EOM
target_cpu="arm64"
target_os="ios"
skia_enable_gpu=true
skia_use_metal=false
skia_enable_pdf=false
skia_use_expat=false
EOM
tools/git-sync-deps
bin/gn gen out/ios_arm64_gl
ninja -C out/ios_arm64_gl skottie_example
Then install the out/ios_arm64_gl/skottie_example.app
bundle.