Changeset View
Changeset View
Standalone View
Standalone View
abstract_egl_backend.cpp
Show First 20 Lines • Show All 69 Lines • ▼ Show 20 Line(s) | |||||
70 | 70 | | |||
71 | void AbstractEglBackend::cleanup() | 71 | void AbstractEglBackend::cleanup() | ||
72 | { | 72 | { | ||
73 | cleanupGL(); | 73 | cleanupGL(); | ||
74 | doneCurrent(); | 74 | doneCurrent(); | ||
75 | eglDestroyContext(m_display, m_context); | 75 | eglDestroyContext(m_display, m_context); | ||
76 | cleanupSurfaces(); | 76 | cleanupSurfaces(); | ||
77 | eglReleaseThread(); | 77 | eglReleaseThread(); | ||
78 | kwinApp()->platform()->setSceneEglContext(EGL_NO_CONTEXT); | ||||
79 | kwinApp()->platform()->setSceneEglSurface(EGL_NO_SURFACE); | ||||
80 | kwinApp()->platform()->setSceneEglConfig(nullptr); | ||||
78 | } | 81 | } | ||
79 | 82 | | |||
80 | void AbstractEglBackend::cleanupSurfaces() | 83 | void AbstractEglBackend::cleanupSurfaces() | ||
81 | { | 84 | { | ||
82 | if (m_surface != EGL_NO_SURFACE) { | 85 | if (m_surface != EGL_NO_SURFACE) { | ||
83 | eglDestroySurface(m_display, m_surface); | 86 | eglDestroySurface(m_display, m_surface); | ||
84 | } | 87 | } | ||
85 | } | 88 | } | ||
▲ Show 20 Lines • Show All 164 Lines • ▼ Show 20 Line(s) | 247 | for (auto it = candidates.begin(); it != candidates.end(); it++) { | |||
250 | } | 253 | } | ||
251 | } | 254 | } | ||
252 | 255 | | |||
253 | if (ctx == EGL_NO_CONTEXT) { | 256 | if (ctx == EGL_NO_CONTEXT) { | ||
254 | qCCritical(KWIN_CORE) << "Create Context failed"; | 257 | qCCritical(KWIN_CORE) << "Create Context failed"; | ||
255 | return false; | 258 | return false; | ||
256 | } | 259 | } | ||
257 | m_context = ctx; | 260 | m_context = ctx; | ||
261 | kwinApp()->platform()->setSceneEglContext(m_context); | ||||
258 | return true; | 262 | return true; | ||
259 | } | 263 | } | ||
260 | 264 | | |||
261 | void AbstractEglBackend::setEglDisplay(const EGLDisplay &display) { | 265 | void AbstractEglBackend::setEglDisplay(const EGLDisplay &display) { | ||
262 | m_display = display; | 266 | m_display = display; | ||
263 | kwinApp()->platform()->setSceneEglDisplay(display); | 267 | kwinApp()->platform()->setSceneEglDisplay(display); | ||
264 | } | 268 | } | ||
265 | 269 | | |||
270 | void AbstractEglBackend::setConfig(const EGLConfig &config) | ||||
271 | { | ||||
272 | m_config = config; | ||||
273 | kwinApp()->platform()->setSceneEglConfig(config); | ||||
274 | } | ||||
275 | | ||||
276 | void AbstractEglBackend::setSurface(const EGLSurface &surface) | ||||
277 | { | ||||
278 | m_surface = surface; | ||||
279 | kwinApp()->platform()->setSceneEglSurface(surface); | ||||
280 | } | ||||
281 | | ||||
266 | AbstractEglTexture::AbstractEglTexture(SceneOpenGL::Texture *texture, AbstractEglBackend *backend) | 282 | AbstractEglTexture::AbstractEglTexture(SceneOpenGL::Texture *texture, AbstractEglBackend *backend) | ||
267 | : SceneOpenGL::TexturePrivate() | 283 | : SceneOpenGL::TexturePrivate() | ||
268 | , q(texture) | 284 | , q(texture) | ||
269 | , m_backend(backend) | 285 | , m_backend(backend) | ||
270 | , m_image(EGL_NO_IMAGE_KHR) | 286 | , m_image(EGL_NO_IMAGE_KHR) | ||
271 | { | 287 | { | ||
272 | m_target = GL_TEXTURE_2D; | 288 | m_target = GL_TEXTURE_2D; | ||
273 | } | 289 | } | ||
▲ Show 20 Lines • Show All 216 Lines • Show Last 20 Lines |