Home | History | Annotate | Download | only in include
      1 /*
      2 // Copyright(c)2014 IntelCorporation
      3 //
      4 // LicensedundertheApacheLicense,Version2.0(the"License");
      5 // youmaynotusethisfileexceptincompliancewiththeLicense.
      6 // YoumayobtainacopyoftheLicenseat
      7 //
      8 // http://www.apache.org/licenses/LICENSE-2.0
      9 //
     10 // Unlessrequiredbyapplicablelaworagreedtoinwriting,software
     11 // distributedundertheLicenseisdistributedonan"ASIS"BASIS,
     12 // WITHOUTWARRANTIESORCONDITIONSOFANYKIND,eitherexpressorimplied.
     13 // SeetheLicenseforthespecificlanguagegoverningpermissionsand
     14 // limitationsundertheLicense.
     15 */
     16 #ifndef GRAPHIC_BUFFER_H
     17 #define GRAPHIC_BUFFER_H
     18 
     19 #include <DataBuffer.h>
     20 
     21 
     22 namespace android {
     23 namespace intel {
     24 
     25 class GraphicBuffer : public DataBuffer {
     26 public:
     27     enum {
     28         USAGE_INVALID = 0xffffffff,
     29     };
     30 
     31 public:
     32     GraphicBuffer(buffer_handle_t handle);
     33     virtual ~GraphicBuffer() {}
     34 
     35     virtual void resetBuffer(buffer_handle_t handle);
     36 
     37     uint32_t getUsage() const { return mUsage; }
     38     uint32_t getBpp() const { return mBpp; }
     39 
     40     static bool isProtectedUsage(uint32_t usage);
     41     static bool isProtectedBuffer(GraphicBuffer *buffer);
     42 
     43     static bool isCompressionUsage(uint32_t usage);
     44     static bool isCompressionBuffer(GraphicBuffer *buffer);
     45 
     46 private:
     47     void initBuffer(buffer_handle_t handle);
     48 
     49 protected:
     50     uint32_t mUsage;
     51     uint32_t mBpp;
     52 };
     53 
     54 } // namespace intel
     55 } // namespace android
     56 
     57 #endif /* GRAPHIC_BUFFER_H */
     58