OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 SkStreamPriv_DEFINED | 8 #ifndef SkStreamPriv_DEFINED |
9 #define SkStreamPriv_DEFINED | 9 #define SkStreamPriv_DEFINED |
10 | 10 |
| 11 #include "SkRefCnt.h" |
| 12 |
11 class SkData; | 13 class SkData; |
12 class SkStream; | 14 class SkStream; |
13 class SkWStream; | 15 class SkWStream; |
14 | 16 |
15 /** | 17 /** |
16 * Copy the provided stream to an SkData variable. | 18 * Copy the provided stream to an SkData variable. |
17 * | 19 * |
18 * Note: Assumes the stream is at the beginning. If it has a length, | 20 * Note: Assumes the stream is at the beginning. If it has a length, |
19 * but is not at the beginning, this call will fail (return NULL). | 21 * but is not at the beginning, this call will fail (return NULL). |
20 * | 22 * |
21 * @param stream SkStream to be copied into data. | 23 * @param stream SkStream to be copied into data. |
22 * @return SkData* The resulting SkData after the copy. This data | 24 * @return SkData* The resulting SkData after the copy. This data |
23 * will have a ref count of one upon return and belongs to the | 25 * will have a ref count of one upon return and belongs to the |
24 * caller. Returns nullptr on failure. | 26 * caller. Returns nullptr on failure. |
25 */ | 27 */ |
26 SkData* SkCopyStreamToData(SkStream* stream); | 28 sk_sp<SkData> SkCopyStreamToData(SkStream* stream); |
27 | 29 |
28 /** | 30 /** |
29 * Copies the input stream from the current position to the end. | 31 * Copies the input stream from the current position to the end. |
30 * Does not rewind the input stream. | 32 * Does not rewind the input stream. |
31 */ | 33 */ |
32 bool SkStreamCopy(SkWStream* out, SkStream* input); | 34 bool SkStreamCopy(SkWStream* out, SkStream* input); |
33 | 35 |
34 #endif // SkStreamPriv_DEFINED | 36 #endif // SkStreamPriv_DEFINED |
OLD | NEW |