Changeset View
Changeset View
Standalone View
Standalone View
composite.cpp
Show First 20 Lines • Show All 267 Lines • ▼ Show 20 Line(s) | 169 | { | |||
---|---|---|---|---|---|
268 | kwinApp()->platform()->setSelectedCompositor(m_scene->compositingType() & OpenGLCompositing ? OpenGLCompositing : m_scene->compositingType()); | 268 | kwinApp()->platform()->setSelectedCompositor(m_scene->compositingType() & OpenGLCompositing ? OpenGLCompositing : m_scene->compositingType()); | ||
269 | 269 | | |||
270 | if (!Workspace::self() && m_scene && m_scene->compositingType() == QPainterCompositing) { | 270 | if (!Workspace::self() && m_scene && m_scene->compositingType() == QPainterCompositing) { | ||
271 | // Force Software QtQuick on first startup with QPainter | 271 | // Force Software QtQuick on first startup with QPainter | ||
272 | QQuickWindow::setSceneGraphBackend(QSGRendererInterface::Software); | 272 | QQuickWindow::setSceneGraphBackend(QSGRendererInterface::Software); | ||
273 | } | 273 | } | ||
274 | 274 | | |||
275 | connect(m_scene, &Scene::resetCompositing, this, &Compositor::reinitialize); | 275 | connect(m_scene, &Scene::resetCompositing, this, &Compositor::reinitialize); | ||
276 | m_frameStatistics.reset(); | ||||
276 | emit sceneCreated(); | 277 | emit sceneCreated(); | ||
277 | 278 | | |||
278 | if (Workspace::self()) { | 279 | if (Workspace::self()) { | ||
279 | startupWithWorkspace(); | 280 | startupWithWorkspace(); | ||
280 | } else { | 281 | } else { | ||
281 | connect(kwinApp(), &Application::workspaceCreated, this, &Compositor::startupWithWorkspace); | 282 | connect(kwinApp(), &Application::workspaceCreated, this, &Compositor::startupWithWorkspace); | ||
282 | } | 283 | } | ||
283 | } | 284 | } | ||
▲ Show 20 Lines • Show All 474 Lines • ▼ Show 20 Line(s) | 644 | { | |||
758 | // is called the next time. If there would be nothing pending, it will not restart the timer and | 759 | // is called the next time. If there would be nothing pending, it will not restart the timer and | ||
759 | // scheduleRepaint() would restart it again somewhen later, called from functions that | 760 | // scheduleRepaint() would restart it again somewhen later, called from functions that | ||
760 | // would again add something pending. | 761 | // would again add something pending. | ||
761 | if (m_bufferSwapPending && m_scene->syncsToVBlank()) { | 762 | if (m_bufferSwapPending && m_scene->syncsToVBlank()) { | ||
762 | m_composeAtSwapCompletion = true; | 763 | m_composeAtSwapCompletion = true; | ||
763 | } else { | 764 | } else { | ||
764 | scheduleRepaint(); | 765 | scheduleRepaint(); | ||
765 | } | 766 | } | ||
767 | m_frameStatistics.addFrame(); | ||||
766 | } | 768 | } | ||
767 | 769 | | |||
768 | template <class T> | 770 | template <class T> | ||
769 | static bool repaintsPending(const QList<T*> &windows) | 771 | static bool repaintsPending(const QList<T*> &windows) | ||
770 | { | 772 | { | ||
771 | return std::any_of(windows.begin(), windows.end(), [] (T *t) { return !t->repaints().isEmpty(); }); | 773 | return std::any_of(windows.begin(), windows.end(), [] (T *t) { return !t->repaints().isEmpty(); }); | ||
772 | } | 774 | } | ||
773 | 775 | | |||
▲ Show 20 Lines • Show All 133 Lines • Show Last 20 Lines |