diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-03-18 12:23:22 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-03-19 15:14:29 +0100 |
commit | cfbe4818385b22128755e13cd8ab3c75182853c2 (patch) | |
tree | 332a753c83d9f0327dbff78a771eaba8e3983b7e /src/gui/painting/qdrawhelper.cpp | |
parent | 5eb492fb9563cad4879bb77a3a5ba24e2d2109a5 (diff) |
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>
Diffstat (limited to 'src/gui/painting/qdrawhelper.cpp')
-rw-r--r-- | src/gui/painting/qdrawhelper.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp index 2d4045fe29..4b0cc2547c 100644 --- a/src/gui/painting/qdrawhelper.cpp +++ b/src/gui/painting/qdrawhelper.cpp @@ -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; |