Index: src/pdf/SkPDFDevice.cpp |
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp |
index 3b0d6f72ae5a1fdeaf51e41f7e2c536486c61084..814504e5e83ae084c01d1353ce2290a880d20cac 100644 |
--- a/src/pdf/SkPDFDevice.cpp |
+++ b/src/pdf/SkPDFDevice.cpp |
@@ -39,12 +39,15 @@ |
static void emit_pdf_color(SkColor color, SkWStream* result) { |
SkASSERT(SkColorGetA(color) == 0xFF); // We handle alpha elsewhere. |
- SkScalar colorScale = SkScalarInvert(0xFF); |
- SkPDFUtils::AppendScalar(SkColorGetR(color) * colorScale, result); |
+ SkScalar colorMax = SkIntToScalar(0xFF); |
+ SkPDFUtils::AppendScalar( |
+ SkScalarDiv(SkIntToScalar(SkColorGetR(color)), colorMax), result); |
result->writeText(" "); |
- SkPDFUtils::AppendScalar(SkColorGetG(color) * colorScale, result); |
+ SkPDFUtils::AppendScalar( |
+ SkScalarDiv(SkIntToScalar(SkColorGetG(color)), colorMax), result); |
result->writeText(" "); |
- SkPDFUtils::AppendScalar(SkColorGetB(color) * colorScale, result); |
+ SkPDFUtils::AppendScalar( |
+ SkScalarDiv(SkIntToScalar(SkColorGetB(color)), colorMax), result); |
result->writeText(" "); |
} |