OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
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 SkStream_DEFINED | 8 #ifndef SkStream_DEFINED |
9 #define SkStream_DEFINED | 9 #define SkStream_DEFINED |
10 | 10 |
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 | 402 |
403 // copy what has been written to the stream into dst | 403 // copy what has been written to the stream into dst |
404 void copyTo(void* dst) const; | 404 void copyTo(void* dst) const; |
405 void writeToStream(SkWStream* dst) const; | 405 void writeToStream(SkWStream* dst) const; |
406 | 406 |
407 /** | 407 /** |
408 * Return a copy of the data written so far. This call is responsible for | 408 * Return a copy of the data written so far. This call is responsible for |
409 * calling unref() when they are finished with the data. | 409 * calling unref() when they are finished with the data. |
410 */ | 410 */ |
411 SkData* copyToData() const; | 411 SkData* copyToData() const; |
| 412 sk_sp<SkData> makeData() const { |
| 413 return sk_sp<SkData>(this->copyToData()); |
| 414 } |
412 | 415 |
413 /** Reset, returning a reader stream with the current content. */ | 416 /** Reset, returning a reader stream with the current content. */ |
414 SkStreamAsset* detachAsStream(); | 417 SkStreamAsset* detachAsStream(); |
415 | 418 |
416 /** Reset the stream to its original, empty, state. */ | 419 /** Reset the stream to its original, empty, state. */ |
417 void reset(); | 420 void reset(); |
418 void padToAlign4(); | 421 void padToAlign4(); |
419 private: | 422 private: |
420 struct Block; | 423 struct Block; |
421 Block* fHead; | 424 Block* fHead; |
(...skipping 22 matching lines...) Expand all Loading... |
444 | 447 |
445 private: | 448 private: |
446 size_t fBytesWritten; | 449 size_t fBytesWritten; |
447 typedef SkWStream INHERITED; | 450 typedef SkWStream INHERITED; |
448 }; | 451 }; |
449 | 452 |
450 // for now | 453 // for now |
451 typedef SkFILEStream SkURLStream; | 454 typedef SkFILEStream SkURLStream; |
452 | 455 |
453 #endif | 456 #endif |
OLD | NEW |