skia2/tools/skottie_ios_app
Kevin Lubick 6ba9f702ba [bazel] Try adding cc_binary rules that use generated rules
To make the atomic rules a bit easier to work with, in many
of the folders, this adds in cc_library rules to group
together the sources from that folder (and subfolders
where prudent). We only needs sources because those atoms
should have their headers as deps.

One issue that was pointed out is that there is currently
no way to restrict the inclusion of certain packages,
a la, `gn check`. For example, there is no mechanism from
stopping a dev from adding
#include "modules/canvaskit/WasmCommon.h"
to something in //src/core (except circular dependencies).
We can probably address that using Bazel's visibility
rules as needed:
https://docs.bazel.build/versions/main/visibility.html
https://docs.bazel.build/versions/main/be/functions.html#package_group

It is recommended to look at this CL patchset by patchset.
PS1: Update gazelle command to generate rules in more folders.
PS2: A few changes to make generation work better.
PS3: The result of running make generate in //bazel
PS4: Adding the rules to build sksllex, the simplest binary I
     could find in the Skia repo.
PS5: Adding the rules to build skdiff, a more complex binary.
     I tried a few approaches, but ended up gravitating back
     towards the layout where we have each folder/package
     group up the sources. I imagine at some point, we'll have
     skdiff depend on skia_core or something, which will
     have things like //src/core, //src/codecs, //src/pathops
     all bundled together.
PS7: Added in the groupings of sources, similar to what we had
     earlier. I liked these for readability. These helped fix
     up the //:skia_core build, and by extension, the CanvasKit
     build.

Change-Id: I3faa7c4e821c876b243617aacf0246efa524cbde
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/476219
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-11-30 18:18:53 +00:00
..
BUILD.bazel [bazel] Try adding cc_binary rules that use generated rules 2021-11-30 18:18:53 +00:00
BUILD.gn roll gn to latest 2021-01-15 15:34:00 +00:00
GrContextHolder.h Reland "Migrate metal tools away from GrContext" 2020-09-23 19:11:07 +00:00
GrContextHolder.mm Reland "Migrate metal tools away from GrContext" 2020-09-23 19:11:07 +00:00
Info.plist skottie_ios_app: fix tap logic 2019-12-17 16:09:42 +00:00
main.mm skottie_ios_app: Add OpenGL. 2020-01-14 16:16:32 +00:00
README.md skottie_ios_app: Add OpenGL. 2020-01-14 16:16:32 +00:00
SkiaContext.h skottie_ios_app: Add OpenGL. 2020-01-14 16:16:32 +00:00
SkiaContext.mm skottie_ios_app: Add OpenGL. 2020-01-14 16:16:32 +00:00
SkiaGLContext.mm Reland "Remove use of legacy display globals." 2020-10-05 19:13:58 +00:00
SkiaMetalContext.mm Update iOS Skottie App for GrContext changes 2020-08-14 12:55:56 +00:00
SkiaUIContext.mm [minor] tools/skottie_ios_app/Skia*Context: remember to cast 2020-01-14 20:05:17 +00:00
SkiaViewController.h skottie_ios_app: Add OpenGL. 2020-01-14 16:16:32 +00:00
SkiaViewController.mm skottie_ios_app: Add OpenGL. 2020-01-14 16:16:32 +00:00
SkMetalViewBridge.h Reland "Migrate metal tools away from GrContext" 2020-09-23 19:11:07 +00:00
SkMetalViewBridge.mm Reland "Remove use of legacy display globals." 2020-10-05 19:13:58 +00:00
SkottieViewController.h skottie_ios_app: Add OpenGL. 2020-01-14 16:16:32 +00:00
SkottieViewController.mm skottie_ios_app: Add OpenGL. 2020-01-14 16:16:32 +00:00

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.