Changeset View
Changeset View
Standalone View
Standalone View
platformsupport/scenes/opengl/backend.h
Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Line(s) | 54 | public: | |||
---|---|---|---|---|---|
70 | * @brief Backend specific code to prepare the rendering of a frame including flushing the | 70 | * @brief Backend specific code to prepare the rendering of a frame including flushing the | ||
71 | * previously rendered frame to the screen if the backend works this way. | 71 | * previously rendered frame to the screen if the backend works this way. | ||
72 | * | 72 | * | ||
73 | * @return A region that if not empty will be repainted in addition to the damaged region | 73 | * @return A region that if not empty will be repainted in addition to the damaged region | ||
74 | */ | 74 | */ | ||
75 | virtual QRegion prepareRenderingFrame() = 0; | 75 | virtual QRegion prepareRenderingFrame() = 0; | ||
76 | 76 | | |||
77 | /** | 77 | /** | ||
78 | * Notifies about starting to paint. | ||||
79 | * | ||||
80 | * @p damage contains the reported damage as suggested by windows and effects on prepaint calls. | ||||
81 | */ | ||||
82 | virtual void aboutToStartPainting(const QRegion &damage); | ||||
zzag: Style: remove whitespace after `&` | |||||
83 | | ||||
84 | /** | ||||
78 | * @brief Backend specific code to handle the end of rendering a frame. | 85 | * @brief Backend specific code to handle the end of rendering a frame. | ||
79 | * | 86 | * | ||
80 | * @param renderedRegion The possibly larger region that has been rendered | 87 | * @param renderedRegion The possibly larger region that has been rendered | ||
81 | * @param damagedRegion The damaged region that should be posted | 88 | * @param damagedRegion The damaged region that should be posted | ||
82 | */ | 89 | */ | ||
83 | virtual void endRenderingFrame(const QRegion &damage, const QRegion &damagedRegion) = 0; | 90 | virtual void endRenderingFrame(const QRegion &damage, const QRegion &damagedRegion) = 0; | ||
84 | virtual void endRenderingFrameForScreen(int screenId, const QRegion &damage, const QRegion &damagedRegion); | 91 | virtual void endRenderingFrameForScreen(int screenId, const QRegion &damage, const QRegion &damagedRegion); | ||
85 | virtual bool makeCurrent() = 0; | 92 | virtual bool makeCurrent() = 0; | ||
▲ Show 20 Lines • Show All 68 Lines • ▼ Show 20 Line(s) | |||||
154 | bool isDirectRendering() const { | 161 | bool isDirectRendering() const { | ||
155 | return m_directRendering; | 162 | return m_directRendering; | ||
156 | } | 163 | } | ||
157 | 164 | | |||
158 | bool supportsBufferAge() const { | 165 | bool supportsBufferAge() const { | ||
159 | return m_haveBufferAge; | 166 | return m_haveBufferAge; | ||
160 | } | 167 | } | ||
161 | 168 | | |||
169 | bool supportsPartialUpdate() const | ||||
170 | { | ||||
171 | return m_havePartialUpdate; | ||||
172 | } | ||||
173 | bool supportsSwapBuffersWithDamage() const | ||||
174 | { | ||||
175 | return m_haveSwapBuffersWithDamage; | ||||
176 | } | ||||
177 | | ||||
162 | /** | 178 | /** | ||
163 | * @returns whether the context is surfaceless | 179 | * @returns whether the context is surfaceless | ||
164 | */ | 180 | */ | ||
165 | bool isSurfaceLessContext() const { | 181 | bool isSurfaceLessContext() const { | ||
166 | return m_surfaceLessContext; | 182 | return m_surfaceLessContext; | ||
167 | } | 183 | } | ||
168 | 184 | | |||
169 | /** | 185 | /** | ||
▲ Show 20 Lines • Show All 73 Lines • ▼ Show 20 Line(s) | 216 | protected: | |||
243 | void setIsDirectRendering(bool direct) { | 259 | void setIsDirectRendering(bool direct) { | ||
244 | m_directRendering = direct; | 260 | m_directRendering = direct; | ||
245 | } | 261 | } | ||
246 | 262 | | |||
247 | void setSupportsBufferAge(bool value) { | 263 | void setSupportsBufferAge(bool value) { | ||
248 | m_haveBufferAge = value; | 264 | m_haveBufferAge = value; | ||
249 | } | 265 | } | ||
250 | 266 | | |||
267 | void setSupportsPartialUpdate(bool value) | ||||
268 | { | ||||
269 | m_havePartialUpdate = value; | ||||
270 | } | ||||
271 | | ||||
272 | void setSupportsSwapBuffersWithDamage(bool value) | ||||
273 | { | ||||
274 | m_haveSwapBuffersWithDamage = value; | ||||
275 | } | ||||
276 | | ||||
251 | /** | 277 | /** | ||
252 | * @return const QRegion& Damage of previously rendered frame | 278 | * @return const QRegion& Damage of previously rendered frame | ||
253 | */ | 279 | */ | ||
254 | const QRegion &lastDamage() const { | 280 | const QRegion &lastDamage() const { | ||
255 | return m_lastDamage; | 281 | return m_lastDamage; | ||
256 | } | 282 | } | ||
257 | void setLastDamage(const QRegion &damage) { | 283 | void setLastDamage(const QRegion &damage) { | ||
258 | m_lastDamage = damage; | 284 | m_lastDamage = damage; | ||
Show All 36 Lines | 311 | private: | |||
295 | * @brief Whether direct rendering is used, defaults to @c false. | 321 | * @brief Whether direct rendering is used, defaults to @c false. | ||
296 | */ | 322 | */ | ||
297 | bool m_directRendering; | 323 | bool m_directRendering; | ||
298 | /** | 324 | /** | ||
299 | * @brief Whether the backend supports GLX_EXT_buffer_age / EGL_EXT_buffer_age. | 325 | * @brief Whether the backend supports GLX_EXT_buffer_age / EGL_EXT_buffer_age. | ||
300 | */ | 326 | */ | ||
301 | bool m_haveBufferAge; | 327 | bool m_haveBufferAge; | ||
302 | /** | 328 | /** | ||
329 | * @brief Whether the backend supports EGL_KHR_partial_update | ||||
330 | */ | ||||
331 | bool m_havePartialUpdate; | ||||
nit while browsing this interesting patch: init this member with false too, otherwise this may be left uninitialized (e.g. if initBufferAge isn't called)? mwolff: nit while browsing this interesting patch:
init this member with false too, otherwise this may… | |||||
332 | bool m_haveSwapBuffersWithDamage = false; | ||||
333 | /** | ||||
303 | * @brief Whether the initialization failed, of course default to @c false. | 334 | * @brief Whether the initialization failed, of course default to @c false. | ||
304 | */ | 335 | */ | ||
305 | bool m_failed; | 336 | bool m_failed; | ||
306 | /** | 337 | /** | ||
307 | * @brief Damaged region of previously rendered frame. | 338 | * @brief Damaged region of previously rendered frame. | ||
308 | */ | 339 | */ | ||
309 | QRegion m_lastDamage; | 340 | QRegion m_lastDamage; | ||
310 | /** | 341 | /** | ||
Show All 15 Lines |
Style: remove whitespace after &