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:
Allan Sandfeld Jensen 2020-03-18 12:23:22 +01:00
parent 5eb492fb95
commit cfbe481838
3 changed files with 5 additions and 10 deletions

View File

@ -4482,9 +4482,8 @@ static void blend_color_generic(int count, const QSpan *spans, void *userData)
uint buffer[BufferSize];
Operator op = getOperator(data, nullptr, 0);
const uint color = data->solidColor.toArgb32();
bool solidFill = data->rasterBuffer->compositionMode == QPainter::CompositionMode_Source
|| (data->rasterBuffer->compositionMode == QPainter::CompositionMode_SourceOver && qAlpha(color) == 255);
QPixelLayout::BPP bpp = qPixelLayouts[data->rasterBuffer->format].bpp;
const bool solidFill = op.mode == QPainter::CompositionMode_Source;
const QPixelLayout::BPP bpp = qPixelLayouts[data->rasterBuffer->format].bpp;
while (count--) {
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];
const QRgba64 color = data->solidColor;
bool solidFill = data->rasterBuffer->compositionMode == QPainter::CompositionMode_Source
|| (data->rasterBuffer->compositionMode == QPainter::CompositionMode_SourceOver && color.isOpaque());
QPixelLayout::BPP bpp = qPixelLayouts[data->rasterBuffer->format].bpp;
const bool solidFill = op.mode == QPainter::CompositionMode_Source;
const QPixelLayout::BPP bpp = qPixelLayouts[data->rasterBuffer->format].bpp;
while (count--) {
int x = spans->x;

View File

@ -601,7 +601,7 @@ public:
FETCH_RADIAL_LOOP(FETCH_RADIAL_LOOP_CLAMP_PAD)
break;
default:
Q_ASSERT(false);
Q_UNREACHABLE();
}
}
};

View File

@ -77,9 +77,6 @@ void qt_blend_rgb32_on_rgb32_sse2(uchar *destPixels, int dbpl,
int w, int h,
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_memfill32_avx2(quint32 *dest, quint32 value, qsizetype count);
#endif // __SSE2__