D6186: Implement software cursor in OpenGL backend

Thomas Lübking noreply at phabricator.kde.org
Sun Jun 18 21:09:13 UTC 2017


luebking added inline comments.

INLINE COMMENTS

> scene_opengl.cpp:699
> +    // don't paint if no image for cursor is set
> +    const QImage img = kwinApp()->platform()->softwareCursor();
> +    if (img.isNull()) {

The entire head should probably be in some init function, not in every paint call.
If you go for a lazy init, you should seekt to prevent double connects (but I don't know whether Qt::UniqueConnection works with functors), but I'd discourage that approach, because it prevents shortcutting the function if there's no cursor image (ie. "!m_cursorTexture")

> scene_opengl.cpp:709
> +        // handle shape update in case cursor image changed
> +        connect(Cursor::self(), &Cursor::cursorChanged, this, [this] {
> +            const QImage img = kwinApp()->platform()->softwareCursor();

At this time, this seems superfluous, because you fetch the current image with every paint call anyway.

> scene_opengl.cpp:711
> +            const QImage img = kwinApp()->platform()->softwareCursor();
> +            m_cursorTexture.reset(new GLTexture(img));
> +        });

There's no .isNull() test here - in contrast to the assignment some lines above

> scene_opengl.cpp:734
> +
> +    glDisable(GL_BLEND);
> +}

This needs a comment from Martin, but you might have to glGet with GL_BLEND_SRC and GL_BLEND_DST as well as glIsEnabled(GL_BLEND)

REPOSITORY
  R108 KWin

REVISION DETAIL
  https://phabricator.kde.org/D6186

To: Kanedias, graesslin, davidedmundson
Cc: luebking, plasma-devel, kwin, #kwin, ZrenBot, spstarr, progwolff, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, eliasp, sebas, apol, mart, hein, lukas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20170618/808b9131/attachment-0001.html>


More information about the Plasma-devel mailing list