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 TNG_DISPLAY_CONTEXT_H 17 #define TNG_DISPLAY_CONTEXT_H 18 19 #include <IDisplayContext.h> 20 #include <hal_public.h> 21 22 typedef struct 23 { 24 hwc_layer_1_t *psLayer; 25 uint32_t custom; 26 } 27 IMG_hwc_layer_t; 28 29 typedef struct IMG_display_device_public 30 { 31 int (*post)(struct IMG_display_device_public *dev, 32 IMG_hwc_layer_t *layers, int num_layers, int *releaseFenceFd); 33 } 34 IMG_display_device_public_t; 35 36 namespace android { 37 namespace intel { 38 39 class TngDisplayContext : public IDisplayContext { 40 public: 41 TngDisplayContext(); 42 virtual ~TngDisplayContext(); 43 public: 44 bool initialize(); 45 void deinitialize(); 46 bool commitBegin(size_t numDisplays, hwc_display_contents_1_t **displays); 47 bool commitContents(hwc_display_contents_1_t *display, HwcLayerList* layerList); 48 bool commitEnd(size_t numDisplays, hwc_display_contents_1_t **displays); 49 bool compositionComplete(); 50 bool setCursorPosition(int disp, int x, int y); 51 52 private: 53 enum { 54 MAXIMUM_LAYER_NUMBER = 20, 55 }; 56 IMG_display_device_public_t *mIMGDisplayDevice; 57 IMG_hwc_layer_t mImgLayers[MAXIMUM_LAYER_NUMBER]; 58 bool mInitialized; 59 size_t mCount; 60 }; 61 62 } // namespace intel 63 } // namespace android 64 65 #endif /* TNG_DISPLAY_CONTEXT_H */ 66