Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qcosmeticstroker.cpp File Reference

(7706c2a28ea5995f828144e39b8d1662aa263aa2)

#include "qcosmeticstroker_p.h"
#include "private/qpainterpath_p.h"
#include "private/qrgba64_p.h"
#include <qdebug.h>
+ Include dependency graph for qcosmeticstroker.cpp:

Go to the source code of this file.

Macros

#define toF26Dot6(x)   static_cast<int>((x) * 64.)
 

Typedefs

typedef void(* DrawPixel) (QCosmeticStroker *stroker, int x, int y, int coverage)
 

Enumerations

enum  StrokeSelection {
  Aliased = 0 , AntiAliased = 1 , Solid = 0 , Dashed = 2 ,
  RegularDraw = 0 , FastDraw = 4
}
 

Functions

static uint sourceOver (uint d, uint color)
 
static FDot16 FDot16FixedDiv (int x, int y)
 
template<DrawPixel drawPixel, class Dasher >
static bool drawLine (QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps)
 
template<DrawPixel drawPixel, class Dasher >
static bool drawLineAA (QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps)
 
void drawPixel (QCosmeticStroker *stroker, int x, int y, int coverage)
 
void drawPixelARGB32 (QCosmeticStroker *stroker, int x, int y, int coverage)
 
void drawPixelARGB32Opaque (QCosmeticStroker *stroker, int x, int y, int)
 
static StrokeLine strokeLine (int strokeSelection)
 
static const QPainterPath::ElementTypesubPath (const QPainterPath::ElementType *t, const QPainterPath::ElementType *end, const qreal *points, bool *closed)
 
static void splitCubic (QCosmeticStroker::PointF *points)
 
static int swapCaps (int caps)
 
static void capAdjust (int caps, int &x1, int &x2, FDot16 &y, FDot16 yinc)
 

Variables

QT_BEGIN_NAMESPACE typedef int FDot16
 

Macro Definition Documentation

◆ toF26Dot6

#define toF26Dot6 ( x)    static_cast<int>((x) * 64.)

Definition at line 31 of file qcosmeticstroker.cpp.

Referenced by drawLine(), and drawLineAA().

Typedef Documentation

◆ DrawPixel

typedef void(* DrawPixel) (QCosmeticStroker *stroker, int x, int y, int coverage)

Definition at line 49 of file qcosmeticstroker.cpp.

Enumeration Type Documentation

◆ StrokeSelection

Enumerator
Aliased 
AntiAliased 
Solid 
Dashed 
RegularDraw 
FastDraw 

Definition at line 162 of file qcosmeticstroker.cpp.

Function Documentation

◆ capAdjust()

static void capAdjust ( int caps,
int & x1,
int & x2,
FDot16 & y,
FDot16 yinc )
inlinestatic

Definition at line 693 of file qcosmeticstroker.cpp.

References QCosmeticStroker::CapBegin, and QCosmeticStroker::CapEnd.

Referenced by drawLine(), and drawLineAA().

+ Here is the caller graph for this function:

◆ drawLine()

template<DrawPixel drawPixel, class Dasher >
static bool drawLine ( QCosmeticStroker * stroker,
qreal x1,
qreal y1,
qreal x2,
qreal y2,
int caps )
static

Definition at line 709 of file qcosmeticstroker.cpp.

References QCosmeticStroker::BottomToTop, capAdjust(), QCosmeticStroker::CapBegin, QCosmeticStroker::CapEnd, QCosmeticStroker::clipLine(), dir, drawPixel(), FDot16, FDot16FixedDiv(), QCosmeticStroker::HorizontalMask, QCosmeticStroker::lastAxisAligned, QCosmeticStroker::lastDir, QCosmeticStroker::lastPixel, QCosmeticStroker::LeftToRight, qAbs(), qSwap(), QCosmeticStroker::RightToLeft, swapCaps(), toF26Dot6, QCosmeticStroker::TopToBottom, QCosmeticStroker::VerticalMask, QCosmeticStroker::Point::x, and QCosmeticStroker::Point::y.

Referenced by strokeLine().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ drawLineAA()

template<DrawPixel drawPixel, class Dasher >
static bool drawLineAA ( QCosmeticStroker * stroker,
qreal x1,
qreal y1,
qreal x2,
qreal y2,
int caps )
static

Definition at line 911 of file qcosmeticstroker.cpp.

References capAdjust(), QCosmeticStroker::clipLine(), drawPixel(), FDot16, FDot16FixedDiv(), Q_ASSERT, qAbs(), qSwap(), swapCaps(), and toF26Dot6.

Referenced by strokeLine().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ drawPixel()

void drawPixel ( QCosmeticStroker * stroker,
int x,
int y,
int coverage )
inline

◆ drawPixelARGB32()

void drawPixelARGB32 ( QCosmeticStroker * stroker,
int x,
int y,
int coverage )
inline

Definition at line 141 of file qcosmeticstroker.cpp.

References BYTE_MUL(), QCosmeticStroker::clip, QCosmeticStroker::color, QCosmeticStroker::pixels, QCosmeticStroker::ppl, and sourceOver().

Referenced by strokeLine().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ drawPixelARGB32Opaque()

void drawPixelARGB32Opaque ( QCosmeticStroker * stroker,
int x,
int y,
int  )
inline

Definition at line 152 of file qcosmeticstroker.cpp.

References QCosmeticStroker::clip, QCosmeticStroker::color, QCosmeticStroker::pixels, QCosmeticStroker::ppl, and sourceOver().

Referenced by strokeLine().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FDot16FixedDiv()

static FDot16 FDot16FixedDiv ( int x,
int y )
inlinestatic

Definition at line 38 of file qcosmeticstroker.cpp.

References FDot16, and qAbs().

Referenced by drawLine(), and drawLineAA().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sourceOver()

static uint sourceOver ( uint d,
uint color )
inlinestatic

Definition at line 33 of file qcosmeticstroker.cpp.

References BYTE_MUL(), d, and qAlpha().

Referenced by drawPixelARGB32(), and drawPixelARGB32Opaque().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ splitCubic()

static void splitCubic ( QCosmeticStroker::PointF * points)
static

Definition at line 639 of file qcosmeticstroker.cpp.

References d.

◆ strokeLine()

static StrokeLine strokeLine ( int strokeSelection)
static

Definition at line 171 of file qcosmeticstroker.cpp.

References Aliased, AntiAliased, Dashed, drawLine(), drawLineAA(), drawPixel(), drawPixelARGB32(), drawPixelARGB32Opaque(), FastDraw, Q_ASSERT, RegularDraw, and Solid.

+ Here is the call graph for this function:

◆ subPath()

static const QPainterPath::ElementType * subPath ( const QPainterPath::ElementType * t,
const QPainterPath::ElementType * end,
const qreal * points,
bool * closed )
inlinestatic

Definition at line 476 of file qcosmeticstroker.cpp.

References QPainterPath::MoveToElement.

Referenced by QOpenGLProgramBinaryCache::QOpenGLProgramBinaryCache(), automaticPipelineCacheDir(), QCosmeticStroker::drawPath(), persistentQsbcDir(), qmlDirectoryRecursion(), QQmlJS::Dom::ModuleIndex::qmldirsToLoad(), readInputFile(), and QSGCurveProcessor::removeNestedSubpaths().

+ Here is the caller graph for this function:

◆ swapCaps()

static int swapCaps ( int caps)
inlinestatic

Definition at line 686 of file qcosmeticstroker.cpp.

References QCosmeticStroker::CapBegin, and QCosmeticStroker::CapEnd.

Referenced by drawLine(), and drawLineAA().

+ Here is the caller graph for this function:

Variable Documentation

◆ FDot16

QT_BEGIN_NAMESPACE typedef int FDot16

Definition at line 28 of file qcosmeticstroker.cpp.

Referenced by drawLine(), drawLineAA(), and FDot16FixedDiv().