summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-03-15 01:00:11 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2018-03-15 01:00:11 +0100
commit8264e495fa9220c101a8a913701a0b8834a6d58b (patch)
tree069aa1d3efab926991c1edfc5b69a3d9e58dcfba /src/gui/painting
parent80f52812f2651e6d427bb3dd2e338b60fb25d48b (diff)
parent8eb3944dac81b8c51d7bac7784204d457551b50c (diff)
Merge remote-tracking branch 'origin/5.11' into dev
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qdrawhelper.cpp2
-rw-r--r--src/gui/painting/qpaintengine_raster.cpp16
2 files changed, 14 insertions, 4 deletions
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index ed9d00f4a7..efd9b0c146 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -5489,6 +5489,8 @@ static inline void alphamapblend_argb32(quint32 *dst, int coverage, QRgba64 srcL
// nothing
} else if (coverage == 255) {
*dst = src;
+ } else if (!colorProfile) {
+ *dst = INTERPOLATE_PIXEL_255(src, coverage, *dst, 255 - coverage);
} else {
if (*dst >= 0xff000000) {
grayBlendPixel(dst, coverage, srcLinear, colorProfile);
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index f7578a3c57..33fde8c61a 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -2341,8 +2341,12 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe
if (s->matrix.type() > QTransform::TxTranslate || stretch_sr) {
QRectF targetBounds = s->matrix.mapRect(r);
- bool exceedsPrecision = targetBounds.width() > 0x7fff
- || targetBounds.height() > 0x7fff;
+ bool exceedsPrecision = r.width() > 0x7fff
+ || r.height() > 0x7fff
+ || targetBounds.width() > 0x7fff
+ || targetBounds.height() > 0x7fff
+ || s->matrix.m11() >= 512
+ || s->matrix.m22() >= 512;
if (!exceedsPrecision && d->canUseFastImageBlending(d->rasterBuffer->compositionMode, img)) {
if (s->matrix.type() > QTransform::TxScale) {
@@ -4639,9 +4643,13 @@ void QSpanData::setupMatrix(const QTransform &matrix, int bilin)
bilinear = bilin;
const bool affine = inv.isAffine();
+ const qreal f1 = m11 * m11 + m21 * m21;
+ const qreal f2 = m12 * m12 + m22 * m22;
fast_matrix = affine
- && m11 * m11 + m21 * m21 < 1e4
- && m12 * m12 + m22 * m22 < 1e4
+ && f1 < 1e4
+ && f2 < 1e4
+ && f1 > (1.0 / 65536)
+ && f2 > (1.0 / 65536)
&& qAbs(dx) < 1e4
&& qAbs(dy) < 1e4;