OLD | NEW |
1 SkPaint | 1 SkPaint |
2 ======= | 2 ======= |
3 | 3 |
4 *color, stroke, font, effects* | 4 *color, stroke, font, effects* |
5 | 5 |
6 - [SkXfermode](#SkXfermode) - transfer modes | 6 - [SkXfermode](#SkXfermode) - transfer modes |
7 - [ShShader](#ShShader) - gradients and patterns | 7 - [ShShader](#ShShader) - gradients and patterns |
8 - [SkMaskFilter](#SkMaskFilter) - modifications to the alpha mask | 8 - [SkMaskFilter](#SkMaskFilter) - modifications to the alpha mask |
9 - [SkColorFilter](#SkColorFilter) - modify the source color before applying th
e | 9 - [SkColorFilter](#SkColorFilter) - modify the source color before applying th
e |
10 | 10 |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 paint.textToGlyphs(...); | 142 paint.textToGlyphs(...); |
143 paint.getFontMetrics(...); | 143 paint.getFontMetrics(...); |
144 | 144 |
145 <span id="SkXfermode"></span> | 145 <span id="SkXfermode"></span> |
146 | 146 |
147 SkXfermode | 147 SkXfermode |
148 ---------- | 148 ---------- |
149 | 149 |
150 The following example demonstrates all of the Skia's standard transfer | 150 The following example demonstrates all of the Skia's standard transfer |
151 modes. In this example the source is a solid magenta color with a | 151 modes. In this example the source is a solid magenta color with a |
152 horizonatal alpha gradient and the destination is a solid cyan color | 152 horizontal alpha gradient and the destination is a solid cyan color |
153 with a vertical alpha gradient. | 153 with a vertical alpha gradient. |
154 | 154 |
155 <!--?prettify lang=cc?--> | 155 <!--?prettify lang=cc?--> |
156 | 156 |
157 SkXfermode::Mode modes[] = { | 157 SkXfermode::Mode modes[] = { |
158 SkXfermode::kClear_Mode, | 158 SkXfermode::kClear_Mode, |
159 SkXfermode::kSrc_Mode, | 159 SkXfermode::kSrc_Mode, |
160 SkXfermode::kDst_Mode, | 160 SkXfermode::kDst_Mode, |
161 SkXfermode::kSrcOver_Mode, | 161 SkXfermode::kSrcOver_Mode, |
162 SkXfermode::kDstOver_Mode, | 162 SkXfermode::kDstOver_Mode, |
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 ct[i] = x < 0 ? 0 : x > 255 ? 255 : x; | 506 ct[i] = x < 0 ? 0 : x > 255 ? 255 : x; |
507 } | 507 } |
508 SkColorFilter* cf = SkTableColorFilter::CreateARGB(NULL, ct, ct, ct); | 508 SkColorFilter* cf = SkTableColorFilter::CreateARGB(NULL, ct, ct, ct); |
509 SkPaint paint; | 509 SkPaint paint; |
510 paint.setColorFilter(cf); | 510 paint.setColorFilter(cf); |
511 cf->unref(); | 511 cf->unref(); |
512 canvas->drawBitmap(source, 0, 0, &paint); | 512 canvas->drawBitmap(source, 0, 0, &paint); |
513 | 513 |
514 <a href="https://fiddle.skia.org/c/0d3d339543afa1b10c60f9826f264c3f"> | 514 <a href="https://fiddle.skia.org/c/0d3d339543afa1b10c60f9826f264c3f"> |
515 <img src="https://fiddle.skia.org/i/0d3d339543afa1b10c60f9826f264c3f_raster.
png"></a> | 515 <img src="https://fiddle.skia.org/i/0d3d339543afa1b10c60f9826f264c3f_raster.
png"></a> |
OLD | NEW |