From fab44db294846ff05d837b9cf0bf97a073891da7 Mon Sep 17 00:00:00 2001 From: "bungeman@google.com" Date: Fri, 11 Oct 2013 18:50:45 +0000 Subject: Clean up SkTypes.h. This change removes sk_stdint.h since it is only needed for vs2008 and earlier. This change removes SK_MMAP_SUPPORT define since it is no longer used. This change removes the stdio.h include from SkTypes.h since on many systems this is a very large header, few Skia files actually use it, it is available everywhere standard, and SkDebugf should be used instead. After this change there is no need for external users to put Skia's include/config into their own list of includes, saving the headache of having two header files of the same name and sometimes getting the wrong one depending on include order. R=bsalomon@google.com, djsollen@google.com Review URL: https://codereview.chromium.org/27044002 git-svn-id: http://skia.googlecode.com/svn/trunk@11738 2bbb7eff-a529-9590-31e7-b0007b416f81 --- samplecode/SampleDegenerateTwoPtRadials.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'samplecode/SampleDegenerateTwoPtRadials.cpp') diff --git a/samplecode/SampleDegenerateTwoPtRadials.cpp b/samplecode/SampleDegenerateTwoPtRadials.cpp index 91f1622b69..4e83ed8f0a 100644 --- a/samplecode/SampleDegenerateTwoPtRadials.cpp +++ b/samplecode/SampleDegenerateTwoPtRadials.cpp @@ -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 @@ protected: 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); } -- cgit v1.2.3