skia2/tools/skqp
Hal Canary b69a2f6644 SkQP: use bitmap.pixmap()
Change-Id: I8e372f75a1a0b32db88808b0b4d7314c7fba9cda
Reviewed-on: https://skia-review.googlesource.com/97161
Reviewed-by: Hal Canary <halcanary@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
2018-01-19 18:07:43 +00:00
..
jni First version of SkQP app to run on Firebase Testlab 2018-01-08 22:42:21 +00:00
extract_report.py SkQP: better error report workflow 2017-12-20 19:23:46 +00:00
gm_knowledge.cpp SkQP: use bitmap.pixmap() 2018-01-19 18:07:43 +00:00
gm_knowledge.h SkQP: better error report workflow 2017-12-20 19:23:46 +00:00
gm_runner.cpp SkQP: make_gmkb, gm_knowledge (GM Knowledgebase) 2017-12-15 17:23:48 +00:00
gm_runner.h SkQP: make_gmkb, gm_knowledge (GM Knowledgebase) 2017-12-15 17:23:48 +00:00
inflate.py SkQP: add junit app 2017-12-18 18:58:52 +00:00
make_gmkb.go SkQP: better error report workflow 2017-12-20 19:23:46 +00:00
README.md SkQP: better logging 2018-01-19 16:19:23 +00:00
skqp_asset_manager.h SkQP: make_gmkb, gm_knowledge (GM Knowledgebase) 2017-12-15 17:23:48 +00:00
skqp.cpp SkQP: better error report workflow 2017-12-20 19:23:46 +00:00
sysopen.py SkQP: make_gmkb, gm_knowledge (GM Knowledgebase) 2017-12-15 17:23:48 +00:00

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:

  1. To build SkQP you need to install the Android NDK.

  2. Checkout depot_tools and Skia, then go to Skia's source directory:

    export PATH="${DEPOT_TOOLS_PATH}:$PATH"
    cd $SKIA_SOURCE_DIRECTORY
    
  3. Configure and build Skia for your device's architecture:

    arch='arm64'  # Also valid: 'arm', 'x68', 'x64'
    android_ndk="${HOME}/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
    
  4. Download meta.json from https://goo.gl/jBw3Dd . This is the data used to build the validation model.

  5. Generate the validation model data:

    go get 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

  1. 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 gmkb report"
    adb push platform_tools/android/apps/skqp/src/main/assets/gmkb \
        /data/local/tmp/
    adb push out/${arch}-rel/skqp /data/local/tmp/
    adb shell "cd /data/local/tmp; ./skqp gmkb report"
    
  2. Get the error report if there are errors:

    if adb shell test -d /data/local/tmp/report; then
        adb pull /data/local/tmp/report /tmp/
        tools/skqp/sysopen.py /tmp/report/report.html
    fi
    

Run as an APK

  1. 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
    
  2. 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 shell am instrument -w \
        org.skia.skqp/android.support.test.runner.AndroidJUnitRunner
    
  3. Retrieve the report if there are any errors:

    adb backup -f /tmp/skqp.ab org.skia.skqp
    # Must unlock phone and verify backup.
    tools/skqp/extract_report.py /tmp/skqp.ab