Home | History | Annotate | Download | only in sample
      1 Skia Viewer
      2 ==========================
      3 The Skia Viewer is another windowed app similar to SampleApp. Its main advantages over SampleApp are that it supports Vulkan on Linux, Windows and Android, and it uses a cleaner cross-platform windowing system (currently located in tools/viewer/sk_app). However, it is a work in progress, so it doesn't yet support all the features of SampleApp.
      4 
      5 Like SampleApp, it displays a series of slides that exhibit specific features of the Skia system. It is mainly controlled using the keyboard: left (&#x2190;) and (&#x2192;) right arrows to move from slide to slide. Some slides require use resources stored outside the program. These resources are stored in the `<skia-path>/resources` directory.
      6 
      7 `<skia-path>/out/Release/viewer --resourcePath <skia-path>/resources`
      8 
      9 In addition to displaying various aspects of Skia, the Viewer is used to debug and understand different parts of the Skia system:
     10 
     11 * Observe rendering performance - pressing the 'f' key places the Viewer in frame rate mode. It continuously draws the slide while desplaying the draw time in the title of the window.
     12 * Try different rendering methods - pressing the 'd' key cycles among the three rendering methods: raster, OpenGL and Vulkan (on supported platforms). You can use this with the 'f' key to see the effect that the different rendering methods have on drawing performance. You can start up with a particular rendering method by using one of the command line options `--backend sw`, `--backend gl`, or `--backend vk` respectively.
     13 * Display and manipulate your own pictures - use `--skps <skp-file-path>` to load any `.skp` files to be displayed by the Viewer. Using `--match <slide-name>` will load only SKPs or slides matching that name.
     14 
     15 Linux, Macintosh and Windows
     16 ----------------------------
     17 
     18 The Viewer can be built using the regular GN build process, e.g.
     19 
     20     bin/gn gen out/Release --args='is_debug=false'
     21     ninja -C out/Release viewer
     22 
     23 Android
     24 -------
     25 The Viewer APK must be built by gradle which can be invoked on the command line with the following script...
     26 
     27     ./platform_tools/android/bin/android_build_app -C <out_dir> viewer
     28 
     29 *   **out_dir** is the ninja out directory for android (e.g., `out/arm64`) that you want to use to
     30 build the app
     31 
     32 Upon completion of the script the APK can be found at <out_dir>/viewer.apk
     33 
     34 To load SKPs in the Android viewer place them in /data/local/tmp/skps.
     35 
     36 iOS
     37 ---
     38 The viewer is currently not supported on iOS.
     39 
     40 Key                              | Action
     41 -----------------------------|-------------
     42 &#x2190; &#x2192; | Move between the slides
     43 &#x2191; &#x2193; | Zoom in / out
     44 d                                   | Change render methods among raster, OpenGL and Vulkan
     45 f                                     | Display the rendering time in the menu bar
     46 
     47 
     48