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

Side by Side Diff: src/core/SkPictureRecord.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/SkPicturePlayback.cpp ('k') | src/core/SkPixmap.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 SkPictureRecord_DEFINED 8 #ifndef SkPictureRecord_DEFINED
9 #define SkPictureRecord_DEFINED 9 #define SkPictureRecord_DEFINED
10 10
(...skipping 25 matching lines...) Expand all
36 } 36 }
37 37
38 const SkTDArray<const SkTextBlob* >& getTextBlobRefs() const { 38 const SkTDArray<const SkTextBlob* >& getTextBlobRefs() const {
39 return fTextBlobRefs; 39 return fTextBlobRefs;
40 } 40 }
41 41
42 const SkTDArray<const SkImage* >& getImageRefs() const { 42 const SkTDArray<const SkImage* >& getImageRefs() const {
43 return fImageRefs; 43 return fImageRefs;
44 } 44 }
45 45
46 SkData* opData(bool deepCopy) const { 46 sk_sp<SkData> opData(bool deepCopy) const {
47 this->validate(fWriter.bytesWritten(), 0); 47 this->validate(fWriter.bytesWritten(), 0);
48 48
49 if (fWriter.bytesWritten() == 0) { 49 if (fWriter.bytesWritten() == 0) {
50 return SkData::NewEmpty(); 50 return SkData::MakeEmpty();
51 } 51 }
52 52
53 if (deepCopy) { 53 if (deepCopy) {
54 return SkData::NewWithCopy(fWriter.contiguousArray(), fWriter.bytesW ritten()); 54 return SkData::MakeWithCopy(fWriter.contiguousArray(), fWriter.bytes Written());
55 } 55 }
56 56
57 return fWriter.snapshotAsData(); 57 return fWriter.snapshotAsData();
58 } 58 }
59 59
60 const SkPictureContentInfo& contentInfo() const { 60 const SkPictureContentInfo& contentInfo() const {
61 return fContentInfo; 61 return fContentInfo;
62 } 62 }
63 63
64 void setFlags(uint32_t recordFlags) { 64 void setFlags(uint32_t recordFlags) {
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 242
243 uint32_t fRecordFlags; 243 uint32_t fRecordFlags;
244 int fInitialSaveCount; 244 int fInitialSaveCount;
245 245
246 friend class SkPictureData; // for SkPictureData's SkPictureRecord-based c onstructor 246 friend class SkPictureData; // for SkPictureData's SkPictureRecord-based c onstructor
247 247
248 typedef SkCanvas INHERITED; 248 typedef SkCanvas INHERITED;
249 }; 249 };
250 250
251 #endif 251 #endif
OLDNEW
« no previous file with comments | « src/core/SkPicturePlayback.cpp ('k') | src/core/SkPixmap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698