Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
KWin
Commits
d1b537b5
Commit
d1b537b5
authored
Apr 04, 2021
by
Vlad Zahorodnii
Browse files
Move insertion of safety points to X11Compositor
Safety points only work on X11. On Wayland, we gain nothing from them.
parent
dcdca9be
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/composite.cpp
View file @
d1b537b5
...
...
@@ -145,9 +145,6 @@ Compositor::Compositor(QObject* workspace)
},
Qt
::
QueuedConnection
);
if
(
qEnvironmentVariableIsSet
(
"KWIN_MAX_FRAMES_TESTED"
))
m_framesToTestForSafety
=
qEnvironmentVariableIntValue
(
"KWIN_MAX_FRAMES_TESTED"
);
// register DBus
new
CompositorDBusInterface
(
this
);
FTraceLogger
::
create
();
...
...
@@ -629,26 +626,11 @@ void Compositor::composite(RenderLoop *renderLoop)
}
}
if
(
m_framesToTestForSafety
>
0
&&
(
m_scene
->
compositingType
()
&
OpenGLCompositing
))
{
kwinApp
()
->
platform
()
->
createOpenGLSafePoint
(
Platform
::
OpenGLSafePoint
::
PreFrame
);
}
const
QRegion
repaints
=
m_scene
->
repaints
(
screenId
);
m_scene
->
resetRepaints
(
screenId
);
m_scene
->
paint
(
screenId
,
repaints
,
windows
,
renderLoop
);
if
(
m_framesToTestForSafety
>
0
)
{
if
(
m_scene
->
compositingType
()
&
OpenGLCompositing
)
{
kwinApp
()
->
platform
()
->
createOpenGLSafePoint
(
Platform
::
OpenGLSafePoint
::
PostFrame
);
}
m_framesToTestForSafety
--
;
if
(
m_framesToTestForSafety
==
0
&&
(
m_scene
->
compositingType
()
&
OpenGLCompositing
))
{
kwinApp
()
->
platform
()
->
createOpenGLSafePoint
(
Platform
::
OpenGLSafePoint
::
PostLastGuardedFrame
);
}
}
if
(
waylandServer
())
{
const
std
::
chrono
::
milliseconds
frameTime
=
std
::
chrono
::
duration_cast
<
std
::
chrono
::
milliseconds
>
(
renderLoop
->
lastPresentationTimestamp
());
...
...
@@ -710,6 +692,9 @@ X11Compositor::X11Compositor(QObject *parent)
:
Compositor
(
parent
)
,
m_suspended
(
options
->
isUseCompositing
()
?
NoReasonSuspend
:
UserSuspend
)
{
if
(
qEnvironmentVariableIsSet
(
"KWIN_MAX_FRAMES_TESTED"
))
{
m_framesToTestForSafety
=
qEnvironmentVariableIntValue
(
"KWIN_MAX_FRAMES_TESTED"
);
}
}
void
X11Compositor
::
toggleCompositing
()
...
...
@@ -822,7 +807,21 @@ void X11Compositor::composite(RenderLoop *renderLoop)
item
->
waitForDamage
();
}
if
(
m_framesToTestForSafety
>
0
&&
(
scene
()
->
compositingType
()
&
OpenGLCompositing
))
{
kwinApp
()
->
platform
()
->
createOpenGLSafePoint
(
Platform
::
OpenGLSafePoint
::
PreFrame
);
}
Compositor
::
composite
(
renderLoop
);
if
(
m_framesToTestForSafety
>
0
)
{
if
(
scene
()
->
compositingType
()
&
OpenGLCompositing
)
{
kwinApp
()
->
platform
()
->
createOpenGLSafePoint
(
Platform
::
OpenGLSafePoint
::
PostFrame
);
}
m_framesToTestForSafety
--
;
if
(
m_framesToTestForSafety
==
0
&&
(
scene
()
->
compositingType
()
&
OpenGLCompositing
))
{
kwinApp
()
->
platform
()
->
createOpenGLSafePoint
(
Platform
::
OpenGLSafePoint
::
PostLastGuardedFrame
);
}
}
}
bool
X11Compositor
::
checkForOverlayWindow
(
WId
w
)
const
...
...
src/composite.h
View file @
d1b537b5
...
...
@@ -140,7 +140,6 @@ private:
QList
<
xcb_atom_t
>
m_unusedSupportProperties
;
QTimer
m_unusedSupportPropertyTimer
;
Scene
*
m_scene
;
int
m_framesToTestForSafety
=
3
;
QMap
<
RenderLoop
*
,
AbstractOutput
*>
m_renderLoops
;
};
...
...
@@ -236,6 +235,7 @@ private:
* Whether the Compositor is currently suspended, 8 bits encoding the reason
*/
SuspendReasons
m_suspended
;
int
m_framesToTestForSafety
=
3
;
};
}
Write
Preview
Supports
Markdown
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