Yet another attempt to fix Win7 warnings/errors

git-svn-id: http://skia.googlecode.com/svn/trunk@9852 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
robertphillips@google.com 2013-07-01 23:15:57 +00:00
Родитель 7d5758d118
Коммит 95faedb764
1 изменённых файлов: 7 добавлений и 6 удалений

Просмотреть файл

@ -11,7 +11,7 @@
#include "SkView.h" #include "SkView.h"
//#include "SkPathOps.h" // loads fine here, won't in PathUtils src files //#include "SkPathOps.h" // loads fine here, won't in PathUtils src files
#include "SkRandom.h" #include "SkRandom.h"
#include "SkTime.h" //#include "SkTime.h"
class samplePathUtils : public SampleView { class samplePathUtils : public SampleView {
public: public:
@ -23,7 +23,7 @@ public:
protected: protected:
static const int numModes = 3; 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 static const int numChars = h * stride; // number of chars in entire array
SkPaint bmp_paint; SkPaint bmp_paint;
@ -52,13 +52,14 @@ protected:
0xff, 0xf0, 0x19, 0x80, 0x36, 0xc0, 0xc0, 0x30 } 0xff, 0xf0, 0x19, 0x80, 0x36, 0xc0, 0xc0, 0x30 }
}; };
static const SkScalar kScale = 10.0f;
for (int i = 0; i < numModes; ++i) { for (int i = 0; i < numModes; ++i) {
SkPath path; // generate and simplify each path SkPath path; // generate and simplify each path
SkPathUtils::BitsToPath_Path(&path, (char*) &bits[i], h, w, stride); SkPathUtils::BitsToPath_Path(&path, (char*) &bits[i], h, w, stride);
canvas->save(); // DRAWING canvas->save(); // DRAWING
canvas->scale(SkIntToScalar(kScale), canvas->scale(kScale, kScale); // scales up each bitmap
SkIntToScalar(kScale)); // scales up each bitmap
canvas->translate(0, 1.5f * h * i); canvas->translate(0, 1.5f * h * i);
canvas->drawPath(path, bmp_paint); // draw bitmap canvas->drawPath(path, bmp_paint); // draw bitmap
canvas->restore(); canvas->restore();
@ -68,8 +69,8 @@ protected:
SkPathUtils::BitsToPath_Region(&pathR, (char*) &bits[i], h, w, stride); SkPathUtils::BitsToPath_Region(&pathR, (char*) &bits[i], h, w, stride);
canvas->save(); 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->translate(1.5f * w, 1.5f * h * i); // translates past previous bitmap
canvas->drawPath(pathR, bmp_paint); // draw bitmap canvas->drawPath(pathR, bmp_paint); // draw bitmap
canvas->restore(); canvas->restore();