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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 bool write(const void* buffer, size_t size) SK_OVERRIDE; | 388 bool write(const void* buffer, size_t size) SK_OVERRIDE; |
389 size_t bytesWritten() const SK_OVERRIDE { return fBytesWritten; } | 389 size_t bytesWritten() const SK_OVERRIDE { return fBytesWritten; } |
390 // random access write | 390 // random access write |
391 // modifies stream and returns true if offset + size is less than or equal t
o getOffset() | 391 // modifies stream and returns true if offset + size is less than or equal t
o getOffset() |
392 bool write(const void* buffer, size_t offset, size_t size); | 392 bool write(const void* buffer, size_t offset, size_t size); |
393 bool read(void* buffer, size_t offset, size_t size); | 393 bool read(void* buffer, size_t offset, size_t size); |
394 size_t getOffset() const { return fBytesWritten; } | 394 size_t getOffset() const { return fBytesWritten; } |
395 | 395 |
396 // copy what has been written to the stream into dst | 396 // copy what has been written to the stream into dst |
397 void copyTo(void* dst) const; | 397 void copyTo(void* dst) const; |
| 398 void writeToStream(SkWStream* dst) const; |
398 | 399 |
399 /** | 400 /** |
400 * Return a copy of the data written so far. This call is responsible for | 401 * Return a copy of the data written so far. This call is responsible for |
401 * calling unref() when they are finished with the data. | 402 * calling unref() when they are finished with the data. |
402 */ | 403 */ |
403 SkData* copyToData() const; | 404 SkData* copyToData() const; |
404 | 405 |
405 /** Reset, returning a reader stream with the current content. */ | 406 /** Reset, returning a reader stream with the current content. */ |
406 SkStreamAsset* detachAsStream(); | 407 SkStreamAsset* detachAsStream(); |
407 | 408 |
(...skipping 29 matching lines...) Expand all Loading... |
437 | 438 |
438 private: | 439 private: |
439 size_t fBytesWritten; | 440 size_t fBytesWritten; |
440 typedef SkWStream INHERITED; | 441 typedef SkWStream INHERITED; |
441 }; | 442 }; |
442 | 443 |
443 // for now | 444 // for now |
444 typedef SkFILEStream SkURLStream; | 445 typedef SkFILEStream SkURLStream; |
445 | 446 |
446 #endif | 447 #endif |
OLD | NEW |