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

Unified Diff: src/pdf/SkPDFDevice.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/gpu/effects/GrDashingEffect.cpp ('k') | src/pdf/SkPDFGraphicState.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFDevice.cpp
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp
index 814504e5e83ae084c01d1353ce2290a880d20cac..3b0d6f72ae5a1fdeaf51e41f7e2c536486c61084 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -39,15 +39,12 @@
static void emit_pdf_color(SkColor color, SkWStream* result) {
SkASSERT(SkColorGetA(color) == 0xFF); // We handle alpha elsewhere.
- SkScalar colorMax = SkIntToScalar(0xFF);
- SkPDFUtils::AppendScalar(
- SkScalarDiv(SkIntToScalar(SkColorGetR(color)), colorMax), result);
+ SkScalar colorScale = SkScalarInvert(0xFF);
+ SkPDFUtils::AppendScalar(SkColorGetR(color) * colorScale, result);
result->writeText(" ");
- SkPDFUtils::AppendScalar(
- SkScalarDiv(SkIntToScalar(SkColorGetG(color)), colorMax), result);
+ SkPDFUtils::AppendScalar(SkColorGetG(color) * colorScale, result);
result->writeText(" ");
- SkPDFUtils::AppendScalar(
- SkScalarDiv(SkIntToScalar(SkColorGetB(color)), colorMax), result);
+ SkPDFUtils::AppendScalar(SkColorGetB(color) * colorScale, result);
result->writeText(" ");
}
« no previous file with comments | « src/gpu/effects/GrDashingEffect.cpp ('k') | src/pdf/SkPDFGraphicState.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698