Make shadows work for windows 100% width or height
ClosedPublic

Authored by davidedmundson on Jun 9 2017, 3:43 PM.

Details

Summary

Clients provide shadows as 9 images, which then get split into relevant quads.
To work out the full width we need the size of an item on the left, the middle and the right.

Some elements can be legitiamtely missing so to work out the width of the left edge we need to consider
all 3 of topleft,left,bottomleft.

Currently we checked both corners in case one was missing, but it's legitimate for both to be missing if the shadow
stretches the whole way.

BUG: 380825

Test Plan

Shadow on panel, rest looks the same

Diff Detail

Repository
R108 KWin
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
davidedmundson created this revision.Jun 9 2017, 3:43 PM
Restricted Application added a project: KWin. · View Herald TranscriptJun 9 2017, 3:43 PM
Restricted Application added subscribers: KWin, kwin, plasma-devel. · View Herald Transcript
mart added a subscriber: mart.Jun 12 2017, 9:37 AM

+1

scene_opengl.cpp
2357–2358

oh, i get it now, i like that logic

utils.h
205 ↗(On Diff #15311)

not sure about calling a local function qMax3, it would suggest it comes from qt.

maybe utilsMax3 or something without q

graesslin added inline comments.
utils.h
205 ↗(On Diff #15311)

make it a variadic template function and call it maxOfAll

Restricted Application edited projects, added Plasma; removed KWin. · View Herald TranscriptJun 20 2017, 10:37 AM
mart accepted this revision.Jun 20 2017, 10:58 AM

isn't a bit heavy building a list just for this?

This revision is now accepted and ready to land.Jun 20 2017, 10:58 AM

isn't a bit heavy building a list just for this?

std::max takes an initialiser-list directly as an argument, it's not converting this into a vector or anything that would invovle copying or mallocs.

This revision was automatically updated to reflect the committed changes.