Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qrasterizer.cpp File Reference

(aefb5c5a56dd6882179130b98fc44ac0fb366b03)

#include "qrasterizer_p.h"
#include <QPoint>
#include <QRect>
#include <private/qmath_p.h>
#include <private/qdatabuffer_p.h>
#include <private/qdrawhelper_p.h>
#include <QtGui/qpainterpath.h>
#include <algorithm>
Include dependency graph for qrasterizer.cpp:

Go to the source code of this file.

Classes

class  QSpanBuffer
class  QScanConverter
struct  QScanConverter::Line
class  QRasterizerPrivate

Macros

#define QScFixedToFloat(i)
#define FloatToQScFixed(i)
#define IntToQScFixed(i)
#define QScFixedToInt(i)
#define QScFixedFactor   65536
#define FTPosToQScFixed(i)
#define QScFixedMultiply(x, y)
#define QScFixedFastMultiply(x, y)
#define SPAN_BUFFER_SIZE   256
#define COORD_ROUNDING   1
#define COORD_OFFSET   32
#define CHUNK_SIZE   64
#define DO_SEGMENT(next, li, ri, ls, rs)

Functions

static QT_FT_Vector PointToVector (const QPointF &p)
static void split (QT_FT_Vector *b)
static QScFixed intersectPixelFP (int x, QScFixed top, QScFixed bottom, QScFixed leftIntersectX, QScFixed rightIntersectX, QScFixed slope, QScFixed invSlope)
static bool q26Dot6Compare (qreal p1, qreal p2)
static QPointF snapTo26Dot6Grid (const QPointF &p)
static qreal qSafeDivide (qreal x, qreal y)
static QScFixed qSafeFloatToQScFixed (qreal x)
static bool qClipLine (QPointF *pt1, QPointF *pt2, const QRectF &clip)

Variables

QT_BEGIN_NAMESPACE typedef int QScFixed

Macro Definition Documentation

◆ CHUNK_SIZE

#define CHUNK_SIZE   64

Definition at line 96 of file qrasterizer.cpp.

◆ COORD_OFFSET

#define COORD_OFFSET   32

Definition at line 37 of file qrasterizer.cpp.

◆ COORD_ROUNDING

#define COORD_ROUNDING   1

Definition at line 36 of file qrasterizer.cpp.

◆ DO_SEGMENT

#define DO_SEGMENT ( next,
li,
ri,
ls,
rs )
Value:
ny = qMin(next + 1, d->clipRect.top()); \
if (y < ny) { \
li += ls * (ny - y); \
ri += rs * (ny - y); \
y = ny; \
} \
if (next > d->clipRect.bottom()) \
next = d->clipRect.bottom(); \
for (; y <= next; ++y) { \
const int x1 = qMax(QScFixedToInt(li), d->clipRect.left()); \
const int x2 = qMin(QScFixedToInt(ri), d->clipRect.right()); \
if (x2 >= x1) \
buffer.addSpan(x1, x2 - x1 + 1, y, 255); \
li += ls; \
ri += rs; \
}
short next
Definition keywords.cpp:453
static int qMax(int i1, int i2, int i3)
QT_BEGIN_NAMESPACE constexpr const T & qMin(const T &a, const T &b)
Definition qminmax.h:19
GLuint GLfloat GLfloat GLfloat x1
GLint y
GLfixed ny
GLfixed GLfixed x2
#define QScFixedToInt(i)
EGLContext EGLenum EGLClientBuffer buffer

◆ FloatToQScFixed

#define FloatToQScFixed ( i)
Value:
(QScFixed)((i) * 65536.)
QT_BEGIN_NAMESPACE typedef int QScFixed

Definition at line 25 of file qrasterizer.cpp.

◆ FTPosToQScFixed

#define FTPosToQScFixed ( i)
Value:
((QScFixed)(i) * (1 << 10))

Definition at line 29 of file qrasterizer.cpp.

◆ IntToQScFixed

#define IntToQScFixed ( i)
Value:
((QScFixed)(i) * (1 << 16))

Definition at line 26 of file qrasterizer.cpp.

◆ QScFixedFactor

#define QScFixedFactor   65536

Definition at line 28 of file qrasterizer.cpp.

◆ QScFixedFastMultiply

#define QScFixedFastMultiply ( x,
y )
Value:
(((x) * (y)) >> 16)
GLint GLint GLint GLint GLint x

Definition at line 32 of file qrasterizer.cpp.

◆ QScFixedMultiply

#define QScFixedMultiply ( x,
y )
Value:
(QScFixed)((qlonglong(x) * qlonglong(y)) >> 16)
qint64 qlonglong
Definition qtypes.h:68

Definition at line 31 of file qrasterizer.cpp.

◆ QScFixedToFloat

#define QScFixedToFloat ( i)
Value:
((i) * (1./65536.))

Definition at line 24 of file qrasterizer.cpp.

◆ QScFixedToInt

#define QScFixedToInt ( i)
Value:
((i) >> 16)

Definition at line 27 of file qrasterizer.cpp.

◆ SPAN_BUFFER_SIZE

#define SPAN_BUFFER_SIZE   256

Definition at line 34 of file qrasterizer.cpp.

Function Documentation

◆ intersectPixelFP()

QScFixed intersectPixelFP ( int x,
QScFixed top,
QScFixed bottom,
QScFixed leftIntersectX,
QScFixed rightIntersectX,
QScFixed slope,
QScFixed invSlope )
static

Definition at line 618 of file qrasterizer.cpp.

References QScFixed.

Referenced by QRasterizer::rasterizeLine().

Here is the caller graph for this function:

◆ PointToVector()

QT_FT_Vector PointToVector ( const QPointF & p)
inlinestatic

Definition at line 39 of file qrasterizer.cpp.

◆ q26Dot6Compare()

bool q26Dot6Compare ( qreal p1,
qreal p2 )
inlinestatic

Definition at line 664 of file qrasterizer.cpp.

◆ qClipLine()

bool qClipLine ( QPointF * pt1,
QPointF * pt2,
const QRectF & clip )
inlinestatic

Definition at line 712 of file qrasterizer.cpp.

◆ qSafeDivide()

qreal qSafeDivide ( qreal x,
qreal y )
inlinestatic

Definition at line 683 of file qrasterizer.cpp.

◆ qSafeFloatToQScFixed()

QScFixed qSafeFloatToQScFixed ( qreal x)
inlinestatic

Definition at line 694 of file qrasterizer.cpp.

References QScFixed.

◆ snapTo26Dot6Grid()

QPointF snapTo26Dot6Grid ( const QPointF & p)
inlinestatic

Definition at line 669 of file qrasterizer.cpp.

◆ split()

void split ( QT_FT_Vector * b)
static

Definition at line 247 of file qrasterizer.cpp.

Referenced by testing.tools.api_check::_GetExportsFromHeader(), testing.tools.suppressor.Suppressor::_MatchSuppression(), and testing.tools.test_runner._PerProcessConfig::InitializeFeatures().

Here is the caller graph for this function:

Variable Documentation

◆ QScFixed