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

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

Issue 2098393002: SkPDF: SkPDFStream takes only SkStreamAsset (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 5 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/SkPDFShader.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 * Copyright 2010 Google Inc. 2 * Copyright 2010 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 8
9 #ifndef SkPDFStream_DEFINED 9 #ifndef SkPDFStream_DEFINED
10 #define SkPDFStream_DEFINED 10 #define SkPDFStream_DEFINED
(...skipping 16 matching lines...) Expand all
27 /** Create a PDF stream. A Length entry is automatically added to the 27 /** Create a PDF stream. A Length entry is automatically added to the
28 * stream dictionary. 28 * stream dictionary.
29 * @param data The data part of the stream. Will not take ownership. 29 * @param data The data part of the stream. Will not take ownership.
30 */ 30 */
31 explicit SkPDFStream(SkData* data) { this->setData(data); } 31 explicit SkPDFStream(SkData* data) { this->setData(data); }
32 32
33 /** Create a PDF stream. A Length entry is automatically added to the 33 /** Create a PDF stream. A Length entry is automatically added to the
34 * stream dictionary. 34 * stream dictionary.
35 * @param stream The data part of the stream. Will not take ownership. 35 * @param stream The data part of the stream. Will not take ownership.
36 */ 36 */
37 explicit SkPDFStream(SkStream* stream) { this->setData(stream); } 37 explicit SkPDFStream(SkStreamAsset* stream) { this->setData(stream); }
38 38
39 virtual ~SkPDFStream(); 39 virtual ~SkPDFStream();
40 40
41 // The SkPDFObject interface. 41 // The SkPDFObject interface.
42 void emitObject(SkWStream* stream, 42 void emitObject(SkWStream* stream,
43 const SkPDFObjNumMap& objNumMap, 43 const SkPDFObjNumMap& objNumMap,
44 const SkPDFSubstituteMap& substitutes) const override; 44 const SkPDFSubstituteMap& substitutes) const override;
45 void drop() override; 45 void drop() override;
46 46
47 protected: 47 protected:
48 /* Create a PDF stream with no data. The setData method must be called to 48 /* Create a PDF stream with no data. The setData method must be called to
49 * set the data. 49 * set the data.
50 */ 50 */
51 SkPDFStream() {} 51 SkPDFStream() {}
52 52
53 /** Only call this function once. */ 53 /** Only call this function once. */
54 void setData(SkStream* stream); 54 void setData(SkStreamAsset* stream);
55 void setData(SkData* data) { 55 void setData(SkData* data) {
56 SkMemoryStream memoryStream(data); 56 SkMemoryStream memoryStream(data);
57 this->setData(&memoryStream); 57 this->setData(&memoryStream);
58 } 58 }
59 59
60 private: 60 private:
61 std::unique_ptr<SkStreamRewindable> fCompressedData; 61 std::unique_ptr<SkStreamAsset> fCompressedData;
62 62
63 typedef SkPDFDict INHERITED; 63 typedef SkPDFDict INHERITED;
64 }; 64 };
65 65
66 #endif 66 #endif
OLDNEW
« no previous file with comments | « src/pdf/SkPDFShader.cpp ('k') | src/pdf/SkPDFStream.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698