2017-12-11 22:46:26 +00:00
|
|
|
|
|
|
|
SkQP
|
|
|
|
====
|
|
|
|
|
2017-12-21 20:13:20 +00:00
|
|
|
**Motivation**: Test an Android device's GPU and OpenGLES & Vulkan drivers with
|
|
|
|
Skia and Skia's existing unit & rendering tests.
|
2017-12-11 22:46:26 +00:00
|
|
|
|
|
|
|
How To Use SkQP on your Android device:
|
|
|
|
|
|
|
|
1. To build SkQP you need to install the
|
|
|
|
[Android NDK](https://developer.android.com/ndk/).
|
|
|
|
|
2017-12-21 20:13:20 +00:00
|
|
|
2. [Checkout depot\_tools and Skia](https://skia.org/user/download),
|
|
|
|
then go to Skia's source directory:
|
2017-12-11 22:46:26 +00:00
|
|
|
|
2017-12-21 20:13:20 +00:00
|
|
|
export PATH="${DEPOT_TOOLS_PATH}:$PATH"
|
2017-12-11 22:46:26 +00:00
|
|
|
cd $SKIA_SOURCE_DIRECTORY
|
|
|
|
|
|
|
|
3. Configure and build Skia for your device's architecture:
|
|
|
|
|
|
|
|
arch='arm64' # Also valid: 'arm', 'x68', 'x64'
|
2018-01-19 18:08:23 +00:00
|
|
|
android_ndk="${HOME}/android-ndk" # Or wherever you installed the NDK.
|
2017-12-11 22:46:26 +00:00
|
|
|
mkdir -p out/${arch}-rel
|
|
|
|
cat > out/${arch}-rel/args.gn << EOF
|
|
|
|
ndk = "$android_ndk"
|
2018-01-18 13:48:53 +00:00
|
|
|
ndk_api = 26
|
2017-12-11 22:46:26 +00:00
|
|
|
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
|
|
|
|
|
|
|
|
4. Download meta.json from [https://goo.gl/jBw3Dd](https://goo.gl/jBw3Dd) .
|
|
|
|
This is the data used to build the validation model.
|
|
|
|
|
|
|
|
5. Generate the validation model data:
|
|
|
|
|
2018-01-19 18:08:23 +00:00
|
|
|
go get -u go.skia.org/infra/golden/go/search
|
2017-12-11 22:46:26 +00:00
|
|
|
go run tools/skqp/make_gmkb.go ~/Downloads/meta.json \
|
|
|
|
platform_tools/android/apps/skqp/src/main/assets/gmkb
|
|
|
|
|
|
|
|
Run as an executable
|
|
|
|
--------------------
|
|
|
|
|
|
|
|
1. Build the SkQP program, load files on the device, and run skqp:
|
|
|
|
|
|
|
|
ninja -C out/${arch}-rel skqp
|
2018-01-19 18:08:23 +00:00
|
|
|
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
|
2017-12-11 22:46:26 +00:00
|
|
|
adb push out/${arch}-rel/skqp /data/local/tmp/
|
2018-01-19 18:08:23 +00:00
|
|
|
adb shell "cd /data/local/tmp; ./skqp skqp_assets report"
|
2017-12-11 22:46:26 +00:00
|
|
|
|
2017-12-18 21:59:56 +00:00
|
|
|
2. Get the error report if there are errors:
|
2017-12-11 22:46:26 +00:00
|
|
|
|
2018-01-19 18:08:23 +00:00
|
|
|
adb pull /data/local/tmp/report /tmp/
|
|
|
|
tools/skqp/sysopen.py /tmp/report/report.html
|
2017-12-11 22:46:26 +00:00
|
|
|
|
|
|
|
Run as an APK
|
|
|
|
-------------
|
|
|
|
|
2017-12-21 20:13:20 +00:00
|
|
|
0. Install the [Android SDK](https://developer.android.com/studio/#command-tools).
|
|
|
|
|
|
|
|
mkdir ~/android-sdk
|
|
|
|
( cd ~/android-sdk; unzip ~/Downloads/sdk-tools-*.zip )
|
|
|
|
yes | ~/android-sdk/tools/bin/sdkmanager --licenses
|
|
|
|
export ANDROID_HOME=~/android-sdk
|
|
|
|
|
2017-12-12 14:42:14 +00:00
|
|
|
1. 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
|
2018-01-19 18:08:23 +00:00
|
|
|
adb logcat -c
|
2017-12-12 14:42:14 +00:00
|
|
|
adb shell am instrument -w \
|
|
|
|
org.skia.skqp/android.support.test.runner.AndroidJUnitRunner
|
|
|
|
|
2018-01-19 18:08:23 +00:00
|
|
|
2. Find out where the report went (and look for Skia errors):
|
|
|
|
|
|
|
|
adb logcat -d org.skia.skqp skia "*:S"
|
|
|
|
|
|
|
|
3. 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
|
2017-12-12 14:42:14 +00:00
|
|
|
|
2017-12-18 21:59:56 +00:00
|
|
|
|
2017-12-12 14:42:14 +00:00
|
|
|
|