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

Unified Diff: include/core/SkData.h

Issue 101973005: SkDecodingImageGenerator now uses SkStreamRewindable (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | include/core/SkImageDecoder.h » ('j') | include/core/SkStream.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « no previous file | include/core/SkImageDecoder.h » ('j') | include/core/SkStream.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698