davidedmundson requested changes to this revision. davidedmundson added a comment. This revision now requires changes to proceed.
Idea is good. Few minor comments. ---- I might be wrong, but it looks to me that: updateCursor now swaps m_cursorIndex which is a signifcant behaviour change from the old separate setCursor/updateCursor therefore if we ever call showCursor updateCursor updateCursor you'd end up painting into the front buffer which is bad. I can see a few code paths that do this. INLINE COMMENTS > drm_output.cpp:125 > + c->fill(Qt::transparent); > + if (m_orientation == Qt::InvertedLandscapeOrientation) { > + cursorImage = cursorImage.mirrored(true, true); This will be much faster is you set a matrix (setWorldTransform) on the QPainter. Then it will do the transformation inside drawImage and get rid of the intermediate data copy > drm_output.cpp:960 > + // the cursor might need to get rotated > + updateCursor(); > // TODO: forward to OutputInterface and OutputDeviceInterface this needs a showCursor() too to be useful > drm_output.cpp:1164 > + } > + m_cursor[index]->image()->fill(Qt::transparent); > + return true; You fill it transparent before every paint anyway > drm_output.h:181 > } m_lastWorkingState; > + DrmDumbBuffer *m_cursor[2]; > + int m_cursorIndex = 0; Not that you need to, but: m_cursor[2] = {nullptr,nullptr} should work just fine instead of doing it in the ctor REPOSITORY R108 KWin REVISION DETAIL https://phabricator.kde.org/D8664 To: graesslin, #kwin, #plasma, davidedmundson Cc: davidedmundson, plasma-devel, kwin, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, mart