summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qblendfunctions_p.h12
-rw-r--r--src/gui/painting/qdrawhelper_p.h42
-rw-r--r--src/gui/painting/qgrayraster.c16
-rw-r--r--src/gui/painting/qpdf.cpp2
-rw-r--r--src/gui/painting/qtransform.cpp6
5 files changed, 43 insertions, 35 deletions
diff --git a/src/gui/painting/qblendfunctions_p.h b/src/gui/painting/qblendfunctions_p.h
index 7ee04987fe..167f725143 100644
--- a/src/gui/painting/qblendfunctions_p.h
+++ b/src/gui/painting/qblendfunctions_p.h
@@ -375,12 +375,12 @@ void qt_transform_image_rasterize(DestT *destPixels, int dbpl,
--ii;
}
switch (i & 7) {
- case 7: blender.write(line, reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line;
- case 6: blender.write(line, reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line;
- case 5: blender.write(line, reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line;
- case 4: blender.write(line, reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line;
- case 3: blender.write(line, reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line;
- case 2: blender.write(line, reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line;
+ case 7: blender.write(line, reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line; Q_FALLTHROUGH();
+ case 6: blender.write(line, reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line; Q_FALLTHROUGH();
+ case 5: blender.write(line, reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line; Q_FALLTHROUGH();
+ case 4: blender.write(line, reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line; Q_FALLTHROUGH();
+ case 3: blender.write(line, reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line; Q_FALLTHROUGH();
+ case 2: blender.write(line, reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line; Q_FALLTHROUGH();
case 1: blender.write(line, reinterpret_cast<const SrcT *>(reinterpret_cast<const uchar *>(srcPixels) + (v >> 16) * sbpl)[u >> 16]); u += dudx; v += dvdx; ++line;
}
diff --git a/src/gui/painting/qdrawhelper_p.h b/src/gui/painting/qdrawhelper_p.h
index cf2213042d..1f97621171 100644
--- a/src/gui/painting/qdrawhelper_p.h
+++ b/src/gui/painting/qdrawhelper_p.h
@@ -833,13 +833,13 @@ inline void qt_memfill(T *dest, T value, int count)
int n = (count + 7) / 8;
switch (count & 0x07)
{
- case 0: do { *dest++ = value;
- case 7: *dest++ = value;
- case 6: *dest++ = value;
- case 5: *dest++ = value;
- case 4: *dest++ = value;
- case 3: *dest++ = value;
- case 2: *dest++ = value;
+ case 0: do { *dest++ = value; Q_FALLTHROUGH();
+ case 7: *dest++ = value; Q_FALLTHROUGH();
+ case 6: *dest++ = value; Q_FALLTHROUGH();
+ case 5: *dest++ = value; Q_FALLTHROUGH();
+ case 4: *dest++ = value; Q_FALLTHROUGH();
+ case 3: *dest++ = value; Q_FALLTHROUGH();
+ case 2: *dest++ = value; Q_FALLTHROUGH();
case 1: *dest++ = value;
} while (--n > 0);
}
@@ -875,13 +875,13 @@ do { \
int n = ((length) + 7) / 8; \
switch ((length) & 0x07) \
{ \
- case 0: do { *--_d = *--_s; \
- case 7: *--_d = *--_s; \
- case 6: *--_d = *--_s; \
- case 5: *--_d = *--_s; \
- case 4: *--_d = *--_s; \
- case 3: *--_d = *--_s; \
- case 2: *--_d = *--_s; \
+ case 0: do { *--_d = *--_s; Q_FALLTHROUGH(); \
+ case 7: *--_d = *--_s; Q_FALLTHROUGH(); \
+ case 6: *--_d = *--_s; Q_FALLTHROUGH(); \
+ case 5: *--_d = *--_s; Q_FALLTHROUGH(); \
+ case 4: *--_d = *--_s; Q_FALLTHROUGH(); \
+ case 3: *--_d = *--_s; Q_FALLTHROUGH(); \
+ case 2: *--_d = *--_s; Q_FALLTHROUGH(); \
case 1: *--_d = *--_s; \
} while (--n > 0); \
} \
@@ -895,13 +895,13 @@ do { \
int n = ((length) + 7) / 8; \
switch ((length) & 0x07) \
{ \
- case 0: do { *_d++ = *_s++; \
- case 7: *_d++ = *_s++; \
- case 6: *_d++ = *_s++; \
- case 5: *_d++ = *_s++; \
- case 4: *_d++ = *_s++; \
- case 3: *_d++ = *_s++; \
- case 2: *_d++ = *_s++; \
+ case 0: do { *_d++ = *_s++; Q_FALLTHROUGH(); \
+ case 7: *_d++ = *_s++; Q_FALLTHROUGH(); \
+ case 6: *_d++ = *_s++; Q_FALLTHROUGH(); \
+ case 5: *_d++ = *_s++; Q_FALLTHROUGH(); \
+ case 4: *_d++ = *_s++; Q_FALLTHROUGH(); \
+ case 3: *_d++ = *_s++; Q_FALLTHROUGH(); \
+ case 2: *_d++ = *_s++; Q_FALLTHROUGH(); \
case 1: *_d++ = *_s++; \
} while (--n > 0); \
} \
diff --git a/src/gui/painting/qgrayraster.c b/src/gui/painting/qgrayraster.c
index 49e53973b0..7b35cd6143 100644
--- a/src/gui/painting/qgrayraster.c
+++ b/src/gui/painting/qgrayraster.c
@@ -183,6 +183,8 @@ typedef ptrdiff_t QT_FT_PtrDist;
#include <private/qrasterdefs_p.h>
#include <private/qgrayraster_p.h>
+#include <qcompilerdetection.h>
+
#include <stdlib.h>
#include <stdio.h>
@@ -1201,13 +1203,13 @@ QT_FT_END_STMNT
*/
switch ( spans->len )
{
- case 7: *q++ = coverage;
- case 6: *q++ = coverage;
- case 5: *q++ = coverage;
- case 4: *q++ = coverage;
- case 3: *q++ = coverage;
- case 2: *q++ = coverage;
- case 1: *q = coverage;
+ case 7: *q++ = coverage; Q_FALLTHROUGH();
+ case 6: *q++ = coverage; Q_FALLTHROUGH();
+ case 5: *q++ = coverage; Q_FALLTHROUGH();
+ case 4: *q++ = coverage; Q_FALLTHROUGH();
+ case 3: *q++ = coverage; Q_FALLTHROUGH();
+ case 2: *q++ = coverage; Q_FALLTHROUGH();
+ case 1: *q = coverage; Q_FALLTHROUGH();
case 0: break;
default:
QT_FT_MEM_SET( q, coverage, spans->len );
diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp
index 25e051d739..2b892159c5 100644
--- a/src/gui/painting/qpdf.cpp
+++ b/src/gui/painting/qpdf.cpp
@@ -2808,6 +2808,7 @@ void QPdfEnginePrivate::drawTextItem(const QPointF &p, const QTextItemInt &ti)
qreal size = ti.fontEngine->fontDef.pixelSize;
int synthesized = ti.fontEngine->synthesized();
qreal stretch = synthesized & QFontEngine::SynthesizedStretch ? ti.fontEngine->fontDef.stretch/100. : 1.;
+ Q_ASSERT(stretch > qreal(0));
QTransform trans;
// Build text rendering matrix (Trm). We need it to map the text area to user
@@ -2884,6 +2885,7 @@ void QPdfEnginePrivate::drawTextItem(const QPointF &p, const QTextItemInt &ti)
return;
int synthesized = ti.fontEngine->synthesized();
qreal stretch = synthesized & QFontEngine::SynthesizedStretch ? ti.fontEngine->fontDef.stretch/100. : 1.;
+ Q_ASSERT(stretch > qreal(0));
*currentPage << "BT\n"
<< "/F" << font->object_id << size << "Tf "
diff --git a/src/gui/painting/qtransform.cpp b/src/gui/painting/qtransform.cpp
index 673f64fbca..7f06915444 100644
--- a/src/gui/painting/qtransform.cpp
+++ b/src/gui/painting/qtransform.cpp
@@ -2094,7 +2094,8 @@ QTransform::TransformationType QTransform::type() const
if (!qFuzzyIsNull(m_13) || !qFuzzyIsNull(m_23) || !qFuzzyIsNull(m_33 - 1)) {
m_type = TxProject;
break;
- }
+ }
+ Q_FALLTHROUGH();
case TxShear:
case TxRotate:
if (!qFuzzyIsNull(affine._m12) || !qFuzzyIsNull(affine._m21)) {
@@ -2105,16 +2106,19 @@ QTransform::TransformationType QTransform::type() const
m_type = TxShear;
break;
}
+ Q_FALLTHROUGH();
case TxScale:
if (!qFuzzyIsNull(affine._m11 - 1) || !qFuzzyIsNull(affine._m22 - 1)) {
m_type = TxScale;
break;
}
+ Q_FALLTHROUGH();
case TxTranslate:
if (!qFuzzyIsNull(affine._dx) || !qFuzzyIsNull(affine._dy)) {
m_type = TxTranslate;
break;
}
+ Q_FALLTHROUGH();
case TxNone:
m_type = TxNone;
break;