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

Side by Side Diff: src/pdf/SkPDFStream.h

Issue 1790023003: SkPDF: add drop() virtual to release resources early. (Closed) Base URL: https://skia.googlesource.com/skia.git@skpdf-global
Patch Set: free → release Created 4 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 | « src/pdf/SkPDFFont.cpp ('k') | src/pdf/SkPDFStream.cpp » ('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 /* 2 /*
3 * Copyright 2010 Google Inc. 3 * Copyright 2010 Google Inc.
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 9
10 #ifndef SkPDFStream_DEFINED 10 #ifndef SkPDFStream_DEFINED
(...skipping 25 matching lines...) Expand all
36 * @param stream The data part of the stream. Will not take ownership. 36 * @param stream The data part of the stream. Will not take ownership.
37 */ 37 */
38 explicit SkPDFStream(SkStream* stream) { this->setData(stream); } 38 explicit SkPDFStream(SkStream* stream) { this->setData(stream); }
39 39
40 virtual ~SkPDFStream(); 40 virtual ~SkPDFStream();
41 41
42 // The SkPDFObject interface. 42 // The SkPDFObject interface.
43 void emitObject(SkWStream* stream, 43 void emitObject(SkWStream* stream,
44 const SkPDFObjNumMap& objNumMap, 44 const SkPDFObjNumMap& objNumMap,
45 const SkPDFSubstituteMap& substitutes) const override; 45 const SkPDFSubstituteMap& substitutes) const override;
46 void drop() override;
46 47
47 protected: 48 protected:
48 /* Create a PDF stream with no data. The setData method must be called to 49 /* Create a PDF stream with no data. The setData method must be called to
49 * set the data. 50 * set the data.
50 */ 51 */
51 SkPDFStream() {} 52 SkPDFStream() {}
52 53
53 /** Only call this function once. */ 54 /** Only call this function once. */
54 void setData(SkStream* stream); 55 void setData(SkStream* stream);
55 void setData(SkData* data) { 56 void setData(SkData* data) {
56 SkMemoryStream memoryStream(data); 57 SkMemoryStream memoryStream(data);
57 this->setData(&memoryStream); 58 this->setData(&memoryStream);
58 } 59 }
59 60
60 private: 61 private:
61 SkAutoTDelete<SkStreamRewindable> fCompressedData; 62 SkAutoTDelete<SkStreamRewindable> fCompressedData;
62 63
63 typedef SkPDFDict INHERITED; 64 typedef SkPDFDict INHERITED;
64 }; 65 };
65 66
66 #endif 67 #endif
OLDNEW
« no previous file with comments | « src/pdf/SkPDFFont.cpp ('k') | src/pdf/SkPDFStream.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698