drawText Cleanup, part 4
Change-Id: I2b48b6f507fe567cf44836c8755871c2a2f61ec0
Reviewed-on: https://skia-review.googlesource.com/c/182220
Auto-Submit: Hal Canary <halcanary@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
diff --git a/samplecode/SampleTextBox.cpp b/samplecode/SampleTextBox.cpp
index 7931dfc..cb31c4d 100644
--- a/samplecode/SampleTextBox.cpp
+++ b/samplecode/SampleTextBox.cpp
@@ -76,14 +76,13 @@
SkScalar margin = 20;
SkPaint paint;
- paint.setAntiAlias(true);
- paint.setLCDRenderText(true);
paint.setColor(fg);
for (int i = 9; i < 24; i += 2) {
SkTextBlobBuilderLineHandler builder;
- paint.setTextSize(SkIntToScalar(i));
- SkFont font = SkFont::LEGACY_ExtractFromPaint(paint);
+ SkFont font(nullptr, SkIntToScalar(i));
+ font.setEdging(SkFont::Edging::kSubpixelAntiAlias);
+
SkPoint end = shaper.shape(&builder, font, gText, strlen(gText), true,
{ margin, margin }, w - margin);
canvas->drawTextBlob(builder.makeBlob(), 0, 0, paint);