From 95faedb764a735fdfbc6fb9e594073ed440541a8 Mon Sep 17 00:00:00 2001 From: "robertphillips@google.com" Date: Mon, 1 Jul 2013 23:15:57 +0000 Subject: Yet another attempt to fix Win7 warnings/errors git-svn-id: http://skia.googlecode.com/svn/trunk@9852 2bbb7eff-a529-9590-31e7-b0007b416f81 --- samplecode/SamplePathUtils.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'samplecode') diff --git a/samplecode/SamplePathUtils.cpp b/samplecode/SamplePathUtils.cpp index d6ef60e698..cc560589fa 100644 --- a/samplecode/SamplePathUtils.cpp +++ b/samplecode/SamplePathUtils.cpp @@ -11,7 +11,7 @@ #include "SkView.h" //#include "SkPathOps.h" // loads fine here, won't in PathUtils src files #include "SkRandom.h" -#include "SkTime.h" +//#include "SkTime.h" class samplePathUtils : public SampleView { public: @@ -23,7 +23,7 @@ public: protected: static const int numModes = 3; - static const int h=8, w=12, stride=2, kScale=10; // stride is in bytes + static const int h=8, w=12, stride=2; // stride is in bytes static const int numChars = h * stride; // number of chars in entire array SkPaint bmp_paint; @@ -52,13 +52,14 @@ protected: 0xff, 0xf0, 0x19, 0x80, 0x36, 0xc0, 0xc0, 0x30 } }; + static const SkScalar kScale = 10.0f; + for (int i = 0; i < numModes; ++i) { SkPath path; // generate and simplify each path SkPathUtils::BitsToPath_Path(&path, (char*) &bits[i], h, w, stride); canvas->save(); // DRAWING - canvas->scale(SkIntToScalar(kScale), - SkIntToScalar(kScale)); // scales up each bitmap + canvas->scale(kScale, kScale); // scales up each bitmap canvas->translate(0, 1.5f * h * i); canvas->drawPath(path, bmp_paint); // draw bitmap canvas->restore(); @@ -68,8 +69,8 @@ protected: SkPathUtils::BitsToPath_Region(&pathR, (char*) &bits[i], h, w, stride); canvas->save(); - canvas->scale(SkIntToScalar(kScale), - SkIntToScalar(kScale)); // scales up each bitmap + + canvas->scale(kScale, kScale); // scales up each bitmap canvas->translate(1.5f * w, 1.5f * h * i); // translates past previous bitmap canvas->drawPath(pathR, bmp_paint); // draw bitmap canvas->restore(); -- cgit v1.2.3