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/SampleStrokePath.cpp b/samplecode/SampleStrokePath.cpp
index adf5a44..3eb6af1 100644
--- a/samplecode/SampleStrokePath.cpp
+++ b/samplecode/SampleStrokePath.cpp
@@ -4,9 +4,12 @@
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
+
#include "Sample.h"
+
#include "SkBlurMask.h"
#include "SkCanvas.h"
+#include "SkFont.h"
#include "SkMaskFilter.h"
#include "SkParsePath.h"
#include "SkPath.h"
@@ -152,7 +155,7 @@
if (true) {
canvas->drawColor(SK_ColorBLACK);
- paint.setTextSize(24);
+ SkFont font(nullptr, 24);
paint.setColor(SK_ColorWHITE);
canvas->translate(10, 30);
@@ -168,7 +171,7 @@
if (x) {
paint.setMaskFilter(SkMaskFilter::MakeBlur(gStyle[x - 1], sigma));
}
- canvas->drawString("Title Bar", x*SkIntToScalar(100), y*SkIntToScalar(30), paint);
+ canvas->drawString("Title Bar", x * 100.0f, y * 30.0f, font, paint);
sigma *= 0.75f;
}