Changeset View
Changeset View
Standalone View
Standalone View
plugins/scenes/opengl/scene_opengl.cpp
Show First 20 Lines • Show All 84 Lines • ▼ Show 20 Line(s) | |||||
85 | { | 85 | { | ||
86 | 86 | | |||
87 | extern int currentRefreshRate(); | 87 | extern int currentRefreshRate(); | ||
88 | 88 | | |||
89 | 89 | | |||
90 | /** | 90 | /** | ||
91 | * SyncObject represents a fence used to synchronize operations in | 91 | * SyncObject represents a fence used to synchronize operations in | ||
92 | * the kwin command stream with operations in the X command stream. | 92 | * the kwin command stream with operations in the X command stream. | ||
93 | */ | 93 | **/ | ||
94 | class SyncObject | 94 | class SyncObject | ||
95 | { | 95 | { | ||
96 | public: | 96 | public: | ||
97 | enum State { Ready, TriggerSent, Waiting, Done, Resetting }; | 97 | enum State { Ready, TriggerSent, Waiting, Done, Resetting }; | ||
98 | 98 | | |||
99 | SyncObject(); | 99 | SyncObject(); | ||
100 | ~SyncObject(); | 100 | ~SyncObject(); | ||
101 | 101 | | |||
▲ Show 20 Lines • Show All 130 Lines • ▼ Show 20 Line(s) | |||||
232 | 232 | | |||
233 | // ----------------------------------------------------------------------- | 233 | // ----------------------------------------------------------------------- | ||
234 | 234 | | |||
235 | 235 | | |||
236 | 236 | | |||
237 | /** | 237 | /** | ||
238 | * SyncManager manages a set of fences used for explicit synchronization | 238 | * SyncManager manages a set of fences used for explicit synchronization | ||
239 | * with the X command stream. | 239 | * with the X command stream. | ||
240 | */ | 240 | **/ | ||
241 | class SyncManager | 241 | class SyncManager | ||
242 | { | 242 | { | ||
243 | public: | 243 | public: | ||
244 | enum { MaxFences = 4 }; | 244 | enum { MaxFences = 4 }; | ||
245 | 245 | | |||
246 | SyncManager(); | 246 | SyncManager(); | ||
247 | ~SyncManager(); | 247 | ~SyncManager(); | ||
248 | 248 | | |||
▲ Show 20 Lines • Show All 339 Lines • ▼ Show 20 Line(s) | 587 | { | |||
588 | if (m_currentFence && m_currentFence->state() != SyncObject::Waiting) { | 588 | if (m_currentFence && m_currentFence->state() != SyncObject::Waiting) { | ||
589 | m_currentFence->wait(); | 589 | m_currentFence->wait(); | ||
590 | } | 590 | } | ||
591 | } | 591 | } | ||
592 | 592 | | |||
593 | /** | 593 | /** | ||
594 | * Render cursor texture in case hardware cursor is disabled. | 594 | * Render cursor texture in case hardware cursor is disabled. | ||
595 | * Useful for screen recording apps or backends that can't do planes. | 595 | * Useful for screen recording apps or backends that can't do planes. | ||
596 | */ | 596 | **/ | ||
597 | void SceneOpenGL2::paintCursor() | 597 | void SceneOpenGL2::paintCursor() | ||
598 | { | 598 | { | ||
599 | // don't paint if we use hardware cursor | 599 | // don't paint if we use hardware cursor | ||
600 | if (!kwinApp()->platform()->usesSoftwareCursor()) { | 600 | if (!kwinApp()->platform()->usesSoftwareCursor()) { | ||
601 | return; | 601 | return; | ||
602 | } | 602 | } | ||
603 | 603 | | |||
604 | // lazy init texture cursor only in case we need software rendering | 604 | // lazy init texture cursor only in case we need software rendering | ||
▲ Show 20 Lines • Show All 1960 Lines • Show Last 20 Lines |