Index: gm/texteffects.cpp |
diff --git a/gm/texteffects.cpp b/gm/texteffects.cpp |
index 53395f0732f2e22a42e50bd9779f2e35d3fce72e..1d4b98e950fdd16a12c7076c4a47d022010ea9e7 100644 |
--- a/gm/texteffects.cpp |
+++ b/gm/texteffects.cpp |
@@ -196,3 +196,35 @@ DEF_SIMPLE_GM(texteffects, canvas, 460, 680) { |
canvas->restore(); |
} |
+ |
+DEF_SIMPLE_GM(textunderstrike, canvas, 460, 680) { |
+ canvas->clear(SK_ColorYELLOW); |
+ SkPaint paint; |
+ sk_tool_utils::set_portable_typeface(&paint); |
+ paint.setTextSize(50); |
+ paint.setStrokeWidth(5); |
+ paint.setAntiAlias(true); |
+ |
+ auto drawText = [&]() { |
+ paint.setStyle(SkPaint::kFill_Style); |
+ canvas->drawText("Hello", 5, 100, 50, paint); |
+ paint.setStyle(SkPaint::kStroke_Style); |
+ canvas->drawText("Hello", 5, 100, 100, paint); |
+ canvas->translate(0, 100); |
+ }; |
+ |
+ drawText(); |
+ paint.setUnderlineText(true); |
+ drawText(); |
+ paint.setUnderlineText(false); |
+ paint.setStrikeThruText(true); |
+ drawText(); |
+ paint.setUnderlineText(true); |
+ drawText(); |
+ paint.setColor(SK_ColorWHITE); |
+ paint.setStyle(SkPaint::kStroke_Style); |
+ canvas->drawText("Hello", 5, 100, 50, paint); |
+ paint.setColor(SK_ColorBLUE); |
+ paint.setStyle(SkPaint::kFill_Style); |
+ canvas->drawText("Hello", 5, 100, 50, paint); |
+} |