skia2/tools/skqp
Kevin Lubick 6ba9f702ba [bazel] Try adding cc_binary rules that use generated rules
To make the atomic rules a bit easier to work with, in many
of the folders, this adds in cc_library rules to group
together the sources from that folder (and subfolders
where prudent). We only needs sources because those atoms
should have their headers as deps.

One issue that was pointed out is that there is currently
no way to restrict the inclusion of certain packages,
a la, `gn check`. For example, there is no mechanism from
stopping a dev from adding
#include "modules/canvaskit/WasmCommon.h"
to something in //src/core (except circular dependencies).
We can probably address that using Bazel's visibility
rules as needed:
https://docs.bazel.build/versions/main/visibility.html
https://docs.bazel.build/versions/main/be/functions.html#package_group

It is recommended to look at this CL patchset by patchset.
PS1: Update gazelle command to generate rules in more folders.
PS2: A few changes to make generation work better.
PS3: The result of running make generate in //bazel
PS4: Adding the rules to build sksllex, the simplest binary I
     could find in the Skia repo.
PS5: Adding the rules to build skdiff, a more complex binary.
     I tried a few approaches, but ended up gravitating back
     towards the layout where we have each folder/package
     group up the sources. I imagine at some point, we'll have
     skdiff depend on skia_core or something, which will
     have things like //src/core, //src/codecs, //src/pathops
     all bundled together.
PS7: Added in the groupings of sources, similar to what we had
     earlier. I liked these for readability. These helped fix
     up the //:skia_core build, and by extension, the CanvasKit
     build.

Change-Id: I3faa7c4e821c876b243617aacf0246efa524cbde
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/476219
Reviewed-by: Ben Wagner <bungeman@google.com>
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
2021-11-30 18:18:53 +00:00
..
src [bazel] Try adding cc_binary rules that use generated rules 2021-11-30 18:18:53 +00:00
bad_gms.txt Remove SkAtlasTextTarget 2020-06-04 03:52:35 +00:00
branch_skqp_dev.sh SkQP: branch script 2018-12-04 20:53:57 +00:00
BUILD.bazel [bazel] Try adding cc_binary rules that use generated rules 2021-11-30 18:18:53 +00:00
clean_app.sh
create_apk.py Replace third_party/gif: Preflight changes 2019-11-21 15:19:41 +00:00
cut_release.py SkQP: model-creation improvements 2019-12-04 17:08:36 +00:00
docker_build_universal_apk.sh SkQP: Docker compile helper script respects SKQP_OUTPUT_DIR 2019-08-08 14:11:58 +00:00
docker_run_apk.sh SkQP: new docker test code 2019-04-19 18:50:03 +00:00
download_model SkQP: split make_apk script into create_apk and make_apk 2019-08-20 15:08:03 +00:00
download_model.py SkQP: split make_apk script into create_apk and make_apk 2019-08-20 15:08:03 +00:00
find_commit_with_best_gold_results.py Update references to master branch 2021-05-21 15:18:16 +00:00
gn_to_bp.py [SkQP/Android] Replace -Weverything with -Wextra 2019-11-12 16:49:29 +00:00
jitter_gms.cpp gm: GMFactory returns a unique_ptr<> 2019-08-12 19:02:40 +00:00
make_apk_list.py Update references to master branch 2021-05-21 15:18:16 +00:00
make_apk.sh SkQP: split make_apk script into create_apk and make_apk 2019-08-20 15:08:03 +00:00
make_skqp_model.cpp SkQP: model-creation improvements 2019-12-04 17:08:36 +00:00
make_universal_apk tools/skqp/make_universal_apk -> python 2018-11-01 16:48:59 +00:00
make_universal_apk.py SkQP: split make_apk script into create_apk and make_apk 2019-08-20 15:08:03 +00:00
README_ALGORITHM.md SkQP: refatctor C++ bits. 2018-11-30 18:38:00 +00:00
README_GENERATING_MODELS.md Update references to master branch 2021-05-21 15:18:16 +00:00
README.md SkQP: Fix document about running as native executable 2020-04-21 14:48:54 +00:00
release.sh Update CtsSkQPTestCases to non-shardable in release script 2019-06-14 17:05:51 +00:00
run_apk.sh SkQP: new docker test code 2019-04-19 18:50:03 +00:00
run_skqp_exe SkQP: Fix broken run_skqp_exe 2020-04-21 18:39:45 +00:00
setup_resources
skqp_gn_args.py SkQP: split make_apk script into create_apk and make_apk 2019-08-20 15:08:03 +00:00
test_apk.sh SkQP: new docker test code 2019-04-19 18:50:03 +00:00
upload_apk SkQP: tools/skqp/get_gold_export_url.py 2018-12-03 22:33:39 +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:

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