| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkPDFDevice.h" | 8 #include "SkPDFDevice.h" |
| 9 | 9 |
| 10 #include "SkAnnotation.h" | 10 #include "SkAnnotation.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "SkPDFStream.h" | 26 #include "SkPDFStream.h" |
| 27 #include "SkPDFTypes.h" | 27 #include "SkPDFTypes.h" |
| 28 #include "SkPDFUtils.h" | 28 #include "SkPDFUtils.h" |
| 29 #include "SkRect.h" | 29 #include "SkRect.h" |
| 30 #include "SkRRect.h" | 30 #include "SkRRect.h" |
| 31 #include "SkString.h" | 31 #include "SkString.h" |
| 32 #include "SkSurface.h" | 32 #include "SkSurface.h" |
| 33 #include "SkTextFormatParams.h" | 33 #include "SkTextFormatParams.h" |
| 34 #include "SkTemplates.h" | 34 #include "SkTemplates.h" |
| 35 #include "SkTypefacePriv.h" | 35 #include "SkTypefacePriv.h" |
| 36 #include "SkTSet.h" | |
| 37 | 36 |
| 38 #define DPI_FOR_RASTER_SCALE_ONE 72 | 37 #define DPI_FOR_RASTER_SCALE_ONE 72 |
| 39 | 38 |
| 40 // Utility functions | 39 // Utility functions |
| 41 | 40 |
| 42 static void emit_pdf_color(SkColor color, SkWStream* result) { | 41 static void emit_pdf_color(SkColor color, SkWStream* result) { |
| 43 SkASSERT(SkColorGetA(color) == 0xFF); // We handle alpha elsewhere. | 42 SkASSERT(SkColorGetA(color) == 0xFF); // We handle alpha elsewhere. |
| 44 SkScalar colorMax = SkIntToScalar(0xFF); | 43 SkScalar colorMax = SkIntToScalar(0xFF); |
| 45 SkPDFScalar::Append( | 44 SkPDFScalar::Append( |
| 46 SkScalarDiv(SkIntToScalar(SkColorGetR(color)), colorMax), result); | 45 SkScalarDiv(SkIntToScalar(SkColorGetR(color)), colorMax), result); |
| (...skipping 2093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2140 return; | 2139 return; |
| 2141 } | 2140 } |
| 2142 SkAutoTUnref<SkPDFObject> image(SkPDFBitmap::Create(fCanon, subsetBitmap)); | 2141 SkAutoTUnref<SkPDFObject> image(SkPDFBitmap::Create(fCanon, subsetBitmap)); |
| 2143 if (!image) { | 2142 if (!image) { |
| 2144 return; | 2143 return; |
| 2145 } | 2144 } |
| 2146 | 2145 |
| 2147 SkPDFUtils::DrawFormXObject(this->addXObjectResource(image.get()), | 2146 SkPDFUtils::DrawFormXObject(this->addXObjectResource(image.get()), |
| 2148 &content.entry()->fContent); | 2147 &content.entry()->fContent); |
| 2149 } | 2148 } |
| OLD | NEW |