diff --git a/src/gui/painting/qbrush.cpp b/src/gui/painting/qbrush.cpp
index 5c13308d94..607596087d 100644
--- a/src/gui/painting/qbrush.cpp
+++ b/src/gui/painting/qbrush.cpp
@@ -193,10 +193,12 @@ struct QTexturedBrushData : public QBrushData
         }
 
         m_image = QImage();
+        qDebug()  << __FUNCTION__ << m_image << m_pixmap;
     }
 
     void setImage(const QImage &image) {
         m_image = image;
+        qDebug()  << __FUNCTION__ << m_image;
         delete m_pixmap;
         m_pixmap = 0;
         m_has_pixmap_texture = false;
@@ -206,12 +208,15 @@ struct QTexturedBrushData : public QBrushData
         if (!m_pixmap) {
             m_pixmap = new QPixmap(QPixmap::fromImage(m_image));
         }
+        qDebug() << __FUNCTION__ << m_pixmap << m_image ;
         return *m_pixmap;
     }
 
     QImage &image() {
-        if (m_image.isNull() && m_pixmap)
+        if (m_image.isNull() && m_pixmap) {
             m_image = m_pixmap->toImage();
+        }
+        qDebug() << __FUNCTION__ << m_image << m_pixmap;
         return m_image;
     }
 
@@ -911,6 +916,7 @@ void QBrush::setMatrix(const QMatrix &matrix)
 */
 void QBrush::setTransform(const QTransform &matrix)
 {
+    qDebug() << __FUNCTION__ << matrix;
     detach(d->style);
     d->transform = matrix;
 }
diff --git a/src/gui/painting/qdrawhelper.cpp b/src/gui/painting/qdrawhelper.cpp
index f08038e34b..898c445ac2 100644
--- a/src/gui/painting/qdrawhelper.cpp
+++ b/src/gui/painting/qdrawhelper.cpp
@@ -4944,6 +4944,7 @@ static void blend_transformed_rgb565(int count, const QSpan *spans, void *userDa
 
 static void blend_transformed_tiled_argb(int count, const QSpan *spans, void *userData)
 {
+    qDebug() << __FUNCTION__ << count << "len=" << spans->len;
     QSpanData *data = reinterpret_cast<QSpanData *>(userData);
     if (data->texture.format != QImage::Format_ARGB32_Premultiplied
         && data->texture.format != QImage::Format_RGB32) {
@@ -5261,6 +5262,7 @@ static const ProcessSpans processTextureSpansGeneric64[NBlendTypes] = {
 
 void qBlendTexture(int count, const QSpan *spans, void *userData)
 {
+    qDebug() << __FUNCTION__ << count;
     QSpanData *data = reinterpret_cast<QSpanData *>(userData);
     TextureBlendType blendType = getBlendType(data);
     ProcessSpans proc;
diff --git a/src/gui/painting/qpaintengine_raster.cpp b/src/gui/painting/qpaintengine_raster.cpp
index 6336b2943e..2ecc7462f0 100644
--- a/src/gui/painting/qpaintengine_raster.cpp
+++ b/src/gui/painting/qpaintengine_raster.cpp
@@ -845,6 +845,8 @@ void QRasterPaintEngine::updateBrush(const QBrush &brush)
     Q_D(QRasterPaintEngine);
     QRasterPaintEngineState *s = state();
     // must set clip prior to setup, as setup uses it...
+    qDebug() << __FUNCTION__ << "brush.transform()=" << brush.transform()
+             << "d->brushMatrix()=" << d->brushMatrix();
     s->brushData.clip = d->clip();
     s->brushData.setup(brush, s->intOpacity, s->composition_mode);
     if (s->fillFlags & DirtyTransform
@@ -995,6 +997,7 @@ void QRasterPaintEnginePrivate::drawImage(const QPointF &pt,
                                           int alpha,
                                           const QRect &sr)
 {
+    qDebug() << "QRasterPaintEnginePrivate::drawImage" << pt << img << sr;
     if (alpha == 0 || !clip.isValid())
         return;
 
@@ -1087,6 +1090,7 @@ void QRasterPaintEnginePrivate::systemStateChanged()
 
 void QRasterPaintEnginePrivate::updateMatrixData(QSpanData *spanData, const QBrush &b, const QTransform &m)
 {
+    qDebug() << __FUNCTION__ << m;
     if (b.d->style == Qt::NoBrush || b.d->style == Qt::SolidPattern)
         return;
 
@@ -2076,9 +2080,7 @@ void QRasterPaintEngine::drawPixmap(const QPointF &pos, const QPixmap &pixmap)
 */
 void QRasterPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pixmap, const QRectF &sr)
 {
-#ifdef QT_DEBUG_DRAW
-    qDebug() << " - QRasterPaintEngine::drawPixmap(), r=" << r << " sr=" << sr << " pixmap=" << pixmap.size() << "depth=" << pixmap.depth();
-#endif
+    qDebug() << "> - QRasterPaintEngine::drawPixmap(), r=" << r << " sr=" << sr << " pixmap=" << pixmap;
 
     QPlatformPixmap* pd = pixmap.handle();
     if (pd->classId() == QPlatformPixmap::RasterClass) {
@@ -2118,6 +2120,7 @@ void QRasterPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pixmap, cons
             drawImage(r, image, translatedSource);
         }
     }
+    qDebug() << "> - QRasterPaintEngine::drawPixmap()";
 }
 
 static inline int fast_ceil_positive(const qreal &v)
@@ -2143,9 +2146,8 @@ static inline const QRect toAlignedRect_positive(const QRectF &rect)
 */
 void QRasterPaintEngine::drawImage(const QPointF &p, const QImage &img)
 {
-#ifdef QT_DEBUG_DRAW
-    qDebug() << " - QRasterPaintEngine::drawImage(), p=" <<  p << " image=" << img.size() << "depth=" << img.depth();
-#endif
+    qDebug() << " - QRasterPaintEngine::drawImage(), p=" <<  p << " im=" << img
+             << "depth=" << img.depth();
 
     Q_D(QRasterPaintEngine);
     QRasterPaintEngineState *s = state();
@@ -2185,7 +2187,7 @@ void QRasterPaintEngine::drawImage(const QPointF &p, const QImage &img)
 
         fillRect_normalized(rr, &d->image_filler, d);
     }
-
+    qDebug() << "< - QRasterPaintEngine::drawImage()";
 }
 
 QRectF qt_mapRect_non_normalizing(const QRectF &r, const QTransform &t)
@@ -2234,9 +2236,7 @@ namespace {
 void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRectF &sr,
                                    Qt::ImageConversionFlags)
 {
-#ifdef QT_DEBUG_DRAW
-    qDebug() << " - QRasterPaintEngine::drawImage(), r=" << r << " sr=" << sr << " image=" << img.size() << "depth=" << img.depth();
-#endif
+    qDebug() << "> - QRasterPaintEngine::drawImage(), r=" << r << " sr=" << sr << " image=" << img;
 
     if (r.isEmpty())
         return;
@@ -2476,6 +2476,7 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe
 
         fillRect_normalized(QRect(x1, y1, x2-x1, y2-y1), &d->image_filler, d);
     }
+    qDebug() << "< - QRasterPaintEngine::drawImage()";
 }
 
 /*!
@@ -2483,9 +2484,7 @@ void QRasterPaintEngine::drawImage(const QRectF &r, const QImage &img, const QRe
 */
 void QRasterPaintEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &sr)
 {
-#ifdef QT_DEBUG_DRAW
-    qDebug() << " - QRasterPaintEngine::drawTiledPixmap(), r=" << r << "pixmap=" << pixmap.size();
-#endif
+    qDebug() << "> - QRasterPaintEngine::drawTiledPixmap(), r=" << r << "pixmap=" << pixmap << sr;
     Q_D(QRasterPaintEngine);
     QRasterPaintEngineState *s = state();
     Q_ASSERT(s);
@@ -2498,11 +2497,13 @@ void QRasterPaintEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pixmap,
     } else {
         image = pixmap.toImage();
     }
+    qDebug() << " - QRasterPaintEngine::drawTiledPixmap(), r=" << image << s->matrix;
 
     if (image.depth() == 1)
         image = d->rasterBuffer->colorizeBitmap(image, s->pen.color());
 
     if (s->matrix.type() > QTransform::TxTranslate) {
+        qDebug() << " - QRasterPaintEngine::drawTiledPixmap(), s->matrix.type() > QTransform::TxTranslate";
         QTransform copy = s->matrix;
         copy.translate(r.x(), r.y());
         copy.translate(-sr.x(), -sr.y());
@@ -2515,6 +2516,7 @@ void QRasterPaintEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pixmap,
 #ifdef QT_FAST_SPANS
         ensureRasterState();
         if (s->flags.tx_noshear || s->matrix.type() == QTransform::TxScale) {
+            qDebug() << " - QRasterPaintEngine::drawTiledPixmap() noshear/scale";
             d->initializeRasterizer(&d->image_filler_xform);
             d->rasterizer->setAntialiased(s->flags.antialiased);
             d->rasterizer->setLegacyRoundingEnabled(s->flags.legacy_rounding);
@@ -2526,6 +2528,7 @@ void QRasterPaintEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pixmap,
                 d->rasterizer->rasterizeLine(a, b, rect.height() / rect.width());
             else
                 d->rasterizer->rasterizeLine(a, b, qAbs((s->matrix.m22() * rect.height()) / (s->matrix.m11() * rect.width())));
+            qDebug() << "< - QRasterPaintEngine::drawTiledPixmap(), ret QTransform::TxScale";
             return;
         }
 #endif
@@ -2545,6 +2548,7 @@ void QRasterPaintEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pixmap,
         rr.translate(s->matrix.dx(), s->matrix.dy());
         fillRect_normalized(rr.normalized().toRect(), &d->image_filler, d);
     }
+    qDebug() << "< - QRasterPaintEngine::drawTiledPixmap(), ret";
 }
 
 
@@ -4574,6 +4578,7 @@ void QSpanData::setup(const QBrush &brush, int alpha, QPainter::CompositionMode
             *tempImage = rasterBuffer->colorizeBitmap(brush.textureImage(), brush.color());
         else
             *tempImage = brush.textureImage();
+        qDebug() << __FUNCTION__ << tempImage;
         initTexture(tempImage, alpha, QTextureData::Tiled, tempImage->rect());
         break;
 
@@ -4630,6 +4635,7 @@ void QSpanData::adjustSpanMethods()
 
 void QSpanData::setupMatrix(const QTransform &matrix, int bilin)
 {
+    qDebug() << __FUNCTION__ <<  matrix;
     QTransform delta;
     // make sure we round off correctly in qdrawhelper.cpp
     delta.translate(1.0 / 65536, 1.0 / 65536);
@@ -4663,6 +4669,7 @@ void QSpanData::setupMatrix(const QTransform &matrix, int bilin)
 
 void QSpanData::initTexture(const QImage *image, int alpha, QTextureData::Type _type, const QRect &sourceRect)
 {
+    qDebug() << __FUNCTION__ << *image;
     const QImageData *d = const_cast<QImage *>(image)->data_ptr();
     if (!d || d->height == 0) {
         texture.imageData = 0;
diff --git a/src/gui/painting/qpainter.cpp b/src/gui/painting/qpainter.cpp
index b992e8f55d..a370199587 100644
--- a/src/gui/painting/qpainter.cpp
+++ b/src/gui/painting/qpainter.cpp
@@ -5048,6 +5048,7 @@ static inline QPointF roundInDeviceCoordinates(const QPointF &p, const QTransfor
 */
 void QPainter::drawPixmap(const QPointF &p, const QPixmap &pm)
 {
+    qDebug() << "\n>QPainter::drawPixmap()" << p << pm;
 #if defined QT_DEBUG_DRAW
     if (qt_show_painter_debug_output)
         printf("QPainter::drawPixmap(), p=[%.2f,%.2f], pix=[%d,%d]\n",
@@ -5114,8 +5115,10 @@ void QPainter::drawPixmap(const QPointF &p, const QPixmap &pm)
             y += d->state->matrix.dy();
         }
         qreal scale = pm.devicePixelRatio();
+        qDebug() << "QPainter::drawPixmap(): scale";
         d->engine->drawPixmap(QRectF(x, y, w / scale, h / scale), pm, QRectF(0, 0, w, h));
     }
+    qDebug() << "<QPainter::drawPixmap()\n";
 }
 
 void QPainter::drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr)
@@ -6661,6 +6664,7 @@ QRectF QPainter::boundingRect(const QRectF &r, const QString &text, const QTextO
 */
 void QPainter::drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &sp)
 {
+    qDebug() << "\n QPainter::drawTiledPixmap" << r << pixmap;
 #ifdef QT_DEBUG_DRAW
     if (qt_show_painter_debug_output)
         printf("QPainter::drawTiledPixmap(), target=[%.2f,%.2f,%.2f,%.2f], pix=[%d,%d], offset=[%.2f,%.2f]\n",
@@ -6693,6 +6697,7 @@ void QPainter::drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPo
 
     if (d->extended) {
         d->extended->drawTiledPixmap(r, pixmap, QPointF(sx, sy));
+        qDebug() << "<QPainter::drawTiledPixmap  ret extended";
         return;
     }
 
@@ -6727,6 +6732,7 @@ void QPainter::drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPo
             drawRect(r);
         }
         restore();
+        qDebug() << "<QPainter::drawTiledPixmap  ret 2 complex transform";
         return;
     }
 
@@ -6739,6 +6745,7 @@ void QPainter::drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPo
     }
 
     d->engine->drawTiledPixmap(QRectF(x, y, r.width(), r.height()), pixmap, QPointF(sx, sy));
+    qDebug() << "<QPainter::drawTiledPixmap  ret\n";
 }
 
 /*!
@@ -6938,6 +6945,7 @@ void QPainter::fillRect(const QRectF &r, const QBrush &brush)
 
 void QPainter::fillRect(const QRect &r, const QBrush &brush)
 {
+    qDebug() << "\n>QPainter::fillRect" << brush.style();
     Q_D(QPainter);
 
     if (!d->engine)
@@ -6947,6 +6955,7 @@ void QPainter::fillRect(const QRect &r, const QBrush &brush)
         const QGradient *g = brush.gradient();
         if (!g || g->coordinateMode() == QGradient::LogicalMode) {
             d->extended->fillRect(r, brush);
+            qDebug() << "<QPainter::fillRect extended";
             return;
         }
     }
@@ -6965,6 +6974,7 @@ void QPainter::fillRect(const QRect &r, const QBrush &brush)
     drawRect(r);
     setBrush(oldBrush);
     setPen(oldPen);
+    qDebug() << "<QPainter::fillRect\n";
 }
 
 
