The fact that it's happening in both cairo-based apps and KWin suggests an OpenGL problem. You should be able to confirm if that's the case by running a Qt/KDE program with QT_GRAPHICSSYSTEM=opengl env var set.