Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(573)

Side by Side Diff: src/core/SkStreamPriv.h

Issue 1779263003: Make sp variants for SkData (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/core/SkStream.cpp ('k') | src/core/SkWriter32.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
OLDNEW
« no previous file with comments | « src/core/SkStream.cpp ('k') | src/core/SkWriter32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698