diff options
Diffstat (limited to 'src/opengl/gl2paintengineex')
-rw-r--r-- | src/opengl/gl2paintengineex/qglengineshadermanager_p.h | 2 | ||||
-rw-r--r-- | src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 10 | ||||
-rw-r--r-- | src/opengl/gl2paintengineex/qtriangulator.cpp | 21 |
3 files changed, 11 insertions, 22 deletions
diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h index e5ababf..d24f302 100644 --- a/src/opengl/gl2paintengineex/qglengineshadermanager_p.h +++ b/src/opengl/gl2paintengineex/qglengineshadermanager_p.h @@ -455,7 +455,7 @@ public: AttributeOpacity }; - // There are optimisations we can do, depending on the brush transform: + // There are optimizations we can do, depending on the brush transform: // 1) May not have to apply perspective-correction // 2) Can use lower precision for matrix void optimiseForBrushTransform(QTransform::TransformationType transformType); diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 025731d..14c26b9 100644 --- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp +++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp @@ -102,7 +102,7 @@ extern Q_GUI_EXPORT bool qt_cleartype_enabled; extern bool qt_applefontsmoothing_enabled; #endif -extern QImage qt_imageForBrush(int brushStyle, bool invert); +Q_DECL_IMPORT extern QImage qt_imageForBrush(int brushStyle, bool invert); ////////////////////////////////// Private Methods ////////////////////////////////////////// @@ -825,7 +825,7 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) glBindBuffer(GL_ARRAY_BUFFER, cache->vbo); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, cache->ibo); - if (glSupportsElementIndexUint) + if (QGLExtensions::glExtensions() & QGLExtensions::ElementIndexUint) glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(quint32) * polys.indices.size(), polys.indices.data(), GL_STATIC_DRAW); else glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(quint16) * polys.indices.size(), polys.indices.data(), GL_STATIC_DRAW); @@ -836,7 +836,7 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) glBufferData(GL_ARRAY_BUFFER, sizeof(float) * vertices.size(), vertices.data(), GL_STATIC_DRAW); #else cache->vertices = (float *) qMalloc(sizeof(float) * polys.vertices.size()); - if (glSupportsElementIndexUint) { + if (QGLExtensions::glExtensions() & QGLExtensions::ElementIndexUint) { cache->indices = (quint32 *) qMalloc(sizeof(quint32) * polys.indices.size()); memcpy(cache->indices, polys.indices.data(), sizeof(quint32) * polys.indices.size()); } else { @@ -853,7 +853,7 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) glBindBuffer(GL_ARRAY_BUFFER, cache->vbo); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, cache->ibo); setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, 0); - if (glSupportsElementIndexUint) + if (QGLExtensions::glExtensions() & QGLExtensions::ElementIndexUint) glDrawElements(cache->primitiveType, cache->indexCount, GL_UNSIGNED_INT, 0); else glDrawElements(cache->primitiveType, cache->indexCount, GL_UNSIGNED_SHORT, 0); @@ -861,7 +861,7 @@ void QGL2PaintEngineExPrivate::fill(const QVectorPath& path) glBindBuffer(GL_ARRAY_BUFFER, 0); #else setVertexAttributePointer(QT_VERTEX_COORDS_ATTR, cache->vertices); - if (glSupportsElementIndexUint) + if (QGLExtensions::glExtensions() & QGLExtensions::ElementIndexUint) glDrawElements(cache->primitiveType, cache->indexCount, GL_UNSIGNED_INT, (qint32 *)cache->indices); else glDrawElements(cache->primitiveType, cache->indexCount, GL_UNSIGNED_SHORT, (qint16 *)cache->indices); diff --git a/src/opengl/gl2paintengineex/qtriangulator.cpp b/src/opengl/gl2paintengineex/qtriangulator.cpp index b839b00..85f604a 100644 --- a/src/opengl/gl2paintengineex/qtriangulator.cpp +++ b/src/opengl/gl2paintengineex/qtriangulator.cpp @@ -58,7 +58,6 @@ #include <math.h> #include <private/qgl_p.h> -#include <private/qglextensions_p.h> QT_BEGIN_NAMESPACE @@ -3014,10 +3013,8 @@ void QTriangulator<T>::MonotoneToTriangles::decompose() QTriangleSet qTriangulate(const qreal *polygon, int count, uint hint, const QTransform &matrix) { - QGLContext *ctx = 0; // Not really used but needs to be introduced for glSupportsElementIndexUint - QTriangleSet triangleSet; - if (glSupportsElementIndexUint) { + if (QGLExtensions::glExtensions() & QGLExtensions::ElementIndexUint) { QTriangulator<quint32> triangulator; triangulator.initialize(polygon, count, hint, matrix); QVertexSet<quint32> vertexSet = triangulator.triangulate(); @@ -3037,10 +3034,8 @@ QTriangleSet qTriangulate(const qreal *polygon, QTriangleSet qTriangulate(const QVectorPath &path, const QTransform &matrix, qreal lod) { - QGLContext *ctx = 0; // Not really used but needs to be introduced for glSupportsElementIndexUint - QTriangleSet triangleSet; - if (glSupportsElementIndexUint) { + if (QGLExtensions::glExtensions() & QGLExtensions::ElementIndexUint) { QTriangulator<quint32> triangulator; triangulator.initialize(path, matrix, lod); QVertexSet<quint32> vertexSet = triangulator.triangulate(); @@ -3059,10 +3054,8 @@ QTriangleSet qTriangulate(const QVectorPath &path, QTriangleSet qTriangulate(const QPainterPath &path, const QTransform &matrix, qreal lod) { - QGLContext *ctx = 0; // Not really used but needs to be introduced for glSupportsElementIndexUint - QTriangleSet triangleSet; - if (glSupportsElementIndexUint) { + if (QGLExtensions::glExtensions() & QGLExtensions::ElementIndexUint) { QTriangulator<quint32> triangulator; triangulator.initialize(path, matrix, lod); QVertexSet<quint32> vertexSet = triangulator.triangulate(); @@ -3081,10 +3074,8 @@ QTriangleSet qTriangulate(const QPainterPath &path, QPolylineSet qPolyline(const QVectorPath &path, const QTransform &matrix, qreal lod) { - QGLContext *ctx = 0; // Not really used but needs to be introduced for glSupportsElementIndexUint - QPolylineSet polyLineSet; - if (glSupportsElementIndexUint) { + if (QGLExtensions::glExtensions() & QGLExtensions::ElementIndexUint) { QTriangulator<quint32> triangulator; triangulator.initialize(path, matrix, lod); QVertexSet<quint32> vertexSet = triangulator.polyline(); @@ -3103,10 +3094,8 @@ QPolylineSet qPolyline(const QVectorPath &path, QPolylineSet qPolyline(const QPainterPath &path, const QTransform &matrix, qreal lod) { - QGLContext *ctx = 0; // Not really used but needs to be introduced for glSupportsElementIndexUint - QPolylineSet polyLineSet; - if (glSupportsElementIndexUint) { + if (QGLExtensions::glExtensions() & QGLExtensions::ElementIndexUint) { QTriangulator<quint32> triangulator; triangulator.initialize(path, matrix, lod); QVertexSet<quint32> vertexSet = triangulator.polyline(); |