OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |