MCPcopy Create free account
hub / github.com/danoon2/Boxedwine / draw

Method draw

source/x11/xserver.cpp:365–401  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

363}
364
365void XServer::draw(bool drawNow) {
366 static U32 lastDraw;
367
368 if (!isDisplayDirty || !root) {
369 return;
370 }
371 {
372 BOXEDWINE_CRITICAL_SECTION;
373 if (!isDisplayDirty) {
374 return;
375 }
376 U32 now = KSystem::getMilliesSinceStart();
377 if (!drawNow && (now - lastDraw < 16)) {
378 return;
379 }
380 lastDraw = now;
381 isDisplayDirty = false;
382 }
383
384 KNativeScreenPtr screen = KNativeSystem::getScreen();
385 if (!screen->canBltToScreen()) {
386 return;
387 }
388 screen->getInput()->runOnUiThread([screen, this]() {
389 bool childWasDrawn = false;
390
391 screen->clear();
392 root->iterateMappedChildrenBackToFront([&childWasDrawn](XWindowPtr child) {
393 if (child->c_class == InputOutput) {
394 child->draw();
395 childWasDrawn = true;
396 }
397 return true;
398 }, true);
399 screen->present();
400 });
401}
402
403XWindowPtr XServer::getWindow(U32 window) {
404 BOXEDWINE_CRITICAL_SECTION_WITH_MUTEX(windowsMutex);

Callers

nothing calls this directly

Calls 6

canBltToScreenMethod · 0.80
runOnUiThreadMethod · 0.80
getInputMethod · 0.80
presentMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected