1Skia Debugger 2============= 3 4Introduction 5------------ 6 7The Skia Debugger is a graphical tool used to step through and analyze the 8contents of the Skia picture format. Pre-requisites include installing the Qt 9Library and downloading the Skia code base. 10 11Qt is available here: http://qt-project.org/downloads. 12 13It can also be installed on linux using 14 15<!--?prettify?--> 16~~~~ 17sudo apt-get install libqt4-dev 18~~~~ 19 20Note that the debugger has been tested with Qt 4.8.6; it is known not to work 21with Qt 5.0RC1 on the Mac. 22 23Design Documents: 24 25https://docs.google.com/a/google.com/document/d/1b8muqVzfbJmYbno9nTv5721V2nlFMfnqXYLNHiSQ4ws/pub 26 27 28How to build and run 29-------------------- 30 31Because the debugger uses Qt, you'll need to build skia in 64 bit mode: 32 33<!--?prettify?--> 34 35 GYP_DEFINES="skia_arch_width=64" python bin/sync-and-gyp 36 ninja -C out/Debug debugger 37 out/Debug/debugger 38 39For Windows, Qt ships as 32 bit libraries so to build and run one should just be 40able to: 41 42<!--?prettify?--> 43~~~~ 44cd trunk 45make clean gyp 46<open solution in VS2010 and build everything> 47~~~~ 48 49Depending on how your Qt is installed you may also need to define an environment 50variable like: 51 52~~~~ 53GYP_DEFINES=qt_sdk='C:\Qt\4.8.6\' 54~~~~ 55(which needs to be set before you execute 'make gyp') 56 57On Windows, you may need to copy several DLL and PDB files from %QTDIR%\bin into 58your executable directory (out/Debug or out/Release): 59 60QtCore4.dll QtCored4.dll QtCored4.pdb 61 62QtGui4.dll QtGuid4.dll QtGuid4.pdb 63 64QtOpenGL4.dll QtOpenGLd4.dll QtOpenGLd4.pdb 65 66 67Producing SKPs for usage 68------------------------ 69 70You may either use the Skia testing images (GMs) for use in the debugger or 71create your own via chromium. 72 73To create SKPs from Chromium you must download and build chromium on your 74platform of choice: http://www.chromium.org/Home 75 76<!--?prettify?--> 77~~~~ 78cd src 79make chrome 80out/Debug/chrome --no-sandbox --enable-gpu-benchmarking --force-compositing-mode 81~~~~ 82 83After which go to Tools, Settings, Javascript Console and type: 84 85<!--?prettify?--> 86~~~~ 87chrome.gpuBenchmarking.printToSkPicture(dirname) 88~~~~ 89 90Using the Debugger 91------------------ 92 93The debugger is fairly straight forward to use once a picture is loaded in. We 94can step through different commands via the up and down keys, and clicking on 95the command in the list. We can pause execution of commands with the pause 96button in order to inspect the details of the command in the inspector tabs 97down below. 98 99 100 Command | Function 101 -------------|----------------------------------------------- 102 x | toggles the visibility of the selected command 103 alt-x | clears all hidden commands 104 ctrl-x | shows all deleted commands 105 b | creates a breakpoint on a command 106 alt-b | clears all breakpoints 107 ctrl-b | shows all breakpoints 108 ctrl-r | rewinds the picture to the first command 109 ctrl-p | plays to the next breakpoint or last command 110 ctrl-i | Toggles the inspector and settings widgets 111 ctrl-d | Toggles the directory widget 112 space | Pauses drawing execution 113 ctrl-o | Opens a file dialog for loading pictures 114 ctrl-s | Saves the skp if you deleted any commands 115 ctrl-shift-s | Saves the skp under the new specified name 116 ctrl-q | Quits 117 118 119 120 121