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

Public Functions

void addTrap (const Trapezoid &trap)
 
void done ()
 
 QXRenderTessellator ()
 
QRect tessellate (const QPointF *points, int nPoints, bool winding)
 
 ~QXRenderTessellator ()
 
- 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
 
int size
 
XTrapezoid * traps
 

Detailed Description

Definition at line 257 of file qpaintengine_x11.cpp.

Constructors and Destructors

◆ QXRenderTessellator()

QXRenderTessellator::QXRenderTessellator ( )
inline

◆ ~QXRenderTessellator()

QXRenderTessellator::~QXRenderTessellator ( )
inline

Definition at line 261 of file qpaintengine_x11.cpp.

261 { free(traps); }

Functions

◆ addTrap()

void QXRenderTessellator::addTrap ( const Trapezoid trap)
virtual

Implements QTessellator.

Definition at line 280 of file qpaintengine_x11.cpp.

281 {
282  if (size == allocated) {
283  allocated = qMax(2*allocated, 64);
284  traps = q_check_ptr((XTrapezoid *)realloc(traps, allocated * sizeof(XTrapezoid)));
285  }
286  traps[size].top = Q27Dot5ToXFixed(trap.top);
287  traps[size].bottom = Q27Dot5ToXFixed(trap.bottom);
288  traps[size].left.p1.x = Q27Dot5ToXFixed(trap.topLeft->x);
289  traps[size].left.p1.y = Q27Dot5ToXFixed(trap.topLeft->y);
290  traps[size].left.p2.x = Q27Dot5ToXFixed(trap.bottomLeft->x);
291  traps[size].left.p2.y = Q27Dot5ToXFixed(trap.bottomLeft->y);
292  traps[size].right.p1.x = Q27Dot5ToXFixed(trap.topRight->x);
293  traps[size].right.p1.y = Q27Dot5ToXFixed(trap.topRight->y);
294  traps[size].right.p2.x = Q27Dot5ToXFixed(trap.bottomRight->x);
295  traps[size].right.p2.y = Q27Dot5ToXFixed(trap.bottomRight->y);
296  ++size;
297 }
T * q_check_ptr(T *p)
Definition: qglobal.h:1857
#define Q27Dot5ToXFixed(i)
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217

◆ done()

void QXRenderTessellator::done ( )
inline

Definition at line 271 of file qpaintengine_x11.cpp.

271  {
272  if (allocated > 64) {
273  free(traps);
274  traps = 0;
275  allocated = 0;
276  }
277  }

◆ tessellate()

QRect QXRenderTessellator::tessellate ( const QPointF points,
int  nPoints,
bool  winding 
)
inline

Definition at line 266 of file qpaintengine_x11.cpp.

266  {
267  size = 0;
268  setWinding(winding);
269  return QTessellator::tessellate(points, nPoints).toRect();
270  }
QRectF tessellate(const QPointF *points, int nPoints)
QRect toRect() const
Returns a QRect based on the values of this rectangle.
Definition: qrect.h:845
void setWinding(bool w)

Properties

◆ allocated

int QXRenderTessellator::allocated

Definition at line 263 of file qpaintengine_x11.cpp.

Referenced by addTrap().

◆ size

int QXRenderTessellator::size

Definition at line 264 of file qpaintengine_x11.cpp.

Referenced by addTrap().

◆ traps

XTrapezoid* QXRenderTessellator::traps

Definition at line 262 of file qpaintengine_x11.cpp.

Referenced by addTrap(), and ~QXRenderTessellator().


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