| Index: samplecode/SampleEmptyPath.cpp
|
| ===================================================================
|
| --- a/samplecode/SampleEmptyPath.cpp (revision 11693)
|
| +++ b/samplecode/SampleEmptyPath.cpp (working copy)
|
| @@ -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 @@
|
| 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);
|
| }
|
|
|