Changeset View
Changeset View
Standalone View
Standalone View
platformsupport/scenes/opengl/backend.h
Show First 20 Lines • Show All 162 Lines • ▼ Show 20 Line(s) | 54 | public: | |||
---|---|---|---|---|---|
163 | * @returns whether the context is surfaceless | 163 | * @returns whether the context is surfaceless | ||
164 | **/ | 164 | **/ | ||
165 | bool isSurfaceLessContext() const { | 165 | bool isSurfaceLessContext() const { | ||
166 | return m_surfaceLessContext; | 166 | return m_surfaceLessContext; | ||
167 | } | 167 | } | ||
168 | 168 | | |||
169 | /** | 169 | /** | ||
170 | * Returns the damage that has accumulated since a buffer of the given age was presented. | 170 | * Returns the damage that has accumulated since a buffer of the given age was presented. | ||
171 | */ | 171 | **/ | ||
172 | QRegion accumulatedDamageHistory(int bufferAge) const; | 172 | QRegion accumulatedDamageHistory(int bufferAge) const; | ||
173 | 173 | | |||
174 | /** | 174 | /** | ||
175 | * Saves the given region to damage history. | 175 | * Saves the given region to damage history. | ||
176 | */ | 176 | **/ | ||
177 | void addToDamageHistory(const QRegion ®ion); | 177 | void addToDamageHistory(const QRegion ®ion); | ||
178 | 178 | | |||
179 | /** | 179 | /** | ||
180 | * The backend specific extensions (e.g. EGL/GLX extensions). | 180 | * The backend specific extensions (e.g. EGL/GLX extensions). | ||
181 | * | 181 | * | ||
182 | * Not the OpenGL (ES) extension! | 182 | * Not the OpenGL (ES) extension! | ||
183 | **/ | 183 | **/ | ||
184 | QList<QByteArray> extensions() const { | 184 | QList<QByteArray> extensions() const { | ||
185 | return m_extensions; | 185 | return m_extensions; | ||
186 | } | 186 | } | ||
187 | 187 | | |||
188 | /** | 188 | /** | ||
189 | * @returns whether the backend specific extensions contains @p extension. | 189 | * @returns whether the backend specific extensions contains @p extension. | ||
190 | **/ | 190 | **/ | ||
191 | bool hasExtension(const QByteArray &extension) const { | 191 | bool hasExtension(const QByteArray &extension) const { | ||
192 | return m_extensions.contains(extension); | 192 | return m_extensions.contains(extension); | ||
193 | } | 193 | } | ||
194 | 194 | | |||
195 | /** | 195 | /** | ||
196 | * Copy a region of pixels from the current read to the current draw buffer | 196 | * Copy a region of pixels from the current read to the current draw buffer | ||
197 | */ | 197 | **/ | ||
198 | void copyPixels(const QRegion ®ion); | 198 | void copyPixels(const QRegion ®ion); | ||
199 | 199 | | |||
200 | protected: | 200 | protected: | ||
201 | /** | 201 | /** | ||
202 | * @brief Backend specific flushing of frame to screen. | 202 | * @brief Backend specific flushing of frame to screen. | ||
203 | **/ | 203 | **/ | ||
204 | virtual void present() = 0; | 204 | virtual void present() = 0; | ||
205 | /** | 205 | /** | ||
▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Line(s) | 285 | private: | |||
292 | **/ | 292 | **/ | ||
293 | bool m_blocksForRetrace; | 293 | bool m_blocksForRetrace; | ||
294 | /** | 294 | /** | ||
295 | * @brief Whether direct rendering is used, defaults to @c false. | 295 | * @brief Whether direct rendering is used, defaults to @c false. | ||
296 | **/ | 296 | **/ | ||
297 | bool m_directRendering; | 297 | bool m_directRendering; | ||
298 | /** | 298 | /** | ||
299 | * @brief Whether the backend supports GLX_EXT_buffer_age / EGL_EXT_buffer_age. | 299 | * @brief Whether the backend supports GLX_EXT_buffer_age / EGL_EXT_buffer_age. | ||
300 | */ | 300 | **/ | ||
301 | bool m_haveBufferAge; | 301 | bool m_haveBufferAge; | ||
302 | /** | 302 | /** | ||
303 | * @brief Whether the initialization failed, of course default to @c false. | 303 | * @brief Whether the initialization failed, of course default to @c false. | ||
304 | **/ | 304 | **/ | ||
305 | bool m_failed; | 305 | bool m_failed; | ||
306 | /** | 306 | /** | ||
307 | * @brief Damaged region of previously rendered frame. | 307 | * @brief Damaged region of previously rendered frame. | ||
308 | **/ | 308 | **/ | ||
309 | QRegion m_lastDamage; | 309 | QRegion m_lastDamage; | ||
310 | /** | 310 | /** | ||
311 | * @brief The damage history for the past 10 frames. | 311 | * @brief The damage history for the past 10 frames. | ||
312 | */ | 312 | **/ | ||
313 | QList<QRegion> m_damageHistory; | 313 | QList<QRegion> m_damageHistory; | ||
314 | /** | 314 | /** | ||
315 | * @brief Timer to measure how long a frame renders. | 315 | * @brief Timer to measure how long a frame renders. | ||
316 | **/ | 316 | **/ | ||
317 | QElapsedTimer m_renderTimer; | 317 | QElapsedTimer m_renderTimer; | ||
318 | bool m_surfaceLessContext = false; | 318 | bool m_surfaceLessContext = false; | ||
319 | 319 | | |||
320 | QList<QByteArray> m_extensions; | 320 | QList<QByteArray> m_extensions; | ||
321 | }; | 321 | }; | ||
322 | 322 | | |||
323 | } | 323 | } | ||
324 | 324 | | |||
325 | #endif | 325 | #endif |