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

Unified Diff: src/pdf/SkPDFDevice.cpp

Issue 2151863003: SkPdf: smaller color serialization (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: SkFixed - 2016-07-15 (Friday) 15:45:32 EDT Created 4 years, 5 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 | « bench/PDFBench.cpp ('k') | src/pdf/SkPDFShader.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 8e417b1f529dbf9e4b41909175a9cf7107aeb940..340f3674af6466b1343fa0c909b8e06ec68bbb47 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -51,12 +51,11 @@ static void replace_srcmode_on_opaque_paint(SkPaint* paint) {
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);
+ SkPDFUtils::AppendColorComponent(SkColorGetR(color), result);
result->writeText(" ");
- SkPDFUtils::AppendScalar(SkColorGetG(color) * colorScale, result);
+ SkPDFUtils::AppendColorComponent(SkColorGetG(color), result);
result->writeText(" ");
- SkPDFUtils::AppendScalar(SkColorGetB(color) * colorScale, result);
+ SkPDFUtils::AppendColorComponent(SkColorGetB(color), result);
result->writeText(" ");
}
« no previous file with comments | « bench/PDFBench.cpp ('k') | src/pdf/SkPDFShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698