OLD | NEW |
1 Skia Debugger | 1 Skia Debugger |
2 ============= | 2 ============= |
3 | 3 |
4 Introduction | 4 Introduction |
5 ------------ | 5 ------------ |
6 | 6 |
7 The Skia Debugger is a graphical tool used to step through and analyze the | 7 The Skia Debugger is a graphical tool used to step through and analyze the |
8 contents of the Skia picture format. Pre-requisites include installing the Qt | 8 contents of the Skia picture format. The tool is available online at |
9 Library and downloading the Skia code base. | 9 [https://debugger.skia.org](https://debugger.skia.org/) or can be run locally. |
10 | 10 |
11 Qt is available here: http://qt-project.org/downloads. | 11 Building and running locally |
12 | |
13 It can also be installed on linux using | |
14 | |
15 <!--?prettify?--> | |
16 ~~~~ | |
17 sudo apt-get install libqt4-dev | |
18 ~~~~ | |
19 | |
20 Note that the debugger has been tested with Qt 4.8.6; it is known not to work | |
21 with Qt 5.0RC1 on the Mac. | |
22 | |
23 Design Documents: | |
24 | |
25 https://docs.google.com/a/google.com/document/d/1b8muqVzfbJmYbno9nTv5721V2nlFMfn
qXYLNHiSQ4ws/pub | |
26 | |
27 | |
28 How to build and run | |
29 -------------------- | 12 -------------------- |
30 | 13 |
31 Because the debugger uses Qt, you'll need to build skia in 64 bit mode: | 14 Begin by following the instructions to |
| 15 [download and build Skia](../../user/quick), then simply build and run the |
| 16 `skiaserve` tool: |
32 | 17 |
33 <!--?prettify?--> | 18 <!--?prettify lang=sh?--> |
34 | 19 |
35 GYP_DEFINES="skia_arch_width=64" python bin/sync-and-gyp | 20 # Build. |
36 ninja -C out/Debug debugger | 21 ninja -C out/Release/skiaserve |
37 out/Debug/debugger | |
38 | 22 |
39 For Windows, Qt ships as 32 bit libraries so to build and run one should just be | 23 # Run the debugger locally |
40 able to: | 24 out/Release/skiaserve |
41 | 25 |
42 <!--?prettify?--> | 26 After running `skiaserve`, follow the instructions to open the debugger in your |
43 ~~~~ | 27 local browser. By default the address will be `http://127.0.0.1:8888`. |
44 cd trunk | |
45 make clean gyp | |
46 <open solution in VS2010 and build everything> | |
47 ~~~~ | |
48 | 28 |
49 Depending on how your Qt is installed you may also need to define an environment | 29 ![Debugger interface](onlinedebugger.png) |
50 variable like: | |
51 | |
52 ~~~~ | |
53 GYP_DEFINES=qt_sdk='C:\Qt\4.8.6\' | |
54 ~~~~ | |
55 (which needs to be set before you execute 'make gyp') | |
56 | |
57 On Windows, you may need to copy several DLL and PDB files from %QTDIR%\bin into | |
58 your executable directory (out/Debug or out/Release): | |
59 | |
60 QtCore4.dll QtCored4.dll QtCored4.pdb | |
61 | |
62 QtGui4.dll QtGuid4.dll QtGuid4.pdb | |
63 | |
64 QtOpenGL4.dll QtOpenGLd4.dll QtOpenGLd4.pdb | |
65 | |
66 | |
67 Producing SKPs for usage | |
68 ------------------------ | |
69 | |
70 You may either use the Skia testing images (GMs) for use in the debugger or | |
71 create your own via chromium. | |
72 | |
73 To create SKPs from Chromium you must download and build chromium on your | |
74 platform of choice: http://www.chromium.org/Home | |
75 | |
76 <!--?prettify?--> | |
77 ~~~~ | |
78 cd src | |
79 make chrome | |
80 out/Debug/chrome --no-sandbox --enable-gpu-benchmarking --force-compositing-mode | |
81 ~~~~ | |
82 | |
83 After which go to Tools, Settings, Javascript Console and type: | |
84 | |
85 <!--?prettify?--> | |
86 ~~~~ | |
87 chrome.gpuBenchmarking.printToSkPicture(dirname) | |
88 ~~~~ | |
89 | |
90 Using the Debugger | |
91 ------------------ | |
92 | |
93 The debugger is fairly straight forward to use once a picture is loaded in. We | |
94 can step through different commands via the up and down keys, and clicking on | |
95 the command in the list. We can pause execution of commands with the pause | |
96 button in order to inspect the details of the command in the inspector tabs | |
97 down 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 ![Debugger interface](debugger.png) | |
119 | |
120 | |
OLD | NEW |