Home | History | Annotate | Download | only in ports
      1 #ifndef SkImageRef_ashmem_DEFINED
      2 #define SkImageRef_ashmem_DEFINED
      3 
      4 #include "SkImageRef.h"
      5 
      6 struct SkAshmemRec {
      7     int     fFD;
      8     void*   fAddr;
      9     size_t  fSize;
     10     bool    fPinned;
     11 };
     12 
     13 class SkImageRef_ashmem : public SkImageRef {
     14 public:
     15     SkImageRef_ashmem(SkStream*, SkBitmap::Config, int sampleSize = 1);
     16     virtual ~SkImageRef_ashmem();
     17 
     18 protected:
     19     virtual bool onDecode(SkImageDecoder* codec, SkStream* stream,
     20                           SkBitmap* bitmap, SkBitmap::Config config,
     21                           SkImageDecoder::Mode mode);
     22 
     23     virtual void* onLockPixels(SkColorTable**);
     24     virtual void onUnlockPixels();
     25 
     26 private:
     27     void closeFD();
     28 
     29     SkColorTable* fCT;
     30     SkAshmemRec fRec;
     31 
     32     typedef SkImageRef INHERITED;
     33 };
     34 
     35 #endif
     36