D25611: [scene] Fix decoration texture bleeding

Vlad Zahorodnii noreply at phabricator.kde.org
Mon Dec 2 14:24:05 GMT 2019


zzag added a comment.


  In D25611#570783 <https://phabricator.kde.org/D25611#570783>, @davidedmundson wrote:
  
  > The QSG code looks quite simple, but they go via another QImage buffer.
  >
  >   QPainter p(&tmp);
  >   p.setCompositionMode(QPainter::CompositionMode_Source);
  >   
  >   int w = r.width(); //Dave <- image.width+padding*2
  >   int h = r.height();
  >   int iw = image.width();
  >   int ih = image.height();
  >   p.drawImage(1, 1, image);
  >   p.drawImage(1, 0, image, 0, 0, iw, 1);
  >   p.drawImage(1, h - 1, image, 0, ih - 1, iw, 1);
  >   p.drawImage(0, 1, image, 0, 0, 1, ih);
  >   p.drawImage(w - 1, 1, image, iw - 1, 0, 1, ih);
  >   p.drawImage(0, 0, image, 0, 0, 1, 1);
  >   p.drawImage(0, h - 1, image, 0, ih - 1, 1, 1);
  >   p.drawImage(w - 1, 0, image, iw - 1, 0, 1, 1);
  >   p.drawImage(w - 1, h - 1, image, iw - 1, ih - 1, 1, 1);
  >   
  >
  > Assuming Qt copes with rendering into the image it reads from we could have done the same.
  >  We have the extra complexity of partial updates, but if we have the clipRect set correctly that should just quietly no-op
  
  
  That's definitely an option, I'll see what I can do.

INLINE COMMENTS

> davidedmundson wrote in scene_opengl.cpp:2625
> QRect point should also be *= devicePixelRatio?

No, since it must be in device-independent pixels.

> davidedmundson wrote in scene_opengl.cpp:2670
> We rotate the vertical bars so everything is horizontal, so in theory we could:
> 
> GL_CLAMP_S=GL_CLAMP_TO_EDGE
> 
> and only pad T.
> 
> Though maybe that's just making things more complicated...

This will be the case only if all decoration parts have the same width.

REPOSITORY
  R108 KWin

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

To: zzag, #kwin
Cc: davidedmundson, fredrik, kwin, fvogt, LeGast00n, The-Feren-OS-Dev, sbergeron, jraleigh, fbampaloukas, GB_2, mkulinski, ragreen, jackyalcine, iodelay, crozbo, bwowk, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, hardening, romangg, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwin/attachments/20191202/f569c0f2/attachment-0001.html>


More information about the kwin mailing list