Use native_handle_{create,delete} functions instead of the C++
alloc/free. This will do the initialization for us instead of open
coding it.
Change-Id: I285292770ca756c1d2c2effa5c73e252526bae0c
Signed-off-by: Rob Herring <robh@kernel.org>
{
struct gralloc_gbm_handle_t *handle;
- handle = new gralloc_gbm_handle_t();
+ handle = (gralloc_gbm_handle_t *)native_handle_create(GRALLOC_GBM_HANDLE_NUM_FDS, GRALLOC_GBM_HANDLE_NUM_INTS);
if (!handle)
return NULL;
- handle->base.version = sizeof(handle->base);
- handle->base.numInts = GRALLOC_GBM_HANDLE_NUM_INTS;
- handle->base.numFds = GRALLOC_GBM_HANDLE_NUM_FDS;
-
handle->magic = GRALLOC_GBM_HANDLE_MAGIC;
handle->width = width;
handle->height = height;
bo = gbm_alloc(gbm, handle);
if (!bo) {
- delete handle;
+ native_handle_delete(&handle->base);
return NULL;
}