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
qbrush.cpp File Reference

(6376b1c5a708ddb1a82e81cbc7ce4df159ba565b)

#include "qbrush.h"
#include "qpixmap.h"
#include "qbitmap.h"
#include "qpixmapcache.h"
#include <qpa/qplatformpixmap.h>
#include "qdatastream.h"
#include "qvariant.h"
#include "qline.h"
#include "qdebug.h"
#include <QtCore/qjsondocument.h>
#include <QtCore/qjsonarray.h>
#include <QtCore/qcoreapplication.h>
#include "private/qhexstring_p.h"
#include <QtCore/qnumeric.h>
#include <QtCore/qfile.h>
#include <QtCore/qmutex.h>
#include <QtCore/private/qoffsetstringarray_p.h>
#include "webgradients.cpp"
#include "moc_qbrush.cpp"
+ Include dependency graph for qbrush.cpp:

Go to the source code of this file.

Classes

class  QBrushPatternImageCache
 
struct  QTexturedBrushData
 
struct  QGradientBrushData
 
class  QNullBrushData
 

Functions

const ucharqt_patternForBrush (int brushStyle, bool invert)
 
Q_GUI_EXPORT QPixmap qt_pixmapForBrush (int brushStyle, bool invert)
 
static void qt_cleanup_brush_pattern_image_cache ()
 
Q_GUI_EXPORT QImage qt_imageForBrush (int brushStyle, bool invert)
 
bool Q_GUI_EXPORT qHasPixmapTexture (const QBrush &brush)
 
static void deleteData (QBrushData *d)
 
static QBrushDatanullBrushInstance ()
 
static bool qbrush_check_type (Qt::BrushStyle style)
 
static constexpr bool use_same_brushdata (Qt::BrushStyle lhs, Qt::BrushStyle rhs)
 
Q_GUI_EXPORT bool qt_isExtendedRadialGradient (const QBrush &brush)
 
QDebug operator<< (QDebug dbg, const QBrush &b)
 
QDataStreamoperator<< (QDataStream &s, const QBrush &b)
 
QDataStreamoperator>> (QDataStream &s, QBrush &b)
 
static bool ok (QGradientStop stop)
 
static bool ok (const QGradientStops &stops)
 
static QPointF qt_radial_gradient_adapt_focal_point (const QPointF &center, qreal radius, const QPointF &focalPoint)
 

Function Documentation

◆ deleteData()

static void deleteData ( QBrushData * d)
static

Definition at line 215 of file qbrush.cpp.

References Qt::ConicalGradientPattern, d, Qt::LinearGradientPattern, Qt::RadialGradientPattern, and Qt::TexturePattern.

Referenced by QBrushDataPointerDeleter::operator()().

+ Here is the caller graph for this function:

◆ nullBrushInstance()

static QBrushData * nullBrushInstance ( )
static

Definition at line 337 of file qbrush.cpp.

Referenced by QBrush::QBrush(), and QBrush::QBrush().

+ Here is the caller graph for this function:

◆ ok() [1/2]

static bool ok ( const QGradientStops & stops)
inlinestatic

Definition at line 1585 of file qbrush.cpp.

References ok, and Q_UNLIKELY.

◆ ok() [2/2]

static bool ok ( QGradientStop stop)
inlinestatic

Definition at line 1580 of file qbrush.cpp.

◆ operator<<() [1/2]

QDataStream & operator<< ( QDataStream & s,
const QBrush & b )
related

Definition at line 998 of file qbrush.cpp.

◆ operator<<() [2/2]

QDebug operator<< ( QDebug dbg,
const QBrush & b )

Definition at line 953 of file qbrush.cpp.

References qOffsetStringArray().

+ Here is the call graph for this function:

◆ operator>>()

QDataStream & operator>> ( QDataStream & s,
QBrush & b )
related

Definition at line 1074 of file qbrush.cpp.

◆ qbrush_check_type()

static bool qbrush_check_type ( Qt::BrushStyle style)
static

Definition at line 342 of file qbrush.cpp.

References Qt::ConicalGradientPattern, Qt::LinearGradientPattern, qWarning, Qt::RadialGradientPattern, and Qt::TexturePattern.

Referenced by QBrush::QBrush(), and QBrush::setStyle().

+ Here is the caller graph for this function:

◆ qHasPixmapTexture()

bool Q_GUI_EXPORT qHasPixmapTexture ( const QBrush & brush)

Definition at line 202 of file qbrush.cpp.

References QImage::Format_MonoLSB, QBitmap::fromData(), QPixmapCache::insert(), and qt_patternForBrush().

Referenced by QTextHtmlParserNode::applyForegroundImage(), QQC2::QWindowsStyle::drawControl(), QEmulationPaintEngine::fill(), is_brush_transparent(), needsEmulation(), QOpenGL2PaintEngineExPrivate::setBrush(), QSpanData::setup(), QOpenGL2PaintEngineExPrivate::updateBrushUniforms(), and QPainterPrivate::updateEmulationSpecifier().

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

◆ qt_cleanup_brush_pattern_image_cache()

static void qt_cleanup_brush_pattern_image_cache ( )
static

Definition at line 141 of file qbrush.cpp.

Referenced by QBrushPatternImageCache::init().

+ Here is the caller graph for this function:

◆ qt_imageForBrush()

Q_GUI_EXPORT QImage qt_imageForBrush ( int brushStyle,
bool invert )

Definition at line 146 of file qbrush.cpp.

Referenced by QSvgPaintEngine::savePatternMask(), QSpanData::setup(), QWindowsDirect2DPaintEnginePrivate::to_d2d_brush(), and QOpenGL2PaintEngineExPrivate::updateBrushTexture().

+ Here is the caller graph for this function:

◆ qt_isExtendedRadialGradient()

Q_GUI_EXPORT bool qt_isExtendedRadialGradient ( const QBrush & brush)

Definition at line 801 of file qbrush.cpp.

References qFuzzyIsNull(), Qt::RadialGradientPattern, QPointF::x(), and QPointF::y().

Referenced by QBrush::isOpaque(), removeTransparencyFromBrush(), and QPainterPrivate::updateEmulationSpecifier().

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

◆ qt_patternForBrush()

const uchar * qt_patternForBrush ( int brushStyle,
bool invert )

Definition at line 32 of file qbrush.cpp.

References Qt::Dense1Pattern, Qt::LinearGradientPattern, Q_ASSERT, and Qt::SolidPattern.

Referenced by QBrushPatternImageCache::init(), and qHasPixmapTexture().

+ Here is the caller graph for this function:

◆ qt_pixmapForBrush()

Q_GUI_EXPORT QPixmap qt_pixmapForBrush ( int brushStyle,
bool invert )

Definition at line 80 of file qbrush.cpp.

Referenced by QX11PaintEngine::updateBrush().

+ Here is the caller graph for this function:

◆ qt_radial_gradient_adapt_focal_point()

static QPointF qt_radial_gradient_adapt_focal_point ( const QPointF & center,
qreal radius,
const QPointF & focalPoint )
static

Definition at line 1999 of file qbrush.cpp.

References QString::length(), and line.

Referenced by QRadialGradient::QRadialGradient().

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

◆ use_same_brushdata()

static constexpr bool use_same_brushdata ( Qt::BrushStyle lhs,
Qt::BrushStyle rhs )
inlinestaticconstexpr