Changeset View
Changeset View
Standalone View
Standalone View
composite.h
Show First 20 Lines • Show All 138 Lines • ▼ Show 20 Line(s) | 131 | protected: | |||
---|---|---|---|---|---|
139 | * @brief Prepares start. | 139 | * @brief Prepares start. | ||
140 | * @return bool @c true if start should be continued and @c if not. | 140 | * @return bool @c true if start should be continued and @c if not. | ||
141 | */ | 141 | */ | ||
142 | bool setupStart(); | 142 | bool setupStart(); | ||
143 | /** | 143 | /** | ||
144 | * Continues the startup after Scene And Workspace are created | 144 | * Continues the startup after Scene And Workspace are created | ||
145 | */ | 145 | */ | ||
146 | void startupWithWorkspace(); | 146 | void startupWithWorkspace(); | ||
147 | virtual void performCompositing(); | 147 | virtual void performCompositing(bool force = false); | ||
148 | 148 | | |||
149 | virtual void configChanged(); | 149 | virtual void configChanged(); | ||
150 | 150 | | |||
151 | void destroyCompositorSelection(); | 151 | void destroyCompositorSelection(); | ||
152 | 152 | | |||
153 | static Compositor *s_compositor; | 153 | static Compositor *s_compositor; | ||
154 | 154 | | |||
155 | private: | 155 | private: | ||
156 | void claimCompositorSelection(); | 156 | void claimCompositorSelection(); | ||
157 | 157 | | |||
158 | void setupX11Support(); | 158 | void setupX11Support(); | ||
159 | 159 | | |||
160 | void setCompositeTimer(); | 160 | void setFallbackTimer(); | ||
161 | bool windowRepaintsPending() const; | 161 | bool windowRepaintsPending() const; | ||
162 | 162 | | |||
163 | void releaseCompositorSelection(); | 163 | void releaseCompositorSelection(); | ||
164 | void deleteUnusedSupportProperties(); | 164 | void deleteUnusedSupportProperties(); | ||
165 | 165 | | |||
166 | bool delayPerform(); | ||||
167 | void updatePaintTimes(qint64 time); | ||||
168 | | ||||
166 | State m_state; | 169 | State m_state; | ||
167 | 170 | | |||
168 | QBasicTimer compositeTimer; | | |||
169 | CompositorSelectionOwner *m_selectionOwner; | 171 | CompositorSelectionOwner *m_selectionOwner; | ||
170 | QTimer m_releaseSelectionTimer; | 172 | QTimer m_releaseSelectionTimer; | ||
171 | QList<xcb_atom_t> m_unusedSupportProperties; | 173 | QList<xcb_atom_t> m_unusedSupportProperties; | ||
172 | QTimer m_unusedSupportPropertyTimer; | 174 | QTimer m_unusedSupportPropertyTimer; | ||
173 | qint64 vBlankInterval, fpsInterval; | | |||
174 | QRegion repaints_region; | 175 | QRegion repaints_region; | ||
175 | 176 | | |||
176 | qint64 m_timeSinceLastVBlank; | | |||
177 | | ||||
178 | Scene *m_scene; | 177 | Scene *m_scene; | ||
179 | 178 | | |||
180 | bool m_bufferSwapPending; | 179 | bool m_bufferSwapPending; | ||
181 | bool m_composeAtSwapCompletion; | 180 | bool m_composeAtSwapCompletion; | ||
182 | 181 | | |||
183 | int m_framesToTestForSafety = 3; | 182 | int m_framesToTestForSafety = 3; | ||
183 | | ||||
184 | QBasicTimer m_delayTimer; | ||||
185 | | ||||
186 | // In nano seconds. | ||||
187 | qint64 m_paintTimes[4] = {0}; | ||||
188 | size_t m_paintTimesIndex = 0; | ||||
189 | | ||||
190 | QBasicTimer m_fallbackTimer; | ||||
184 | QElapsedTimer m_monotonicClock; | 191 | QElapsedTimer m_monotonicClock; | ||
185 | }; | 192 | }; | ||
186 | 193 | | |||
187 | class KWIN_EXPORT WaylandCompositor : public Compositor | 194 | class KWIN_EXPORT WaylandCompositor : public Compositor | ||
188 | { | 195 | { | ||
189 | Q_OBJECT | 196 | Q_OBJECT | ||
190 | public: | 197 | public: | ||
191 | static WaylandCompositor *create(QObject *parent = nullptr); | 198 | static WaylandCompositor *create(QObject *parent = nullptr); | ||
▲ Show 20 Lines • Show All 75 Lines • ▼ Show 20 Line(s) | 220 | public: | |||
267 | 274 | | |||
268 | int refreshRate() const override; | 275 | int refreshRate() const override; | ||
269 | 276 | | |||
270 | void updateCompositeBlocking() override; | 277 | void updateCompositeBlocking() override; | ||
271 | void updateClientCompositeBlocking(KWin::Client* c) override; | 278 | void updateClientCompositeBlocking(KWin::Client* c) override; | ||
272 | 279 | | |||
273 | protected: | 280 | protected: | ||
274 | void start() override; | 281 | void start() override; | ||
275 | void performCompositing() override; | 282 | void performCompositing(bool force) override; | ||
276 | 283 | | |||
277 | private: | 284 | private: | ||
278 | explicit X11Compositor(QObject *parent); | 285 | explicit X11Compositor(QObject *parent); | ||
279 | /** | 286 | /** | ||
280 | * Whether the Compositor is currently suspended, 8 bits encoding the reason | 287 | * Whether the Compositor is currently suspended, 8 bits encoding the reason | ||
281 | **/ | 288 | **/ | ||
282 | SuspendReasons m_suspended; | 289 | SuspendReasons m_suspended; | ||
283 | 290 | | |||
284 | int m_xrrRefreshRate; | 291 | int m_xrrRefreshRate; | ||
285 | }; | 292 | }; | ||
286 | 293 | | |||
287 | } | 294 | } |