2011-07-28 14:26:00 +00:00
|
|
|
|
2008-12-17 15:59:43 +00:00
|
|
|
/*
|
2011-07-28 14:26:00 +00:00
|
|
|
* Copyright 2008 The Android Open Source Project
|
2008-12-17 15:59:43 +00:00
|
|
|
*
|
2011-07-28 14:26:00 +00:00
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
2008-12-17 15:59:43 +00:00
|
|
|
*/
|
|
|
|
|
2011-07-28 14:26:00 +00:00
|
|
|
|
2008-12-17 15:59:43 +00:00
|
|
|
#ifndef SkMMapStream_DEFINED
|
|
|
|
#define SkMMapStream_DEFINED
|
|
|
|
|
|
|
|
#include "SkStream.h"
|
|
|
|
|
|
|
|
class SkMMAPStream : public SkMemoryStream {
|
|
|
|
public:
|
|
|
|
SkMMAPStream(const char filename[]);
|
|
|
|
virtual ~SkMMAPStream();
|
|
|
|
|
2009-01-14 16:46:16 +00:00
|
|
|
virtual void setMemory(const void* data, size_t length, bool);
|
2008-12-17 15:59:43 +00:00
|
|
|
private:
|
|
|
|
int fFildes;
|
|
|
|
void* fAddr;
|
|
|
|
size_t fSize;
|
|
|
|
|
|
|
|
void closeMMap();
|
|
|
|
|
|
|
|
typedef SkMemoryStream INHERITED;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|