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

Side by Side Diff: src/core/SkPictureData.h

Issue 1779263003: Make sp variants for SkData (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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/core/SkPicture.cpp ('k') | src/core/SkPictureData.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 2011 Google Inc. 2 * Copyright 2011 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 #ifndef SkPictureData_DEFINED 8 #ifndef SkPictureData_DEFINED
9 #define SkPictureData_DEFINED 9 #define SkPictureData_DEFINED
10 10
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 70
71 void serialize(SkWStream*, SkPixelSerializer*, SkRefCntSet*) const; 71 void serialize(SkWStream*, SkPixelSerializer*, SkRefCntSet*) const;
72 void flatten(SkWriteBuffer&) const; 72 void flatten(SkWriteBuffer&) const;
73 73
74 bool containsBitmaps() const; 74 bool containsBitmaps() const;
75 75
76 bool hasText() const { return fContentInfo.hasText(); } 76 bool hasText() const { return fContentInfo.hasText(); }
77 77
78 int opCount() const { return fContentInfo.numOperations(); } 78 int opCount() const { return fContentInfo.numOperations(); }
79 79
80 const SkData* opData() const { return fOpData; } 80 const sk_sp<SkData>& opData() const { return fOpData; }
81 81
82 protected: 82 protected:
83 explicit SkPictureData(const SkPictInfo& info); 83 explicit SkPictureData(const SkPictInfo& info);
84 84
85 // Does not affect ownership of SkStream. 85 // Does not affect ownership of SkStream.
86 bool parseStream(SkStream*, SkPicture::InstallPixelRefProc, SkTypefacePlayba ck*); 86 bool parseStream(SkStream*, SkPicture::InstallPixelRefProc, SkTypefacePlayba ck*);
87 bool parseBuffer(SkReadBuffer& buffer); 87 bool parseBuffer(SkReadBuffer& buffer);
88 88
89 public: 89 public:
90 const SkBitmap& getBitmap(SkReader32* reader) const { 90 const SkBitmap& getBitmap(SkReader32* reader) const {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 void flattenToBuffer(SkWriteBuffer&) const; 151 void flattenToBuffer(SkWriteBuffer&) const;
152 152
153 // Only used by getBitmap() if the passed in index is SkBitmapHeap::INVALID_ SLOT. This empty 153 // Only used by getBitmap() if the passed in index is SkBitmapHeap::INVALID_ SLOT. This empty
154 // bitmap allows playback to draw nothing and move on. 154 // bitmap allows playback to draw nothing and move on.
155 SkBitmap fBadBitmap; 155 SkBitmap fBadBitmap;
156 156
157 SkTArray<SkBitmap> fBitmaps; 157 SkTArray<SkBitmap> fBitmaps;
158 SkTArray<SkPaint> fPaints; 158 SkTArray<SkPaint> fPaints;
159 SkTArray<SkPath> fPaths; 159 SkTArray<SkPath> fPaths;
160 160
161 SkData* fOpData; // opcodes and parameters 161 sk_sp<SkData> fOpData; // opcodes and parameters
162 162
163 const SkPicture** fPictureRefs; 163 const SkPicture** fPictureRefs;
164 int fPictureCount; 164 int fPictureCount;
165 const SkTextBlob** fTextBlobRefs; 165 const SkTextBlob** fTextBlobRefs;
166 int fTextBlobCount; 166 int fTextBlobCount;
167 const SkImage** fImageRefs; 167 const SkImage** fImageRefs;
168 int fImageCount; 168 int fImageCount;
169 169
170 SkPictureContentInfo fContentInfo; 170 SkPictureContentInfo fContentInfo;
171 171
172 SkTypefacePlayback fTFPlayback; 172 SkTypefacePlayback fTFPlayback;
173 SkFactoryPlayback* fFactoryPlayback; 173 SkFactoryPlayback* fFactoryPlayback;
174 174
175 const SkPictInfo fInfo; 175 const SkPictInfo fInfo;
176 176
177 static void WriteFactories(SkWStream* stream, const SkFactorySet& rec); 177 static void WriteFactories(SkWStream* stream, const SkFactorySet& rec);
178 static void WriteTypefaces(SkWStream* stream, const SkRefCntSet& rec); 178 static void WriteTypefaces(SkWStream* stream, const SkRefCntSet& rec);
179 179
180 void initForPlayback() const; 180 void initForPlayback() const;
181 }; 181 };
182 182
183 #endif 183 #endif
OLDNEW
« no previous file with comments | « src/core/SkPicture.cpp ('k') | src/core/SkPictureData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698