aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/core/SkData.h6
-rw-r--r--include/core/SkMMapStream.h30
-rw-r--r--include/core/SkPreConfig.h11
-rw-r--r--include/core/SkStream.h7
4 files changed, 30 insertions, 24 deletions
diff --git a/include/core/SkData.h b/include/core/SkData.h
index 6b09119fc5..9a0cb09b60 100644
--- a/include/core/SkData.h
+++ b/include/core/SkData.h
@@ -89,12 +89,6 @@ public:
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().
- */
- static SkData* NewFromMMap(const void* data, size_t length);
-
- /**
* Create a new dataref using a subset of the data in the specified
* src dataref.
*/
diff --git a/include/core/SkMMapStream.h b/include/core/SkMMapStream.h
new file mode 100644
index 0000000000..a3b35f2df8
--- /dev/null
+++ b/include/core/SkMMapStream.h
@@ -0,0 +1,30 @@
+
+/*
+ * Copyright 2008 The Android Open Source Project
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+
+#ifndef SkMMapStream_DEFINED
+#define SkMMapStream_DEFINED
+
+#include "SkStream.h"
+
+class SkMMAPStream : public SkMemoryStream {
+public:
+ SkMMAPStream(const char filename[]);
+ virtual ~SkMMAPStream();
+
+ virtual void setMemory(const void* data, size_t length, bool);
+private:
+ void* fAddr;
+ size_t fSize;
+
+ void closeMMap();
+
+ typedef SkMemoryStream INHERITED;
+};
+
+#endif
diff --git a/include/core/SkPreConfig.h b/include/core/SkPreConfig.h
index 11cb2235a7..2246b63f59 100644
--- a/include/core/SkPreConfig.h
+++ b/include/core/SkPreConfig.h
@@ -108,17 +108,6 @@
//////////////////////////////////////////////////////////////////////
-#ifndef SK_MMAP_SUPPORT
- #ifdef SK_BUILD_FOR_WIN32
- // by default, if we're windows, we assume we don't have mmap
- #define SK_MMAP_SUPPORT 0
- #else
- #define SK_MMAP_SUPPORT 1
- #endif
-#endif
-
-//////////////////////////////////////////////////////////////////////
-
/**
* SK_CPU_SSE_LEVEL
*
diff --git a/include/core/SkStream.h b/include/core/SkStream.h
index eb0cd4757f..7e3c1a370b 100644
--- a/include/core/SkStream.h
+++ b/include/core/SkStream.h
@@ -17,13 +17,6 @@ class SkData;
class SK_API SkStream : public SkRefCnt {
public:
- /**
- * Attempts to open the specified file, and return a stream to it (using
- * mmap if available). On success, the caller must call unref() on the
- * returned object. On failure, returns NULL.
- */
- static SkStream* NewFromFile(const char path[]);
-
SK_DECLARE_INST_COUNT(SkStream)
/** Called to rewind to the beginning of the stream. If this cannot be