Qt 4.8
Public Functions | Public Variables | List of all members
QOpenGLTrapezoidToArrayTessellator Class Reference
Inheritance diagram for QOpenGLTrapezoidToArrayTessellator:
QOpenGLTessellator QTessellator

Public Functions

void addTrap (const Trapezoid &trap)
 
 QOpenGLTrapezoidToArrayTessellator ()
 
void tessellate (const QPointF *points, int nPoints, bool winding)
 
 ~QOpenGLTrapezoidToArrayTessellator ()
 
- Public Functions inherited from QOpenGLTessellator
 QOpenGLTessellator ()
 
QGLTrapezoid toGLTrapezoid (const Trapezoid &trap)
 
 ~QOpenGLTessellator ()
 
- Public Functions inherited from QTessellator
 QTessellator ()
 
void setWinding (bool w)
 
QRectF tessellate (const QPointF *points, int nPoints)
 
void tessellateConvex (const QPointF *points, int nPoints)
 
void tessellateRect (const QPointF &a, const QPointF &b, qreal width)
 
virtual ~QTessellator ()
 

Public Variables

int allocated
 
QRectF bounds
 
int size
 
GLfloat * vertices
 

Detailed Description

Definition at line 1789 of file qpaintengine_opengl.cpp.

Constructors and Destructors

◆ QOpenGLTrapezoidToArrayTessellator()

QOpenGLTrapezoidToArrayTessellator::QOpenGLTrapezoidToArrayTessellator ( )
inline

◆ ~QOpenGLTrapezoidToArrayTessellator()

QOpenGLTrapezoidToArrayTessellator::~QOpenGLTrapezoidToArrayTessellator ( )
inline

Definition at line 1793 of file qpaintengine_opengl.cpp.

Functions

◆ addTrap()

void QOpenGLTrapezoidToArrayTessellator::addTrap ( const Trapezoid trap)
virtual

Implements QTessellator.

Definition at line 1806 of file qpaintengine_opengl.cpp.

1807 {
1808  // On OpenGL ES we convert the trap to 2 triangles
1809 #ifndef QT_OPENGL_ES
1810  if (size > allocated - 8) {
1811 #else
1812  if (size > allocated - 12) {
1813 #endif
1814  allocated = qMax(2*allocated, 512);
1815  vertices = (GLfloat *)realloc(vertices, allocated * sizeof(GLfloat));
1816  }
1817 
1818  QGLTrapezoid t = toGLTrapezoid(trap);
1819 
1820 #ifndef QT_OPENGL_ES
1821  vertices[size++] = t.topLeftX;
1822  vertices[size++] = t.top;
1823  vertices[size++] = t.topRightX;
1824  vertices[size++] = t.top;
1825  vertices[size++] = t.bottomRightX;
1826  vertices[size++] = t.bottom;
1827  vertices[size++] = t.bottomLeftX;
1828  vertices[size++] = t.bottom;
1829 #else
1830  // First triangle
1831  vertices[size++] = t.topLeftX;
1832  vertices[size++] = t.top;
1833  vertices[size++] = t.topRightX;
1834  vertices[size++] = t.top;
1835  vertices[size++] = t.bottomRightX;
1836  vertices[size++] = t.bottom;
1837 
1838  // Second triangle
1839  vertices[size++] = t.bottomLeftX;
1840  vertices[size++] = t.bottom;
1841  vertices[size++] = t.topLeftX;
1842  vertices[size++] = t.top;
1843  vertices[size++] = t.bottomRightX;
1844  vertices[size++] = t.bottom;
1845 #endif
1846 }
QGLTrapezoid toGLTrapezoid(const Trapezoid &trap)
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217

◆ tessellate()

void QOpenGLTrapezoidToArrayTessellator::tessellate ( const QPointF points,
int  nPoints,
bool  winding 
)
inline

Definition at line 1799 of file qpaintengine_opengl.cpp.

Referenced by QOpenGLPaintEnginePrivate::fillPolygon_dev().

1799  {
1800  size = 0;
1801  setWinding(winding);
1802  bounds = QTessellator::tessellate(points, nPoints);
1803  }
QRectF tessellate(const QPointF *points, int nPoints)
void setWinding(bool w)

Properties

◆ allocated

int QOpenGLTrapezoidToArrayTessellator::allocated

Definition at line 1795 of file qpaintengine_opengl.cpp.

◆ bounds

QRectF QOpenGLTrapezoidToArrayTessellator::bounds

◆ size

int QOpenGLTrapezoidToArrayTessellator::size

◆ vertices

GLfloat* QOpenGLTrapezoidToArrayTessellator::vertices

The documentation for this class was generated from the following file: