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

Unified Diff: include/core/SkData.h

Issue 14336003: Move MMap to SkData. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Work on Linux. Created 7 years, 8 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 | « gm/factory.cpp ('k') | src/core/SkData.cpp » ('j') | src/core/SkStream.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkData.h
===================================================================
--- include/core/SkData.h (revision 8838)
+++ include/core/SkData.h (working copy)
@@ -13,6 +13,8 @@
#include "SkFlattenable.h"
+struct SkFILE;
+
/**
* SkData holds an immutable data buffer. Not only is the data immutable,
* but the actual ptr that is returned (by data() or bytes()) is guaranteed
@@ -89,10 +91,12 @@
static SkData* NewFromMalloc(const void* data, size_t length);
/**
- * Create a new dataref from a pointer allocated by mmap. The Data object
- * will handle calling munmap().
+ * Create a new dataref from a SkFILE.
+ * This does not take ownership of the SkFILE, nor close it.
+ * The SkFILE must be open for reading only.
+ * Returns NULL on failure.
*/
- static SkData* NewFromMMap(const void* data, size_t length);
+ static SkData* NewFromFILE(SkFILE* f);
/**
* Create a new dataref using a subset of the data in the specified
« no previous file with comments | « gm/factory.cpp ('k') | src/core/SkData.cpp » ('j') | src/core/SkStream.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698