diff options
author | Liang Qi <liang.qi@qt.io> | 2017-04-06 13:52:45 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-04-06 14:16:31 +0200 |
commit | 0fc569184cf0fb6663e955e68bfa14baf3f3fe0d (patch) | |
tree | 0161df2f2ac28b554e77d62498647054198d8e1e /src/gui/painting | |
parent | 280e321e52fd4e86545f3f0d4bd4e047786a897e (diff) | |
parent | efb84b6189f9e98c6dd29c22f00ad760445196c2 (diff) |
Merge remote-tracking branch 'origin/5.8' into 5.9
Conflicts:
src/platformsupport/fontdatabases/freetype/qfontengine_ft.cpp
src/platformsupport/fontdatabases/freetype/qfreetypefontdatabase.cpp
src/plugins/platformthemes/gtk3/qgtk3dialoghelpers.cpp
src/widgets/widgets/qtabbar.cpp
Change-Id: Iaa9daee5f7a6490d56257a3824730a35751ceb05
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qblendfunctions_p.h | 12 | ||||
-rw-r--r-- | src/gui/painting/qdrawhelper_p.h | 42 | ||||
-rw-r--r-- | src/gui/painting/qgrayraster.c | 14 | ||||
-rw-r--r-- | src/gui/painting/qpdf.cpp | 2 | ||||
-rw-r--r-- | src/gui/painting/qtransform.cpp | 6 |
5 files changed, 42 insertions, 34 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 db3453898f..dae1c06bec 100644 --- a/src/gui/painting/qgrayraster.c +++ b/src/gui/painting/qgrayraster.c @@ -162,6 +162,8 @@ #include <private/qrasterdefs_p.h> #include <private/qgrayraster_p.h> +#include <qcompilerdetection.h> + #include <stdlib.h> #include <stdio.h> @@ -1147,12 +1149,12 @@ switch ( spans->len ) { - case 7: *q++ = (unsigned char)coverage; - case 6: *q++ = (unsigned char)coverage; - case 5: *q++ = (unsigned char)coverage; - case 4: *q++ = (unsigned char)coverage; - case 3: *q++ = (unsigned char)coverage; - case 2: *q++ = (unsigned char)coverage; + case 7: *q++ = (unsigned char)coverage; Q_FALLTHROUGH(); + case 6: *q++ = (unsigned char)coverage; Q_FALLTHROUGH(); + case 5: *q++ = (unsigned char)coverage; Q_FALLTHROUGH(); + case 4: *q++ = (unsigned char)coverage; Q_FALLTHROUGH(); + case 3: *q++ = (unsigned char)coverage; Q_FALLTHROUGH(); + case 2: *q++ = (unsigned char)coverage; Q_FALLTHROUGH(); case 1: *q = (unsigned char)coverage; default: ; diff --git a/src/gui/painting/qpdf.cpp b/src/gui/painting/qpdf.cpp index ca3e3ac362..afeb198953 100644 --- a/src/gui/painting/qpdf.cpp +++ b/src/gui/painting/qpdf.cpp @@ -2565,6 +2565,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 @@ -2641,6 +2642,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; |