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 23 matching lines...) Expand all Loading... |
34 * always return all N bytes of the request if possible. If they return fewer | 34 * always return all N bytes of the request if possible. If they return fewer |
35 * (the read() call returns the number of bytes read) then that means there is | 35 * (the read() call returns the number of bytes read) then that means there is |
36 * no more data (at EOF or hit an error). The caller should *not* call again | 36 * no more data (at EOF or hit an error). The caller should *not* call again |
37 * in hopes of fulfilling more of the request. | 37 * in hopes of fulfilling more of the request. |
38 */ | 38 */ |
39 class SK_API SkStream : public SkNoncopyable { | 39 class SK_API SkStream : public SkNoncopyable { |
40 public: | 40 public: |
41 virtual ~SkStream() {} | 41 virtual ~SkStream() {} |
42 | 42 |
43 /** | 43 /** |
44 * @deprecated | |
45 * SkStream is no longer ref counted, but we leave this here for staging. | |
46 */ | |
47 void unref() { | |
48 SkDebugf("SkStream is no longer ref counted!"); | |
49 } | |
50 | |
51 /** | |
52 * Attempts to open the specified file, and return a stream to it (using | 44 * Attempts to open the specified file, and return a stream to it (using |
53 * mmap if available). On success, the caller is responsible for deleting. | 45 * mmap if available). On success, the caller is responsible for deleting. |
54 * On failure, returns NULL. | 46 * On failure, returns NULL. |
55 */ | 47 */ |
56 static SkStreamAsset* NewFromFile(const char path[]); | 48 static SkStreamAsset* NewFromFile(const char path[]); |
57 | 49 |
58 /** Reads or skips size number of bytes. | 50 /** Reads or skips size number of bytes. |
59 * If buffer == NULL, skip size bytes, return how many were skipped. | 51 * If buffer == NULL, skip size bytes, return how many were skipped. |
60 * If buffer != NULL, copy size bytes into buffer, return how many were cop
ied. | 52 * If buffer != NULL, copy size bytes into buffer, return how many were cop
ied. |
61 * @param buffer when NULL skip size bytes, otherwise copy size bytes into
buffer | 53 * @param buffer when NULL skip size bytes, otherwise copy size bytes into
buffer |
(...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 | 437 |
446 private: | 438 private: |
447 size_t fBytesWritten; | 439 size_t fBytesWritten; |
448 typedef SkWStream INHERITED; | 440 typedef SkWStream INHERITED; |
449 }; | 441 }; |
450 | 442 |
451 // for now | 443 // for now |
452 typedef SkFILEStream SkURLStream; | 444 typedef SkFILEStream SkURLStream; |
453 | 445 |
454 #endif | 446 #endif |
OLD | NEW |