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

Function PiuViewDrawTexture

modules/piu/MC/piuView.c:556–594  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

554}
555
556void PiuViewDrawTexture(PiuView* self, PiuTexture* texture, PiuCoordinate x, PiuCoordinate y, PiuCoordinate sx, PiuCoordinate sy, PiuDimension sw, PiuDimension sh)
557{
558 Poco poco = (*self)->poco;
559 PiuDimension tw = (*texture)->width;
560 PiuDimension th = (*texture)->height;
561 if (sx < 0) {
562 x -= sx;
563 sw += sx;
564 sx = 0;
565 }
566 if (sx + sw > tw)
567 sw = tw - sx;
568 if (sy < 0) {
569 y -= sy;
570 sh += sy;
571 sy = 0;
572 }
573 if (sy + sh > th)
574 sh = th - sy;
575 if ((sw <= 0) || (sh <= 0)) return;
576 x += poco->xOrigin;
577 y += poco->yOrigin;
578#ifdef piuGPU
579 PiuViewDrawTextureAux(self, texture, (*self)->pixel, (*self)->blend, x, y, sx, sy, sw, sh);
580#else
581 {
582 PIUQueueCommand(DrawTextureCommand);
583 command->texture = texture;
584 command->color = (*self)->pixel;
585 command->blend = (*self)->blend;
586 command->x = x;
587 command->y = y;
588 command->sx = sx;
589 command->sy = sy;
590 command->sw = sw;
591 command->sh = sh;
592 }
593#endif
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{

Callers 2

PiuPort_drawTextureFunction · 0.50
PiuSkinDrawAuxFunction · 0.50

Calls 1

PiuViewDrawTextureAuxFunction · 0.70

Tested by

no test coverage detected