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

Function PocoDrawingBegin

modules/commodetto/commodettoPocoBlit.c:3513–3557  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3511}
3512
3513void PocoDrawingBegin(Poco poco, PocoCoordinate x, PocoCoordinate y, PocoDimension w, PocoDimension h)
3514{
3515 // clip against the display
3516 if (x < 0) {
3517 w += x;
3518 x = 0;
3519 }
3520 else if (x >= poco->width)
3521 w = 0;
3522
3523 if (y < 0) {
3524 h += y;
3525 y = 0;
3526 }
3527 else if (y >= poco->height)
3528 h = 0;
3529
3530 if ((x + w) > poco->width)
3531 w = poco->width - x;
3532 if ((y + h) > poco->height)
3533 h = poco->height - y;
3534
3535 // rotate
3536 rotateCoordinatesAndDimensions(poco->width, poco->height, x, y, w, h);
3537
3538 // get started
3539 poco->next = (PocoCommand)poco->displayList;
3540 poco->flags &= ~(kPocoFlagErrorDisplayListOverflow | kPocoFlagErrorStackProblem | kPocoFlagGCDisabled);
3541 poco->stackDepth = 0;
3542 poco->xOrigin = poco->yOrigin = 0;
3543
3544 poco->x = x;
3545 poco->y = y;
3546 poco->w = w;
3547 poco->h = h;
3548
3549 poco->xMax = x + w;
3550 poco->yMax = y + h;
3551
3552 poco->flags |= kPocoFlagDidBegin;
3553
3554#if kPocoFrameBuffer
3555 poco->frameBuffer = NULL;
3556#endif
3557 }
3558
3559int PocoDrawingEnd(Poco poco, PocoPixel *pixels, int byteLength, PocoRenderedPixelsReceiver pixelReceiver, void *refCon)
3560{

Callers 4

xs_poco_beginFunction · 0.85
PiuViewBeginFunction · 0.85
piuView.cFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected