summaryrefslogtreecommitdiffstats
path: root/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-01-13 18:55:05 (GMT)
committerThiago Macieira <thiago.macieira@nokia.com>2010-01-13 18:55:05 (GMT)
commit7d1e48639d6d3897e66779f22fe02d17d6c38707 (patch)
tree7abc16568274e1f54c976f890e92d73f7a00160c /src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
parent20e0e7a849d70139f9106f60c78fd0c736ec3c4b (diff)
parente1b03bac22f87edbbe78eba366966259be6eb0ed (diff)
downloadQt-7d1e48639d6d3897e66779f22fe02d17d6c38707.zip
Qt-7d1e48639d6d3897e66779f22fe02d17d6c38707.tar.gz
Qt-7d1e48639d6d3897e66779f22fe02d17d6c38707.tar.bz2
Merge branch '4.6'
Conflicts: bin/syncqt doc/src/deployment/deployment.qdoc src/corelib/io/qfsfileengine_win.cpp src/corelib/xml/qxmlstream.cpp src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h tools/assistant/tools/assistant/centralwidget.cpp tools/linguist/lupdate/main.cpp
Diffstat (limited to 'src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h')
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
index f3cba17..e3d0bfc 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
@@ -196,6 +196,9 @@ public:
void drawPixmaps(const QDrawPixmaps::Data *drawingData, int dataCount, const QPixmap &pixmap, QDrawPixmaps::DrawingHints hints);
void drawCachedGlyphs(const QPointF &p, QFontEngineGlyphCache::Type glyphType, const QTextItemInt &ti);
+ // Calls glVertexAttributePointer if the pointer has changed
+ inline void setVertexAttributePointer(unsigned int arrayIndex, const GLfloat *pointer);
+
// draws whatever is in the vertex array:
void drawVertexArrays(const float *data, int *stops, int stopCount, GLenum primitive);
void drawVertexArrays(QGL2PEXVertexArray &vertexArray, GLenum primitive) {
@@ -230,6 +233,7 @@ public:
void regenerateClip();
void systemStateChanged();
+
static QGLEngineShaderManager* shaderManagerForEngine(QGL2PaintEngineEx *engine) { return engine->d_func()->shaderManager; }
static QGL2PaintEngineExPrivate *getData(QGL2PaintEngineEx *engine) { return engine->d_func(); }
static void cleanupVectorPath(QPaintEngineEx *engine, void *data);
@@ -292,8 +296,24 @@ public:
QSet<QVectorPath::CacheEntry *> pathCaches;
QVector<GLuint> unusedVBOSToClean;
QVector<GLuint> unusedIBOSToClean;
+
+ const GLfloat *vertexAttribPointers[3];
};
+
+void QGL2PaintEngineExPrivate::setVertexAttributePointer(unsigned int arrayIndex, const GLfloat *pointer)
+{
+ Q_ASSERT(arrayIndex < 3);
+ if (pointer == vertexAttribPointers[arrayIndex])
+ return;
+
+ vertexAttribPointers[arrayIndex] = pointer;
+ if (arrayIndex == QT_OPACITY_ATTR)
+ glVertexAttribPointer(arrayIndex, 1, GL_FLOAT, GL_FALSE, 0, pointer);
+ else
+ glVertexAttribPointer(arrayIndex, 2, GL_FLOAT, GL_FALSE, 0, pointer);
+}
+
QT_END_NAMESPACE
#endif