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 DUMMY_DEVICE_H
     17 #define DUMMY_DEVICE_H
     18 
     19 #include <IDisplayDevice.h>
     20 
     21 namespace android {
     22 namespace intel {
     23 
     24 class Hwcomposer;
     25 class SoftVsyncObserver;
     26 
     27 class DummyDevice : public IDisplayDevice {
     28 public:
     29     DummyDevice(uint32_t disp, Hwcomposer& hwc);
     30     virtual ~DummyDevice();
     31 
     32 public:
     33     virtual bool prePrepare(hwc_display_contents_1_t *display);
     34     virtual bool prepare(hwc_display_contents_1_t *display);
     35     virtual bool commit(hwc_display_contents_1_t *display,
     36                           IDisplayContext *context);
     37 
     38     virtual bool vsyncControl(bool enabled);
     39     virtual bool blank(bool blank);
     40     virtual bool getDisplaySize(int *width, int *height);
     41     virtual bool getDisplayConfigs(uint32_t *configs,
     42                                        size_t *numConfigs);
     43     virtual bool getDisplayAttributes(uint32_t config,
     44                                           const uint32_t *attributes,
     45                                           int32_t *values);
     46     virtual bool compositionComplete();
     47 
     48     virtual bool setPowerMode(int mode);
     49     virtual int  getActiveConfig();
     50     virtual bool setActiveConfig(int index);
     51 
     52     virtual bool initialize();
     53     virtual void deinitialize();
     54     virtual bool isConnected() const;
     55     virtual const char* getName() const;
     56     virtual int getType() const;
     57     virtual void onVsync(int64_t timestamp);
     58     virtual void dump(Dump& d);
     59 
     60 protected:
     61     bool mInitialized;
     62     bool mConnected;
     63     bool mBlank;
     64     uint32_t mDisp;
     65     Hwcomposer& mHwc;
     66     SoftVsyncObserver *mVsyncObserver;
     67 
     68     const char *mName;
     69 };
     70 
     71 }
     72 }
     73 
     74 #endif /* DUMMY_DEVICE_H */
     75