Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Plasma
KWin
Commits
c11da495
Commit
c11da495
authored
Nov 04, 2020
by
Vlad Zahorodnii
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
scene: Simplify decoration quad generation code
parent
d91da41c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
18 deletions
+5
-18
scene.cpp
scene.cpp
+4
-17
scene.h
scene.h
+1
-1
No files found.
scene.cpp
View file @
c11da495
...
...
@@ -977,27 +977,13 @@ WindowQuadList Scene::Window::buildQuads(bool force) const
}
if
(
!
toplevel
->
frameMargins
().
isNull
())
{
AbstractClient
*
client
=
dynamic_cast
<
AbstractClient
*>
(
toplevel
);
QRegion
center
=
toplevel
->
transparentRect
();
const
QRegion
decoration
=
decorationShape
();
qreal
decorationScale
=
1.0
;
QRect
rects
[
4
];
bool
isShadedClient
=
false
;
if
(
client
)
{
if
(
AbstractClient
*
client
=
qobject_cast
<
AbstractClient
*>
(
toplevel
)
)
{
client
->
layoutDecorationRects
(
rects
[
0
],
rects
[
1
],
rects
[
2
],
rects
[
3
]);
decorationScale
=
client
->
screenScale
();
isShadedClient
=
client
->
isShade
()
||
center
.
isEmpty
();
}
if
(
isShadedClient
)
{
const
QRect
bounding
=
rects
[
0
]
|
rects
[
1
]
|
rects
[
2
]
|
rects
[
3
];
*
ret
+=
makeDecorationQuads
(
rects
,
bounding
,
decorationScale
);
}
else
{
*
ret
+=
makeDecorationQuads
(
rects
,
decoration
,
decorationScale
);
}
*
ret
+=
makeDecorationQuads
(
rects
,
decorationShape
());
}
if
(
m_shadow
&&
toplevel
->
wantsShadowToBeRendered
())
{
*
ret
<<
m_shadow
->
shadowQuads
();
...
...
@@ -1007,10 +993,11 @@ WindowQuadList Scene::Window::buildQuads(bool force) const
return
*
ret
;
}
WindowQuadList
Scene
::
Window
::
makeDecorationQuads
(
const
QRect
*
rects
,
const
QRegion
&
region
,
qreal
textureScale
)
const
WindowQuadList
Scene
::
Window
::
makeDecorationQuads
(
const
QRect
*
rects
,
const
QRegion
&
region
)
const
{
WindowQuadList
list
;
const
qreal
textureScale
=
toplevel
->
screenScale
();
const
int
padding
=
1
;
const
QPoint
topSpritePosition
(
padding
,
padding
);
...
...
scene.h
View file @
c11da495
...
...
@@ -389,7 +389,7 @@ public:
template
<
typename
T
>
T
*
previousWindowPixmap
()
const
;
protected:
WindowQuadList
makeDecorationQuads
(
const
QRect
*
rects
,
const
QRegion
&
region
,
qreal
textureScale
=
1.0
)
const
;
WindowQuadList
makeDecorationQuads
(
const
QRect
*
rects
,
const
QRegion
&
region
)
const
;
WindowQuadList
makeContentsQuads
()
const
;
/**
* @brief Factory method to create a WindowPixmap.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment