Merge "gralloc: Perform func to return stride and height"
This commit is contained in:
committed by
Gerrit - the friendly Code Review server
commit
43da51a308
@@ -79,6 +79,7 @@ enum {
|
||||
// libraries
|
||||
GRALLOC_MODULE_PERFORM_GET_STRIDE,
|
||||
GRALLOC_MODULE_PERFORM_GET_CUSTOM_STRIDE_FROM_HANDLE,
|
||||
GRALLOC_MODULE_PERFORM_GET_CUSTOM_STRIDE_AND_HEIGHT_FROM_HANDLE,
|
||||
GRALLOC_MODULE_PERFORM_GET_ATTRIBUTES,
|
||||
GRALLOC_MODULE_PERFORM_GET_COLOR_SPACE_FROM_HANDLE,
|
||||
};
|
||||
|
||||
@@ -400,6 +400,25 @@ int gralloc_perform(struct gralloc_module_t const* module,
|
||||
res = 0;
|
||||
} break;
|
||||
|
||||
case GRALLOC_MODULE_PERFORM_GET_CUSTOM_STRIDE_AND_HEIGHT_FROM_HANDLE:
|
||||
{
|
||||
private_handle_t* hnd = va_arg(args, private_handle_t*);
|
||||
int *stride = va_arg(args, int *);
|
||||
int *height = va_arg(args, int *);
|
||||
if (private_handle_t::validate(hnd)) {
|
||||
return res;
|
||||
}
|
||||
MetaData_t *metadata = (MetaData_t *)hnd->base_metadata;
|
||||
if(metadata && metadata->operation & UPDATE_BUFFER_GEOMETRY) {
|
||||
*stride = metadata->bufferDim.sliceWidth;
|
||||
*height = metadata->bufferDim.sliceHeight;
|
||||
} else {
|
||||
*stride = hnd->width;
|
||||
*height = hnd->height;
|
||||
}
|
||||
res = 0;
|
||||
} break;
|
||||
|
||||
case GRALLOC_MODULE_PERFORM_GET_ATTRIBUTES:
|
||||
{
|
||||
int width = va_arg(args, int);
|
||||
|
||||
Reference in New Issue
Block a user