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

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

Issue 1035513003: SkPDF: skpdfdocument and skpdfpage use skpdfdevice in a const way (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 9 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 | « no previous file | src/pdf/SkPDFDevice.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"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 return success; 55 return success;
56 } 56 }
57 57
58 void onAbort() SK_OVERRIDE { 58 void onAbort() SK_OVERRIDE {
59 fPageDevices.unrefAll(); 59 fPageDevices.unrefAll();
60 fCanon.reset(); 60 fCanon.reset();
61 } 61 }
62 62
63 private: 63 private:
64 SkPDFCanon fCanon; 64 SkPDFCanon fCanon;
65 SkTDArray<SkPDFDevice*> fPageDevices; 65 SkTDArray<const SkPDFDevice*> fPageDevices;
66 SkAutoTUnref<SkCanvas> fCanvas; 66 SkAutoTUnref<SkCanvas> fCanvas;
67 SkScalar fRasterDpi; 67 SkScalar fRasterDpi;
68 }; 68 };
69 } // namespace 69 } // namespace
70 /////////////////////////////////////////////////////////////////////////////// 70 ///////////////////////////////////////////////////////////////////////////////
71 71
72 SkDocument* SkDocument::CreatePDF(SkWStream* stream, SkScalar dpi) { 72 SkDocument* SkDocument::CreatePDF(SkWStream* stream, SkScalar dpi) {
73 return stream ? SkNEW_ARGS(SkDocument_PDF, (stream, NULL, dpi)) : NULL; 73 return stream ? SkNEW_ARGS(SkDocument_PDF, (stream, NULL, dpi)) : NULL;
74 } 74 }
75 75
76 static void delete_wstream(SkWStream* stream, bool aborted) { 76 static void delete_wstream(SkWStream* stream, bool aborted) {
77 SkDELETE(stream); 77 SkDELETE(stream);
78 } 78 }
79 79
80 SkDocument* SkDocument::CreatePDF(const char path[], SkScalar dpi) { 80 SkDocument* SkDocument::CreatePDF(const char path[], SkScalar dpi) {
81 SkFILEWStream* stream = SkNEW_ARGS(SkFILEWStream, (path)); 81 SkFILEWStream* stream = SkNEW_ARGS(SkFILEWStream, (path));
82 if (!stream->isValid()) { 82 if (!stream->isValid()) {
83 SkDELETE(stream); 83 SkDELETE(stream);
84 return NULL; 84 return NULL;
85 } 85 }
86 return SkNEW_ARGS(SkDocument_PDF, (stream, delete_wstream, dpi)); 86 return SkNEW_ARGS(SkDocument_PDF, (stream, delete_wstream, dpi));
87 } 87 }
OLDNEW
« no previous file with comments | « no previous file | src/pdf/SkPDFDevice.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698