Lines Matching refs:target

461 void gfx_surface_blend(struct gfx_surface* target, struct gfx_surface* source, unsigned destx, unsigned desty) {
462 gfx_blend(target, source, 0, 0, source->width, source->height, destx, desty);
468 void gfx_blend(gfx_surface* target, gfx_surface* source, unsigned srcx, unsigned srcy, unsigned width, unsigned height, unsigned destx, unsigned desty) {
469 assert(target->format == source->format);
471 xprintf("target %p, source %p, srcx %u, srcy %u, width %u, height %u, destx %u, desty %u\n", target, source, srcx, srcy, width, height, destx, desty);
473 if (destx >= target->width)
475 if (desty >= target->height)
483 if (destx + width > target->width)
484 width = target->width - destx;
485 if (desty + height > target->height)
486 height = target->height - desty;
494 if (source->format == ZX_PIXEL_FORMAT_RGB_565 && target->format == ZX_PIXEL_FORMAT_RGB_565) {
497 uint16_t* dest = &((uint16_t*)target->ptr)[destx + desty * target->stride];
498 unsigned dest_stride_diff = target->stride - width;
513 } else if (source->format == ZX_PIXEL_FORMAT_ARGB_8888 && target->format == ZX_PIXEL_FORMAT_ARGB_8888) {
516 uint32_t* dest = &((uint32_t*)target->ptr)[destx + desty * target->stride];
517 unsigned dest_stride_diff = target->stride - width;
533 } else if (source->format == ZX_PIXEL_FORMAT_RGB_x888 && target->format == ZX_PIXEL_FORMAT_RGB_x888) {
536 uint32_t* dest = &((uint32_t*)target->ptr)[destx + desty * target->stride];
537 unsigned dest_stride_diff = target->stride - width;
552 } else if (source->format == ZX_PIXEL_FORMAT_MONO_8 && target->format == ZX_PIXEL_FORMAT_MONO_8) {
555 uint8_t* dest = &((uint8_t*)target->ptr)[destx + desty * target->stride];
556 unsigned dest_stride_diff = target->stride - width;
572 xprintf("gfx_surface_blend: unimplemented colorspace combination (source %d target %d)\n", source->format, target->format);