diff options
Diffstat (limited to 'samplecode/SampleEmptyPath.cpp')
| -rw-r--r-- | samplecode/SampleEmptyPath.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/samplecode/SampleEmptyPath.cpp b/samplecode/SampleEmptyPath.cpp index 51c570eb43..53e2199853 100644 --- a/samplecode/SampleEmptyPath.cpp +++ b/samplecode/SampleEmptyPath.cpp @@ -10,6 +10,7 @@ #include "SkCanvas.h" #include "SkPaint.h" #include "SkRandom.h" +#include "SkString.h" class EmptyPathView : public SampleView { public: @@ -103,14 +104,14 @@ protected: rectPaint.setAntiAlias(true); canvas->drawRect(rect, rectPaint); - char label[1024]; - sprintf(label, "%s, %s", gStyles[style].fName, - gFills[fill].fName); + SkString label; + label.appendf("%s, %s", gStyles[style].fName, gFills[fill].fName); + SkPaint labelPaint; labelPaint.setColor(color); labelPaint.setAntiAlias(true); labelPaint.setLCDRenderText(true); - canvas->drawText(label, strlen(label), + canvas->drawText(label.c_str(), label.size(), 0, rect.height() + 15 * SK_Scalar1, labelPaint); } |
