Qt 4.8
Public Functions | Private Functions | Properties | List of all members
QGLLineMaskGenerator Class Reference
Inheritance diagram for QGLLineMaskGenerator:
QGLTrapezoidMaskGenerator QGLMaskGenerator

Public Functions

 QGLLineMaskGenerator (const QPainterPath &path, const QTransform &matrix, qreal width, QGLOffscreen &offscreen, GLuint maskFragmentProgram)
 
- Public Functions inherited from QGLTrapezoidMaskGenerator
void drawMask (const QRect &rect)
 
 QGLTrapezoidMaskGenerator (const QPainterPath &path, const QTransform &matrix, QGLOffscreen &offscreen, GLuint maskFragmentProgram, qreal strokeWidth=-1.0)
 
QRect screenRect ()
 
- Public Functions inherited from QGLMaskGenerator
QTransform matrix () const
 
QPainterPath path () const
 
 QGLMaskGenerator (const QPainterPath &path, const QTransform &matrix, qreal stroke_width=-1)
 
qreal strokeWidth () const
 
virtual ~QGLMaskGenerator ()
 

Private Functions

QRect computeScreenRect ()
 
QVector< QGLTrapezoidgenerateTrapezoids ()
 

Properties

QPainterPath transformedPath
 

Detailed Description

Definition at line 3064 of file qpaintengine_opengl.cpp.

Constructors and Destructors

◆ QGLLineMaskGenerator()

QGLLineMaskGenerator::QGLLineMaskGenerator ( const QPainterPath path,
const QTransform matrix,
qreal  width,
QGLOffscreen offscreen,
GLuint  maskFragmentProgram 
)

Definition at line 3210 of file qpaintengine_opengl.cpp.

3211  : QGLTrapezoidMaskGenerator(path, matrix, offs, program, width)
3212 {
3213 }
QGLTrapezoidMaskGenerator(const QPainterPath &path, const QTransform &matrix, QGLOffscreen &offscreen, GLuint maskFragmentProgram, qreal strokeWidth=-1.0)

Functions

◆ computeScreenRect()

QRect QGLLineMaskGenerator::computeScreenRect ( )
privatevirtual

Implements QGLTrapezoidMaskGenerator.

Definition at line 3222 of file qpaintengine_opengl.cpp.

3223 {
3224  transformedPath = matrix().map(path());
3225 
3226  return transformedPath.controlPointRect().adjusted(-1, -1, 1, 1).toAlignedRect();
3227 }
QRect toAlignedRect() const
Returns a QRect based on the values of this rectangle that is the smallest possible integer rectangle...
Definition: qrect.cpp:2817
QPoint map(const QPoint &p) const
Creates and returns a QPoint object that is a copy of the given point, mapped into the coordinate sys...
QRectF adjusted(qreal x1, qreal y1, qreal x2, qreal y2) const
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
Definition: qrect.h:781
QRectF controlPointRect() const
Returns the rectangle containing all the points and control points in this path.
QTransform matrix() const
QPainterPath path() const

◆ generateTrapezoids()

QVector< QGLTrapezoid > QGLLineMaskGenerator::generateTrapezoids ( )
privatevirtual

Implements QGLTrapezoidMaskGenerator.

Definition at line 3229 of file qpaintengine_opengl.cpp.

3230 {
3231  QOpenGLImmediateModeTessellator tessellator;
3232  QPointF last;
3233  for (int i = 0; i < transformedPath.elementCount(); ++i) {
3235 
3236  Q_ASSERT(!element.isCurveTo());
3237 
3238  if (element.isLineTo())
3239  tessellator.tessellateRect(last, element, strokeWidth());
3240 
3241  last = element;
3242  }
3243 
3244  return tessellator.trapezoids;
3245 }
The QPainterPath::Element class specifies the position and type of a subpath.
Definition: qpainterpath.h:77
The QPointF class defines a point in the plane using floating point precision.
Definition: qpoint.h:214
bool isLineTo() const
Returns true if the element is a line, otherwise returns false.
Definition: qpainterpath.h:84
bool isCurveTo() const
Returns true if the element is a curve, otherwise returns false.
Definition: qpainterpath.h:85
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
const QPainterPath::Element & elementAt(int i) const
Returns the element at the given index in the painter path.
Definition: qpainterpath.h:402
int elementCount() const
Returns the number of path elements in the painter path.
Definition: qpainterpath.h:397
void tessellateRect(const QPointF &a, const QPointF &b, qreal width)

Properties

◆ transformedPath

QPainterPath QGLLineMaskGenerator::transformedPath
private

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