use utils for deprecated TextAlign
Bug: skia:8493
Change-Id: Ie7162d6e9099ce6499f05024205bd39fdd944c2b
Reviewed-on: https://skia-review.googlesource.com/c/165300
Auto-Submit: Mike Reed <reed@google.com>
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
diff --git a/samplecode/SampleXfer.cpp b/samplecode/SampleXfer.cpp
index d0ba35e..f87d60c 100644
--- a/samplecode/SampleXfer.cpp
+++ b/samplecode/SampleXfer.cpp
@@ -15,6 +15,7 @@
#include "SkRSXform.h"
#include "SkString.h"
#include "SkSurface.h"
+#include "SkTextUtils.h"
#include "SkGradientShader.h"
const SkBlendMode gModes[] = {
@@ -52,9 +53,9 @@
paint.setColor(0xFFFFFFFF);
paint.setTextSize(16);
- paint.setTextAlign(SkPaint::kCenter_Align);
paint.setLCDRenderText(true);
- canvas->drawString(fLabel, fRect.centerX(), fRect.fTop + 0.68f * fRect.height(), paint);
+ SkTextUtils::DrawString(canvas, fLabel, fRect.centerX(), fRect.fTop + 0.68f * fRect.height(),
+ paint, SkPaint::kCenter_Align);
}
bool hitTest(SkScalar x, SkScalar y) {