diff options
author | Andreas Kling <andreas.kling@nokia.com> | 2010-01-20 08:34:08 (GMT) |
---|---|---|
committer | Andreas Kling <andreas.kling@nokia.com> | 2010-01-20 08:34:08 (GMT) |
commit | 01f733a64e45363e74bea62e4cae8a658bc09383 (patch) | |
tree | ea39b38552a063e7e10bd432b1155a7abae61620 /src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h | |
parent | fdf463ba74b2e00ba5f9db10f43585e8b15054f7 (diff) | |
parent | b906feddf1593a837785bc41d65e837e64d31284 (diff) | |
download | Qt-01f733a64e45363e74bea62e4cae8a658bc09383.zip Qt-01f733a64e45363e74bea62e4cae8a658bc09383.tar.gz Qt-01f733a64e45363e74bea62e4cae8a658bc09383.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.6
Diffstat (limited to 'src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h')
-rw-r--r-- | src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h index 37bae6f..ce1b538 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h @@ -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); @@ -291,8 +295,24 @@ public: QSet<QVectorPath::CacheEntry *> pathCaches; QVector<GLuint> unusedVBOSToClean; + + 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 |