QDrawHelper cleanups
We don't need to handle solid SourceOver logic directly, this was already handled by getOperator and changed composition to Source. Also removes some dead code and changes an assert in unreachable code to Q_UNREACHABLE. Change-Id: I66a6c1248bd34e31096023f1acb20385099932c9 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
This commit is contained in:
parent
5eb492fb95
commit
cfbe481838
@ -4482,9 +4482,8 @@ static void blend_color_generic(int count, const QSpan *spans, void *userData)
|
|||||||
uint buffer[BufferSize];
|
uint buffer[BufferSize];
|
||||||
Operator op = getOperator(data, nullptr, 0);
|
Operator op = getOperator(data, nullptr, 0);
|
||||||
const uint color = data->solidColor.toArgb32();
|
const uint color = data->solidColor.toArgb32();
|
||||||
bool solidFill = data->rasterBuffer->compositionMode == QPainter::CompositionMode_Source
|
const bool solidFill = op.mode == QPainter::CompositionMode_Source;
|
||||||
|| (data->rasterBuffer->compositionMode == QPainter::CompositionMode_SourceOver && qAlpha(color) == 255);
|
const QPixelLayout::BPP bpp = qPixelLayouts[data->rasterBuffer->format].bpp;
|
||||||
QPixelLayout::BPP bpp = qPixelLayouts[data->rasterBuffer->format].bpp;
|
|
||||||
|
|
||||||
while (count--) {
|
while (count--) {
|
||||||
int x = spans->x;
|
int x = spans->x;
|
||||||
@ -4552,9 +4551,8 @@ void blend_color_generic_rgb64(int count, const QSpan *spans, void *userData)
|
|||||||
|
|
||||||
alignas(8) QRgba64 buffer[BufferSize];
|
alignas(8) QRgba64 buffer[BufferSize];
|
||||||
const QRgba64 color = data->solidColor;
|
const QRgba64 color = data->solidColor;
|
||||||
bool solidFill = data->rasterBuffer->compositionMode == QPainter::CompositionMode_Source
|
const bool solidFill = op.mode == QPainter::CompositionMode_Source;
|
||||||
|| (data->rasterBuffer->compositionMode == QPainter::CompositionMode_SourceOver && color.isOpaque());
|
const QPixelLayout::BPP bpp = qPixelLayouts[data->rasterBuffer->format].bpp;
|
||||||
QPixelLayout::BPP bpp = qPixelLayouts[data->rasterBuffer->format].bpp;
|
|
||||||
|
|
||||||
while (count--) {
|
while (count--) {
|
||||||
int x = spans->x;
|
int x = spans->x;
|
||||||
|
@ -601,7 +601,7 @@ public:
|
|||||||
FETCH_RADIAL_LOOP(FETCH_RADIAL_LOOP_CLAMP_PAD)
|
FETCH_RADIAL_LOOP(FETCH_RADIAL_LOOP_CLAMP_PAD)
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Q_ASSERT(false);
|
Q_UNREACHABLE();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -77,9 +77,6 @@ void qt_blend_rgb32_on_rgb32_sse2(uchar *destPixels, int dbpl,
|
|||||||
int w, int h,
|
int w, int h,
|
||||||
int const_alpha);
|
int const_alpha);
|
||||||
|
|
||||||
extern CompositionFunction qt_functionForMode_SSE2[];
|
|
||||||
extern CompositionFunctionSolid qt_functionForModeSolid_SSE2[];
|
|
||||||
|
|
||||||
void qt_memfill64_avx2(quint64 *dest, quint64 value, qsizetype count);
|
void qt_memfill64_avx2(quint64 *dest, quint64 value, qsizetype count);
|
||||||
void qt_memfill32_avx2(quint32 *dest, quint32 value, qsizetype count);
|
void qt_memfill32_avx2(quint32 *dest, quint32 value, qsizetype count);
|
||||||
#endif // __SSE2__
|
#endif // __SSE2__
|
||||||
|
Loading…
Reference in New Issue
Block a user