From 80ea19ca4bdd68c1493666a5fe7e4ce9d43ded8b Mon Sep 17 00:00:00 2001 From: reed Date: Tue, 12 May 2015 10:37:34 -0700 Subject: Revert of Revert of stop calling SkScalarDiv (patchset #1 id:1 of https://codereview.chromium.org/1138263002/) Reason for revert: android patched, blink has rolled Original issue's description: > Revert of stop calling SkScalarDiv (patchset #4 id:60001 of https://codereview.chromium.org/1135053002/) > > Reason for revert: > need to wait for Blink roll (and patch android) > > Original issue's description: > > stop calling SkScalarDiv > > > > BUG=skia: > > TBR= > > > > Committed: https://skia.googlesource.com/skia/+/67d71c898249a7af3523b16c6a69895a63bfae0a > > TBR= > NOPRESUBMIT=true > NOTREECHECKS=true > NOTRY=true > BUG=skia: > > Committed: https://skia.googlesource.com/skia/+/2629697933b5cc975e45d2a45c48f803fc6cbcec TBR= NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=skia: Review URL: https://codereview.chromium.org/1135693003 --- src/pdf/SkPDFShader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/pdf/SkPDFShader.cpp') diff --git a/src/pdf/SkPDFShader.cpp b/src/pdf/SkPDFShader.cpp index c2f0bc4677..c627c14257 100644 --- a/src/pdf/SkPDFShader.cpp +++ b/src/pdf/SkPDFShader.cpp @@ -58,7 +58,7 @@ static void interpolateColorCode(SkScalar range, SkScalar* curColor, // Figure out how to scale each color component. SkScalar multiplier[kColorComponents]; for (int i = 0; i < kColorComponents; i++) { - multiplier[i] = SkScalarDiv(curColor[i] - prevColor[i], range); + multiplier[i] = (curColor[i] - prevColor[i]) / range; } // Calculate when we no longer need to keep a copy of the input parameter t. @@ -1132,7 +1132,7 @@ SkPDFShader::State::State(const SkShader& shader, const SkMatrix& canvasTransfor static const SkScalar kMaxBitmapArea = 1024 * 1024; SkScalar bitmapArea = rasterScale * bbox.width() * rasterScale * bbox.height(); if (bitmapArea > kMaxBitmapArea) { - rasterScale *= SkScalarSqrt(SkScalarDiv(kMaxBitmapArea, bitmapArea)); + rasterScale *= SkScalarSqrt(kMaxBitmapArea / bitmapArea); } SkISize size = SkISize::Make(SkScalarRoundToInt(rasterScale * bbox.width()), -- cgit v1.2.3