HWComposer.h revision f5f2712854599b4970643c6000fe6ae950a08ba9
1/* 2 * Copyright (C) 2010 The Android Open Source Project 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 17#ifndef ANDROID_SF_HWCOMPOSER_H 18#define ANDROID_SF_HWCOMPOSER_H 19 20#include <stdint.h> 21#include <sys/types.h> 22 23#include <EGL/egl.h> 24 25#include <hardware/hwcomposer.h> 26 27namespace android { 28// --------------------------------------------------------------------------- 29 30class HWComposer 31{ 32public: 33 34 HWComposer(); 35 ~HWComposer(); 36 37 status_t initCheck() const; 38 39 // tells the HAL what the framebuffer is 40 void setFrameBuffer(EGLDisplay dpy, EGLSurface sur); 41 42 // create a work list for numLayers layer 43 status_t createWorkList(size_t numLayers); 44 45 // Asks the HAL what it can do 46 status_t prepare() const; 47 48 // commits the list 49 status_t commit() const; 50 51 // release hardware resources 52 status_t release() const; 53 54 size_t getNumLayers() const; 55 hwc_layer_t* getLayers() const; 56 57private: 58 hw_module_t const* mModule; 59 hwc_composer_device_t* mHwc; 60 hwc_layer_list_t* mList; 61 size_t mCapacity; 62 hwc_display_t mDpy; 63 hwc_surface_t mSur; 64}; 65 66 67// --------------------------------------------------------------------------- 68}; // namespace android 69 70#endif // ANDROID_SF_HWCOMPOSER_H 71