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 TNG_DISPLAY_CONTEXT_H 17 #define TNG_DISPLAY_CONTEXT_H 18 19 #include <IDisplayContext.h> 20 #include <hal_public.h> 21 22 namespace android { 23 namespace intel { 24 25 class TngDisplayContext : public IDisplayContext { 26 public: 27 TngDisplayContext(); 28 virtual ~TngDisplayContext(); 29 public: 30 bool initialize(); 31 void deinitialize(); 32 bool commitBegin(size_t numDisplays, hwc_display_contents_1_t **displays); 33 bool commitContents(hwc_display_contents_1_t *display, HwcLayerList* layerList); 34 bool commitEnd(size_t numDisplays, hwc_display_contents_1_t **displays); 35 bool compositionComplete(); 36 bool setCursorPosition(int disp, int x, int y); 37 38 private: 39 enum { 40 MAXIMUM_LAYER_NUMBER = 20, 41 }; 42 IMG_display_device_public_t *mIMGDisplayDevice; 43 IMG_hwc_layer_t mImgLayers[MAXIMUM_LAYER_NUMBER]; 44 bool mInitialized; 45 size_t mCount; 46 }; 47 48 } // namespace intel 49 } // namespace android 50 51 #endif /* TNG_DISPLAY_CONTEXT_H */ 52