1533 #ifdef QT_MAC_USE_NATIVE_GRADIENTS 1536 if (drawGradientNatively(grad)) {
1539 static const CGFloat domain[] = { 0.0f, +1.0f };
1540 static const CGFunctionCallbacks callbacks = { 0, qt_mac_color_gradient_function, 0 };
1541 CGFunctionRef fill_func = CGFunctionCreate(reinterpret_cast<void *>(&
current.brush),
1542 1, domain, 4, 0, &callbacks);
1549 shading = CGShadingCreateAxial(colorspace, CGPointMake(start.x(), start.y()),
1550 CGPointMake(stop.x(), stop.y()), fill_func,
true,
true);
1558 shading = CGShadingCreateRadial(colorspace, CGPointMake(focal.x(), focal.y()),
1559 focalRadius, CGPointMake(
center.x(),
center.y()), radius, fill_func,
false,
true);
1562 CGFunctionRelease(fill_func);
1567 #ifndef QT_MAC_USE_NATIVE_GRADIENTS
1574 CGFloat components[4] = { 1.0, 1.0, 1.0, 1.0 };
1595 int width = qpattern->
width(), height = qpattern->
height();
1598 CGColorSpaceRef fill_colorspace = CGColorSpaceCreatePattern(base_colorspace);
1599 CGContextSetFillColorSpace(
hd, fill_colorspace);
1601 CGAffineTransform xform = CGContextGetCTM(
hd);
1603 xform = CGAffineTransformTranslate(xform, offset.x(), offset.y());
1605 CGPatternCallbacks callbks;
1606 callbks.version = 0;
1609 CGPatternRef fill_pattern = CGPatternCreate(qpattern, CGRectMake(0, 0, width, height),
1610 xform, width, height, kCGPatternTilingNoDistortion,
1611 !base_colorspace, &callbks);
1612 CGContextSetFillPattern(
hd, fill_pattern, components);
1614 CGPatternRelease(fill_pattern);
1615 CGColorSpaceRelease(fill_colorspace);
qreal focalRadius() const
Returns the focal radius of this radial gradient in logical coordinates.
static const uchar * qt_mac_patternForBrush(int brushStyle)
The QColor class provides colors based on RGB, HSV or CMYK values.
static QCFType< CGColorRef > cgColorForQColor(const QColor &col, QPaintDevice *pdev)
QPointF focalPoint() const
Returns the focal point of this radial gradient in logical coordinates.
static CGColorSpaceRef macGenericColorSpace()
The QPointF class defines a point in the plane using floating point precision.
CGColorSpaceRef qt_mac_colorSpaceForDeviceType(const QPaintDevice *paintDevice)
ushort red
Returns the red color component of this color.
The QRadialGradient class is used in combination with QBrush to specify a radial gradient brush...
struct QMacPattern::@240 data
bool isQBitmap() const
Returns true if this is a QBitmap; otherwise returns false.
static void qt_mac_dispose_pattern(void *info)
QPointF start() const
Returns the start point of this linear gradient in logical coordinates.
static void qt_mac_draw_pattern(void *info, CGContextRef c)
Q_CORE_EXPORT QTextStream & center(QTextStream &s)
struct CGColorSpace * CGColorSpaceRef
ushort blue
Returns the blue color component of this color.
The QLinearGradient class is used in combination with QBrush to specify a linear gradient brush...
The QGradient class is used in combination with QBrush to specify gradient fills. ...
CGAffineTransform qt_mac_convert_transform_to_cg(const QTransform &t)
qreal radius() const
Returns the radius of this radial gradient in logical coordinates.
Spread spread() const
Returns the spread method use by this gradient.
QPointF center() const
Returns the center of this radial gradient in logical coordinates.
struct QCoreGraphicsPaintEnginePrivate::@241 current
static float qt_mac_convert_color_to_cg(int c)
ushort green
Returns the green color component of this color.
QPointF finalStop() const
Returns the final stop point of this linear gradient in logical coordinates.