[Differential] [Changed Subscribers] D3501: Scale surface damage eventsDamage events come in global compositor space, not relative to the surface.For a glTex2D we need the events relatvie to the surface, so they need scaling up

graesslin (Martin Gräßlin) noreply at phabricator.kde.org
Fri Nov 25 14:30:55 UTC 2016


graesslin added inline comments.

INLINE COMMENTS

> abstract_egl_backend.cpp:363
>      if (GLPlatform::instance()->isGLES()) {
> +
>          if (s_supportsARGB32 && (image.format() == QImage::Format_ARGB32 || image.format() == QImage::Format_ARGB32_Premultiplied)) {

nitpick

> abstract_egl_backend.cpp:373-384
>              for (const QRect &rect : damage.rects()) {
> -                glTexSubImage2D(m_target, 0, rect.x(), rect.y(), rect.width(), rect.height(),
> -                                GL_RGBA, GL_UNSIGNED_BYTE, im.copy(rect).bits());
> +                auto scaledRect = QRect(rect.x() * scale, rect.y() * scale, rect.width() * scale, rect.height() * scale);
> +                glTexSubImage2D(m_target, 0, scaledRect.x(), scaledRect.y(), scaledRect.width(), scaledRect.height(),
> +                                GL_RGBA, GL_UNSIGNED_BYTE, im.copy(scaledRect).bits());
>              }
>          }
>      } else {

I'm wondering whether the partial upload makes sense at all now. Maybe we should just upload the complete texture?

Note: I have vague ideas of using a texture upload thread.

> abstract_egl_backend.cpp:403
>      const QSize &size = image.size();
> +
>      // TODO: this should be shared with GLTexture(const QImage&, GLenum)

nitpick

REPOSITORY
  rKWIN KWin

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

EMAIL PREFERENCES
  https://phabricator.kde.org/settings/panel/emailpreferences/

To: davidedmundson, #plasma
Cc: graesslin, plasma-devel, kwin, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20161125/3564f72c/attachment-0001.html>


More information about the Plasma-devel mailing list