| 594 | } |
| 595 | |
| 596 | void 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 | |
| 629 | void PiuViewEnd(PiuView* self) |
| 630 | { |
no test coverage detected