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

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

Issue 1932223003: Remove SkWriter32::contiguousArray(). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 4 years, 7 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/SkPictureData.cpp ('k') | src/core/SkRecordedDrawable.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 29 matching lines...) Expand all
40 } 40 }
41 41
42 const SkTDArray<const SkTextBlob* >& getTextBlobRefs() const { 42 const SkTDArray<const SkTextBlob* >& getTextBlobRefs() const {
43 return fTextBlobRefs; 43 return fTextBlobRefs;
44 } 44 }
45 45
46 const SkTDArray<const SkImage* >& getImageRefs() const { 46 const SkTDArray<const SkImage* >& getImageRefs() const {
47 return fImageRefs; 47 return fImageRefs;
48 } 48 }
49 49
50 sk_sp<SkData> opData(bool deepCopy) const { 50 sk_sp<SkData> opData() const {
51 this->validate(fWriter.bytesWritten(), 0); 51 this->validate(fWriter.bytesWritten(), 0);
52 52
53 if (fWriter.bytesWritten() == 0) { 53 if (fWriter.bytesWritten() == 0) {
54 return SkData::MakeEmpty(); 54 return SkData::MakeEmpty();
55 } 55 }
56
57 if (deepCopy) {
58 return SkData::MakeWithCopy(fWriter.contiguousArray(), fWriter.bytes Written());
59 }
60
61 return fWriter.snapshotAsData(); 56 return fWriter.snapshotAsData();
62 } 57 }
63 58
64 const SkPictureContentInfo& contentInfo() const { 59 const SkPictureContentInfo& contentInfo() const {
65 return fContentInfo; 60 return fContentInfo;
66 } 61 }
67 62
68 void setFlags(uint32_t recordFlags) { 63 void setFlags(uint32_t recordFlags) {
69 fRecordFlags = recordFlags; 64 fRecordFlags = recordFlags;
70 } 65 }
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 244
250 uint32_t fRecordFlags; 245 uint32_t fRecordFlags;
251 int fInitialSaveCount; 246 int fInitialSaveCount;
252 247
253 friend class SkPictureData; // for SkPictureData's SkPictureRecord-based c onstructor 248 friend class SkPictureData; // for SkPictureData's SkPictureRecord-based c onstructor
254 249
255 typedef SkCanvas INHERITED; 250 typedef SkCanvas INHERITED;
256 }; 251 };
257 252
258 #endif 253 #endif
OLDNEW
« no previous file with comments | « src/core/SkPictureData.cpp ('k') | src/core/SkRecordedDrawable.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698