Lines Matching refs:buf

167 void checkPixel(const CpuConsumer::LockedBuffer &buf,  in checkPixel()  argument
170 switch(buf.format) { in checkPixel()
173 uint16_t *bPtr = (uint16_t*)buf.data; in checkPixel()
174 bPtr += y * buf.stride + x; in checkPixel()
192 uint8_t *bPtr = (uint8_t*)buf.data; in checkPixel()
193 bPtr += y * buf.stride + x; in checkPixel()
200 uint16_t *bPtr = ((uint16_t*)buf.data) + y * buf.stride + x; in checkPixel()
207 uint8_t *bPtr = (uint8_t*)buf.data; in checkPixel()
208 bPtr += (y * buf.stride + x) * bytesPerPixel; in checkPixel()
216 ADD_FAILURE() << "Unknown format for check:" << buf.format; in checkPixel()
223 void fillYV12Buffer(uint8_t* buf, int w, int h, int stride);
227 void fillGreyscaleBuffer(T* buf, int w, int h, int stride, int bpp) { in fillGreyscaleBuffer() argument
242 buf[yuvTexOffsetY + (y * yuvTexStrideY) + x] = intensity; in fillGreyscaleBuffer()
256 void fillRgba8888Buffer(uint8_t* buf, int w, int h, int stride) in fillRgba8888Buffer() argument
272 buf[(y*stride + x)*bytesPerPixel + 0] = r; in fillRgba8888Buffer()
273 buf[(y*stride + x)*bytesPerPixel + 1] = g; in fillRgba8888Buffer()
274 buf[(y*stride + x)*bytesPerPixel + 2] = b; in fillRgba8888Buffer()
275 buf[(y*stride + x)*bytesPerPixel + 3] = 255; in fillRgba8888Buffer()
283 void fillBayerRawBuffer(uint8_t* buf, int w, int h, int stride) { in fillBayerRawBuffer() argument
284 ALOGVV("fillBayerRawBuffer: %p with %d x %d, stride %d", buf, w, h ,stride); in fillBayerRawBuffer()
289 uint16_t *bPtr1 = ((uint16_t*)buf) + stride*y; in fillBayerRawBuffer()
309 void checkGreyscaleBuffer(const CpuConsumer::LockedBuffer &buf) { in checkGreyscaleBuffer() argument
310 uint32_t w = buf.width; in checkGreyscaleBuffer()
311 uint32_t h = buf.height; in checkGreyscaleBuffer()
316 checkPixel(buf, 0, 0, 191); in checkGreyscaleBuffer()
317 checkPixel(buf, 1, 0, 191); in checkGreyscaleBuffer()
318 checkPixel(buf, 0, 1, 191); in checkGreyscaleBuffer()
319 checkPixel(buf, 1, 1, 191); in checkGreyscaleBuffer()
322 checkPixel(buf, blockWidth, 0, 63); in checkGreyscaleBuffer()
323 checkPixel(buf, blockWidth + 1, 0, 63); in checkGreyscaleBuffer()
324 checkPixel(buf, blockWidth, 1, 63); in checkGreyscaleBuffer()
325 checkPixel(buf, blockWidth + 1, 1, 63); in checkGreyscaleBuffer()
328 checkPixel(buf, 0, blockHeight, 63); in checkGreyscaleBuffer()
329 checkPixel(buf, 1, blockHeight, 63); in checkGreyscaleBuffer()
330 checkPixel(buf, 0, blockHeight + 1, 63); in checkGreyscaleBuffer()
331 checkPixel(buf, 1, blockHeight + 1, 63); in checkGreyscaleBuffer()
334 checkPixel(buf, blockWidth, blockHeight, 191); in checkGreyscaleBuffer()
335 checkPixel(buf, blockWidth + 1, blockHeight, 191); in checkGreyscaleBuffer()
336 checkPixel(buf, blockWidth, blockHeight + 1, 191); in checkGreyscaleBuffer()
337 checkPixel(buf, blockWidth + 1, blockHeight + 1, 191); in checkGreyscaleBuffer()
343 checkPixel(buf, w-1, h-1, pixelValue); in checkGreyscaleBuffer()
346 void checkRgba8888Buffer(const CpuConsumer::LockedBuffer &buf) { in checkRgba8888Buffer() argument
347 uint32_t w = buf.width; in checkRgba8888Buffer()
348 uint32_t h = buf.height; in checkRgba8888Buffer()
353 checkPixel(buf, 0, 0, 191, 63, 63); in checkRgba8888Buffer()
354 checkPixel(buf, 1, 0, 191, 63, 63); in checkRgba8888Buffer()
355 checkPixel(buf, 0, 1, 191, 63, 63); in checkRgba8888Buffer()
356 checkPixel(buf, 1, 1, 191, 63, 63); in checkRgba8888Buffer()
359 checkPixel(buf, blockWidth, 0, 63, 191, 63); in checkRgba8888Buffer()
360 checkPixel(buf, blockWidth + 1, 0, 63, 191, 63); in checkRgba8888Buffer()
361 checkPixel(buf, blockWidth, 1, 63, 191, 63); in checkRgba8888Buffer()
362 checkPixel(buf, blockWidth + 1, 1, 63, 191, 63); in checkRgba8888Buffer()
365 checkPixel(buf, 0, blockHeight, 63, 191, 63); in checkRgba8888Buffer()
366 checkPixel(buf, 1, blockHeight, 63, 191, 63); in checkRgba8888Buffer()
367 checkPixel(buf, 0, blockHeight + 1, 63, 191, 63); in checkRgba8888Buffer()
368 checkPixel(buf, 1, blockHeight + 1, 63, 191, 63); in checkRgba8888Buffer()
371 checkPixel(buf, blockWidth, blockHeight, 63, 63, 191); in checkRgba8888Buffer()
372 checkPixel(buf, blockWidth + 1, blockHeight, 63, 63, 191); in checkRgba8888Buffer()
373 checkPixel(buf, blockWidth, blockHeight + 1, 63, 63, 191); in checkRgba8888Buffer()
374 checkPixel(buf, blockWidth + 1, blockHeight + 1, 63, 63, 191); in checkRgba8888Buffer()
383 checkPixel(buf, w-1, h-1, r, g, b); in checkRgba8888Buffer()
387 void checkBayerRawBuffer(const CpuConsumer::LockedBuffer &buf) { in checkBayerRawBuffer() argument
388 uint32_t w = buf.width; in checkBayerRawBuffer()
389 uint32_t h = buf.height; in checkBayerRawBuffer()
394 checkPixel(buf, 0, 0, 1000, 200, 200); in checkBayerRawBuffer()
395 checkPixel(buf, 1, 0, 1000, 200, 200); in checkBayerRawBuffer()
396 checkPixel(buf, 0, 1, 1000, 200, 200); in checkBayerRawBuffer()
397 checkPixel(buf, 1, 1, 1000, 200, 200); in checkBayerRawBuffer()
400 checkPixel(buf, blockWidth, 0, 200, 200, 1000); in checkBayerRawBuffer()
401 checkPixel(buf, blockWidth + 1, 0, 200, 200, 1000); in checkBayerRawBuffer()
402 checkPixel(buf, blockWidth, 1, 200, 200, 1000); in checkBayerRawBuffer()
403 checkPixel(buf, blockWidth + 1, 1, 200, 200, 1000); in checkBayerRawBuffer()
406 checkPixel(buf, 0, blockHeight, 200, 1000, 200); in checkBayerRawBuffer()
407 checkPixel(buf, 1, blockHeight, 200, 1000, 200); in checkBayerRawBuffer()
408 checkPixel(buf, 0, blockHeight + 1, 200, 1000, 200); in checkBayerRawBuffer()
409 checkPixel(buf, 1, blockHeight + 1, 200, 1000, 200); in checkBayerRawBuffer()
412 checkPixel(buf, blockWidth, blockHeight, 1000, 1000, 1000); in checkBayerRawBuffer()
413 checkPixel(buf, blockWidth + 1, blockHeight, 1000, 1000, 1000); in checkBayerRawBuffer()
414 checkPixel(buf, blockWidth, blockHeight + 1, 1000, 1000, 1000); in checkBayerRawBuffer()
415 checkPixel(buf, blockWidth + 1, blockHeight + 1, 1000, 1000, 1000); in checkBayerRawBuffer()
423 checkPixel(buf, w-1, h-1, maxR, maxG, maxB); in checkBayerRawBuffer()
426 void checkAnyBuffer(const CpuConsumer::LockedBuffer &buf, int format) { in checkAnyBuffer() argument
429 checkBayerRawBuffer(buf); in checkAnyBuffer()
432 checkGreyscaleBuffer<uint8_t>(buf); in checkAnyBuffer()
435 checkGreyscaleBuffer<uint16_t>(buf); in checkAnyBuffer()
438 checkRgba8888Buffer(buf); in checkAnyBuffer()
489 sp<GraphicBuffer> buf(GraphicBuffer::from(anb)); in produceOneFrame() local
491 *stride = buf->getStride(); in produceOneFrame()
495 err = buf->lock(GRALLOC_USAGE_SW_WRITE_OFTEN, (void**)(&img)); in produceOneFrame()
503 fillBayerRawBuffer(img, params.width, params.height, buf->getStride()); in produceOneFrame()
507 buf->getStride(), /*bpp*/8); in produceOneFrame()
511 params.height, buf->getStride(), in produceOneFrame()
515 fillRgba8888Buffer(img, params.width, params.height, buf->getStride()); in produceOneFrame()
522 err = buf->unlock(); in produceOneFrame()
530 err = anw->queueBuffer(anw.get(), buf->getNativeBuffer(), -1); in produceOneFrame()