MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / PiuViewDrawTextureAux

Function PiuViewDrawTextureAux

modules/piu/MC/piuView.c:596–627  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

594}
595
596void PiuViewDrawTextureAux(PiuView* self, PiuTexture* texture, PocoColor color, uint8_t blend, PiuCoordinate x, PiuCoordinate y, PiuCoordinate sx, PiuCoordinate sy, PiuDimension sw, PiuDimension sh)
597{
598 Poco poco = (*self)->poco;
599 PiuFlags flags = (*texture)->flags;
600 PocoBitmap bits = (flags & piuTextureColor) ? &((*texture)->bits) : NULL;
601 PocoBitmap mask = (flags & piuTextureAlpha) ? &((*texture)->mask) : NULL;
602 if (mask) {
603 if (bits) {
604 if ((kCommodettoBitmapMonochrome == bits->format) || (kCommodettoBitmapMonochromeAligned == bits->format)) {
605 PocoColor black = PocoMakeColor((*self)->poco, 0, 0, 0);
606 PocoColor white = PocoMakeColor((*self)->poco, 255, 255, 255);
607 PocoColor background, foreground;
608 if (color == black) {
609 background = white;
610 foreground = black;
611 }
612 else {
613 background = black;
614 foreground = white;
615 }
616 PocoMonochromeBitmapDraw(poco, mask, kPocoMonochromeForeground, background, background, x, y, sx, sy, sw, sh);
617 PocoMonochromeBitmapDraw(poco, bits, kPocoMonochromeForeground, foreground, foreground, x, y, sx, sy, sw, sh);
618 }
619 else
620 PocoBitmapDrawMasked(poco, blend, bits, x, y, sx, sy, sw, sh, mask, sx, sy);
621 }
622 else
623 PocoGrayBitmapDraw(poco, mask, color, blend, x, y, sx, sy, sw, sh);
624 }
625 else
626 PocoBitmapDraw(poco, bits, x, y, sx, sy, sw, sh);
627}
628
629void PiuViewEnd(PiuView* self)
630{

Callers 1

PiuViewDrawTextureFunction · 0.70

Calls 4

PocoMonochromeBitmapDrawFunction · 0.85
PocoBitmapDrawMaskedFunction · 0.85
PocoGrayBitmapDrawFunction · 0.85
PocoBitmapDrawFunction · 0.85

Tested by

no test coverage detected