Changeset View
Changeset View
Standalone View
Standalone View
plugins/platforms/drm/drm_backend.cpp
Show First 20 Lines • Show All 555 Lines • ▼ Show 20 Line(s) | 552 | { | |||
---|---|---|---|---|---|
556 | if (it != m_outputs.constEnd()) { | 556 | if (it != m_outputs.constEnd()) { | ||
557 | return *it; | 557 | return *it; | ||
558 | } | 558 | } | ||
559 | return nullptr; | 559 | return nullptr; | ||
560 | } | 560 | } | ||
561 | 561 | | |||
562 | void DrmBackend::present(DrmBuffer *buffer, DrmOutput *output) | 562 | void DrmBackend::present(DrmBuffer *buffer, DrmOutput *output) | ||
563 | { | 563 | { | ||
564 | if (!buffer || buffer->bufferId() == 0) { | ||||
565 | if (m_deleteBufferAfterPageFlip) { | ||||
566 | delete buffer; | ||||
567 | } | ||||
568 | return; | ||||
569 | } | ||||
570 | | ||||
564 | if (output->present(buffer)) { | 571 | if (output->present(buffer)) { | ||
565 | m_pageFlipsPending++; | 572 | m_pageFlipsPending++; | ||
566 | if (m_pageFlipsPending == 1 && Compositor::self()) { | 573 | if (m_pageFlipsPending == 1 && Compositor::self()) { | ||
567 | Compositor::self()->aboutToSwapBuffers(); | 574 | Compositor::self()->aboutToSwapBuffers(); | ||
568 | } | 575 | } | ||
576 | } else if (m_deleteBufferAfterPageFlip) { | ||||
577 | delete buffer; | ||||
569 | } | 578 | } | ||
570 | } | 579 | } | ||
571 | 580 | | |||
572 | void DrmBackend::initCursor() | 581 | void DrmBackend::initCursor() | ||
573 | { | 582 | { | ||
574 | m_cursorEnabled = waylandServer()->seat()->hasPointer(); | 583 | m_cursorEnabled = waylandServer()->seat()->hasPointer(); | ||
575 | connect(waylandServer()->seat(), &KWayland::Server::SeatInterface::hasPointerChanged, this, | 584 | connect(waylandServer()->seat(), &KWayland::Server::SeatInterface::hasPointerChanged, this, | ||
576 | [this] { | 585 | [this] { | ||
▲ Show 20 Lines • Show All 152 Lines • Show Last 20 Lines |