FrameSvg: Recache maskFrame if enabledBorders has been changed
Summary: In some cases, when rendering frame svg background, measures & margins do not correspond to `enabledBorders`. I.e. `bottomHeight` may be equal to 5, but the bottom border is disabled. This causes visual artifacts like this {F5878318, layout=center, size=full} //Pay close attention to the bottom of the Task switcher. It has a transparent strip at the bottom, which shouldn't be there.// The cause of this problem is that FrameSVGPrivate::alphaMask doesn't take enabledBorders into account when it's making decision whether it should update maskFrame. Just for reference, this is "after" {F5878319, layout=center, size=full} BUG: 382324 BUG: 390632 BUG: 391659 Test Plan: * Triggered the Breeze task switcher (with compositing on and off) * Didn't see any transparent strips --- * Tried running FrameSvgTest, still passes Reviewers: #plasma, #frameworks, mart Reviewed By: #plasma, mart Subscribers: abetts, mart, aseigo, broulik, kde-frameworks-devel Tags: #frameworks Differential Revision: https://phabricator.kde.org/D13215
This commit is contained in:
parent
a46cd14553
commit
dce258bee3
@ -480,9 +480,15 @@ QPixmap FrameSvgPrivate::alphaMask()
|
|||||||
updateSizes(maskFrame);
|
updateSizes(maskFrame);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const bool shouldUpdate = maskFrame->cachedBackground.isNull()
|
||||||
|
|| maskFrame->enabledBorders != frame->enabledBorders
|
||||||
|
|| maskFrame->frameSize != frameSize(frame);
|
||||||
|
if (!shouldUpdate) {
|
||||||
|
return maskFrame->cachedBackground;
|
||||||
|
}
|
||||||
|
|
||||||
const QString oldKey = cacheId(maskFrame, maskPrefix);
|
const QString oldKey = cacheId(maskFrame, maskPrefix);
|
||||||
maskFrame->enabledBorders = frame->enabledBorders;
|
maskFrame->enabledBorders = frame->enabledBorders;
|
||||||
if (maskFrame->cachedBackground.isNull() || maskFrame->frameSize != frameSize(frame)) {
|
|
||||||
maskFrame->frameSize = frameSize(frame).toSize();
|
maskFrame->frameSize = frameSize(frame).toSize();
|
||||||
const QString newKey = cacheId(maskFrame, maskPrefix);
|
const QString newKey = cacheId(maskFrame, maskPrefix);
|
||||||
if (s_sharedFrames[q->theme()->d].contains(oldKey)) {
|
if (s_sharedFrames[q->theme()->d].contains(oldKey)) {
|
||||||
@ -492,8 +498,8 @@ QPixmap FrameSvgPrivate::alphaMask()
|
|||||||
|
|
||||||
maskFrame->cachedBackground = QPixmap();
|
maskFrame->cachedBackground = QPixmap();
|
||||||
|
|
||||||
|
updateSizes(maskFrame);
|
||||||
generateBackground(maskFrame);
|
generateBackground(maskFrame);
|
||||||
}
|
|
||||||
|
|
||||||
return maskFrame->cachedBackground;
|
return maskFrame->cachedBackground;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user