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

Unified Diff: samplecode/SampleDegenerateTwoPtRadials.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 | « include/core/SkTypes.h ('k') | samplecode/SampleEmptyPath.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samplecode/SampleDegenerateTwoPtRadials.cpp
===================================================================
--- a/samplecode/SampleDegenerateTwoPtRadials.cpp (revision 11693)
+++ b/samplecode/SampleDegenerateTwoPtRadials.cpp (working copy)
@@ -10,6 +10,7 @@
#include "SkCanvas.h"
#include "Sk64.h"
#include "SkGradientShader.h"
+#include "SkString.h"
static void draw_gradient2(SkCanvas* canvas, const SkRect& rect, SkScalar delta) {
SkColor colors[] = { SK_ColorRED, SK_ColorGREEN, SK_ColorBLUE, SK_ColorMAGENTA };
@@ -71,12 +72,12 @@
SkScalar l = SK_Scalar1 * 100;
SkScalar t = SK_Scalar1 * 100;
draw_gradient2(canvas, SkRect::MakeXYWH(l, t, w, h), delta);
- char txt[512];
- sprintf(txt, "gap at \"tangent\" pt = %f", SkScalarToFloat(delta));
+ SkString txt;
+ txt.appendf("gap at \"tangent\" pt = %f", SkScalarToFloat(delta));
SkPaint paint;
paint.setAntiAlias(true);
paint.setColor(SK_ColorBLACK);
- canvas->drawText(txt, strlen(txt), l + w/2 + w*DELTA_SCALE*delta, t + h + SK_Scalar1 * 10, paint);
+ canvas->drawText(txt.c_str(), txt.size(), l + w/2 + w*DELTA_SCALE*delta, t + h + SK_Scalar1 * 10, paint);
this->inval(NULL);
}
« no previous file with comments | « include/core/SkTypes.h ('k') | samplecode/SampleEmptyPath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698