mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-23 18:32:55 +00:00
pass gradient as pointer to QGradientData::generateGradientColorTable()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
e8c43bfb23
commit
372992cb47
3 changed files with 6 additions and 6 deletions
|
@ -50,13 +50,13 @@ static inline QRgb qConvertRgb16To32(uint c)
|
|||
| ((((c) << 8) & 0xf80000) | (((c) << 3) & 0x70000));
|
||||
}
|
||||
|
||||
void QGradientData::generateGradientColorTable(const QGradient& gradient, int opacity)
|
||||
void QGradientData::generateGradientColorTable(const QGradient* gradient, int opacity)
|
||||
{
|
||||
QGradientStops stops = gradient.stops();
|
||||
QGradientStops stops = gradient->stops();
|
||||
int stopCount = stops.count();
|
||||
Q_ASSERT(stopCount > 0);
|
||||
|
||||
bool colorInterpolation = (gradient.interpolationMode() == QGradient::ColorInterpolation);
|
||||
bool colorInterpolation = (gradient->interpolationMode() == QGradient::ColorInterpolation);
|
||||
|
||||
if (stopCount == 2) {
|
||||
uint first_color = ARGB_COMBINE_ALPHA(stops[0].second.rgba(), opacity);
|
||||
|
|
|
@ -196,7 +196,7 @@ struct QGradientData
|
|||
uint colorTable[GRADIENT_STOPTABLE_SIZE];
|
||||
bool alphaColor;
|
||||
|
||||
void generateGradientColorTable(const QGradient& g, int opacity);
|
||||
void generateGradientColorTable(const QGradient* g, int opacity);
|
||||
};
|
||||
|
||||
struct QTextureData
|
||||
|
|
|
@ -2656,7 +2656,7 @@ void QSpanData::setup(const QBrush &brush, int alpha, QPainter::CompositionMode
|
|||
type = LinearGradient;
|
||||
const QLinearGradient *g = static_cast<const QLinearGradient *>(brush.gradient());
|
||||
gradient.alphaColor = !brush.isOpaque() || alpha != 256;
|
||||
gradient.generateGradientColorTable(*g, alpha);
|
||||
gradient.generateGradientColorTable(g, alpha);
|
||||
gradient.spread = g->spread();
|
||||
|
||||
QLinearGradientData &linearData = gradient.linear;
|
||||
|
@ -2672,7 +2672,7 @@ void QSpanData::setup(const QBrush &brush, int alpha, QPainter::CompositionMode
|
|||
type = RadialGradient;
|
||||
const QRadialGradient *g = static_cast<const QRadialGradient *>(brush.gradient());
|
||||
gradient.alphaColor = !brush.isOpaque() || alpha != 256;
|
||||
gradient.generateGradientColorTable(*g, alpha);
|
||||
gradient.generateGradientColorTable(g, alpha);
|
||||
gradient.spread = g->spread();
|
||||
|
||||
QRadialGradientData &radialData = gradient.radial;
|
||||
|
|
Loading…
Add table
Reference in a new issue