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

Side by Side Diff: src/doc/SkDocument_PDF.cpp

Issue 944643002: PDF: Now threadsafe! (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: TODO=DONE Created 5 years, 10 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 unified diff | Download patch
« no previous file with comments | « dm/DMSrcSink.h ('k') | src/pdf/SkPDFBitmap.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « dm/DMSrcSink.h ('k') | src/pdf/SkPDFBitmap.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698