D14784: [scenes/opengl] Fix overlaps in shadow texture atlas

David Edmundson <[email protected]>
Newsgroups gmane.comp.kde.devel.kwin
Message-ID <[email protected]>
davidedmundson added inline comments.

INLINE COMMENTS

> scene_opengl.cpp:2425-2426
> +
>      p.drawPixmap(0, 0, shadowPixmap(ShadowElementTopLeft));
> -    p.drawPixmap(topLeft.width(), 0, shadowPixmap(ShadowElementTop));
> -    p.drawPixmap(topLeft.width() + top.width(), 0, shadowPixmap(ShadowElementTopRight));
> -    p.drawPixmap(0, topLeft.height(), shadowPixmap(ShadowElementLeft));
> -    p.drawPixmap(width - right.width(), topRight.height(), shadowPixmap(ShadowElementRight));
> -    p.drawPixmap(0, topLeft.height() + left.height(), shadowPixmap(ShadowElementBottomLeft));
> -    p.drawPixmap(bottomLeft.width(), height - bottom.height(), shadowPixmap(ShadowElementBottom));
> -    p.drawPixmap(bottomLeft.width() + bottom.width(), topRight.height() + right.height(), shadowPixmap(ShadowElementBottomRight));
> +    p.drawPixmap(innerRectLeft, 0, shadowPixmap(ShadowElementTop));
> +    p.drawPixmap(width - topRight.width(), 0, shadowPixmap(ShadowElementTopRight));

If left is wider than topleft then we'll end up with a gap between the topleft and top.

Personally I'd call that a corrupt data and not care, which is what the code currently does.
But this whole patch is about handling corrupt shadows.

---

We could either p.drawPixmap(QRect, QImage)  so it scales to fill the quadrant

or

p.drawPixmap( innerRectLeft - shadowElementTopLeft.width(), ....)

so that we align the topLeft element to the right of it's allocated rectangle.

(or the equivalent with style()->drawItemPixmap)

REPOSITORY
  R108 KWin

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

To: zzag, #kwin
Cc: davidedmundson, abetts, kwin, mkulinski, ragreen, jackyalcine, Pitel, iodelay, bwowk, ZrenBot, lesliezhai, ali-mohamed, hardening, jensreuterberg, sebas, apol, mart
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.