![]() |
Qt 6.x
The Qt SDK
|
#include <qpainter_p.h>
Classes | |
struct | QPaintEngineDestructor |
struct | SmallStack |
Public Types | |
enum | DrawOperation { StrokeDraw = 0x1 , FillDraw = 0x2 , StrokeAndFillDraw = 0x3 } |
Static Public Member Functions | |
static QPainterPrivate * | get (QPainter *painter) |
static bool | attachPainterPrivate (QPainter *q, QPaintDevice *pdev) |
Public Attributes | |
QPainter * | q_ptr |
QVarLengthArray< QPainterPrivate *, NDPtrs > | d_ptrs |
std::unique_ptr< QPainterState > | state |
SmallStack< std::unique_ptr< QPainterState > > | savedStates |
std::unique_ptr< QPainterDummyState > | dummyState |
QTransform | invMatrix |
uint | txinv:1 |
uint | inDestructor: 1 |
uint | refcount = 1 |
QPaintDevice * | device = nullptr |
QPaintDevice * | original_device = nullptr |
QPaintDevice * | helper_device = nullptr |
std::unique_ptr< QPaintEngine, QPaintEngineDestructor > | engine |
std::unique_ptr< QEmulationPaintEngine > | emulationEngine |
QPaintEngineEx * | extended = nullptr |
QBrush | colorBrush |
Static Public Attributes | |
static constexpr qsizetype | NDPtrs = 4 |
Definition at line 157 of file qpainter_p.h.
Enumerator | |
---|---|
StrokeDraw | |
FillDraw | |
StrokeAndFillDraw |
Definition at line 185 of file qpainter_p.h.
|
explicit |
Definition at line 199 of file qpainter.cpp.
|
default |
|
static |
Definition at line 237 of file qpainter.cpp.
References QPaintEnginePrivate::currentClipDevice, QTransform::fromTranslate(), QPaintDevice::height(), Q_ASSERT, Q_UNUSED, QPaintDevice::redirected(), QPaintEnginePrivate::setSystemTransform(), QPaintDevice::sharedPainter(), sp, QPaintEnginePrivate::systemStateChanged(), and QPaintDevice::width().
Referenced by QPainter::QPainter(), and QPainter::begin().
void QPainterPrivate::checkEmulation | ( | ) |
Definition at line 171 of file qpainter.cpp.
References QPaintEngineEx::DoNotEmulate, emulationEngine, extended, QPaintEngineEx::flags(), needsEmulation(), Qt::OpaqueMode, Q_ASSERT, qpen_brush(), QPaintEngineEx::setState(), and state.
Definition at line 290 of file qpainter.cpp.
References QVarLengthArray< T, Prealloc >::back(), d_ptrs, emulationEngine, extended, inDestructor, QVarLengthArray< T, Prealloc >::pop_back(), Q_ASSERT, Q_UNUSED, and refcount.
void QPainterPrivate::draw_helper | ( | const QPainterPath & | path, |
DrawOperation | operation = StrokeAndFillDraw |
||
) |
Definition at line 317 of file qpainter.cpp.
References QRectF::adjusted(), QPainter::Antialiasing, QPainterPath::boundingRect(), boundingRect(), QPainter::CompositionMode_SourceAtop, QPainterPathStroker::createStroke(), device, QPaintEngine::DirtyTransform, QPainter::drawLine(), drawOpaqueBackground(), drawStretchedGradient(), QPainter::end(), engine, extended, FillDraw, QPainter::fillRect(), QImage::Format_ARGB32_Premultiplied, QPaintDevice::height(), QRect::height(), helper_device, info, QRectF::intersected(), invMatrix, QPainterPath::isEmpty(), QRectF::isEmpty(), Qt::NoBrush, Qt::NoPen, QPaintEngine::ObjectBoundingModeGradients, Qt::OrderedAlphaDither, Qt::OrderedDither, QPaintEngine::PatternTransform, qAbs(), qEnvironmentVariableIsEmpty(), QGradient_StretchToDevice, QPaintEngine_OpaqueBackground, QPainterPathStroker::setCapStyle(), QPainterPathStroker::setJoinStyle(), QPainterPathStroker::setWidth(), QPainter::SmoothPixmapTransform, state, StrokeDraw, QRectF::toAlignedRect(), QPaintEngineEx::transformChanged(), txinv, QTransform::TxProject, QTransform::TxScale, updateState(), QPaintDevice::width(), QRect::width(), QRect::x(), and QRect::y().
void QPainterPrivate::drawGlyphs | ( | const QPointF & | decorationPosition, |
const quint32 * | glyphArray, | ||
QFixedPoint * | positionArray, | ||
int | glyphCount, | ||
QFontEngine * | fontEngine, | ||
bool | overline = false , |
||
bool | underline = false , |
||
bool | strikeOut = false |
||
) |
Definition at line 5317 of file qpainter.cpp.
References QGlyphLayout::advances, QGlyphLayout::attributes, QStaticTextItem::color, QVarLengthArray< T, Prealloc >::data(), QPaintEngineEx::drawStaticTextItem(), engine, extended, QStaticTextItem::font, QTextItemInt::fontEngine, QStaticTextItem::glyphPositions, QStaticTextItem::glyphs, QGlyphLayout::glyphs, QTextItemInt::glyphs, QGlyphLayout::justifications, QStaticTextItem::numGlyphs, QGlyphLayout::numGlyphs, QGlyphLayout::offsets, positions, qt_draw_decoration_for_glyphs(), QStaticTextItem::setFontEngine(), QVLABaseBase::size(), state, updateState(), and QStaticTextItem::usesRawFont.
void QPainterPrivate::drawOpaqueBackground | ( | const QPainterPath & | path, |
DrawOperation | operation | ||
) |
Definition at line 473 of file qpainter.cpp.
References FillDraw, Qt::NoBrush, Qt::NoPen, Qt::OpaqueMode, state, StrokeDraw, and Qt::TransparentMode.
Referenced by draw_helper().
void QPainterPrivate::drawStretchedGradient | ( | const QPainterPath & | path, |
DrawOperation | operation | ||
) |
Definition at line 511 of file qpainter.cpp.
References boundingRect(), QPen::brush(), QPen::capStyle(), coordinateMode(), QPainterPathStroker::createStroke(), engine, FillDraw, QPaintDevice::height(), helper_device, QPen::joinStyle(), QPen::miterLimit(), Qt::NoBrush, Qt::NoPen, QGradient::ObjectBoundingMode, QGradient::ObjectMode, QPaintEngine::PatternTransform, Q_ASSERT, QPen::setBrush(), QPainterPathStroker::setCapStyle(), QPainterPathStroker::setDashPattern(), QPainterPathStroker::setJoinStyle(), QPainterPathStroker::setMiterLimit(), QPainterPathStroker::setWidth(), state, stretchGradientToUserSpace(), QGradient::StretchToDeviceMode, StrokeDraw, QPen::style(), updateState(), QPaintDevice::width(), and QPen::widthF().
Referenced by draw_helper().
void QPainterPrivate::drawTextItem | ( | const QPointF & | p, |
const QTextItem & | _ti, | ||
QTextEngine * | textEngine | ||
) |
Definition at line 6097 of file qpainter.cpp.
References QPainter::Antialiasing, QTextItemInt::ascent, QTextItemInt::charFormat, QTextItemInt::descent, QPaintEngine::DirtyHints, QPaintEngine::drawTextItem(), drawTextItemDecoration(), e, QGlyphLayout::effectiveAdvance(), engine, QFontEngineMulti::engine(), QFontEngineMulti::ensureEngineAt(), extended, QTextItemInt::flags, QTextItemInt::fontEngine, QGlyphLayout::glyphs, QTextItemInt::glyphs, i, QTextItemInt::midItem(), QFontEngine::Multi, Qt::NoPen, QGlyphLayout::numGlyphs, Qt::OpaqueMode, qFuzzyIsNull(), qPrintable, rect, QPaintEngineEx::renderHintsChanged(), QTextItem::RightToLeft, state, QTextItem::text(), QFixed::toReal(), QTransform::TxScale, QTransform::TxShear, QFontEngine::type(), QTextItemInt::underlineStyle, updateState(), and QTextItemInt::width.
qreal QPainterPrivate::effectiveDevicePixelRatio | ( | ) | const |
Definition at line 218 of file qpainter.cpp.
References device, QPaintDevice::devicePixelRatio(), QPaintDevice::devType(), QInternal::Printer, and qMax().
Referenced by hidpiScaleTransform().
|
inline |
Definition at line 190 of file qpainter_p.h.
References dummyState.
|
inlinestatic |
Definition at line 217 of file qpainter_p.h.
References painter.
QTransform QPainterPrivate::hidpiScaleTransform | ( | ) | const |
Definition at line 227 of file qpainter.cpp.
References effectiveDevicePixelRatio(), and QTransform::fromScale().
Referenced by updateMatrix().
void QPainterPrivate::initFrom | ( | const QPaintDevice * | device | ) |
Definition at line 1523 of file qpainter.cpp.
References device, QPaintEngine::DirtyBrush, QPaintEngine::DirtyFont, QPaintEngine::DirtyPen, engine, extended, QPaintDevice::initPainter(), QPaintEngineEx::penChanged(), and qWarning.
void QPainterPrivate::updateEmulationSpecifier | ( | QPainterState * | s | ) |
Definition at line 655 of file qpainter.cpp.
References QColor::alpha(), QPaintEngine::AlphaBlend, QPaintEngine::BlendModes, QPaintEngine::BrushStroke, QBrush::color(), QPainter::CompositionMode_Xor, QPaintEngine::ConicalGradientFill, Qt::ConicalGradientPattern, QPaintEngine::ConstantOpacity, coordinateMode(), QPixmap::depth(), QPaintEngine::DirtyBackgroundMode, QPaintEngine::DirtyBrush, QPaintEngine::DirtyHints, QPaintEngine::DirtyOpacity, QPaintEngine::DirtyPen, QPaintEngine::DirtyTransform, engine, QPixmap::hasAlpha(), QImage::hasAlphaChannel(), is_brush_transparent(), is_pen_transparent(), QTransform::isAffine(), QTransform::isIdentity(), QBrush::isOpaque(), QPaintEngine::LinearGradientFill, Qt::LinearGradientPattern, QPaintEngine::MaskedBrush, Qt::NoBrush, Qt::NoPen, QGradient::ObjectBoundingMode, QPaintEngine::ObjectBoundingModeGradients, QGradient::ObjectMode, Qt::OpaqueMode, QPaintEngine::PatternBrush, QPaintEngine::PatternTransform, QPaintEngine::PerspectiveTransform, QPaintEngine::PrimitiveTransform, qbrush_style(), qDebug, QGradient_StretchToDevice, qHasPixmapTexture(), QPaintEngine_OpaqueBackground, qpen_brush(), qpen_style(), qt_isExtendedRadialGradient(), QPaintEngine::RadialGradientFill, Qt::RadialGradientPattern, Qt::SolidPattern, state, QGradient::StretchToDeviceMode, QBrush::style(), QBrush::texture(), QBrush::textureImage(), Qt::TexturePattern, QTransform::TxNone, QTransform::TxTranslate, and xform.
Referenced by updateStateImpl().
void QPainterPrivate::updateInvMatrix | ( | ) |
void QPainterPrivate::updateMatrix | ( | ) |
Definition at line 626 of file qpainter.cpp.
References QPaintEngine::DirtyTransform, extended, hidpiScaleTransform(), state, QPaintEngineEx::transformChanged(), txinv, and viewTransform().
void QPainterPrivate::updateState | ( | QPainterState * | state | ) |
Definition at line 892 of file qpainter.cpp.
References engine, newState(), and updateStateImpl().
Referenced by draw_helper(), drawGlyphs(), drawStretchedGradient(), and drawTextItem().
|
inline |
Definition at line 199 of file qpainter_p.h.
References state, and updateState().
Referenced by updateState().
void QPainterPrivate::updateStateImpl | ( | QPainterState * | state | ) |
Definition at line 860 of file qpainter.cpp.
References QPaintEngine::AllDirty, QPainterState::changeFlags, QPaintEngine::DirtyBackground, QPaintEngine::DirtyBackgroundMode, engine, newState(), and updateEmulationSpecifier().
Referenced by updateState().
QTransform QPainterPrivate::viewTransform | ( | ) | const |
Definition at line 207 of file qpainter.cpp.
References state.
Referenced by updateMatrix().
QBrush QPainterPrivate::colorBrush |
Definition at line 244 of file qpainter_p.h.
QVarLengthArray<QPainterPrivate*, NDPtrs> QPainterPrivate::d_ptrs |
Definition at line 169 of file qpainter_p.h.
Referenced by detachPainterPrivate().
QPaintDevice* QPainterPrivate::device = nullptr |
Definition at line 229 of file qpainter_p.h.
Referenced by draw_helper(), effectiveDevicePixelRatio(), and initFrom().
|
mutable |
Definition at line 178 of file qpainter_p.h.
Referenced by fakeState().
std::unique_ptr<QEmulationPaintEngine> QPainterPrivate::emulationEngine |
Definition at line 242 of file qpainter_p.h.
Referenced by checkEmulation(), and detachPainterPrivate().
std::unique_ptr<QPaintEngine, QPaintEngineDestructor> QPainterPrivate::engine |
Definition at line 240 of file qpainter_p.h.
Referenced by draw_helper(), drawGlyphs(), drawStretchedGradient(), drawTextItem(), initFrom(), updateEmulationSpecifier(), updateState(), and updateStateImpl().
QPaintEngineEx* QPainterPrivate::extended = nullptr |
Definition at line 243 of file qpainter_p.h.
Referenced by checkEmulation(), detachPainterPrivate(), draw_helper(), drawGlyphs(), drawTextItem(), initFrom(), and updateMatrix().
QPaintDevice* QPainterPrivate::helper_device = nullptr |
Definition at line 231 of file qpainter_p.h.
Referenced by draw_helper(), and drawStretchedGradient().
uint QPainterPrivate::inDestructor |
Definition at line 182 of file qpainter_p.h.
Referenced by detachPainterPrivate().
QTransform QPainterPrivate::invMatrix |
Definition at line 180 of file qpainter_p.h.
Referenced by draw_helper(), and updateInvMatrix().
|
staticconstexpr |
Definition at line 168 of file qpainter_p.h.
QPaintDevice* QPainterPrivate::original_device = nullptr |
Definition at line 230 of file qpainter_p.h.
QPainter* QPainterPrivate::q_ptr |
Definition at line 164 of file qpainter_p.h.
uint QPainterPrivate::refcount = 1 |
Definition at line 183 of file qpainter_p.h.
Referenced by detachPainterPrivate().
SmallStack<std::unique_ptr<QPainterState> > QPainterPrivate::savedStates |
Definition at line 176 of file qpainter_p.h.
std::unique_ptr<QPainterState> QPainterPrivate::state |
Definition at line 171 of file qpainter_p.h.
Referenced by checkEmulation(), draw_helper(), drawGlyphs(), drawOpaqueBackground(), drawStretchedGradient(), drawTextItem(), updateEmulationSpecifier(), updateInvMatrix(), updateMatrix(), updateState(), and viewTransform().
uint QPainterPrivate::txinv |
Definition at line 181 of file qpainter_p.h.
Referenced by draw_helper(), updateInvMatrix(), and updateMatrix().