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> |
||
---|---|---|
.. | ||
src | ||
clean_app.sh | ||
create_apk.py | ||
docker_build_universal_apk.sh | ||
docker_run_apk.sh | ||
make_apk.sh | ||
make_universal_apk | ||
make_universal_apk.py | ||
README.md | ||
run_apk.sh | ||
run_skqp_exe | ||
setup_resources | ||
test_apk.sh |
SkQP
SkQP (Skia Quality Program) is a component of the Android CTS (Compatablity Test Suite) that tests an Android device's GPU and OpenGLES & Vulkan drivers using Skia's existing unit & rendering tests.
See https://skia.org/dev/testing/skqp for pre-build APKs.
How to build and run the SkQP tests
-
Get the dependencies:
-
You will need Java JDK 8,
git
, andpython
. -
Install Chromium's depot_tools. Add it to your
PATH
.git clone 'https://chromium.googlesource.com/chromium/tools/depot_tools.git' export PATH="${PWD}/depot_tools:${PATH}"
-
Install the Android NDK.
( cd ~; unzip ~/Downloads/android-ndk-*.zip ) ANDROID_NDK=$(ls -d ~/android-ndk-*) # Or wherever you installed the Android NDK.
-
Install the Android SDK. Set the
ANDROID_HOME
environment variable.mkdir ~/android-sdk ( cd ~/android-sdk; unzip ~/Downloads/sdk-tools-*.zip ) yes | ~/android-sdk/tools/bin/sdkmanager --licenses export ANDROID_HOME=~/android-sdk # Or wherever you installed the Android SDK.
Put
adb
in yourPATH
.export PATH="${PATH}:${ANDROID_HOME}/platform-tools"
-
-
Get the right version of Skia:
git clone https://skia.googlesource.com/skia.git cd skia git checkout origin/skqp/dev # or whatever release tag you need
-
Build the APK:
tools/git-sync-deps tools/skqp/make_universal_apk
-
Build, install, and run.
adb install -r out/skqp/skqp-universal-debug.apk adb logcat -c adb shell am instrument -w org.skia.skqp
-
Monitor the output with:
adb logcat TestRunner org.skia.skqp skia "*:S"
Note the test's output path on the device. It will look something like this:
01-23 15:22:12.688 27158 27173 I org.skia.skqp: output written to "/storage/emulated/0/Android/data/org.skia.skqp/files/output"
-
Retrieve and view the report with:
OUTPUT_LOCATION="/storage/emulated/0/Android/data/org.skia.skqp/files/output" adb pull $OUTPUT_LOCATION /tmp/ bin/sysopen /tmp/output/skqp_report/report.html
Running a single test
To run a single test, for example gles_aarectmodes
:
adb shell am instrument -e class 'org.skia.skqp.SkQPRunner#gles_aarectmodes' -w org.skia.skqp
Unit tests can be run with the unitTest_
prefix:
adb shell am instrument -e class 'org.skia.skqp.SkQPRunner#unitTest_GrSurface -w org.skia.skqp
Run as a non-APK executable
-
Follow steps 1-3 as above.
-
Build the SkQP program, load files on the device, and run skqp:
ninja -C out/skqp/arm skqp python tools/skqp/run_skqp_exe out/skqp/arm