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

Function PiuViewCombine

modules/piu/MC/piuView.c:217–285  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

215#ifdef piuGPU
216#else
217void PiuViewCombine(PiuView* self, PiuRectangle area, PiuCoordinate op)
218{
219 xsMachine* the = (*self)->the;
220 Poco poco = (*self)->poco;
221 PiuRegion* tmp = (*self)->dirty;
222 (*self)->dirty = (*self)->swap;
223 (*self)->swap = tmp;
224 if (area) {
225 PiuRegionRecord regionRecord;
226 PiuRegion region = &regionRecord;
227 PocoCoordinate left = area->x;
228 PocoCoordinate top = area->y;
229 PocoCoordinate right = left + area->width;
230 PocoCoordinate bottom = top + area->height;
231 PocoCoordinate x, y;
232 PocoDimension w, h;
233 if (left < 0) left = 0;
234 else if (left > poco->width) left = poco->width;
235 if (top < 0) top = 0;
236 else if (top > poco->height) top = poco->height;
237 if (right < 0) right = 0;
238 else if (right > poco->width) right = poco->width;
239 if (bottom < 0) bottom = 0;
240 else if (bottom > poco->height) bottom = poco->height;
241 x = left;
242 y = top;
243 w = right - left;
244 h = bottom - top;
245 if (poco->flags & kPocoFlagAdaptInvalid) {
246 PixelsOutDispatch pixelsOutDispatch = poco->outputRefcon ? *(PixelsOutDispatch *)poco->outputRefcon : NULL;
247 CommodettoRectangle cr = xsGetHostChunk(xsReference((*self)->rectangle));
248 rotateCoordinatesAndDimensions(poco->width, poco->height, x, y, w, h);
249 cr->x = x;
250 cr->y = y;
251 cr->w = w;
252 cr->h = h;
253#if MODDEF_ECMA419_DISPLAY
254 if (poco->displayHooks) {
255 (((xsDisplayHostHooks)poco->displayHooks)->doAdaptInvalid)(poco->outputRefcon, cr);
256 }
257 else
258#endif
259 if (pixelsOutDispatch)
260 (pixelsOutDispatch->doAdaptInvalid)(poco->outputRefcon, cr);
261 else
262 xsCallFunction1((*self)->_adaptInvalid, xsReference((*self)->screen), xsReference((*self)->rectangle));
263 x = cr->x;
264 y = cr->y;
265 w = cr->w;
266 h = cr->h;
267 unrotateCoordinatesAndDimensions(poco->width, poco->height, x, y, w, h);
268 }
269 regionRecord.reference = NULL;
270 regionRecord.available = 11;
271 PiuRegionRectangle(&region, x, y, w, h);
272 if (PiuRegionCombine((*self)->dirty, (*self)->swap, &region, op)) {
273 return;
274 }

Callers 2

PiuViewInvalidateFunction · 0.85
PiuViewValidateFunction · 0.85

Calls 3

PiuRegionRectangleFunction · 0.85
PiuRegionCombineFunction · 0.85
PiuRegionEmptyFunction · 0.85

Tested by

no test coverage detected