drawText Cleanup, part 5
Change-Id: I2e6cb63839ec9c6f9d5b829505472f97b076a82c
Reviewed-on: https://skia-review.googlesource.com/c/182260
Auto-Submit: Hal Canary <halcanary@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
diff --git a/example/SkiaSDLExample.cpp b/example/SkiaSDLExample.cpp
index 4314296..7405252 100644
--- a/example/SkiaSDLExample.cpp
+++ b/example/SkiaSDLExample.cpp
@@ -10,6 +10,7 @@
#include "GrContext.h"
#include "SDL.h"
#include "SkCanvas.h"
+#include "SkFont.h"
#include "SkRandom.h"
#include "SkSurface.h"
@@ -256,14 +257,14 @@
sk_sp<SkImage> image = cpuSurface->makeImageSnapshot();
int rotation = 0;
+ SkFont font;
while (!state.fQuit) { // Our application loop
SkRandom rand;
canvas->clear(SK_ColorWHITE);
handle_events(&state, canvas);
paint.setColor(SK_ColorBLACK);
- canvas->drawText(helpMessage, strlen(helpMessage), SkIntToScalar(100),
- SkIntToScalar(100), paint);
+ canvas->drawString(helpMessage, 100.0f, 100.0f, font, paint);
for (int i = 0; i < state.fRects.count(); i++) {
paint.setColor(rand.nextU() | 0x44808080);
canvas->drawRect(state.fRects[i], paint);