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

Function PiuViewFillTexture

modules/piu/MC/piuView.c:701–753  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

699}
700
701void PiuViewFillTexture(PiuView* self, PiuTexture* texture, PiuCoordinate x, PiuCoordinate y, PiuDimension w, PiuDimension h, PiuCoordinate sx, PiuCoordinate sy, PiuDimension sw, PiuDimension sh)
702{
703 Poco poco = (*self)->poco;
704 PiuDimension tw = (*texture)->width;
705 PiuDimension th = (*texture)->height;
706 if (sx < 0) {
707 if (w == sw) {
708 x -= sx;
709 w += sx;
710 }
711 sw += sx;
712 sx = 0;
713 }
714 if (sx + sw > tw) {
715 if (w == sw)
716 w = tw - sx;
717 sw = tw - sx;
718 }
719 if (sy < 0) {
720 if (h == sh) {
721 y -= sy;
722 h += sy;
723 }
724 sh += sy;
725 sy = 0;
726 }
727 if (sy + sh > th) {
728 if (h == sh)
729 h = th - sy;
730 sh = th - sy;
731 }
732 if ((w <= 0) || (h <= 0) || (sw <= 0) || (sh <= 0)) return;
733 x += poco->xOrigin;
734 y += poco->yOrigin;
735#ifdef piuGPU
736 PiuViewFillTextureAux(self, texture, (*self)->pixel, (*self)->blend, x, y, w, h, sx, sy, sw, sh);
737#else
738 {
739 PIUQueueCommand(FillTextureCommand);
740 command->texture = texture;
741 command->color = (*self)->pixel;
742 command->blend = (*self)->blend;
743 command->x = x;
744 command->y = y;
745 command->w = w;
746 command->h = h;
747 command->sx = sx;
748 command->sy = sy;
749 command->sw = sw;
750 command->sh = sh;
751 }
752#endif
753}
754
755void PiuViewFillTextureAux(PiuView* self, PiuTexture* texture, PocoColor color, uint8_t blend, PiuCoordinate x, PiuCoordinate y, PiuDimension w, PiuDimension h, PiuCoordinate sx, PiuCoordinate sy, PiuDimension sw, PiuDimension sh)
756{

Callers 2

PiuPort_fillTextureFunction · 0.50
PiuSkinDrawAuxFunction · 0.50

Calls 1

PiuViewFillTextureAuxFunction · 0.85

Tested by

no test coverage detected