Lines Matching refs:buf

165 void checkPixel(const CpuConsumer::LockedBuffer &buf,  in checkPixel()  argument
168 switch(buf.format) { in checkPixel()
171 uint16_t *bPtr = (uint16_t*)buf.data; in checkPixel()
172 bPtr += y * buf.stride + x; in checkPixel()
190 uint8_t *bPtr = (uint8_t*)buf.data; in checkPixel()
191 bPtr += y * buf.stride + x; in checkPixel()
198 uint16_t *bPtr = ((uint16_t*)buf.data) + y * buf.stride + x; in checkPixel()
205 uint8_t *bPtr = (uint8_t*)buf.data; in checkPixel()
206 bPtr += (y * buf.stride + x) * bytesPerPixel; in checkPixel()
214 ADD_FAILURE() << "Unknown format for check:" << buf.format; in checkPixel()
221 void fillYV12Buffer(uint8_t* buf, int w, int h, int stride);
225 void fillGreyscaleBuffer(T* buf, int w, int h, int stride, int bpp) { in fillGreyscaleBuffer() argument
240 buf[yuvTexOffsetY + (y * yuvTexStrideY) + x] = intensity; in fillGreyscaleBuffer()
254 void fillRgba8888Buffer(uint8_t* buf, int w, int h, int stride) in fillRgba8888Buffer() argument
270 buf[(y*stride + x)*bytesPerPixel + 0] = r; in fillRgba8888Buffer()
271 buf[(y*stride + x)*bytesPerPixel + 1] = g; in fillRgba8888Buffer()
272 buf[(y*stride + x)*bytesPerPixel + 2] = b; in fillRgba8888Buffer()
273 buf[(y*stride + x)*bytesPerPixel + 3] = 255; in fillRgba8888Buffer()
281 void fillBayerRawBuffer(uint8_t* buf, int w, int h, int stride) { in fillBayerRawBuffer() argument
282 ALOGVV("fillBayerRawBuffer: %p with %d x %d, stride %d", buf, w, h ,stride); in fillBayerRawBuffer()
287 uint16_t *bPtr1 = ((uint16_t*)buf) + stride*y; in fillBayerRawBuffer()
307 void checkGreyscaleBuffer(const CpuConsumer::LockedBuffer &buf) { in checkGreyscaleBuffer() argument
308 uint32_t w = buf.width; in checkGreyscaleBuffer()
309 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()
355 checkPixel(buf, 0, 0, 191, 63, 63); in checkRgba8888Buffer()
356 checkPixel(buf, 1, 0, 191, 63, 63); in checkRgba8888Buffer()
357 checkPixel(buf, 0, 1, 191, 63, 63); in checkRgba8888Buffer()
358 checkPixel(buf, 1, 1, 191, 63, 63); in checkRgba8888Buffer()
361 checkPixel(buf, blockWidth, 0, 63, 191, 63); in checkRgba8888Buffer()
362 checkPixel(buf, blockWidth + 1, 0, 63, 191, 63); in checkRgba8888Buffer()
363 checkPixel(buf, blockWidth, 1, 63, 191, 63); in checkRgba8888Buffer()
364 checkPixel(buf, blockWidth + 1, 1, 63, 191, 63); in checkRgba8888Buffer()
367 checkPixel(buf, 0, blockHeight, 63, 191, 63); in checkRgba8888Buffer()
368 checkPixel(buf, 1, blockHeight, 63, 191, 63); in checkRgba8888Buffer()
369 checkPixel(buf, 0, blockHeight + 1, 63, 191, 63); in checkRgba8888Buffer()
370 checkPixel(buf, 1, blockHeight + 1, 63, 191, 63); in checkRgba8888Buffer()
373 checkPixel(buf, blockWidth, blockHeight, 63, 63, 191); in checkRgba8888Buffer()
374 checkPixel(buf, blockWidth + 1, blockHeight, 63, 63, 191); in checkRgba8888Buffer()
375 checkPixel(buf, blockWidth, blockHeight + 1, 63, 63, 191); in checkRgba8888Buffer()
376 checkPixel(buf, blockWidth + 1, blockHeight + 1, 63, 63, 191); in checkRgba8888Buffer()
385 checkPixel(buf, w-1, h-1, r, g, b); in checkRgba8888Buffer()
389 void checkBayerRawBuffer(const CpuConsumer::LockedBuffer &buf) { in checkBayerRawBuffer() argument
390 uint32_t w = buf.width; in checkBayerRawBuffer()
391 uint32_t h = buf.height; in checkBayerRawBuffer()
398 checkPixel(buf, 0, 0, 1000, 200, 200); in checkBayerRawBuffer()
399 checkPixel(buf, 1, 0, 1000, 200, 200); in checkBayerRawBuffer()
400 checkPixel(buf, 0, 1, 1000, 200, 200); in checkBayerRawBuffer()
401 checkPixel(buf, 1, 1, 1000, 200, 200); in checkBayerRawBuffer()
404 checkPixel(buf, blockWidth, 0, 200, 200, 1000); in checkBayerRawBuffer()
405 checkPixel(buf, blockWidth + 1, 0, 200, 200, 1000); in checkBayerRawBuffer()
406 checkPixel(buf, blockWidth, 1, 200, 200, 1000); in checkBayerRawBuffer()
407 checkPixel(buf, blockWidth + 1, 1, 200, 200, 1000); in checkBayerRawBuffer()
410 checkPixel(buf, 0, blockHeight, 200, 1000, 200); in checkBayerRawBuffer()
411 checkPixel(buf, 1, blockHeight, 200, 1000, 200); in checkBayerRawBuffer()
412 checkPixel(buf, 0, blockHeight + 1, 200, 1000, 200); in checkBayerRawBuffer()
413 checkPixel(buf, 1, blockHeight + 1, 200, 1000, 200); in checkBayerRawBuffer()
416 checkPixel(buf, blockWidth, blockHeight, 1000, 1000, 1000); in checkBayerRawBuffer()
417 checkPixel(buf, blockWidth + 1, blockHeight, 1000, 1000, 1000); in checkBayerRawBuffer()
418 checkPixel(buf, blockWidth, blockHeight + 1, 1000, 1000, 1000); in checkBayerRawBuffer()
419 checkPixel(buf, blockWidth + 1, blockHeight + 1, 1000, 1000, 1000); in checkBayerRawBuffer()
427 checkPixel(buf, w-1, h-1, maxR, maxG, maxB); in checkBayerRawBuffer()
430 void checkAnyBuffer(const CpuConsumer::LockedBuffer &buf, int format) { in checkAnyBuffer() argument
433 checkBayerRawBuffer(buf); in checkAnyBuffer()
436 checkGreyscaleBuffer<uint8_t>(buf); in checkAnyBuffer()
439 checkGreyscaleBuffer<uint16_t>(buf); in checkAnyBuffer()
442 checkRgba8888Buffer(buf); in checkAnyBuffer()
447 void fillYV12BufferRect(uint8_t* buf, int w, int h, int stride,
450 void fillRGBA8Buffer(uint8_t* buf, int w, int h, int stride);
452 void fillRGBA8BufferSolid(uint8_t* buf, int w, int h, int stride, uint8_t r,
498 sp<GraphicBuffer> buf(new GraphicBuffer(anb, false)); in produceOneFrame() local
500 *stride = buf->getStride(); in produceOneFrame()
504 err = buf->lock(GRALLOC_USAGE_SW_WRITE_OFTEN, (void**)(&img)); in produceOneFrame()
512 fillBayerRawBuffer(img, params.width, params.height, buf->getStride()); in produceOneFrame()
516 buf->getStride(), /*bpp*/8); in produceOneFrame()
520 params.height, buf->getStride(), in produceOneFrame()
524 fillRgba8888Buffer(img, params.width, params.height, buf->getStride()); in produceOneFrame()
531 err = buf->unlock(); in produceOneFrame()
539 err = anw->queueBuffer(anw.get(), buf->getNativeBuffer(), -1); in produceOneFrame()