diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-03-18 19:32:58 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-03-18 19:32:58 +0000 |
commit | 1311f7e7f43d00cd1fa6802a414e987e60e6d67d (patch) | |
tree | 3d7c3ce7ecf7634e6563bb973736a1b01b19772f /include | |
parent | d5ea2aeb6082840c598818aba37fcb8e08773341 (diff) |
revert 8200 to figure out android break
git-svn-id: http://skia.googlecode.com/svn/trunk@8201 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r-- | include/core/SkData.h | 6 | ||||
-rw-r--r-- | include/core/SkMMapStream.h | 30 | ||||
-rw-r--r-- | include/core/SkPreConfig.h | 11 | ||||
-rw-r--r-- | include/core/SkStream.h | 7 |
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 |