| 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 29 matching lines...) Expand all Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |