skia2/tools/skqp
Hal Canary 5b39dc8153 SkQP: fix model colorspace (16-bit gold images)
Problem: `make_gmkb.go `was ignoring the ignoring the embedded ICC
profile in the images it was getting from Gold.

Replace make_gmkb.go with two small programs: `goldgetter.py` and
`make_skqp_model.cpp`.

`make_skqp_model` uses Skia to create the model from a bunch of images.

`goldgetter` wraps `make_skqp_model` and handles:
  - json parsing
  - downloading images from gold
  - multiprocessing

CQ_INCLUDE_TRYBOTS=skia.primary:Build-Debian9-Clang-x86-devrel-Android_SKQP,Test-Debian9-Clang-NUC7i5BNK-CPU-Emulator-x86-devrel-All-Android_SKQP

Change-Id: I7add1a1dfd83bbd0ab07ab126d4183c36325263c
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/209101
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
2019-04-17 20:26:39 +00:00
..
src sk_tool_utils -> ToolUtils, and git clang-format 2019-03-20 18:05:42 +00:00
bad_gms.txt SkQP: remove bad tests from future branches. 2019-04-11 13:50:25 +00:00
branch_skqp_dev.sh SkQP: branch script 2018-12-04 20:53:57 +00:00
clean_app.sh Test SKQP on Firebase Testlab and Upload 2018-03-07 20:44:50 +00:00
cut_release SkQP: fix model colorspace (16-bit gold images) 2019-04-17 20:26:39 +00:00
docker_build_universal_apk.sh SkQP: experimental docker script cleanup, try 2 2018-12-19 03:25:42 +00:00
download_model SkQP: download_model complains when files.checksum is missing 2018-02-06 19:48:55 +00:00
find_commit_with_best_gold_results.py find_commit_with_best_gold_results takes arguments 2019-02-11 15:00:27 +00:00
generate_gn_args SkQP: from skqp_gn_args import SkqpGnArgs 2019-03-05 20:51:55 +00:00
get_gold_results.py SkQP: branching tools updated. 2019-01-17 15:29:50 +00:00
gn_to_bp.py SkQP: from skqp_gn_args import SkqpGnArgs 2019-03-05 20:51:55 +00:00
goldgetter.py SkQP: fix model colorspace (16-bit gold images) 2019-04-17 20:26:39 +00:00
jitter_gms.cpp SkQP: refatctor C++ bits. 2018-11-30 18:38:00 +00:00
make_apk_list.py SkQP: tools/skqp/get_gold_export_url.py 2018-12-03 22:33:39 +00:00
make_apk.sh SkQP: Stop requiring users to use posix shell 2018-01-24 21:11:19 +00:00
make_rendertests_list.py SkQP: refatctor C++ bits. 2018-11-30 18:38:00 +00:00
make_skqp_model.cpp SkQP: fix model colorspace (16-bit gold images) 2019-04-17 20:26:39 +00:00
make_universal_apk tools/skqp/make_universal_apk -> python 2018-11-01 16:48:59 +00:00
make_universal_apk.py SkQP: clean up make_universal_apk.py 2019-01-14 15:22:49 +00:00
README_ALGORITHM.md SkQP: refatctor C++ bits. 2018-11-30 18:38:00 +00:00
README_GENERATING_MODELS.md SkQP: branching tools updated. 2019-01-17 15:29:50 +00:00
README.md SkQP: document requirement to run git-sync-deps 2018-12-07 16:51:42 +00:00
release.sh SkQP: fix androidx (follows 2ccdd2bc1d) 2019-03-04 21:43:58 +00:00
run_skqp_exe SkQP: run_skqp_exe script 2018-01-25 16:30:22 +00:00
setup_resources SkQP: remove skia_embed_resources option 2018-01-30 19:24:15 +00:00
skqp_gn_args.py SkQP: from skqp_gn_args import SkqpGnArgs 2019-03-05 20:51:55 +00:00
test_apk.sh SkQP: fix model colorspace (16-bit gold images) 2019-04-17 20:26:39 +00:00
upload_apk SkQP: tools/skqp/get_gold_export_url.py 2018-12-03 22:33:39 +00:00
upload_model SkQP: refatctor C++ bits. 2018-11-30 18:38:00 +00:00

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

  1. Get the dependencies:

    • You will need Java JDK 8, git, and python.

    • 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 your PATH.

      export PATH="${PATH}:${ANDROID_HOME}/platform-tools"
      
  2. 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
    
  3. Build the APK:

    tools/git-sync-deps
    tools/skqp/make_universal_apk
    
  4. Build, install, and run.

    adb install -r out/skqp/skqp-universal-debug.apk
    adb logcat -c
    adb shell am instrument -w org.skia.skqp
    
  5. 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"
    
  6. 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

  1. Follow steps 1-3 as above.

  2. Build the SkQP program, load files on the device, and run skqp:

    gn gen out/skqp-arm
    ninja -C out/skqp-arm skqp
    python tools/skqp/run_skqp_exe out/skqp-arm