OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 "SkDocument.h" | 8 #include "SkDocument.h" |
9 #include "SkPDFCanon.h" | 9 #include "SkPDFCanon.h" |
10 #include "SkPDFDocument.h" | 10 #include "SkPDFDocument.h" |
11 #include "SkPDFDevice.h" | 11 #include "SkPDFDevice.h" |
12 | 12 |
13 class SkDocument_PDF : public SkDocument { | 13 class SkDocument_PDF : public SkDocument { |
14 public: | 14 public: |
15 SkDocument_PDF(SkWStream* stream, | 15 SkDocument_PDF(SkWStream* stream, |
16 void (*doneProc)(SkWStream*,bool), | 16 void (*doneProc)(SkWStream*, bool), |
17 SkScalar rasterDpi) | 17 SkScalar rasterDpi) |
18 : SkDocument(stream, doneProc) | 18 : SkDocument(stream, doneProc) |
19 , fDoc(SkNEW(SkPDFDocument)) | 19 , fDoc(SkNEW(SkPDFDocument)) |
20 , fRasterDpi(rasterDpi) {} | 20 , fRasterDpi(rasterDpi) {} |
21 | 21 |
22 virtual ~SkDocument_PDF() { | 22 virtual ~SkDocument_PDF() { |
23 // subclasses must call close() in their destructors | 23 // subclasses must call close() in their destructors |
24 this->close(); | 24 this->close(); |
25 } | 25 } |
26 | 26 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 } | 84 } |
85 | 85 |
86 SkDocument* SkDocument::CreatePDF(const char path[], SkScalar dpi) { | 86 SkDocument* SkDocument::CreatePDF(const char path[], SkScalar dpi) { |
87 SkFILEWStream* stream = SkNEW_ARGS(SkFILEWStream, (path)); | 87 SkFILEWStream* stream = SkNEW_ARGS(SkFILEWStream, (path)); |
88 if (!stream->isValid()) { | 88 if (!stream->isValid()) { |
89 SkDELETE(stream); | 89 SkDELETE(stream); |
90 return NULL; | 90 return NULL; |
91 } | 91 } |
92 return SkNEW_ARGS(SkDocument_PDF, (stream, delete_wstream, dpi)); | 92 return SkNEW_ARGS(SkDocument_PDF, (stream, delete_wstream, dpi)); |
93 } | 93 } |
OLD | NEW |