aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/skqp/README.md
blob: d3156a0573ae0822a938b8b179de8d314b6ea44c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82

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](https://developer.android.com/ndk/).

2.  Checkout Skia, then go to the source directory:

        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 = 24
            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:

        rm -rf platform_tools/android/apps/skqp/src/main/assets/gmkb
        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.  Produce a one-page error report if there are errors:

        rm -rf /tmp/report
        if adb shell test -d /data/local/tmp/report; then
            adb pull /data/local/tmp/report /tmp/
            tools/skqp/make_report.py /tmp/report
        fi

Run as an APK
-------------

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
        adb shell am instrument -w \
            org.skia.skqp/android.support.test.runner.AndroidJUnitRunner

2.  Retrieve the report if there are any errors:

        rm -rf /tmp/skqp
        mkdir /tmp/skqp
        adb backup -f /tmp/skqp/backup.ab org.skia.skqp
        dd if=/tmp/skqp/backup.ab bs=24 skip=1 | tools/skqp/inflate.py | \
            ( cd /tmp/skqp; tar x )
        rm /tmp/skqp/backup.ab
        tools/skqp/make_report.py /tmp/skqp/apps/org.skia.skqp/f