OLD | NEW |
1 Tips & FAQ | 1 Tips & FAQ |
2 ========== | 2 ========== |
3 | 3 |
4 + [Gyp Options](#gypdefines) | 4 + [Gyp Options](#gypdefines) |
5 + [Bitmap Subsetting](#bitmap-subsetting) | 5 + [Bitmap Subsetting](#bitmap-subsetting) |
6 + [Capture a `.skp` file on a web page in Chromium](#skp-capture) | 6 + [Capture a `.skp` file on a web page in Chromium](#skp-capture) |
| 7 + [Capture a `.mskp` file on a web page in Chromium](#mskp-capture) |
7 + [How to add hardware acceleration in Skia](#hw-acceleration) | 8 + [How to add hardware acceleration in Skia](#hw-acceleration) |
8 + [Does Skia support Font hinting?](#font-hinting) | 9 + [Does Skia support Font hinting?](#font-hinting) |
9 + [Does Skia shape text (kerning)?](#kerning) | 10 + [Does Skia shape text (kerning)?](#kerning) |
10 + [How do I add drop shadow on text?](#text-shadow) | 11 + [How do I add drop shadow on text?](#text-shadow) |
11 | 12 |
12 * * * | 13 * * * |
13 | 14 |
14 <span id="gypdefines"></span> | 15 <span id="gypdefines"></span> |
15 | 16 |
16 Gyp Options | 17 Gyp Options |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 <!--?prettify lang=sh?--> | 110 <!--?prettify lang=sh?--> |
110 | 111 |
111 out/Release/dm --src skp --skps /tmp/layer_0.skp -w /tmp \ | 112 out/Release/dm --src skp --skps /tmp/layer_0.skp -w /tmp \ |
112 --config 8888 gpu pdf --verbose | 113 --config 8888 gpu pdf --verbose |
113 ls -l /tmp/*/skp/layer_0.skp.* | 114 ls -l /tmp/*/skp/layer_0.skp.* |
114 | 115 |
115 out/Release/SampleApp --picture /tmp/layer_0.skp | 116 out/Release/SampleApp --picture /tmp/layer_0.skp |
116 | 117 |
117 * * * | 118 * * * |
118 | 119 |
| 120 <span id="mskp-capture"></span> |
| 121 |
| 122 Capture a `.mskp` file on a web page in Chromium |
| 123 ----------------------------------------------- |
| 124 |
| 125 Multipage Skia Picture files capture the commands sent to produce PDFs |
| 126 and printed documents. |
| 127 |
| 128 1. Launch Chrome or Chromium with `--no-sandbox --enable-gpu-benchmarking` |
| 129 2. Open the JS console (ctrl-shift-J) |
| 130 3. Execute: `chrome.gpuBenchmarking.printPagesToSkPictures('/tmp/filename.mskp'
)` |
| 131 This returns "undefined" on success. |
| 132 |
| 133 Open the resulting file in the [Skia Debugger](/dev/tools/debugger) or |
| 134 process it with `dm`. |
| 135 |
| 136 <!--?prettify lang=sh?--> |
| 137 |
| 138 experimental/tools/mskp_parser.py /tmp/filename.mskp /tmp/filename.mskp.skp |
| 139 ls -l /tmp/filename.mskp.skp |
| 140 # open filename.mskp.skp in the debugger. |
| 141 |
| 142 out/Release/dm --src mskp --mskps /tmp/filename.mskp -w /tmp \ |
| 143 --config pdf --verbose |
| 144 ls -l /tmp/pdf/mskp/filename.mskp |
| 145 |
| 146 * * * |
| 147 |
119 <span id="hw-acceleration"></span> | 148 <span id="hw-acceleration"></span> |
120 | 149 |
121 How to add hardware acceleration in Skia | 150 How to add hardware acceleration in Skia |
122 ---------------------------------------- | 151 ---------------------------------------- |
123 | 152 |
124 There are two ways Skia takes advantage of specific hardware. | 153 There are two ways Skia takes advantage of specific hardware. |
125 | 154 |
126 1. Subclass SkCanvas | 155 1. Subclass SkCanvas |
127 | 156 |
128 Since all drawing calls go through SkCanvas, those calls can be | 157 Since all drawing calls go through SkCanvas, those calls can be |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 SkBlurMaskFilter::ConvertRadiusToSigma(radius), 0)); | 228 SkBlurMaskFilter::ConvertRadiusToSigma(radius), 0)); |
200 canvas->drawText(text, strlen(text), x + xDrop, y + yDrop, blur); | 229 canvas->drawText(text, strlen(text), x + xDrop, y + yDrop, blur); |
201 canvas->drawText(text, strlen(text), x, y, paint); | 230 canvas->drawText(text, strlen(text), x, y, paint); |
202 } | 231 } |
203 | 232 |
204 <a href='https://fiddle.skia.org/c/@text_shadow'><img src='https://fiddle.skia.o
rg/i/@text_shadow_raster.png'></a> | 233 <a href='https://fiddle.skia.org/c/@text_shadow'><img src='https://fiddle.skia.o
rg/i/@text_shadow_raster.png'></a> |
205 | 234 |
206 * * * | 235 * * * |
207 | 236 |
208 <div style="margin-bottom:99%"></div> | 237 <div style="margin-bottom:99%"></div> |
OLD | NEW |