Lines Matching refs:buf
166 void checkPixel(const CpuConsumer::LockedBuffer &buf, in checkPixel() argument
169 switch(buf.format) { in checkPixel()
172 uint16_t *bPtr = (uint16_t*)buf.data; in checkPixel()
173 bPtr += y * buf.stride + x; in checkPixel()
191 uint8_t *bPtr = (uint8_t*)buf.data; in checkPixel()
192 bPtr += y * buf.stride + x; in checkPixel()
199 uint16_t *bPtr = ((uint16_t*)buf.data) + y * buf.stride + x; in checkPixel()
206 uint8_t *bPtr = (uint8_t*)buf.data; in checkPixel()
207 bPtr += (y * buf.stride + x) * bytesPerPixel; in checkPixel()
215 ADD_FAILURE() << "Unknown format for check:" << buf.format; in checkPixel()
222 void fillYV12Buffer(uint8_t* buf, int w, int h, int stride);
226 void fillGreyscaleBuffer(T* buf, int w, int h, int stride, int bpp) { in fillGreyscaleBuffer() argument
241 buf[yuvTexOffsetY + (y * yuvTexStrideY) + x] = intensity; in fillGreyscaleBuffer()
255 void fillRgba8888Buffer(uint8_t* buf, int w, int h, int stride) in fillRgba8888Buffer() argument
271 buf[(y*stride + x)*bytesPerPixel + 0] = r; in fillRgba8888Buffer()
272 buf[(y*stride + x)*bytesPerPixel + 1] = g; in fillRgba8888Buffer()
273 buf[(y*stride + x)*bytesPerPixel + 2] = b; in fillRgba8888Buffer()
274 buf[(y*stride + x)*bytesPerPixel + 3] = 255; in fillRgba8888Buffer()
282 void fillBayerRawBuffer(uint8_t* buf, int w, int h, int stride) { in fillBayerRawBuffer() argument
283 ALOGVV("fillBayerRawBuffer: %p with %d x %d, stride %d", buf, w, h ,stride); in fillBayerRawBuffer()
288 uint16_t *bPtr1 = ((uint16_t*)buf) + stride*y; in fillBayerRawBuffer()
308 void checkGreyscaleBuffer(const CpuConsumer::LockedBuffer &buf) { in checkGreyscaleBuffer() argument
309 uint32_t w = buf.width; in checkGreyscaleBuffer()
310 uint32_t h = buf.height; in checkGreyscaleBuffer()
317 checkPixel(buf, 0, 0, 191); in checkGreyscaleBuffer()
318 checkPixel(buf, 1, 0, 191); in checkGreyscaleBuffer()
319 checkPixel(buf, 0, 1, 191); in checkGreyscaleBuffer()
320 checkPixel(buf, 1, 1, 191); in checkGreyscaleBuffer()
323 checkPixel(buf, blockWidth, 0, 63); in checkGreyscaleBuffer()
324 checkPixel(buf, blockWidth + 1, 0, 63); in checkGreyscaleBuffer()
325 checkPixel(buf, blockWidth, 1, 63); in checkGreyscaleBuffer()
326 checkPixel(buf, blockWidth + 1, 1, 63); in checkGreyscaleBuffer()
329 checkPixel(buf, 0, blockHeight, 63); in checkGreyscaleBuffer()
330 checkPixel(buf, 1, blockHeight, 63); in checkGreyscaleBuffer()
331 checkPixel(buf, 0, blockHeight + 1, 63); in checkGreyscaleBuffer()
332 checkPixel(buf, 1, blockHeight + 1, 63); in checkGreyscaleBuffer()
335 checkPixel(buf, blockWidth, blockHeight, 191); in checkGreyscaleBuffer()
336 checkPixel(buf, blockWidth + 1, blockHeight, 191); in checkGreyscaleBuffer()
337 checkPixel(buf, blockWidth, blockHeight + 1, 191); in checkGreyscaleBuffer()
338 checkPixel(buf, blockWidth + 1, blockHeight + 1, 191); in checkGreyscaleBuffer()
344 checkPixel(buf, w-1, h-1, pixelValue); in checkGreyscaleBuffer()
347 void checkRgba8888Buffer(const CpuConsumer::LockedBuffer &buf) { in checkRgba8888Buffer() argument
348 uint32_t w = buf.width; in checkRgba8888Buffer()
349 uint32_t h = buf.height; in checkRgba8888Buffer()
356 checkPixel(buf, 0, 0, 191, 63, 63); in checkRgba8888Buffer()
357 checkPixel(buf, 1, 0, 191, 63, 63); in checkRgba8888Buffer()
358 checkPixel(buf, 0, 1, 191, 63, 63); in checkRgba8888Buffer()
359 checkPixel(buf, 1, 1, 191, 63, 63); in checkRgba8888Buffer()
362 checkPixel(buf, blockWidth, 0, 63, 191, 63); in checkRgba8888Buffer()
363 checkPixel(buf, blockWidth + 1, 0, 63, 191, 63); in checkRgba8888Buffer()
364 checkPixel(buf, blockWidth, 1, 63, 191, 63); in checkRgba8888Buffer()
365 checkPixel(buf, blockWidth + 1, 1, 63, 191, 63); in checkRgba8888Buffer()
368 checkPixel(buf, 0, blockHeight, 63, 191, 63); in checkRgba8888Buffer()
369 checkPixel(buf, 1, blockHeight, 63, 191, 63); in checkRgba8888Buffer()
370 checkPixel(buf, 0, blockHeight + 1, 63, 191, 63); in checkRgba8888Buffer()
371 checkPixel(buf, 1, blockHeight + 1, 63, 191, 63); in checkRgba8888Buffer()
374 checkPixel(buf, blockWidth, blockHeight, 63, 63, 191); in checkRgba8888Buffer()
375 checkPixel(buf, blockWidth + 1, blockHeight, 63, 63, 191); in checkRgba8888Buffer()
376 checkPixel(buf, blockWidth, blockHeight + 1, 63, 63, 191); in checkRgba8888Buffer()
377 checkPixel(buf, blockWidth + 1, blockHeight + 1, 63, 63, 191); in checkRgba8888Buffer()
386 checkPixel(buf, w-1, h-1, r, g, b); in checkRgba8888Buffer()
390 void checkBayerRawBuffer(const CpuConsumer::LockedBuffer &buf) { in checkBayerRawBuffer() argument
391 uint32_t w = buf.width; in checkBayerRawBuffer()
392 uint32_t h = buf.height; in checkBayerRawBuffer()
399 checkPixel(buf, 0, 0, 1000, 200, 200); in checkBayerRawBuffer()
400 checkPixel(buf, 1, 0, 1000, 200, 200); in checkBayerRawBuffer()
401 checkPixel(buf, 0, 1, 1000, 200, 200); in checkBayerRawBuffer()
402 checkPixel(buf, 1, 1, 1000, 200, 200); in checkBayerRawBuffer()
405 checkPixel(buf, blockWidth, 0, 200, 200, 1000); in checkBayerRawBuffer()
406 checkPixel(buf, blockWidth + 1, 0, 200, 200, 1000); in checkBayerRawBuffer()
407 checkPixel(buf, blockWidth, 1, 200, 200, 1000); in checkBayerRawBuffer()
408 checkPixel(buf, blockWidth + 1, 1, 200, 200, 1000); in checkBayerRawBuffer()
411 checkPixel(buf, 0, blockHeight, 200, 1000, 200); in checkBayerRawBuffer()
412 checkPixel(buf, 1, blockHeight, 200, 1000, 200); in checkBayerRawBuffer()
413 checkPixel(buf, 0, blockHeight + 1, 200, 1000, 200); in checkBayerRawBuffer()
414 checkPixel(buf, 1, blockHeight + 1, 200, 1000, 200); in checkBayerRawBuffer()
417 checkPixel(buf, blockWidth, blockHeight, 1000, 1000, 1000); in checkBayerRawBuffer()
418 checkPixel(buf, blockWidth + 1, blockHeight, 1000, 1000, 1000); in checkBayerRawBuffer()
419 checkPixel(buf, blockWidth, blockHeight + 1, 1000, 1000, 1000); in checkBayerRawBuffer()
420 checkPixel(buf, blockWidth + 1, blockHeight + 1, 1000, 1000, 1000); in checkBayerRawBuffer()
428 checkPixel(buf, w-1, h-1, maxR, maxG, maxB); in checkBayerRawBuffer()
431 void checkAnyBuffer(const CpuConsumer::LockedBuffer &buf, int format) { in checkAnyBuffer() argument
434 checkBayerRawBuffer(buf); in checkAnyBuffer()
437 checkGreyscaleBuffer<uint8_t>(buf); in checkAnyBuffer()
440 checkGreyscaleBuffer<uint16_t>(buf); in checkAnyBuffer()
443 checkRgba8888Buffer(buf); in checkAnyBuffer()
494 sp<GraphicBuffer> buf(GraphicBuffer::from(anb)); in produceOneFrame() local
496 *stride = buf->getStride(); in produceOneFrame()
500 err = buf->lock(GRALLOC_USAGE_SW_WRITE_OFTEN, (void**)(&img)); in produceOneFrame()
508 fillBayerRawBuffer(img, params.width, params.height, buf->getStride()); in produceOneFrame()
512 buf->getStride(), /*bpp*/8); in produceOneFrame()
516 params.height, buf->getStride(), in produceOneFrame()
520 fillRgba8888Buffer(img, params.width, params.height, buf->getStride()); in produceOneFrame()
527 err = buf->unlock(); in produceOneFrame()
535 err = anw->queueBuffer(anw.get(), buf->getNativeBuffer(), -1); in produceOneFrame()