Move QTriangulator and QTriangulatingStroker classes to painting

Previously the private APIs for QTriangulator and QTriangulatingStroker
were located in src/gui/opengl because they were used by the OpenGL
paint engine.  These API's are not actually specific to OpenGL however,
and were not being built when QT_NO_OPENGL was defined.  It makes more
sense for these classes to belong in the painting subgroup.

Aside from the OpenGL paint engine, these private APIs are used by
QtLocation to triangulate polylines to be rendered by QtQuick.

Change-Id: Idb4d1e5b2a51394d4c6bcdf9ab1ece99de23d4de
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
bb10
Andy Nichols 2016-08-12 10:16:46 +02:00
parent 131eee5cd7
commit ff57203b57
7 changed files with 13 additions and 8 deletions

View File

@ -22,12 +22,9 @@ contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles2) {
opengl/qopenglpaintengine_p.h \
opengl/qopenglengineshadersource_p.h \
opengl/qopenglcustomshaderstage_p.h \
opengl/qtriangulatingstroker_p.h \
opengl/qopengltextureglyphcache_p.h \
opengl/qopenglshadercache_p.h \
opengl/qopenglshadercache_meego_p.h \
opengl/qtriangulator_p.h \
opengl/qrbtree_p.h \
opengl/qopenglversionfunctions.h \
opengl/qopenglversionfunctionsfactory_p.h \
opengl/qopenglvertexarrayobject.h \
@ -51,9 +48,7 @@ contains(QT_CONFIG, opengl)|contains(QT_CONFIG, opengles2) {
opengl/qopengl2pexvertexarray.cpp \
opengl/qopenglpaintengine.cpp \
opengl/qopenglcustomshaderstage.cpp \
opengl/qtriangulatingstroker.cpp \
opengl/qopengltextureglyphcache.cpp \
opengl/qtriangulator.cpp \
opengl/qopenglversionfunctions.cpp \
opengl/qopenglversionfunctionsfactory.cpp \
opengl/qopenglvertexarrayobject.cpp \

View File

@ -42,6 +42,7 @@ HEADERS += \
painting/qpolygonclipper_p.h \
painting/qrasterdefs_p.h \
painting/qrasterizer_p.h \
painting/qrbtree_p.h \
painting/qregion.h \
painting/qrgb.h \
painting/qrgba64.h \
@ -49,6 +50,8 @@ HEADERS += \
painting/qstroker_p.h \
painting/qtextureglyphcache_p.h \
painting/qtransform.h \
painting/qtriangulatingstroker_p.h \
painting/qtriangulator_p.h \
painting/qplatformbackingstore.h \
painting/qpathsimplifier_p.h
@ -92,6 +95,8 @@ SOURCES += \
painting/qstroker.cpp \
painting/qtextureglyphcache.cpp \
painting/qtransform.cpp \
painting/qtriangulatingstroker.cpp \
painting/qtriangulator.cpp \
painting/qplatformbackingstore.cpp \
painting/qpathsimplifier.cpp

View File

@ -50,9 +50,10 @@
#include <QtCore/qglobal.h>
#include <QtCore/qpoint.h>
#include <QtCore/qalgorithms.h>
#include <private/qopenglcontext_p.h>
#include <private/qopenglextensions_p.h>
#ifndef QT_NO_OPENGL
# include <private/qopenglcontext_p.h>
# include <private/qopenglextensions_p.h>
#endif
#include <private/qrbtree_p.h>
QT_BEGIN_NAMESPACE
@ -2267,10 +2268,14 @@ void QTriangulator<T>::MonotoneToTriangles::decompose()
static bool hasElementIndexUint()
{
#ifndef QT_NO_OPENGL
QOpenGLContext *context = QOpenGLContext::currentContext();
if (!context)
return false;
return static_cast<QOpenGLExtensions *>(context->functions())->hasOpenGLExtension(QOpenGLExtensions::ElementIndexUint);
#else
return false;
#endif
}
Q_GUI_EXPORT QTriangleSet qTriangulate(const qreal *polygon,