Commit 33ed3d0bacddce214a43be60eb6481903e753a88

  • avatar
  • Gunnar Sletta <gunnar @trol…ech.com>
  • Tue Oct 13 10:23:54 CEST 2009
Work around broken ATI X1600 drivers on Mac OS X

The GLSL implementation messes up return values from functions so that
all our srcPixel()'s become black and several matrices are off. We
don't want to rewrite the shader code to fit an "ancient" graphics
card, so we simply fall back to the GL 1 engine.

Reviewed-by: Trond
  
150150class QGLEngineSelector
151151{
152152public:
153 QGLEngineSelector() : engineType(QPaintEngine::MaxUser) { }
153 QGLEngineSelector() : engineType(QPaintEngine::MaxUser)
154 {
155#ifdef Q_WS_MAC
156 // The ATI X1600 driver for Mac OS X does not support return
157 // values from functions in GLSL. Since working around this in
158 // the GL2 engine would require a big, ugly rewrite, we're
159 // falling back to the GL 1 engine..
160 QGLWidget *tmp = 0;
161 if (!QGLContext::currentContext()) {
162 tmp = new QGLWidget();
163 tmp->makeCurrent();
164 }
165 if (strstr((char *) glGetString(GL_RENDERER), "X1600"))
166 setPreferredPaintEngine(QPaintEngine::OpenGL);
167 if (tmp)
168 delete tmp;
169#endif
170
171 }
154172
155173 void setPreferredPaintEngine(QPaintEngine::Type type) {
156174 if (type == QPaintEngine::OpenGL || type == QPaintEngine::OpenGL2)