summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2016-01-20 15:50:55 +0100
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2016-01-21 09:16:26 +0000
commit7edd488a5f1d5ac2e21ce08177a0d733185e38df (patch)
treea99b09bbb6436b3eb67e2fd3f902afe8b4c40716 /src/plugins/platforms
parent205987750d51a446118f50b9ed583d40a565f445 (diff)
eglfs: Detect llvmpipe and show a warning
Do ourselves and our users a favor by pointing out why Qt (Quick) apps perform horribly on commonly used distros on the RPi. Using a software rasterizer on such boards is not going to cut it. Task-number: QTBUG-50533 Change-Id: I087f502ddb9c6bdde84343e6abd85c87cdc474f0 Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/eglfs/qeglfscontext.cpp10
-rw-r--r--src/plugins/platforms/eglfs/qeglfscontext.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/src/plugins/platforms/eglfs/qeglfscontext.cpp b/src/plugins/platforms/eglfs/qeglfscontext.cpp
index 6fcdae7ad2..db35338423 100644
--- a/src/plugins/platforms/eglfs/qeglfscontext.cpp
+++ b/src/plugins/platforms/eglfs/qeglfscontext.cpp
@@ -85,6 +85,16 @@ void QEglFSContext::destroyTemporaryOffscreenSurface(EGLSurface surface)
}
}
+void QEglFSContext::runGLChecks()
+{
+ // Note that even though there is an EGL context current here,
+ // QOpenGLContext and QOpenGLFunctions are not yet usable at this stage.
+ const char *renderer = reinterpret_cast<const char *>(glGetString(GL_RENDERER));
+ // Be nice and warn about a common source of confusion.
+ if (renderer && strstr(renderer, "llvmpipe"))
+ qWarning("Running on a software rasterizer (LLVMpipe), expect limited performance.");
+}
+
void QEglFSContext::swapBuffers(QPlatformSurface *surface)
{
// draw the cursor
diff --git a/src/plugins/platforms/eglfs/qeglfscontext.h b/src/plugins/platforms/eglfs/qeglfscontext.h
index 612960dc24..906d11b3d1 100644
--- a/src/plugins/platforms/eglfs/qeglfscontext.h
+++ b/src/plugins/platforms/eglfs/qeglfscontext.h
@@ -48,6 +48,7 @@ public:
EGLSurface eglSurfaceForPlatformSurface(QPlatformSurface *surface) Q_DECL_OVERRIDE;
EGLSurface createTemporaryOffscreenSurface() Q_DECL_OVERRIDE;
void destroyTemporaryOffscreenSurface(EGLSurface surface) Q_DECL_OVERRIDE;
+ void runGLChecks() Q_DECL_OVERRIDE;
void swapBuffers(QPlatformSurface *surface) Q_DECL_OVERRIDE;
private: