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; | 175 | qint64 vBlankInterval, fpsInterval; | ||
174 | QRegion repaints_region; | 176 | QRegion repaints_region; | ||
175 | 177 | | |||
176 | qint64 m_timeSinceLastVBlank; | 178 | qint64 m_timeSinceLastVBlank; | ||
177 | 179 | | |||
178 | Scene *m_scene; | 180 | Scene *m_scene; | ||
179 | 181 | | |||
180 | bool m_bufferSwapPending; | 182 | bool m_bufferSwapPending; | ||
181 | bool m_composeAtSwapCompletion; | 183 | bool m_composeAtSwapCompletion; | ||
182 | 184 | | |||
183 | int m_framesToTestForSafety = 3; | 185 | int m_framesToTestForSafety = 3; | ||
186 | | ||||
187 | QBasicTimer m_delayTimer; | ||||
188 | | ||||
189 | // In nano seconds. | ||||
190 | qint64 m_paintTimes[4] = {0}; | ||||
191 | size_t m_paintTimesIndex = 0; | ||||
192 | | ||||
193 | QBasicTimer m_fallbackTimer; | ||||
184 | QElapsedTimer m_monotonicClock; | 194 | QElapsedTimer m_monotonicClock; | ||
185 | }; | 195 | }; | ||
186 | 196 | | |||
187 | class KWIN_EXPORT WaylandCompositor : public Compositor | 197 | class KWIN_EXPORT WaylandCompositor : public Compositor | ||
188 | { | 198 | { | ||
189 | Q_OBJECT | 199 | Q_OBJECT | ||
190 | public: | 200 | public: | ||
191 | static WaylandCompositor *create(QObject *parent = nullptr); | 201 | static WaylandCompositor *create(QObject *parent = nullptr); | ||
▲ Show 20 Lines • Show All 75 Lines • ▼ Show 20 Line(s) | 223 | public: | |||
267 | 277 | | |||
268 | int refreshRate() const override; | 278 | int refreshRate() const override; | ||
269 | 279 | | |||
270 | void updateCompositeBlocking() override; | 280 | void updateCompositeBlocking() override; | ||
271 | void updateClientCompositeBlocking(KWin::Client* c) override; | 281 | void updateClientCompositeBlocking(KWin::Client* c) override; | ||
272 | 282 | | |||
273 | protected: | 283 | protected: | ||
274 | void start() override; | 284 | void start() override; | ||
275 | void performCompositing() override; | 285 | void performCompositing(bool force) override; | ||
276 | 286 | | |||
277 | private: | 287 | private: | ||
278 | explicit X11Compositor(QObject *parent); | 288 | explicit X11Compositor(QObject *parent); | ||
279 | /** | 289 | /** | ||
280 | * Whether the Compositor is currently suspended, 8 bits encoding the reason | 290 | * Whether the Compositor is currently suspended, 8 bits encoding the reason | ||
281 | **/ | 291 | **/ | ||
282 | SuspendReasons m_suspended; | 292 | SuspendReasons m_suspended; | ||
283 | 293 | | |||
284 | int m_xrrRefreshRate; | 294 | int m_xrrRefreshRate; | ||
285 | }; | 295 | }; | ||
286 | 296 | | |||
287 | } | 297 | } |