Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qpaintengine_raster.cpp File Reference
#include <QtCore/qglobal.h>
#include <QtCore/qmutex.h>
#include <private/qrasterdefs_p.h>
#include <private/qgrayraster_p.h>
#include <qpainterpath.h>
#include <qdebug.h>
#include <qbitmap.h>
#include "qmath_p.h"
#include <qrandom.h>
#include <private/qtextengine_p.h>
#include <private/qfontengine_p.h>
#include <private/qpixmap_raster_p.h>
#include <private/qimage_p.h>
#include <private/qstatictext_p.h>
#include <private/qcosmeticstroker_p.h>
#include <private/qdrawhelper_p.h>
#include <private/qmemrotate_p.h>
#include <private/qpixellayout_p.h>
#include <private/qrgba64_p.h>
#include "qpaintengine_raster_p.h"
#include "qoutlinemapper_p.h"
#include <limits.h>
#include <algorithm>
+ Include dependency graph for qpaintengine_raster.cpp:

Go to the source code of this file.

Classes

class  QRectVectorPath
 
struct  ClipData
 
struct  QRasterFloatPoint
 
struct  VisibleGlyphRange
 
class  QGradientCache
 
struct  QGradientCache::CacheInfo
 

Macros

#define QT_FT_BEGIN_HEADER
 
#define QT_FT_END_HEADER
 
#define qt_swap_int(x, y)   { int tmp = (x); (x) = (y); (y) = tmp; }
 
#define qt_swap_qreal(x, y)   { qreal tmp = (x); (x) = (y); (y) = tmp; }
 
#define QT_FAST_SPANS
 
#define int_dim(pos, dim)   (int(pos+dim) - int(pos))
 

Enumerations

enum  LineDrawMode { LineDrawClipped , LineDrawNormal , LineDrawIncludeLastPixel }
 

Functions

Q_GUI_EXPORT bool qt_scaleForTransform (const QTransform &transform, qreal *scale)
 
static void qt_span_fill_clipRect (int count, const QT_FT_Span *spans, void *userData)
 
static void qt_span_fill_clipped (int count, const QT_FT_Span *spans, void *userData)
 
static void qt_span_clip (int count, const QT_FT_Span *spans, void *userData)
 
static void drawEllipse_midpoint_i (const QRect &rect, const QRect &clip, ProcessSpans pen_func, ProcessSpans brush_func, QSpanData *pen_data, QSpanData *brush_data)
 
static void qt_ft_outline_move_to (qfixed x, qfixed y, void *data)
 
static void qt_ft_outline_line_to (qfixed x, qfixed y, void *data)
 
static void qt_ft_outline_cubic_to (qfixed c1x, qfixed c1y, qfixed c2x, qfixed c2y, qfixed ex, qfixed ey, void *data)
 
static void qrasterpaintengine_state_setNoClip (QRasterPaintEngineState *s)
 
static void qrasterpaintengine_dirty_clip (QRasterPaintEnginePrivate *d, QRasterPaintEngineState *s)
 
static void fillRect_normalized (const QRect &r, QSpanData *data, QRasterPaintEnginePrivate *pe)
 
static QColor qPremultiplyWithExtraAlpha (const QColor &c, int alpha)
 
static bool isAbove (const QPointF *a, const QPointF *b)
 
static bool splitPolygon (const QPointF *points, int pointCount, QList< QPointF > *upper, QList< QPointF > *lower)
 
static int fast_ceil_positive (const qreal &v)
 
static const QRect toAlignedRect_positive (const QRectF &rect)
 
QRectF qt_mapRect_non_normalizing (const QRectF &r, const QTransform &t)
 
static bool monoVal (const uchar *s, int x)
 
static VisibleGlyphRange visibleGlyphRange (const QRectF &clip, QFontEngine *fontEngine, glyph_t *glyphs, QFixedPoint *positions, int numGlyphs)
 
int q_gray_rendered_spans (QT_FT_Raster raster)
 
static ucharalignAddress (uchar *address, quintptr alignmentMask)
 
static const QT_FT_Spanqt_intersect_spans (const QClipData *clip, int *currentClip, const QT_FT_Span *spans, const QT_FT_Span *end, QT_FT_Span **outSpans, int available)
 
static int qt_intersect_spans (QT_FT_Span *&spans, int numSpans, const QRect &clip)
 
Q_GUI_EXPORT QImage qt_imageForBrush (int brushStyle, bool invert)
 
static void drawEllipsePoints (int x, int y, int length, const QRect &rect, const QRect &clip, ProcessSpans pen_func, ProcessSpans brush_func, QSpanData *pen_data, QSpanData *brush_data)
 

Macro Definition Documentation

◆ int_dim

#define int_dim (   pos,
  dim 
)    (int(pos+dim) - int(pos))

Definition at line 115 of file qpaintengine_raster.cpp.

◆ QT_FAST_SPANS

#define QT_FAST_SPANS

Definition at line 109 of file qpaintengine_raster.cpp.

◆ QT_FT_BEGIN_HEADER

#define QT_FT_BEGIN_HEADER

Definition at line 7 of file qpaintengine_raster.cpp.

◆ QT_FT_END_HEADER

#define QT_FT_END_HEADER

Definition at line 8 of file qpaintengine_raster.cpp.

◆ qt_swap_int

#define qt_swap_int (   x,
  y 
)    { int tmp = (x); (x) = (y); (y) = tmp; }

Definition at line 101 of file qpaintengine_raster.cpp.

◆ qt_swap_qreal

#define qt_swap_qreal (   x,
  y 
)    { qreal tmp = (x); (x) = (y); (y) = tmp; }

Definition at line 102 of file qpaintengine_raster.cpp.

Enumeration Type Documentation

◆ LineDrawMode

Enumerator
LineDrawClipped 
LineDrawNormal 
LineDrawIncludeLastPixel 

Definition at line 157 of file qpaintengine_raster.cpp.

Function Documentation

◆ alignAddress()

static uchar * alignAddress ( uchar address,
quintptr  alignmentMask 
)
inlinestatic

Definition at line 3558 of file qpaintengine_raster.cpp.

Referenced by QRasterPaintEnginePrivate::rasterize().

+ Here is the caller graph for this function:

◆ drawEllipse_midpoint_i()

static void drawEllipse_midpoint_i ( const QRect rect,
const QRect clip,
ProcessSpans  pen_func,
ProcessSpans  brush_func,
QSpanData pen_data,
QSpanData brush_data 
)
static

Draws an ellipse using the integer point midpoint algorithm.

Definition at line 4800 of file qpaintengine_raster.cpp.

References d, drawEllipsePoints(), and rect.

Referenced by QRasterPaintEngine::drawEllipse().

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

◆ drawEllipsePoints()

static void drawEllipsePoints ( int  x,
int  y,
int  length,
const QRect rect,
const QRect clip,
ProcessSpans  pen_func,
ProcessSpans  brush_func,
QSpanData pen_data,
QSpanData brush_data 
)
inlinestatic

x and y is relative to the midpoint of rect.

Definition at line 4726 of file qpaintengine_raster.cpp.

References QT_FT_Span_::coverage, fill(), QT_FT_Span_::len, qMax(), qMin(), qt_intersect_spans(), rect, QT_FT_Span_::x, and QT_FT_Span_::y.

Referenced by drawEllipse_midpoint_i().

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

◆ fast_ceil_positive()

static int fast_ceil_positive ( const qreal v)
inlinestatic

Definition at line 2075 of file qpaintengine_raster.cpp.

Referenced by toAlignedRect_positive().

+ Here is the caller graph for this function:

◆ fillRect_normalized()

static void fillRect_normalized ( const QRect r,
QSpanData data,
QRasterPaintEnginePrivate pe 
)
static

Definition at line 1362 of file qpaintengine_raster.cpp.

References QRasterBuffer::compositionMode, QPainter::CompositionMode_Source, QPainter::CompositionMode_SourceOver, QT_FT_Span_::coverage, QRasterPaintEnginePrivate::deviceRect, QColor::ExtendedRgb, QRect::height(), i, QRasterPaintEnginePrivate::isUnclipped_normalized(), QT_FT_Span_::len, Q_ASSERT, qMax(), qMin(), QRasterPaintEnginePrivate::rasterBuffer, QRect::width(), QRect::x(), QT_FT_Span_::x, QRect::y(), and QT_FT_Span_::y.

Referenced by QRasterPaintEngine::drawImage(), QRasterPaintEngine::drawImage(), QRasterPaintEngine::drawRects(), QRasterPaintEngine::drawTiledPixmap(), and QRasterPaintEngine::fill().

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

◆ isAbove()

static bool isAbove ( const QPointF a,
const QPointF b 
)
inlinestatic

Definition at line 1789 of file qpaintengine_raster.cpp.

Referenced by splitPolygon().

+ Here is the caller graph for this function:

◆ monoVal()

static bool monoVal ( const uchar s,
int  x 
)
inlinestatic

Definition at line 2519 of file qpaintengine_raster.cpp.

Referenced by QRasterPaintEngine::alphaPenBlt().

+ Here is the caller graph for this function:

◆ q_gray_rendered_spans()

int q_gray_rendered_spans ( QT_FT_Raster  raster)

◆ qPremultiplyWithExtraAlpha()

static QColor qPremultiplyWithExtraAlpha ( const QColor c,
int  alpha 
)
static

Definition at line 1754 of file qpaintengine_raster.cpp.

References combineAlpha256(), QColor::ExtendedRgb, QColor::fromRgbF(), qPremultiply(), and Qt::transparent.

Referenced by QRasterPaintEngine::fillRect(), and QSpanData::setup().

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

◆ qrasterpaintengine_dirty_clip()

static void qrasterpaintengine_dirty_clip ( QRasterPaintEnginePrivate d,
QRasterPaintEngineState s 
)
static

Definition at line 1101 of file qpaintengine_raster.cpp.

References d, and QPaintEngine::DirtyClipPath.

Referenced by QRasterPaintEngine::clip(), and QRasterPaintEngine::clip().

+ Here is the caller graph for this function:

◆ qrasterpaintengine_state_setNoClip()

static void qrasterpaintengine_state_setNoClip ( QRasterPaintEngineState s)
static

Definition at line 1093 of file qpaintengine_raster.cpp.

Referenced by QRasterPaintEngine::clip(), QRasterPaintEngine::clip(), QRasterPaintEngine::clip(), and QRasterPaintEnginePrivate::updateClipping().

+ Here is the caller graph for this function:

◆ qt_ft_outline_cubic_to()

static void qt_ft_outline_cubic_to ( qfixed  c1x,
qfixed  c1y,
qfixed  c2x,
qfixed  c2y,
qfixed  ex,
qfixed  ey,
void data 
)
static

Definition at line 204 of file qpaintengine_raster.cpp.

References qt_fixed_to_real.

◆ qt_ft_outline_line_to()

static void qt_ft_outline_line_to ( qfixed  x,
qfixed  y,
void data 
)
static

Definition at line 199 of file qpaintengine_raster.cpp.

References qt_fixed_to_real.

◆ qt_ft_outline_move_to()

static void qt_ft_outline_move_to ( qfixed  x,
qfixed  y,
void data 
)
static

Definition at line 194 of file qpaintengine_raster.cpp.

References qt_fixed_to_real.

◆ qt_imageForBrush()

Q_GUI_EXPORT QImage qt_imageForBrush ( int  brushStyle,
bool  invert 
)

Definition at line 146 of file qbrush.cpp.

◆ qt_intersect_spans() [1/2]

static const QT_FT_Span * qt_intersect_spans ( const QClipData clip,
int *  currentClip,
const QT_FT_Span spans,
const QT_FT_Span end,
QT_FT_Span **  outSpans,
int  available 
)
static

spans must be sorted on y

Definition at line 4016 of file qpaintengine_raster.cpp.

References QClipData::count, QT_FT_Span_::coverage, initialize(), QT_FT_Span_::len, QClipData::m_clipLines, QClipData::m_spans, out, Q_ASSERT, qMax(), qMin(), qt_div_255(), QClipData::ClipLine::spans, QT_FT_Span_::x, and QT_FT_Span_::y.

Referenced by drawEllipsePoints(), qt_span_clip(), qt_span_fill_clipped(), and qt_span_fill_clipRect().

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

◆ qt_intersect_spans() [2/2]

static int qt_intersect_spans ( QT_FT_Span *&  spans,
int  numSpans,
const QRect clip 
)
static

Definition at line 4106 of file qpaintengine_raster.cpp.

References QRect::bottom(), QRect::left(), QT_FT_Span_::len, qMin(), QRect::right(), QRect::top(), and QT_FT_Span_::y.

+ Here is the call graph for this function:

◆ qt_mapRect_non_normalizing()

QRectF qt_mapRect_non_normalizing ( const QRectF r,
const QTransform t 
)

Definition at line 2151 of file qpaintengine_raster.cpp.

Referenced by QRasterPaintEngine::drawImage().

+ Here is the caller graph for this function:

◆ qt_scaleForTransform()

Q_GUI_EXPORT bool qt_scaleForTransform ( const QTransform transform,
qreal scale 
)

Definition at line 2301 of file qtransform.cpp.

◆ qt_span_clip()

static void qt_span_clip ( int  count,
const QT_FT_Span spans,
void userData 
)
static

Definition at line 4160 of file qpaintengine_raster.cpp.

References QClipData::allocated, QClipData::appendSpans(), QClipData::count, QClipData::initialize(), Qt::IntersectClip, QClipData::m_spans, ClipData::newClip, Qt::NoClip, ClipData::oldClip, ClipData::operation, qt_intersect_spans(), and Qt::ReplaceClip.

Referenced by QRasterPaintEngine::clip().

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

◆ qt_span_fill_clipped()

static void qt_span_fill_clipped ( int  count,
const QT_FT_Span spans,
void userData 
)
static

Definition at line 4079 of file qpaintengine_raster.cpp.

References QSpanData::blend, QSpanData::clip, Q_ASSERT, qt_intersect_spans(), and QSpanData::unclipped_blend.

Referenced by QSpanData::adjustSpanMethods().

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

◆ qt_span_fill_clipRect()

static void qt_span_fill_clipRect ( int  count,
const QT_FT_Span spans,
void userData 
)
static

Definition at line 4143 of file qpaintengine_raster.cpp.

References QSpanData::blend, QSpanData::clip, QClipData::clipRect, QRect::isEmpty(), Q_ASSERT, qt_intersect_spans(), and QSpanData::unclipped_blend.

Referenced by QSpanData::adjustSpanMethods().

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

◆ splitPolygon()

static bool splitPolygon ( const QPointF points,
int  pointCount,
QList< QPointF > *  upper,
QList< QPointF > *  lower 
)
static

Definition at line 1794 of file qpaintengine_raster.cpp.

References QList< T >::at(), QList< T >::begin(), QList< T >::end(), i, isAbove(), Q_ASSERT, qFuzzyCompare(), QList< T >::reserve(), QList< T >::size(), QPointF::x(), and QPointF::y().

Referenced by QRasterPaintEngine::fillPolygon().

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

◆ toAlignedRect_positive()

static const QRect toAlignedRect_positive ( const QRectF rect)
inlinestatic

Definition at line 2084 of file qpaintengine_raster.cpp.

References fast_ceil_positive(), and rect.

Referenced by QRasterPaintEngine::drawImage().

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

◆ visibleGlyphRange()

static VisibleGlyphRange visibleGlyphRange ( const QRectF clip,
QFontEngine fontEngine,
glyph_t glyphs,
QFixedPoint positions,
int  numGlyphs 
)
static

Definition at line 3001 of file qpaintengine_raster.cpp.

References QRectF::bottom(), QFontEngine::boundingBox(), QFixed::fromReal(), QRectF::left(), positions, QRectF::right(), and QRectF::top().

Referenced by QRasterPaintEngine::drawStaticTextItem(), and QRasterPaintEngine::drawTextItem().

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