Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(352)

Unified Diff: src/pdf/SkPDFShader.cpp

Issue 1135693003: Revert of Revert of stop calling SkScalarDiv (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pdf/SkPDFGraphicState.cpp ('k') | src/ports/SkFontHost_FreeType.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFShader.cpp
diff --git a/src/pdf/SkPDFShader.cpp b/src/pdf/SkPDFShader.cpp
index c2f0bc4677120e600f6982c1ed83749d6d7a35a1..c627c142578ad630f68e5d5aadd11cea12bfaf1f 100644
--- a/src/pdf/SkPDFShader.cpp
+++ b/src/pdf/SkPDFShader.cpp
@@ -58,7 +58,7 @@
// 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 @@
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()),
« no previous file with comments | « src/pdf/SkPDFGraphicState.cpp ('k') | src/ports/SkFontHost_FreeType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698