From f34cfa14ff6b0928f98143f72e1f512eceabe27c Mon Sep 17 00:00:00 2001 From: Rhys Weatherley Date: Mon, 7 Dec 2009 09:38:24 +1000 Subject: Replace glColor4ub() calls with glColor4f() Intel Q45/Q43 Express Chipset has problems with glColor4ub() not updating GL_CURRENT_COLOR correctly. Replace all references with calls to glColor4f() instead as it is more likely to be implemented correctly on all chipsets. Task-number: QTBUG-6217 Reviewed-by: Sarah Smith --- src/opengl/qgl.cpp | 2 +- src/opengl/qpaintengine_opengl.cpp | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp index 18c70f3..b011637 100644 --- a/src/opengl/qgl.cpp +++ b/src/opengl/qgl.cpp @@ -3530,7 +3530,7 @@ void QGLWidget::qglColor(const QColor& c) const const QGLContext *ctx = QGLContext::currentContext(); if (ctx) { if (ctx->format().rgba()) - glColor4ub(c.red(), c.green(), c.blue(), c.alpha()); + glColor4f(c.redF(), c.greenF(), c.blueF(), c.alphaF()); else if (!d->cmap.isEmpty()) { // QGLColormap in use? int i = d->cmap.find(c.rgb()); if (i < 0) diff --git a/src/opengl/qpaintengine_opengl.cpp b/src/opengl/qpaintengine_opengl.cpp index e7251e8..4823408 100644 --- a/src/opengl/qpaintengine_opengl.cpp +++ b/src/opengl/qpaintengine_opengl.cpp @@ -113,11 +113,7 @@ static bool DEBUG_TEMP_FLAG; static inline void qt_glColor4ubv(unsigned char *col) { -#ifdef QT_OPENGL_ES - glColor4f(col[0]/255.0, col[1]/255.0, col[2]/255.0, col[3]/255.0); -#else - glColor4ubv(col); -#endif + glColor4f(col[0]/255.0f, col[1]/255.0f, col[2]/255.0f, col[3]/255.0f); } struct QT_PointF { -- cgit v0.12