deprecate SkScalarRound (and its ilk), use SkScalarRound[ToInt,ToScalar]. #define SK_SUPPORT_DEPRECATED_SCALARROUND for legacy clients

BUG=
R=robertphillips@google.com

Review URL: https://codereview.chromium.org/111353003

git-svn-id: http://skia.googlecode.com/svn/trunk@12719 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/animator/SkAnimateBase.cpp b/src/animator/SkAnimateBase.cpp
index 3d50144..8467ce6 100644
--- a/src/animator/SkAnimateBase.cpp
+++ b/src/animator/SkAnimateBase.cpp
@@ -163,8 +163,10 @@
 {
     SkASSERT(count == 4);
     converted->setCount(1);
-    SkColor color = SkColorSetARGB(SkScalarRound(array[0]), SkScalarRound(array[1]),
-        SkScalarRound(array[2]), SkScalarRound(array[3]));
+    SkColor color = SkColorSetARGB(SkScalarRoundToInt(array[0]),
+                                   SkScalarRoundToInt(array[1]),
+                                   SkScalarRoundToInt(array[2]),
+                                   SkScalarRoundToInt(array[3]));
     (*converted)[0].fS32 = color;
 }
 
diff --git a/src/animator/SkDisplayMath.cpp b/src/animator/SkDisplayMath.cpp
index ac2ba8b..7f406c1 100644
--- a/src/animator/SkDisplayMath.cpp
+++ b/src/animator/SkDisplayMath.cpp
@@ -155,7 +155,7 @@
             scalarResult = SkScalarATan2(input, parameters[1].fOperand.fScalar);
             break;
         case SK_FUNCTION(ceil):
-            scalarResult = SkIntToScalar(SkScalarCeil(input));
+            scalarResult = SkScalarCeilToScalar(input);
             break;
         case SK_FUNCTION(cos):
             scalarResult = SkScalarCos(input);
@@ -164,7 +164,7 @@
             scalarResult = SkScalarExp(input);
             break;
         case SK_FUNCTION(floor):
-            scalarResult = SkIntToScalar(SkScalarFloor(input));
+            scalarResult = SkScalarFloorToScalar(input);
             break;
         case SK_FUNCTION(log):
             scalarResult = SkScalarLog(input);
@@ -193,7 +193,7 @@
             scalarResult = fRandom.nextUScalar1();
             break;
         case SK_FUNCTION(round):
-            scalarResult = SkIntToScalar(SkScalarRound(input));
+            scalarResult = SkScalarRoundToScalar(input);
             break;
         case SK_FUNCTION(sin):
             scalarResult = SkScalarSin(input);
diff --git a/src/animator/SkDrawColor.cpp b/src/animator/SkDrawColor.cpp
index 00c429b..eb57d9d 100644
--- a/src/animator/SkDrawColor.cpp
+++ b/src/animator/SkDrawColor.cpp
@@ -69,7 +69,7 @@
         red = green = blue = value;
     else {
         //SkScalar fraction = SkScalarMod(hue, 60 * SK_Scalar1);
-        int sextant = SkScalarFloor(hue / 60);
+        int sextant = SkScalarFloorToInt(hue / 60);
         SkScalar fraction = hue / 60 - SkIntToScalar(sextant);
         SkScalar p = SkScalarMul(value , SK_Scalar1 - saturation);
         SkScalar q = SkScalarMul(value, SK_Scalar1 - SkScalarMul(saturation, fraction));
@@ -85,8 +85,8 @@
         }
     }
     //used to say SkToU8((U8CPU) red) etc
-    return SkColorSetARGB(SkColorGetA(color), SkScalarRound(red),
-        SkScalarRound(green), SkScalarRound(blue));
+    return SkColorSetARGB(SkColorGetA(color), SkScalarRoundToInt(red),
+                          SkScalarRoundToInt(green), SkScalarRoundToInt(blue));
 }
 
 #if defined _WIN32 && _MSC_VER >= 1300
diff --git a/src/animator/SkOperandIterpolator.cpp b/src/animator/SkOperandIterpolator.cpp
index 7822ee2..84b3282 100644
--- a/src/animator/SkOperandIterpolator.cpp
+++ b/src/animator/SkOperandIterpolator.cpp
@@ -81,7 +81,7 @@
                 for (int i = fElemCount - 1; i >= 0; --i) {
                     int32_t a = prevSrc[i].fS32;
                     int32_t b = nextSrc[i].fS32;
-                    values[i].fS32 = a + SkScalarRound((b - a) * T);
+                    values[i].fS32 = a + SkScalarRoundToInt((b - a) * T);
                 }
             } else
                 memcpy(values, prevSrc, sizeof(SkOperand) * fElemCount);
diff --git a/src/animator/SkScript.cpp b/src/animator/SkScript.cpp
index bf55cb5..1d04d1b 100644
--- a/src/animator/SkScript.cpp
+++ b/src/animator/SkScript.cpp
@@ -1157,7 +1157,7 @@
                 }
                 SkOperand indexOperand;
                 fOperandStack.pop(&indexOperand);
-                int index = indexType == kScalar ? SkScalarFloor(indexOperand.fScalar) :
+                int index = indexType == kScalar ? SkScalarFloorToInt(indexOperand.fScalar) :
                     indexOperand.fS32;
                 SkOpType arrayType;
                 fTypeStack.pop(&arrayType);
@@ -1324,7 +1324,7 @@
                 type1 = kScalar;
             }
             if (type1 == kScalar && (attributes->fLeftType == kInt || type2 == kInt)) {
-                operand1.fS32 = SkScalarFloor(operand1.fScalar);
+                operand1.fS32 = SkScalarFloorToInt(operand1.fScalar);
                 type1 = kInt;
             }
         }
@@ -1339,7 +1339,7 @@
             type2 = kScalar;
         }
         if (type2 == kScalar && (attributes->fRightType == kInt || type1 == kInt)) {
-            operand2.fS32 = SkScalarFloor(operand2.fScalar);
+            operand2.fS32 = SkScalarFloorToInt(operand2.fScalar);
             type2 = kInt;
         }
     }
@@ -1503,7 +1503,7 @@
             if (type == SkType_Boolean)
                 break;
             if (type == SkType_Float)
-                operand.fS32 = SkScalarFloor(operand.fScalar);
+                operand.fS32 = SkScalarFloorToInt(operand.fScalar);
             else {
                 if (type != SkType_String) {
                     success = false;
diff --git a/src/animator/SkScriptRuntime.cpp b/src/animator/SkScriptRuntime.cpp
index 061847e..78d9d5c 100644
--- a/src/animator/SkScriptRuntime.cpp
+++ b/src/animator/SkScriptRuntime.cpp
@@ -210,7 +210,7 @@
                 return false;
             break;
         case SkScriptEngine2::kScalarToInt:
-            operand[0].fS32 = SkScalarFloor(operand[0].fScalar);
+            operand[0].fS32 = SkScalarFloorToInt(operand[0].fScalar);
             break;
         // arithmetic ops
         case SkScriptEngine2::kAddInt:
diff --git a/src/animator/SkScriptTokenizer.cpp b/src/animator/SkScriptTokenizer.cpp
index 2408445..8fc5d80 100644
--- a/src/animator/SkScriptTokenizer.cpp
+++ b/src/animator/SkScriptTokenizer.cpp
@@ -984,7 +984,7 @@
                 SkScriptValue2 value;
                 fValueStack.pop(&value);
                 SkASSERT(value.fType == SkOperand2::kS32 || value.fType == SkOperand2::kScalar); // !!! add error handling (although, could permit strings eventually)
-                int index = value.fType == SkOperand2::kScalar ? SkScalarFloor(value.fOperand.fScalar) :
+                int index = value.fType == SkOperand2::kScalar ? SkScalarFloorToInt(value.fOperand.fScalar) :
                     value.fOperand.fS32;
                 SkScriptValue2 arrayValue;
                 fValueStack.pop(&arrayValue);
@@ -1200,7 +1200,7 @@
     switch (toType) {
         case SkOperand2::kS32:
             if (type == SkOperand2::kScalar)
-                operand.fS32 = SkScalarFloor(operand.fScalar);
+                operand.fS32 = SkScalarFloorToInt(operand.fScalar);
             else {
                 SkASSERT(type == SkOperand2::kString);
                 success = SkParse::FindS32(operand.fString->c_str(), &operand.fS32) != NULL;
diff --git a/src/animator/SkSnapshot.cpp b/src/animator/SkSnapshot.cpp
index 493ce2b..6f818a6 100644
--- a/src/animator/SkSnapshot.cpp
+++ b/src/animator/SkSnapshot.cpp
@@ -62,6 +62,6 @@
         name.append(".png");
     encoder->encodeFile(name.c_str(),
                         maker.fCanvas->getDevice()->accessBitmap(false),
-                        SkScalarFloor(quality));
+                        SkScalarFloorToInt(quality));
     return false;
 }
diff --git a/src/core/SkClipStack.cpp b/src/core/SkClipStack.cpp
index 9e3f7c6..53a8888 100644
--- a/src/core/SkClipStack.cpp
+++ b/src/core/SkClipStack.cpp
@@ -288,10 +288,10 @@
         // Note: the left edge is handled slightly differently below. We
         // are a bit more generous in the rounding since we don't want to
         // risk missing the left pixels when fLeft is very close to .5
-        fFiniteBound.set(SkIntToScalar(SkScalarFloorToInt(fFiniteBound.fLeft+0.45f)),
-                         SkIntToScalar(SkScalarRound(fFiniteBound.fTop)),
-                         SkIntToScalar(SkScalarRound(fFiniteBound.fRight)),
-                         SkIntToScalar(SkScalarRound(fFiniteBound.fBottom)));
+        fFiniteBound.set(SkScalarFloorToScalar(fFiniteBound.fLeft+0.45f),
+                         SkScalarRoundToScalar(fFiniteBound.fTop),
+                         SkScalarRoundToScalar(fFiniteBound.fRight),
+                         SkScalarRoundToScalar(fFiniteBound.fBottom));
     }
 
     // Now determine the previous Element's bound information taking into
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp
index ccab56c..d9bdd8e 100644
--- a/src/core/SkDraw.cpp
+++ b/src/core/SkDraw.cpp
@@ -399,8 +399,8 @@
 static void bw_pt_hair_proc(const PtProcRec& rec, const SkPoint devPts[],
                             int count, SkBlitter* blitter) {
     for (int i = 0; i < count; i++) {
-        int x = SkScalarFloor(devPts[i].fX);
-        int y = SkScalarFloor(devPts[i].fY);
+        int x = SkScalarFloorToInt(devPts[i].fX);
+        int y = SkScalarFloorToInt(devPts[i].fY);
         if (rec.fClip->contains(x, y)) {
             blitter->blitH(x, y, 1);
         }
@@ -1195,8 +1195,8 @@
     SkASSERT(bitmap.config() == SkBitmap::kA8_Config);
 
     if (just_translate(*fMatrix, bitmap)) {
-        int ix = SkScalarRound(fMatrix->getTranslateX());
-        int iy = SkScalarRound(fMatrix->getTranslateY());
+        int ix = SkScalarRoundToInt(fMatrix->getTranslateX());
+        int iy = SkScalarRoundToInt(fMatrix->getTranslateY());
 
         SkAutoLockPixels alp(bitmap);
         if (!bitmap.readyToDraw()) {
@@ -1318,8 +1318,8 @@
 
     if (fBounder && just_translate(matrix, bitmap)) {
         SkIRect ir;
-        int32_t ix = SkScalarRound(matrix.getTranslateX());
-        int32_t iy = SkScalarRound(matrix.getTranslateY());
+        int32_t ix = SkScalarRoundToInt(matrix.getTranslateX());
+        int32_t iy = SkScalarRoundToInt(matrix.getTranslateY());
         ir.set(ix, iy, ix + bitmap.width(), iy + bitmap.height());
         if (!fBounder->doIRect(ir)) {
             return;
@@ -1336,8 +1336,8 @@
         if (!bitmap.readyToDraw()) {
             return;
         }
-        int ix = SkScalarRound(matrix.getTranslateX());
-        int iy = SkScalarRound(matrix.getTranslateY());
+        int ix = SkScalarRoundToInt(matrix.getTranslateX());
+        int iy = SkScalarRoundToInt(matrix.getTranslateY());
         if (clipHandlesSprite(*fRC, ix, iy, bitmap)) {
             uint32_t    storage[kBlitterStorageLongCount];
             SkBlitter*  blitter = SkBlitter::ChooseSprite(*fBitmap, paint, bitmap,
@@ -2741,16 +2741,16 @@
     if (v0 > v1) {
         SkTSwap<SkScalar>(v0, v1);
     }
-    r.fLeft     = SkScalarFloor(v0);
-    r.fRight    = SkScalarCeil(v1);
+    r.fLeft     = SkScalarFloorToInt(v0);
+    r.fRight    = SkScalarCeilToInt(v1);
 
     v0 = pt0.fY;
     v1 = pt1.fY;
     if (v0 > v1) {
         SkTSwap<SkScalar>(v0, v1);
     }
-    r.fTop      = SkScalarFloor(v0);
-    r.fBottom   = SkScalarCeil(v1);
+    r.fTop      = SkScalarFloorToInt(v0);
+    r.fBottom   = SkScalarCeilToInt(v1);
 
     if (paint.isAntiAlias()) {
         r.inset(-1, -1);
diff --git a/src/core/SkRTree.cpp b/src/core/SkRTree.cpp
index 253a7ee..fe08437 100644
--- a/src/core/SkRTree.cpp
+++ b/src/core/SkRTree.cpp
@@ -345,9 +345,9 @@
             }
         }
 
-        int numStrips = SkScalarCeil(SkScalarSqrt(SkIntToScalar(numBranches) *
+        int numStrips = SkScalarCeilToInt(SkScalarSqrt(SkIntToScalar(numBranches) *
                                      SkScalarInvert(fAspectRatio)));
-        int numTiles = SkScalarCeil(SkIntToScalar(numBranches) /
+        int numTiles = SkScalarCeilToInt(SkIntToScalar(numBranches) /
                                     SkIntToScalar(numStrips));
         int currentBranch = 0;
 
diff --git a/src/core/SkRegion_path.cpp b/src/core/SkRegion_path.cpp
index ec4d9f0..a20647c 100644
--- a/src/core/SkRegion_path.cpp
+++ b/src/core/SkRegion_path.cpp
@@ -290,8 +290,8 @@
     }
     SkASSERT(top <= bot);
 
-    *itop = SkScalarRound(top);
-    *ibot = SkScalarRound(bot);
+    *itop = SkScalarRoundToInt(top);
+    *ibot = SkScalarRoundToInt(bot);
     return maxEdges;
 }
 
diff --git a/src/core/SkScan_Hairline.cpp b/src/core/SkScan_Hairline.cpp
index 3b0f152..1e7e762 100644
--- a/src/core/SkScan_Hairline.cpp
+++ b/src/core/SkScan_Hairline.cpp
@@ -200,8 +200,8 @@
     dx = SkScalarAbs(dx);
     dy = SkScalarAbs(dy);
     // convert to whole pixel values (use ceiling to be conservative)
-    int idx = SkScalarCeil(dx);
-    int idy = SkScalarCeil(dy);
+    int idx = SkScalarCeilToInt(dx);
+    int idy = SkScalarCeilToInt(dy);
     // use the cheap approx for distance
     if (idx > idy) {
         return idx + (idy >> 1);
diff --git a/src/effects/SkBlurMask.cpp b/src/effects/SkBlurMask.cpp
index d2484c8..32a3d20 100644
--- a/src/effects/SkBlurMask.cpp
+++ b/src/effects/SkBlurMask.cpp
@@ -404,7 +404,7 @@
 
 static void get_adjusted_radii(SkScalar passRadius, int *loRadius, int *hiRadius)
 {
-    *loRadius = *hiRadius = SkScalarCeil(passRadius);
+    *loRadius = *hiRadius = SkScalarCeilToInt(passRadius);
     if (SkIntToScalar(*hiRadius) - passRadius > 0.5f) {
         *loRadius = *hiRadius - 1;
     }
@@ -512,8 +512,8 @@
     // to approximate a Gaussian blur
     int passCount = (kHigh_Quality == quality) ? 3 : 1;
 
-    int rx = SkScalarCeil(passRadius);
-    int outerWeight = 255 - SkScalarRound((SkIntToScalar(rx) - passRadius) * 255);
+    int rx = SkScalarCeilToInt(passRadius);
+    int outerWeight = 255 - SkScalarRoundToInt((SkIntToScalar(rx) - passRadius) * 255);
 
     SkASSERT(rx >= 0);
     SkASSERT((unsigned)outerWeight <= 255);
@@ -865,7 +865,7 @@
 
     float variance = sigma * sigma;
 
-    int windowSize = SkScalarCeil(sigma*6);
+    int windowSize = SkScalarCeilToInt(sigma*6);
     // round window size up to nearest odd number
     windowSize |= 1;
 
diff --git a/src/effects/SkDashPathEffect.cpp b/src/effects/SkDashPathEffect.cpp
index 4099058..10fee23 100644
--- a/src/effects/SkDashPathEffect.cpp
+++ b/src/effects/SkDashPathEffect.cpp
@@ -277,7 +277,7 @@
                 scale = SkScalarDiv(length, fIntervalLength);
             } else {
                 SkScalar div = SkScalarDiv(length, fIntervalLength);
-                int n = SkScalarFloor(div);
+                int n = SkScalarFloorToInt(div);
                 scale = SkScalarDiv(length, n * fIntervalLength);
             }
         }
diff --git a/src/effects/SkDiscretePathEffect.cpp b/src/effects/SkDiscretePathEffect.cpp
index eece2ef..b7ec1de 100644
--- a/src/effects/SkDiscretePathEffect.cpp
+++ b/src/effects/SkDiscretePathEffect.cpp
@@ -30,7 +30,7 @@
     bool doFill = rec->isFillStyle();
 
     SkPathMeasure   meas(src, doFill);
-    uint32_t        seed = SkScalarRound(meas.getLength());
+    uint32_t        seed = SkScalarRoundToInt(meas.getLength());
     SkLCGRandom     rand(seed ^ ((seed << 16) | (seed >> 16)));
     SkScalar        scale = fPerterb;
     SkPoint         p;
@@ -42,7 +42,7 @@
         if (fSegLength * (2 + doFill) > length) {
             meas.getSegment(0, length, dst, true);  // to short for us to mangle
         } else {
-            int         n = SkScalarRound(SkScalarDiv(length, fSegLength));
+            int         n = SkScalarRoundToInt(length / fSegLength);
             SkScalar    delta = length / n;
             SkScalar    distance = 0;
 
diff --git a/src/effects/SkEmbossMaskFilter.cpp b/src/effects/SkEmbossMaskFilter.cpp
index 905cfab..1306d6a 100644
--- a/src/effects/SkEmbossMaskFilter.cpp
+++ b/src/effects/SkEmbossMaskFilter.cpp
@@ -89,7 +89,7 @@
 
     dst->fFormat = SkMask::k3D_Format;
     if (margin) {
-        margin->set(SkScalarCeil(3*sigma), SkScalarCeil(3*sigma));
+        margin->set(SkScalarCeilToInt(3*sigma), SkScalarCeilToInt(3*sigma));
     }
 
     if (src.fImage == NULL) {
diff --git a/src/gpu/GrPathUtils.cpp b/src/gpu/GrPathUtils.cpp
index 8b06daf..2f60069 100644
--- a/src/gpu/GrPathUtils.cpp
+++ b/src/gpu/GrPathUtils.cpp
@@ -51,7 +51,7 @@
         // subdivide x = log4(d/tol) times. x subdivisions creates 2^(x)
         // points.
         // 2^(log4(x)) = sqrt(x);
-        int temp = SkScalarCeil(SkScalarSqrt(SkScalarDiv(d, tol)));
+        int temp = SkScalarCeilToInt(SkScalarSqrt(SkScalarDiv(d, tol)));
         int pow2 = GrNextPow2(temp);
         // Because of NaNs & INFs we can wind up with a degenerate temp
         // such that pow2 comes out negative. Also, our point generator
@@ -102,7 +102,7 @@
     if (d <= tol) {
         return 1;
     } else {
-        int temp = SkScalarCeil(SkScalarSqrt(SkScalarDiv(d, tol)));
+        int temp = SkScalarCeilToInt(SkScalarSqrt(SkScalarDiv(d, tol)));
         int pow2 = GrNextPow2(temp);
         // Because of NaNs & INFs we can wind up with a degenerate temp
         // such that pow2 comes out negative. Also, our point generator
diff --git a/src/pdf/SkPDFShader.cpp b/src/pdf/SkPDFShader.cpp
index 94bdf2d..62adf58 100644
--- a/src/pdf/SkPDFShader.cpp
+++ b/src/pdf/SkPDFShader.cpp
@@ -988,8 +988,8 @@
     SkMatrix unflip;
     unflip.setTranslate(0, SkScalarRoundToScalar(deviceBounds.height()));
     unflip.preScale(SK_Scalar1, -SK_Scalar1);
-    SkISize size = SkISize::Make(SkScalarRound(deviceBounds.width()),
-                                 SkScalarRound(deviceBounds.height()));
+    SkISize size = SkISize::Make(SkScalarRoundToInt(deviceBounds.width()),
+                                 SkScalarRoundToInt(deviceBounds.height()));
     // TODO(edisonn): should we pass here the DCT encoder of the destination device?
     // TODO(edisonn): NYI Perspective, use SkPDFDeviceFlattener.
     SkPDFDevice pattern(size, size, unflip);
diff --git a/src/pdf/SkPDFTypes.cpp b/src/pdf/SkPDFTypes.cpp
index aafad79..e3cc90c 100644
--- a/src/pdf/SkPDFTypes.cpp
+++ b/src/pdf/SkPDFTypes.cpp
@@ -142,7 +142,7 @@
 
 #if !defined(SK_ALLOW_LARGE_PDF_SCALARS)
     if (value > 32767 || value < -32767) {
-        stream->writeDecAsText(SkScalarRound(value));
+        stream->writeDecAsText(SkScalarRoundToInt(value));
         return;
     }
 
diff --git a/src/ports/SkFontHost_win.cpp b/src/ports/SkFontHost_win.cpp
index aee2b86..82b99d6 100755
--- a/src/ports/SkFontHost_win.cpp
+++ b/src/ports/SkFontHost_win.cpp
@@ -1065,7 +1065,7 @@
     for (int i = 0; i < 256; i++) {
         float x = i / 255.f;
         x = sk_float_pow(x, ee);
-        int xx = SkScalarRound(x * 255);
+        int xx = SkScalarRoundToInt(x * 255);
         table[i] = SkToU8(xx);
     }
 }
diff --git a/src/utils/SkParseColor.cpp b/src/utils/SkParseColor.cpp
index 37f1308..26ad8b7 100644
--- a/src/utils/SkParseColor.cpp
+++ b/src/utils/SkParseColor.cpp
@@ -487,8 +487,8 @@
 //      if (end == NULL)
 //          return NULL;
         // !!! range check for errors?
-//      *colorPtr = SkColorSetARGB(SkScalarRound(array[0]), SkScalarRound(array[1]),
-//          SkScalarRound(array[2]), SkScalarRound(array[3]));
+//      *colorPtr = SkColorSetARGB(SkScalarRoundToInt(array[0]), SkScalarRoundToInt(array[1]),
+//          SkScalarRoundToInt(array[2]), SkScalarRoundToInt(array[3]));
 //      return end;
     } else
         return FindNamedColor(value, strlen(value), colorPtr);
diff --git a/src/views/SkParsePaint.cpp b/src/views/SkParsePaint.cpp
index 344da0b..5b44764 100644
--- a/src/views/SkParsePaint.cpp
+++ b/src/views/SkParsePaint.cpp
@@ -96,7 +96,7 @@
     if (dom.findScalar(node, "opacity", &x))
     {
         x = SkMaxScalar(0, SkMinScalar(x, SK_Scalar1));
-        paint->setAlpha(SkScalarRound(x * 255));
+        paint->setAlpha(SkScalarRoundToInt(x * 255));
     }
 
     int    index = dom.findList(node, "text-anchor", "left,center,right");
diff --git a/src/views/SkStackViewLayout.cpp b/src/views/SkStackViewLayout.cpp
index 9a3a352..aba6f2e 100644
--- a/src/views/SkStackViewLayout.cpp
+++ b/src/views/SkStackViewLayout.cpp
@@ -167,11 +167,11 @@
     while ((child = iter.next()) != NULL)
     {
         if (fRound)
-            pos = SkIntToScalar(SkScalarRound(pos));
+            pos = SkScalarRoundToScalar(pos);
         (child->*mainLocP)(pos);
         SkScalar crossLoc = crossStartM + gAlignProcs[fAlign]((child->*crossGetSizeP)(), crossLimit);
         if (fRound)
-            crossLoc = SkIntToScalar(SkScalarRound(crossLoc));
+            crossLoc = SkScalarRoundToScalar(crossLoc);
         (child->*crossLocP)(crossLoc);
 
         if (crossSetSizeP)
diff --git a/src/views/SkWindow.cpp b/src/views/SkWindow.cpp
index 3291450..7a4d71a 100644
--- a/src/views/SkWindow.cpp
+++ b/src/views/SkWindow.cpp
@@ -134,8 +134,8 @@
         devR.round(&ir);
     } else {
         ir.set(0, 0,
-               SkScalarRound(this->width()),
-               SkScalarRound(this->height()));
+               SkScalarRoundToInt(this->width()),
+               SkScalarRoundToInt(this->height()));
     }
     fDirtyRgn.op(ir, SkRegion::kUnion_Op);
 
@@ -145,8 +145,8 @@
 
 void SkWindow::forceInvalAll() {
     fDirtyRgn.setRect(0, 0,
-                      SkScalarCeil(this->width()),
-                      SkScalarCeil(this->height()));
+                      SkScalarCeilToInt(this->width()),
+                      SkScalarCeilToInt(this->height()));
 }
 
 #if defined(SK_BUILD_FOR_WINCE) && defined(USE_GX_SCREEN)
diff --git a/src/views/unix/SkOSWindow_Unix.cpp b/src/views/unix/SkOSWindow_Unix.cpp
index 9fa2b30..374dbcc 100644
--- a/src/views/unix/SkOSWindow_Unix.cpp
+++ b/src/views/unix/SkOSWindow_Unix.cpp
@@ -330,7 +330,8 @@
                    fUnixWindow.fWin,
                    fUnixWindow.fGLContext);
     glViewport(0, 0,
-               SkScalarRound(this->width()), SkScalarRound(this->height()));
+               SkScalarRoundToInt(this->width()),
+               SkScalarRoundToInt(this->height()));
     glClearColor(0, 0, 0, 0);
     glClearStencil(0);
     glClear(GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
diff --git a/src/views/win/SkOSWindow_win.cpp b/src/views/win/SkOSWindow_win.cpp
index 7549ea2..e91d73a 100644
--- a/src/views/win/SkOSWindow_win.cpp
+++ b/src/views/win/SkOSWindow_win.cpp
@@ -361,7 +361,9 @@
             info->fSampleCount = 0;
         }
 
-        glViewport(0, 0, SkScalarRound(this->width()), SkScalarRound(this->height()));
+        glViewport(0, 0,
+                   SkScalarRoundToInt(this->width()),
+                   SkScalarRoundToInt(this->height()));
         return true;
     }
     return false;
@@ -500,8 +502,9 @@
         SkAutoTUnref<const GrGLInterface> intf(GrGLCreateANGLEInterface());
 
         if (intf ) {
-            ANGLE_GL_CALL(intf, Viewport(0, 0, SkScalarRound(this->width()),
-                                      SkScalarRound(this->height())));
+            ANGLE_GL_CALL(intf, Viewport(0, 0,
+                                         SkScalarRoundToInt(this->width()),
+                                         SkScalarRoundToInt(this->height())));
         }
         return true;
     }