OLD | NEW |
1 Runtime Configuration | 1 Runtime Configuration |
2 ===================== | 2 ===================== |
3 | 3 |
4 Skia supports the configuration of various aspects of its behavior at runtime, | 4 Skia supports the configuration of various aspects of its behavior at runtime, |
5 allowing developers to enable\/disable features, or to experiment with numerical | 5 allowing developers to enable\/disable features, or to experiment with numerical |
6 quantities without recompiling. | 6 quantities without recompiling. |
7 | 7 |
8 ## Enabling runtime configuration | 8 ## Enabling runtime configuration |
9 | 9 |
10 In order to use a runtime-configurable variable in your source, simply: | 10 In order to use a runtime-configurable variable in your source, simply: |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 line will be commented out and have its value already equal to its default, so | 145 line will be commented out and have its value already equal to its default, so |
146 you can then edit this file to your liking. | 146 you can then edit this file to your liking. |
147 | 147 |
148 To trigger this behavior, call the function | 148 To trigger this behavior, call the function |
149 `skRTConfRegistry().possiblyDumpFile(); ` or simply use `SkAutoGraphics | 149 `skRTConfRegistry().possiblyDumpFile(); ` or simply use `SkAutoGraphics |
150 ag;`, which also validates your configuration and print out active non-default | 150 ag;`, which also validates your configuration and print out active non-default |
151 options. | 151 options. |
152 | 152 |
153 ## Are these things enabled all the time? | 153 ## Are these things enabled all the time? |
154 | 154 |
155 In `Debug` builds, yes. `Release` builds disable runtime configuration by | 155 No, they are only enabled in builds where SK_DEBUG is defined. This includes bot
h |
156 default, but it is still useful to be able to tweak certain algorithm parameters | 156 `Debug` and `Release_Developer` gyp BUILDTYPES. The `Release_Developer` build ty
pe |
157 at runtime to do scripted performance studies. Therefore, a third build type, | 157 has exactly the same build flags as `Release`, except it re-enables SK_DEBUG, wh
ich |
158 `Release_Developer` has been added. This build type has exactly the same build | 158 in turn enables runtime configuration behavior. |
159 flags as `Release`, except it re-enables all runtime configuration behavior. | |
160 Specifically: | 159 Specifically: |
161 | 160 |
162 <!--?prettify?--> | 161 <!--?prettify?--> |
163 ~~~~ | 162 ~~~~ |
164 prompt% ninja -C BUILDTYPE=Release_Developer | 163 prompt% ninja -C BUILDTYPE=Release_Developer |
165 ~~~~ | 164 ~~~~ |
166 | 165 |
167 ... wait a long time ... | 166 ... wait a long time ... |
168 | 167 |
169 <!--?prettify?--> | 168 <!--?prettify?--> |
170 ~~~~ | 169 ~~~~ |
171 prompt % skia_gpu_printShaders=true out/Release_Developer/dm | 170 prompt % skia_gpu_printShaders=true out/Release_Developer/dm |
172 ~~~~ | 171 ~~~~ |
173 | 172 |
174 ... enjoy ... | 173 ... enjoy ... |
175 | 174 |
176 ## Known issues / limitations | 175 ## Known issues / limitations |
177 | 176 |
178 Lines in 'skia.conf', including comments, are limited to 1024 characters. | 177 Lines in 'skia.conf', including comments, are limited to 1024 characters. |
179 Runtime configuration variables of type `char \* ` cannot currently have spaces | 178 Runtime configuration variables of type `char \* ` cannot currently have spaces |
180 in them. | 179 in them. |
181 Runtime variables are only fully supported for `int`, `unsigned int`, `float`, | 180 Runtime variables are only fully supported for `int`, `unsigned int`, `float`, |
182 `double`, `bool`, and `char \*`. | 181 `double`, `bool`, and `char \*`. |
183 | |
184 ## Questions? Bugs? Improvements? | |
185 | |
186 Feel free to send feedback on this system to Greg Humphreys \(humper@google\.com
\) | |
OLD | NEW |