aboutsummaryrefslogtreecommitdiffhomepage
path: root/samplecode
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-07-01 23:15:57 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-07-01 23:15:57 +0000
commit95faedb764a735fdfbc6fb9e594073ed440541a8 (patch)
tree948f111a464f3d636f65c27d443248585864df30 /samplecode
parent7d5758d11823ef04361c30b458c0e4bd6d94f67b (diff)
Yet another attempt to fix Win7 warnings/errors
git-svn-id: http://skia.googlecode.com/svn/trunk@9852 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'samplecode')
-rw-r--r--samplecode/SamplePathUtils.cpp13
1 files changed, 7 insertions, 6 deletions
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();