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

Unified Diff: include/core/SkData.h

Issue 565803005: use SkData::NewUninitialized (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: readInData -> NewFromStream Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/core/SkData.cpp » ('j') | no next file with comments »
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 6da8e113663f0bf256cd516b7e6576be71cd1d41..e25ef50d711fcbfd0a262c122d1f8b53d1ca11b8 100644
--- a/include/core/SkData.h
+++ b/include/core/SkData.h
@@ -11,6 +11,7 @@
#include "SkRefCnt.h"
struct SkFILE;
+class SkStream;
/**
* SkData holds an immutable data buffer. Not only is the data immutable,
@@ -138,6 +139,13 @@ public:
static SkData* NewFromFD(int fd);
/**
+ * Attempt to read size bytes into a SkData. If the read succeeds, return the data,
+ * else return NULL. Either way the stream's cursor may have been changed as a result
+ * of calling read().
+ */
+ static SkData* NewFromStream(SkStream*, size_t size);
+
+ /**
* Create a new dataref using a subset of the data in the specified
* src dataref.
*/
« no previous file with comments | « no previous file | src/core/SkData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698