diff --git a/libqcomui/qcom_ui.cpp b/libqcomui/qcom_ui.cpp index 58f4ffb..a528391 100644 --- a/libqcomui/qcom_ui.cpp +++ b/libqcomui/qcom_ui.cpp @@ -130,18 +130,18 @@ int getNumberOfArgsForOperation(int operation) { * @return true if the format is supported by the GPU. */ bool isGPUSupportedFormat(int format) { - bool isSupportedFormat = true; - switch(format) { - case (HAL_PIXEL_FORMAT_YCbCr_420_SP_TILED^HAL_PIXEL_FORMAT_INTERLACE): - case (HAL_PIXEL_FORMAT_YCbCr_420_SP_TILED|HAL_3D_OUT_SIDE_BY_SIDE - |HAL_3D_IN_SIDE_BY_SIDE_R_L): - case (HAL_PIXEL_FORMAT_YCbCr_420_SP_TILED|HAL_3D_OUT_SIDE_BY_SIDE - |HAL_3D_IN_SIDE_BY_SIDE_L_R): - isSupportedFormat = false; - break; - default: break; + if (format == HAL_PIXEL_FORMAT_YV12) { + // We check the YV12 formats, since some Qcom specific formats + // could have the bits set. + return true; + } else if (format & INTERLACE_MASK) { + // Interlaced content + return false; + } else if (format & S3D_FORMAT_MASK) { + // S3D Formats are not supported by the GPU + return false; } - return isSupportedFormat; + return true; } /*