Chromium Code Reviews| Index: include/core/SkData.h |
| diff --git a/include/core/SkData.h b/include/core/SkData.h |
| index b5dc66fd5698527ffa88c35875850f69c611162c..17cd71a299571c10d600087b019389b51e87a682 100644 |
| --- a/include/core/SkData.h |
| +++ b/include/core/SkData.h |
| @@ -14,6 +14,7 @@ |
| #include "SkRefCnt.h" |
| struct SkFILE; |
| +class SkStreamRewindable; |
| /** |
| * SkData holds an immutable data buffer. Not only is the data immutable, |
| @@ -70,6 +71,16 @@ public: |
| static SkData* NewWithCopy(const void* data, size_t length); |
| /** |
| + * Create a new dataref by copying the data out of the stream. |
| + * The stream's position will be changed after this call. Only |
| + * succeeds if stream->hasLength(), getLength() is non-zero, and |
| + * sk_malloc) succeeds. Returns NULL on failure. |
| + * |
| + * You probably want to try stream->getData() first. |
|
scroggo
2013/12/05 21:07:18
Can you specify why getData is better?
hal.canary
2013/12/05 22:29:29
Done.
|
| + */ |
| + static SkData* NewWithCopyFromStream(SkStreamRewindable* stream); |
| + |
| + /** |
| * Create a new dataref by copying the specified c-string |
| * (a null-terminated array of bytes). The returned SkData will have size() |
| * equal to strlen(cstr) + 1. If cstr is NULL, it will be treated the same |