Ticket #46496: Add-workaround-for-GL-on-Android-emulator.patch

File Add-workaround-for-GL-on-Android-emulator.patch, 1.5 KB (added by RJVB (René Bertin), 10 years ago)

from Ubuntu

  • qtbase/src/gui/kernel/qopenglcontext.cpp

    From cbf649ff92e7d3416cb9d03609648f96efdf76dd Mon Sep 17 00:00:00 2001
    From: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
    Date: Mon, 17 Mar 2014 19:43:41 -0300
    Subject: [PATCH] Add workaround for GL on Android emulator
    
    On the Android Emulator, the shaders will be compiled by a desktop
    GL driver, since the GL driver in the emulator is just a thin
    wrapper. The GL driver does not necessarily support the precision
    qualifiers, which can cause applications to break. We detect this
    at runtime in the platform plugin and set a workaround flag to
    
    Upstream (9eeb1bd) just enabled the workaround when the android
    backend is used, which is not true in our case (traditional desktop).
    As a consequence, we also need a similar check in order to have
    a functional Ubuntu Touch emulator.
    
    Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
    ---
     src/gui/kernel/qopenglcontext.cpp | 5 +++++
     1 file changed, 5 insertions(+)
    
     
    815815
    816816        d->shareGroup->d_func()->deletePendingResources(this);
    817817
     818        const char *rendererString = reinterpret_cast<const char *>(glGetString(GL_RENDERER));
     819        if (rendererString != 0 && qstrncmp(rendererString, "Android Emulator", 16) == 0) {
     820            QOpenGLContextPrivate *ctx_d = QOpenGLContextPrivate::get(this);
     821            ctx_d->workaround_missingPrecisionQualifiers = true;
     822        }
    818823#ifndef QT_NO_DEBUG
    819824        QOpenGLContextPrivate::toggleMakeCurrentTracker(this, true);
    820825#endif