4080305f57
Change-Id: Idfba4c3e91eb048792ab395d4ab2e4a98ed8888c Reviewed-on: https://skia-review.googlesource.com/98323 Reviewed-by: Hal Canary <halcanary@google.com> Commit-Queue: Hal Canary <halcanary@google.com> |
||
---|---|---|
.. | ||
jni | ||
gm_knowledge.cpp | ||
gm_knowledge.h | ||
gm_runner.cpp | ||
gm_runner.h | ||
inflate.py | ||
make_apk.sh | ||
make_gmkb.go | ||
make_known_tests.sh | ||
make_model.sh | ||
README.md | ||
skqp_asset_manager.h | ||
skqp.cpp | ||
sysopen.py |
SkQP
Motivation: Test an Android device's GPU and OpenGLES & Vulkan drivers with Skia and Skia's existing unit & rendering tests.
How To Use SkQP on your Android device:
-
To build SkQP you need to install the Android NDK.
-
Checkout depot_tools and Skia, then go to Skia's source directory:
export PATH="${DEPOT_TOOLS_PATH}:$PATH" cd $SKIA_SOURCE_DIRECTORY
-
Configure and build Skia for your device's architecture:
arch='arm64' # Also valid: 'arm', 'x68', 'x64' android_ndk="${HOME}/android-ndk" # Or wherever you installed the NDK. mkdir -p out/${arch}-rel cat > out/${arch}-rel/args.gn << EOF ndk = "$android_ndk" ndk_api = 26 target_cpu = "$arch" skia_embed_resources = true is_debug = false EOF tools/git-sync-deps bin/gn gen out/${arch}-rel ninja -C out/${arch}-rel skqp_lib
-
Download meta.json from https://goo.gl/jBw3Dd . This is the data used to build the validation model.
-
Generate the validation model data:
go get -u go.skia.org/infra/golden/go/search go run tools/skqp/make_gmkb.go ~/Downloads/meta.json \ platform_tools/android/apps/skqp/src/main/assets/gmkb
Run as an executable
-
Build the SkQP program, load files on the device, and run skqp:
ninja -C out/${arch}-rel skqp adb shell "cd /data/local/tmp; rm -rf skqp_assets report" adb push platform_tools/android/apps/skqp/src/main/assets \ /data/local/tmp/skqp_assets adb push out/${arch}-rel/skqp /data/local/tmp/ adb shell "cd /data/local/tmp; ./skqp skqp_assets report"
-
Get the error report if there are errors:
adb pull /data/local/tmp/report /tmp/ tools/skqp/sysopen.py /tmp/report/report.html
Run as an APK
-
Install the Android SDK.
mkdir ~/android-sdk ( cd ~/android-sdk; unzip ~/Downloads/sdk-tools-*.zip ) yes | ~/android-sdk/tools/bin/sdkmanager --licenses export ANDROID_HOME=~/android-sdk
-
Build the skqp.apk, load it on the device, and run the tests
platform_tools/android/bin/android_build_app -C out/${arch}-rel skqp adb install -r out/${arch}-rel/skqp.apk adb logcat -c adb shell am instrument -w \ org.skia.skqp/android.support.test.runner.AndroidJUnitRunner
-
Find out where the report went (and look for Skia errors):
adb logcat -d org.skia.skqp skia "*:S"
-
Retrieve and view the report if there are any errors:
adb pull /storage/emulated/0/Android/data/org.skia.skqp/files/output /tmp/ tools/skqp/sysopen.py /tmp/output/skqp_report/report.html