From: Lingfeng Yang Date: Fri, 5 Aug 2016 19:17:23 +0000 (-0700) Subject: Fix comments and style in YUV_420_888 handling X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=6b5060ba266d6abc94b9382feba6538a9d9674ef;p=android-x86%2Fdevice-generic-goldfish-opengl.git Fix comments and style in YUV_420_888 handling Change-Id: Ia64e2396427c944f5eedef30c4bc098303fefd88 --- diff --git a/system/gralloc/gralloc.cpp b/system/gralloc/gralloc.cpp index b823340..542927b 100644 --- a/system/gralloc/gralloc.cpp +++ b/system/gralloc/gralloc.cpp @@ -694,7 +694,7 @@ static void rgb565_to_yv12(char* dest, char* src, int width, int height, uint8_t *yv12_u0 = yv12_v0 + cSize; // switchUV allows this function to take care of - // cases where the U/V plans need to be switched, + // cases where the U/V planes need to be switched, // such as with YUV_420_888. if (switchUV) { yv12_u0 = yv12_y0 + yStride * height; @@ -891,7 +891,7 @@ static void yv12_to_rgb565(char* dest, char* src, int width, int height, uint8_t *yv12_u0 = yv12_v0 + cSize; // switchUV allows this function to take care of - // cases where the U/V plans need to be switched, + // cases where the U/V planes need to be switched, // such as with YUV_420_888. if (switchUV) { yv12_u0 = yv12_y0 + yStride * height; @@ -1095,13 +1095,13 @@ static int gralloc_lock_ycbcr(gralloc_module_t const* module, cSize = cStride * cb->height/2; vOffset = yStride * cb->height; uOffset = vOffset + cSize; + cStep = 1; // 420_888 format will have the U/V switched. if (cb->format == HAL_PIXEL_FORMAT_YCbCr_420_888) { uOffset = yStride * cb->height; vOffset = uOffset + cSize; } - cStep = 1; break; default: ALOGE("gralloc_lock_ycbcr unexpected internal format %x",