~untrusted-ci-dev-bot/qtmir/qtmir-ubuntu-xenial-landing-002

« back to all changes in this revision

Viewing changes to src/platforms/mirserver/miropenglcontext.cpp

  • Committer: CI Train Bot
  • Author(s): Alberto Aguirre
  • Date: 2016-03-10 09:29:36 UTC
  • mfrom: (438.4.1 devel)
  • Revision ID: ci-train-bot@canonical.com-20160310092936-jdns9d3nu5y2ax0e
Hook MirOpenGLContext::doneCurrent to Screen::doneCurrent

Actually unbind the opengl/egl context when requested.
Approved by: Gerry Boland

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
// (i.e. individual display output buffers) to use as a common base context.
37
37
 
38
38
MirOpenGLContext::MirOpenGLContext(const QSharedPointer<MirServer> &server, const QSurfaceFormat &format)
 
39
    : m_currentWindow(nullptr)
39
40
#ifndef QT_NO_DEBUG
40
 
    : m_logger(new QOpenGLDebugLogger(this))
 
41
      , m_logger(new QOpenGLDebugLogger(this))
41
42
#endif
42
43
{
43
44
    auto display = server->the_display();
131
132
    // ultimately calls Mir's DisplayBuffer::make_current()
132
133
    ScreenWindow *screenWindow = static_cast<ScreenWindow*>(surface);
133
134
    if (screenWindow) {
 
135
        m_currentWindow = screenWindow;
134
136
        screenWindow->makeCurrent();
135
137
 
136
138
#ifndef QT_NO_DEBUG
148
150
 
149
151
void MirOpenGLContext::doneCurrent()
150
152
{
151
 
    // FIXME: create a temporary GL context just to release? Would be better to get existing one.
 
153
    if (m_currentWindow) {
 
154
        m_currentWindow->doneCurrent();
 
155
        m_currentWindow = nullptr;
 
156
    }
152
157
}
153
158
 
154
159
QFunctionPointer MirOpenGLContext::getProcAddress(const QByteArray &procName)