Commit 4938dc418e0c7abe3443aedb6aee3ff583893da7

Remove OpenGL/ES 1.0 support.
  
265265#if defined(QT_OPENGL_ES_2)
266266#define QGL_NO_MATRIX_FETCH 1
267267#define QGL_NO_MATRIX_RESET 1
268#elif defined(GL_OES_VERSION_1_0) && !defined(GL_OES_VERSION_1_1)
269#define QGL_NO_MATRIX_FETCH 1
270#define QGL_MATRIX_RESET_TO_IDENTITY 1
271268#endif
272269
273270#ifndef QGL_NO_MATRIX_FETCH
320320#endif
321321
322322// OpenGL/ES 2.0 does not have server-side matrices.
323// OpenGL/ES 1.0 cannot fetch the server-side matrices.
324// For these platforms, we stub out the checks and just hope that they work.
323// For such platforms, we stub out the checks and just hope that they work.
325324static void clearGLMatrix(GLenum) {}
326325static bool checkGLMatrix(GLenum, const QMatrix4x4&) { return true; }
327326static void setGLMatrix(GLenum, const QMatrix4x4&) {}
364364 // Read back the explicitly set value from the GL server.
365365#if defined(QGL_NO_MATRIX_RESET) // OpenGL/ES 2.0
366366 QVERIFY(qFuzzyCompare(m, painter.projectionMatrix().top()));
367#elif defined(QGL_MATRIX_RESET_TO_IDENTITY) // OpenGL/ES 1.0
368 QVERIFY(qFuzzyCompare(QMatrix4x4(), painter.projectionMatrix().top()));
369367#else
370368 QVERIFY(qFuzzyCompare(m2, painter.projectionMatrix().top()));
371369#endif
410410 // Read back the explicitly set value from the GL server.
411411#if defined(QGL_NO_MATRIX_RESET) // OpenGL/ES 2.0
412412 QVERIFY(qFuzzyCompare(m, painter.modelViewMatrix().top()));
413#elif defined(QGL_MATRIX_RESET_TO_IDENTITY) // OpenGL/ES 1.0
414 QVERIFY(qFuzzyCompare(QMatrix4x4(), painter.modelViewMatrix().top()));
415413#else
416414 QVERIFY(qFuzzyCompare(m2, painter.modelViewMatrix().top()));
417415#endif
  
131131 QMatrix4x4 matrix;
132132#if !defined(QT_OPENGL_ES_2)
133133 GLenum glType;
134#if !defined(GL_OES_VERSION_1_0) || defined(GL_OES_VERSION_1_1)
135134 GLenum glFetchType;
136#endif
137135 QList<bool> serverStack;
138136#endif
139137 QList<QMatrix4x4> stack;
142142QGLMatrixStackPrivate::QGLMatrixStackPrivate(QGLMatrixStack::Type t)
143143{
144144 type = t;
145#if defined(GL_OES_VERSION_1_0) && !defined(GL_OES_VERSION_1_1)
145#if !defined(QT_OPENGL_ES_2)
146146 switch (t) {
147147 case QGLMatrixStack::ModelViewMatrix:
148148 glType = GL_MODELVIEW;
149 haveMatrix = false;
150 break;
151 case QGLMatrixStack::ProjectionMatrix:
152 glType = GL_PROJECTION;
153 haveMatrix = false;
154 break;
155 default:
156 glType = 0;
157 haveMatrix = true; // We always have a user-defined matrix.
158 break;
159 }
160 haveMatrix = (t == QGLMatrixStack::UserMatrix);
161#elif !defined(QT_OPENGL_ES_2)
162 switch (t) {
163 case QGLMatrixStack::ModelViewMatrix:
164 glType = GL_MODELVIEW;
165149 glFetchType = GL_MODELVIEW_MATRIX;
166150 haveMatrix = false;
167151 break;
310310 avoided by calling operator=() or setToIdentity() to set the GL server's
311311 matrix to a known value.
312312
313 Note: OpenGL/ES 1.0 does not have a mechanism to fetch the
314 current matrix. On that platform, this function will forcibly set
315 the matrix to the identity if it has not been set previously
316 with operator=() or setToIdentity().
317
318313 Matrix stacks of type UserMatrix never need to perform a round-trip
319314 to the GL server because they are implemented purely client-side.
320315
322322 // We need to retrieve the current matrix from the GL server
323323 // because we have no way to know what state it is currently in.
324324 d->haveMatrix = true;
325#if defined(GL_OES_VERSION_1_0) && !defined(GL_OES_VERSION_1_1)
326 // OpenGL/ES 1.0 does not have glGetFloatv, so we forcibly
327 // set the matrix to the identity so that it is in a known state.
328 glMatrixMode(d->glType);
329 glLoadIdentity();
330 d->matrix.setToIdentity();
331#else
332325 if (sizeof(qreal) == sizeof(GLfloat)) {
333326 glGetFloatv(d->glFetchType, reinterpret_cast<GLfloat *>
334327 (d->matrix.data()));
334334 m[index] = mat[index];
335335 d->matrix.optimize();
336336 }
337#endif
338337 }
339338#endif
340339 return d->matrix;
  
635635 to the GL server to get the scissor rectangle. This round-trip
636636 can be avoided by calling setScissorRect() before scissorRect().
637637
638 Note: OpenGL/ES 1.0 does not have a mechanism to fetch the
639 scissor rectangle. On that platform, this function will forcibly
640 disable scissoring if it has not been set previously with
641 setScissorRect().
642
643638 \sa setScissorRect(), resetScissorRect()
644639*/
645640QRect QGLPainter::scissorRect() const
642642 Q_D(QGLPainter);
643643 QGLPAINTER_CHECK_PRIVATE_RETURN(QRect(0, 0, 0, 0));
644644 if (d->scissorRect.isNull()) {
645#if !defined(GL_OES_VERSION_1_0) || defined(GL_OES_VERSION_1_1)
646645 if (glIsEnabled(GL_SCISSOR_TEST)) {
647646 GLint scissor[4];
648647 glGetIntegerv(GL_SCISSOR_BOX, scissor);
650650 } else {
651651 d->scissorRect = QRect(0, 0, 0, 0);
652652 }
653#else
654 // OpenGL/ES 1.0 does not have glIsEnabled() or GL_SCISSOR_BOX,
655 // so force the scissor setting to a known state.
656 d->scissorRect = QRect(0, 0, 0, 0);
657 glDisable(GL_SCISSOR_TEST);
658#endif
659653 }
660654 return d->scissorRect;
661655}
  
103103
104104typedef void (APIENTRY *q_glVertexAttribPointer) (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *);
105105
106// We can call the buffer functions directly in OpenGL/ES 1.1 or higher,
106// We can call the buffer functions directly in OpenGL/ES,
107107// but all other platforms need to resolve the extensions.
108#if defined(QT_OPENGL_ES)
109#if defined(GL_OES_VERSION_1_0) && !defined(GL_OES_VERSION_1_1)
110#define QGL_RESOLVE_BUFFER_FUNCS 1
111#endif
112#else
108#if !defined(QT_OPENGL_ES)
113109#define QGL_RESOLVE_BUFFER_FUNCS 1
114110#endif
115111