Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(34)

Unified Diff: samplecode/SampleEmptyPath.cpp

Issue 27044002: Clean up SkTypes.h. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: For patch -p1. Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « samplecode/SampleDegenerateTwoPtRadials.cpp ('k') | samplecode/SamplePath.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « samplecode/SampleDegenerateTwoPtRadials.cpp ('k') | samplecode/SamplePath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698