blob: 4714d36318e10218fe1e088964f00c7388e1b94e [file] [log] [blame]
#ifndef GRALLOC_ANDROID
#define GRALLOC_ANDROID
#include <hardware/gralloc.h>
class GrallocModule
{
public:
static GrallocModule* getInstance();
bool supportsConversion() const { return m_supportsConversion; }
int lock(
buffer_handle_t handle, int usage,
int left, int top, int width, int height, void**vaddr) {
return m_module->lock(m_module, handle, 0, left, top, width, height, vaddr);
}
int unlock(buffer_handle_t handle) {
return m_module->unlock(m_module, handle);
}
private:
GrallocModule();
bool m_supportsConversion;
const gralloc_module_t* m_module;
};
#endif // GRALLOC_ANDROID