24 {
26 return;
27 }
28
29
30 calculateThickness(textStyle, context.run->font().refTypeface());
31
33 if ((textStyle.getDecorationType() & decoration) == 0) {
34 continue;
35 }
36
37 calculatePosition(decoration,
39 ? context.run->correctAscent() - context.run->ascent()
40 : context.run->correctAscent());
41
42 calculatePaint(textStyle);
43
44 auto width = context.clip.width();
46 SkScalar y = context.clip.top() + fPosition;
47
50
51 switch (textStyle.getDecorationStyle()) {
53 calculateWaves(textStyle, context.clip);
55 painter->drawPath(fPath, fDecorStyle);
56 break;
57 }
59 SkScalar bottom =
y + kDoubleDecorationSpacing;
60 if (drawGaps) {
62 painter->translate(context.fTextShift, 0);
64 painter->drawPath(fPath, fDecorStyle);
66 painter->drawPath(fPath, fDecorStyle);
67 } else {
68 draw_line_as_rect(painter,
x,
y,
width, fDecorStyle);
69 draw_line_as_rect(painter,
x, bottom,
width, fDecorStyle);
70 }
71 break;
72 }
75 if (drawGaps) {
77 painter->translate(context.fTextShift, 0);
79 painter->drawPath(fPath, fDecorStyle);
80 } else {
81 painter->drawLine(
x,
y,
x +
width,
y, fDecorStyle);
82 }
83 break;
85 if (drawGaps) {
87 painter->translate(context.fTextShift, 0);
89 painter->drawPath(fPath, fDecorStyle);
90 } else {
91 draw_line_as_rect(painter,
x,
y,
width, fDecorStyle);
92 }
93 break;
94 default:break;
95 }
96 }
97}
void offset(SkScalar dx, SkScalar dy, SkPath *dst) const
constexpr TextDecoration AllTextDecorations[]
static constexpr SkRect MakeXYWH(float x, float y, float w, float h)