1 /* 2 // Copyright (c) 2014 Intel Corporation 3 // 4 // Licensed under the Apache License, Version 2.0 (the "License"); 5 // you may not use this file except in compliance with the License. 6 // You may obtain a copy of the License at 7 // 8 // http://www.apache.org/licenses/LICENSE-2.0 9 // 10 // Unless required by applicable law or agreed to in writing, software 11 // distributed under the License is distributed on an "AS IS" BASIS, 12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 // See the License for the specific language governing permissions and 14 // limitations under the License. 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