Changeset View
Changeset View
Standalone View
Standalone View
composite.cpp
Show First 20 Lines • Show All 201 Lines • ▼ Show 20 Line(s) | 191 | { | |||
---|---|---|---|---|---|
202 | case OpenGLCompositing: { | 202 | case OpenGLCompositing: { | ||
203 | qCDebug(KWIN_CORE) << "Initializing OpenGL compositing"; | 203 | qCDebug(KWIN_CORE) << "Initializing OpenGL compositing"; | ||
204 | 204 | | |||
205 | // Some broken drivers crash on glXQuery() so to prevent constant KWin crashes: | 205 | // Some broken drivers crash on glXQuery() so to prevent constant KWin crashes: | ||
206 | if (kwinApp()->platform()->openGLCompositingIsBroken()) | 206 | if (kwinApp()->platform()->openGLCompositingIsBroken()) | ||
207 | qCWarning(KWIN_CORE) << "KWin has detected that your OpenGL library is unsafe to use"; | 207 | qCWarning(KWIN_CORE) << "KWin has detected that your OpenGL library is unsafe to use"; | ||
208 | else { | 208 | else { | ||
209 | kwinApp()->platform()->createOpenGLSafePoint(Platform::OpenGLSafePoint::PreInit); | 209 | kwinApp()->platform()->createOpenGLSafePoint(Platform::OpenGLSafePoint::PreInit); | ||
210 | 210 | | |||
211 | m_scene = SceneOpenGL::createScene(this); | 211 | m_scene = SceneOpenGL::createScene(this); | ||
212 | 212 | | |||
213 | kwinApp()->platform()->createOpenGLSafePoint(Platform::OpenGLSafePoint::PostInit); | 213 | kwinApp()->platform()->createOpenGLSafePoint(Platform::OpenGLSafePoint::PostInit); | ||
214 | 214 | | |||
graesslin: why is the scene creation also guarded with PreFrame and PostLastFrame? Contextual that doesn't… | |||||
215 | if (m_scene && !m_scene->initFailed()) { | 215 | if (m_scene && !m_scene->initFailed()) { | ||
216 | connect(static_cast<SceneOpenGL*>(m_scene), &SceneOpenGL::resetCompositing, this, &Compositor::restart); | 216 | connect(static_cast<SceneOpenGL*>(m_scene), &SceneOpenGL::resetCompositing, this, &Compositor::restart); | ||
217 | break; // --> | 217 | break; // --> | ||
218 | } | 218 | } | ||
219 | delete m_scene; | 219 | delete m_scene; | ||
220 | m_scene = NULL; | 220 | m_scene = NULL; | ||
221 | } | 221 | } | ||
222 | 222 | | |||
▲ Show 20 Lines • Show All 517 Lines • ▼ Show 20 Line(s) | 739 | if (m_framesToTestForSafety > 0 && (m_scene->compositingType() & OpenGLCompositing)) { | |||
740 | kwinApp()->platform()->createOpenGLSafePoint(Platform::OpenGLSafePoint::PreFrame); | 740 | kwinApp()->platform()->createOpenGLSafePoint(Platform::OpenGLSafePoint::PreFrame); | ||
741 | } | 741 | } | ||
742 | m_timeSinceLastVBlank = m_scene->paint(repaints, windows); | 742 | m_timeSinceLastVBlank = m_scene->paint(repaints, windows); | ||
743 | if (m_framesToTestForSafety > 0) { | 743 | if (m_framesToTestForSafety > 0) { | ||
744 | if (m_scene->compositingType() & OpenGLCompositing) { | 744 | if (m_scene->compositingType() & OpenGLCompositing) { | ||
745 | kwinApp()->platform()->createOpenGLSafePoint(Platform::OpenGLSafePoint::PostFrame); | 745 | kwinApp()->platform()->createOpenGLSafePoint(Platform::OpenGLSafePoint::PostFrame); | ||
746 | } | 746 | } | ||
747 | m_framesToTestForSafety--; | 747 | m_framesToTestForSafety--; | ||
748 | if (m_framesToTestForSafety == 0) { | 748 | if (m_framesToTestForSafety == 0 && (m_scene->compositingType() & OpenGLCompositing)) { | ||
graesslin: this misses the
if (m_scene->compositingType() & OpenGLCompositing) | |||||
luebking: also indention. | |||||
749 | kwinApp()->platform()->createOpenGLSafePoint(Platform::OpenGLSafePoint::PostLastGuardedFrame); | 749 | kwinApp()->platform()->createOpenGLSafePoint(Platform::OpenGLSafePoint::PostLastGuardedFrame); | ||
750 | } | 750 | } | ||
751 | } | 751 | } | ||
752 | m_timeSinceStart += m_timeSinceLastVBlank; | 752 | m_timeSinceStart += m_timeSinceLastVBlank; | ||
753 | 753 | | |||
754 | if (waylandServer()) { | 754 | if (waylandServer()) { | ||
755 | for (Toplevel *win : damaged) { | 755 | for (Toplevel *win : damaged) { | ||
756 | if (auto surface = win->surface()) { | 756 | if (auto surface = win->surface()) { | ||
▲ Show 20 Lines • Show All 457 Lines • Show Last 20 Lines |
why is the scene creation also guarded with PreFrame and PostLastFrame? Contextual that doesn't make sense as createScene doesn't render any frames.