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

Function PiuViewEnd

modules/piu/MC/piuView.c:629–677  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

627}
628
629void PiuViewEnd(PiuView* self)
630{
631 Poco poco = (*self)->poco;
632#ifdef piuGPU
633 PocoDrawingEnd(poco, poco->pixels, poco->pixelsLength, PiuViewReceiver, self);
634 pocoInstrumentationAdjust(FramesDrawn, +1);
635#else
636 xsMachine* the = (*self)->the;
637 PiuRegion* dirty = (*self)->dirty;
638 PocoCoordinate *regionBegin0, *region0, *regionLimit0;
639 int size, offset;
640
641 PIUQueueCommand(EndCommand);
642#ifdef mxInstrument
643 modInstrumentationMax(PiuCommandListUsed, (*self)->current);
644#endif
645 regionBegin0 = (*dirty)->data;
646 offset = 5;
647 size = *regionBegin0 - 2; // last span
648 region0 = regionBegin0 + offset;
649 regionLimit0 = regionBegin0 + size;
650
651 while (region0 < regionLimit0) {
652 PocoCoordinate top = *region0++;
653 PocoCoordinate segmentCount = *region0++;
654 PocoCoordinate bottom = *(region0 + segmentCount);
655 while (segmentCount) {
656 PocoCoordinate left = *region0++;
657 segmentCount--;
658 PocoCoordinate right = *region0++;
659 segmentCount--;
660 offset = region0 - regionBegin0;
661 PiuViewUpdateStep(self, left, top, right - left, bottom - top, (region0 < regionLimit0) ? 1 : 0);
662 regionBegin0 = (*dirty)->data;
663 region0 = regionBegin0 + offset;
664 regionLimit0 = regionBegin0 + size;
665 }
666 }
667
668 PiuRegionEmpty(dirty);
669
670 PiuFontListUnlockCache(the);
671 if (poco->flags & kPocoFlagGCDisabled) {
672 xsEnableGarbageCollection(1);
673 xsCollectGarbage();
674 poco->flags &= ~kPocoFlagGCDisabled;
675 }
676#endif
677}
678
679
680void PiuViewFillColor(PiuView* self, PiuCoordinate x, PiuCoordinate y, PiuDimension w, PiuDimension h)

Callers 1

piuView.cFile · 0.85

Calls 2

PiuRegionEmptyFunction · 0.85
PiuFontListUnlockCacheFunction · 0.85

Tested by

no test coverage detected