OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "gm.h" | 8 #include "gm.h" |
9 #include "SkBlurMask.h" | 9 #include "SkBlurMask.h" |
10 #include "SkBlurMaskFilter.h" | 10 #include "SkBlurMaskFilter.h" |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 | 139 |
140 p.setPathEffect(nullptr); | 140 p.setPathEffect(nullptr); |
141 p.setXfermode(nullptr); | 141 p.setXfermode(nullptr); |
142 p.setStyle(SkPaint::kStroke_Style); | 142 p.setStyle(SkPaint::kStroke_Style); |
143 p.setStrokeWidth(SK_Scalar1); | 143 p.setStrokeWidth(SK_Scalar1); |
144 rastBuilder->addLayer(p); | 144 rastBuilder->addLayer(p); |
145 } | 145 } |
146 | 146 |
147 typedef void (*raster_proc)(SkLayerRasterizer::Builder*, SkPaint&); | 147 typedef void (*raster_proc)(SkLayerRasterizer::Builder*, SkPaint&); |
148 | 148 |
149 static const raster_proc gRastProcs[] = { | 149 constexpr raster_proc gRastProcs[] = { |
150 r0, r1, r2, r3, r4, r5, r6, r7, r8, r9 | 150 r0, r1, r2, r3, r4, r5, r6, r7, r8, r9 |
151 }; | 151 }; |
152 | 152 |
153 #include "SkXfermode.h" | 153 #include "SkXfermode.h" |
154 | 154 |
155 static void apply_shader(SkPaint* paint, int index) { | 155 static void apply_shader(SkPaint* paint, int index) { |
156 raster_proc proc = gRastProcs[index]; | 156 raster_proc proc = gRastProcs[index]; |
157 if (proc) { | 157 if (proc) { |
158 SkPaint p; | 158 SkPaint p; |
159 SkLayerRasterizer::Builder rastBuilder; | 159 SkLayerRasterizer::Builder rastBuilder; |
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
489 | 489 |
490 SkScalar start = textPt.fX; | 490 SkScalar start = textPt.fX; |
491 SkScalar end = posX; | 491 SkScalar end = posX; |
492 SkScalar uPos = pos[0].fY + uWidth; | 492 SkScalar uPos = pos[0].fY + uWidth; |
493 SkPath underline = create_underline(intersections, start, end, uPos, uWi
dth, textSize); | 493 SkPath underline = create_underline(intersections, start, end, uPos, uWi
dth, textSize); |
494 paint.setStyle(SkPaint::kStroke_Style); | 494 paint.setStyle(SkPaint::kStroke_Style); |
495 canvas->drawPath(underline, paint); | 495 canvas->drawPath(underline, paint); |
496 canvas->translate(0, textSize * 1.3f); | 496 canvas->translate(0, textSize * 1.3f); |
497 } | 497 } |
498 } | 498 } |
OLD | NEW |