~ci-train-bot/qtubuntu/qtubuntu-ubuntu-yakkety-landing-059

« back to all changes in this revision

Viewing changes to src/ubuntumirclient/glcontext.cpp

  • Committer: CI Train Bot
  • Author(s): Albert Astals Cid
  • Date: 2016-05-27 13:05:08 UTC
  • mfrom: (316.1.2 qtubuntu)
  • Revision ID: ci-train-bot@canonical.com-20160527130508-qutw388m0ooz8u32
Enable workaround_brokenFBOReadBack on the Mali 400

Gives for impressive improvements in QSGDefaultDistanceFieldGlyphCache::storeGlyphs
impressive = 788ms -> 6ms
Approved by: Gerry Boland, Unity8 CI Bot

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
#include <QOpenGLFramebufferObject>
23
23
#include <QtPlatformSupport/private/qeglconvenience_p.h>
 
24
#include <QtGui/private/qopenglcontext_p.h>
24
25
 
25
26
namespace {
26
27
 
173
174
    ASSERT(eglDestroyContext(mEglDisplay, mEglContext) == EGL_TRUE);
174
175
}
175
176
 
 
177
static bool needsFBOReadBackWorkaround()
 
178
{
 
179
    static bool set = false;
 
180
    static bool needsWorkaround = false;
 
181
 
 
182
    if (!set) {
 
183
        const char *rendererString = reinterpret_cast<const char *>(glGetString(GL_RENDERER));
 
184
        needsWorkaround = qstrncmp(rendererString, "Mali-400", 8) == 0;
 
185
        set = true;
 
186
    }
 
187
 
 
188
    return needsWorkaround;
 
189
}
 
190
 
176
191
bool UbuntuOpenGLContext::makeCurrent(QPlatformSurface* surface)
177
192
{
178
193
    Q_ASSERT(surface->surface()->surfaceType() == QSurface::OpenGLSurface);
195
210
            return false;
196
211
        }
197
212
 
 
213
        QOpenGLContextPrivate *ctx_d = QOpenGLContextPrivate::get(context());
 
214
        if (!ctx_d->workaround_brokenFBOReadBack && needsFBOReadBackWorkaround()) {
 
215
            ctx_d->workaround_brokenFBOReadBack = true;
 
216
        }
 
217
 
198
218
        if (ubuntumirclient().isDebugEnabled()) {
199
219
            printOpenGLESConfig();
200
220
        }