Fixed some fixed point build Windows compiler complaints

http://codereview.appspot.com/6197063/



git-svn-id: http://skia.googlecode.com/svn/trunk@3867 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/samplecode/ClockFaceView.cpp b/samplecode/ClockFaceView.cpp
index 9827545..8555992 100644
--- a/samplecode/ClockFaceView.cpp
+++ b/samplecode/ClockFaceView.cpp
@@ -80,7 +80,7 @@
         this->INHERITED::begin(uvBounds, dst);
     }
 //    virtual void end(SkPath* dst) {}
-	virtual void next(const SkPoint& loc, int u, int v, SkPath* dst)
+    virtual void next(const SkPoint& loc, int u, int v, SkPath* dst)
     {
         if (fPts) {
             *fPts->append() = loc;
@@ -131,7 +131,7 @@
 }
 
 static void r7(SkLayerRasterizer* rast, SkPaint& p, SkScalar interp) {
-    p.setPathEffect(makepe(interp, NULL))->unref();
+    p.setPathEffect(makepe(SkScalarToFloat(interp), NULL))->unref();
     rast->addLayer(p);
 #if 0
     p.setPathEffect(new InverseFillPE())->unref();
@@ -152,7 +152,7 @@
     SkLayerRasterizer*  rast = new SkLayerRasterizer;
 
     p.setAntiAlias(true);
-    r7(rast, p, scale);
+    r7(rast, p, SkFloatToScalar(scale));
     paint->setRasterizer(rast)->unref();
 
     paint->setColor(SK_ColorBLUE);
@@ -163,7 +163,7 @@
     SkScalar fInterp;
     SkScalar fDx;
 public:
-	ClockFaceView()
+    ClockFaceView()
     {
         fFace = SkTypeface::CreateFromFile("/Users/reed/Downloads/p052024l.pfb");
         fInterp = 0;
@@ -226,7 +226,7 @@
 
         paint.setTypeface(fFace);
 
-        apply_shader(&paint, fInterp);
+        apply_shader(&paint, SkScalarToFloat(fInterp));
         canvas->drawText(str.c_str(), str.size(), x, y, paint);
 
     //    drawdots(canvas, paint);
diff --git a/samplecode/SampleLineClipper.cpp b/samplecode/SampleLineClipper.cpp
index 8565470..94374b5 100644
--- a/samplecode/SampleLineClipper.cpp
+++ b/samplecode/SampleLineClipper.cpp
@@ -29,7 +29,8 @@
 static int test0(SkPoint pts[], SkRect* clip) {
     pts[0].set(200000, 140);
     pts[1].set(-740000, 483);
-    pts[2].set(1.00000102e-06f, 9.10000017e-05f);
+    pts[2].set(SkFloatToScalar(1.00000102e-06f),
+               SkFloatToScalar(9.10000017e-05f));
     clip->set(0, 0, 640, 480);
     return 2;
 }
diff --git a/samplecode/SamplePolyToPoly.cpp b/samplecode/SamplePolyToPoly.cpp
index dbda4da..c12b402 100644
--- a/samplecode/SamplePolyToPoly.cpp
+++ b/samplecode/SamplePolyToPoly.cpp
@@ -113,7 +113,9 @@
         float y = D/2 - (fm.fAscent + fm.fDescent)/2;
         SkString str;
         str.appendS32(count);
-        canvas->drawText(str.c_str(), str.size(), x, y, *paint);
+        canvas->drawText(str.c_str(), str.size(),
+                         x, SkFloatToScalar(y),
+                         *paint);
 
         canvas->restore();
     }
diff --git a/samplecode/SampleSlides.cpp b/samplecode/SampleSlides.cpp
index 5251036..49a4ee5 100644
--- a/samplecode/SampleSlides.cpp
+++ b/samplecode/SampleSlides.cpp
@@ -75,7 +75,7 @@
         path.lineTo(SkIntToScalar(gXY[i]), SkIntToScalar(gXY[i+1]));
     path.close();
     path.offset(SkIntToScalar(-6), 0);
-    scale(&path, 1.5);
+    scale(&path, SkFloatToScalar(1.5f));
     
     paint->setPathEffect(new SkPath1DPathEffect(path, SkIntToScalar(21), 0,
                                 SkPath1DPathEffect::kRotate_Style))->unref();
diff --git a/samplecode/SampleTextOnPath.cpp b/samplecode/SampleTextOnPath.cpp
index 91100a6..00d9cba 100644
--- a/samplecode/SampleTextOnPath.cpp
+++ b/samplecode/SampleTextOnPath.cpp
@@ -21,7 +21,8 @@
     canvas->save();
     canvas->scale(SkIntToScalar(250),SkIntToScalar(250));
 
-    rect.set(0.0f, 0.21f, 0.78f, 0.99f);
+    rect.set(SkFloatToScalar(0.0f),  SkFloatToScalar(0.21f),
+             SkFloatToScalar(0.78f), SkFloatToScalar(0.99f));
 
     path.addArc(rect, SkIntToScalar(280), SkIntToScalar(350));
 
@@ -41,7 +42,8 @@
     const char* text = "DRAWING STROKED TEXT WITH A BLUR ON A PATH";
     size_t      len = strlen(text);
 
-    canvas->drawTextOnPathHV(text, len, path, 0, -0.025f, paint);
+    canvas->drawTextOnPathHV(text, len, path, 0,
+                             SkFloatToScalar(-0.025f), paint);
     canvas->restore();
 }
 
diff --git a/samplecode/TransitionView.cpp b/samplecode/TransitionView.cpp
index 76e18b6..5e45e37 100644
--- a/samplecode/TransitionView.cpp
+++ b/samplecode/TransitionView.cpp
@@ -146,7 +146,8 @@
         fEnd[kPrevX] = -lr;
         fEnd[kPrevY] = -ud;
         fEnd[kNextX] = fEnd[kNextY] = 0;
-        SkScalar blend[] = {0.8f, 0.0f, 0.0f, 1.0f};
+        SkScalar blend[] = { SkFloatToScalar(0.8f), SkFloatToScalar(0.0f),
+                             SkFloatToScalar(0.0f), SK_Scalar1 };
         fInterp.setKeyFrame(0, SkTime::GetMSecs(), fBegin, blend);
         fInterp.setKeyFrame(1, SkTime::GetMSecs()+500, fEnd, blend);
     }
diff --git a/src/core/SkLineClipper.cpp b/src/core/SkLineClipper.cpp
index 477596c..b2560d6 100644
--- a/src/core/SkLineClipper.cpp
+++ b/src/core/SkLineClipper.cpp
@@ -175,7 +175,7 @@
 static void sect_with_horizontal_test_for_pin_results() {
     const SkPoint pts[] = {
         { -540000,	-720000 },
-        { -9.10000017e-05f,	9.99999996e-13f }
+        { SkFloatToScalar(-9.10000017e-05f), SkFloatToScalar(9.99999996e-13f) }
     };
     float x = sect_with_horizontal(pts, 0);
     SkASSERT(is_between_unsorted(x, pts[0].fX, pts[1].fX));
diff --git a/tests/PathMeasureTest.cpp b/tests/PathMeasureTest.cpp
index 453cdeb..ee78c6b 100644
--- a/tests/PathMeasureTest.cpp
+++ b/tests/PathMeasureTest.cpp
@@ -51,9 +51,9 @@
     const SkPoint pts[] = {
         { 100000, 100000},
         // big jump between these points, makes a big segment
-        { 1.0005, 0.9999 },
+        { SkFloatToScalar(1.0005f), SkFloatToScalar(0.9999f) },
         // tiny (non-zero) jump between these points
-        { 1, 1 },
+        { SK_Scalar1, SK_Scalar1 },
     };
     
     path.moveTo(pts[0]);