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/SampleIdentityScale.cpp b/samplecode/SampleIdentityScale.cpp
index 217a2ca..bb3ff54 100644
--- a/samplecode/SampleIdentityScale.cpp
+++ b/samplecode/SampleIdentityScale.cpp
@@ -11,6 +11,7 @@
#include "SkBlurMaskFilter.h"
#include "SkCanvas.h"
#include "SkColorPriv.h"
+#include "SkFont.h"
#include "SkPath.h"
#include "SkRandom.h"
#include "SkStream.h"
@@ -42,10 +43,10 @@
void onDrawContent(SkCanvas* canvas) override {
+ SkFont font(nullptr, 48);
SkPaint paint;
paint.setAntiAlias(true);
- paint.setTextSize(48);
paint.setFilterQuality(kHigh_SkFilterQuality);
SkTime::DateTime time;
@@ -67,7 +68,7 @@
}
canvas->drawBitmap( fBM, 100, 100, &paint );
canvas->restore();
- canvas->drawString(text, 100, 400, paint );
+ canvas->drawString(text, 100, 400, font, paint);
}
private: