Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 22943e25 authored by Jamie Gennis's avatar Jamie Gennis Committed by Android Git Automerger
Browse files

am c313b59b: am 071929b2: Merge "gl2_yuvtex: use the gralloc-provided stride." into honeycomb-mr1

* commit 'c313b59b4295c7cfe7f13d635be2c85f9fee7365':
  gl2_yuvtex: use the gralloc-provided stride.
parents 5c8257a8 0cd6caf7
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -186,11 +186,6 @@ const int yuvTexUsage = GraphicBuffer::USAGE_HW_TEXTURE |
        GraphicBuffer::USAGE_SW_WRITE_RARELY;
const int yuvTexFormat = HAL_PIXEL_FORMAT_YV12;
const int yuvTexOffsetY = 0;
const int yuvTexStrideY = (yuvTexWidth + 0xf) & ~0xf;
const int yuvTexOffsetV = yuvTexStrideY * yuvTexHeight;
const int yuvTexStrideV = (yuvTexStrideY/2 + 0xf) & ~0xf; 
const int yuvTexOffsetU = yuvTexOffsetV + yuvTexStrideV * yuvTexHeight/2;
const int yuvTexStrideU = yuvTexStrideV;
const bool yuvTexSameUV = false;
static sp<GraphicBuffer> yuvTexBuffer;
static GLuint yuvTex;
@@ -200,6 +195,11 @@ bool setupYuvTexSurface(EGLDisplay dpy, EGLContext context) {
    int blockHeight = yuvTexHeight > 16 ? yuvTexHeight / 16 : 1;
    yuvTexBuffer = new GraphicBuffer(yuvTexWidth, yuvTexHeight, yuvTexFormat,
            yuvTexUsage);
    int yuvTexStrideY = yuvTexBuffer->getStride();
    int yuvTexOffsetV = yuvTexStrideY * yuvTexHeight;
    int yuvTexStrideV = (yuvTexStrideY/2 + 0xf) & ~0xf;
    int yuvTexOffsetU = yuvTexOffsetV + yuvTexStrideV * yuvTexHeight/2;
    int yuvTexStrideU = yuvTexStrideV;
    char* buf = NULL;
    status_t err = yuvTexBuffer->lock(GRALLOC_USAGE_SW_WRITE_OFTEN, (void**)(&buf));
    if (err != 0) {