diff --git a/src/platformsupport/fontdatabases/windows/qwindowsnativeimage.cpp b/src/platformsupport/fontdatabases/windows/qwindowsnativeimage.cpp
index f8fcff9..70d54b1 100644
--- a/src/platformsupport/fontdatabases/windows/qwindowsnativeimage.cpp
+++ b/src/platformsupport/fontdatabases/windows/qwindowsnativeimage.cpp
@@ -41,6 +41,8 @@
 
 #include <QtGui/private/qpaintengine_p.h>
 #include <QtGui/private/qpaintengine_raster_p.h>
+#include <QtCore/QMap>
+#include <QtCore/QDebug>
 
 QT_BEGIN_NAMESPACE
 
@@ -154,4 +156,32 @@ QImage::Format QWindowsNativeImage::systemFormat()
     return depth == 16 ? QImage::Format_RGB16 : QImage::Format_RGB32;
 }
 
+void QWindowsNativeImage::dumpHistogram()
+{
+    typedef QMap<quint32, int> Histogram;
+
+    const uchar *cb = m_image.constBits();
+    const uchar *cbEnd = cb + m_image.byteCount();
+    const quint32 *ab = reinterpret_cast<const quint32 *>(cb);
+    const quint32 *abEnd = reinterpret_cast<const quint32 *>(cbEnd);
+
+    Histogram hist;
+    for ( ; ab < abEnd; ++ab) {
+        const quint32 argb = *ab;
+        Histogram::iterator it = hist.find(argb);
+        if (it == hist.end())
+            hist.insert(argb, 0);
+        else
+            ++it.value();
+    }
+    QDebug d = qDebug();
+    d.nospace();
+    int l  = 1;
+    for (Histogram::const_iterator it = hist.cbegin(), end = hist.cend(); it != end; ++it) {
+        d << hex << qSetPadChar(QLatin1Char('0')) << qSetFieldWidth(8) << it.key() << qSetFieldWidth(0) <<
+             dec << qSetPadChar(QLatin1Char(' ')) << qSetFieldWidth(5) << it.value()
+          << ((l++ % 4) ? ' ' : '\n');
+    }
+}
+
 QT_END_NAMESPACE
diff --git a/src/platformsupport/fontdatabases/windows/qwindowsnativeimage_p.h b/src/platformsupport/fontdatabases/windows/qwindowsnativeimage_p.h
index 6c47a52..f1729d3 100644
--- a/src/platformsupport/fontdatabases/windows/qwindowsnativeimage_p.h
+++ b/src/platformsupport/fontdatabases/windows/qwindowsnativeimage_p.h
@@ -76,6 +76,7 @@ public:
 
     static QImage::Format systemFormat();
 
+    void dumpHistogram();
 private:
     const HDC m_hdc;
     QImage m_image;
diff --git a/src/plugins/platforms/windows/qwindowsbackingstore.cpp b/src/plugins/platforms/windows/qwindowsbackingstore.cpp
index 49c7144..692c8af 100644
--- a/src/plugins/platforms/windows/qwindowsbackingstore.cpp
+++ b/src/plugins/platforms/windows/qwindowsbackingstore.cpp
@@ -89,7 +89,10 @@ void QWindowsBackingStore::flush(QWindow *window, const QRegion &region,
 
     const bool hasAlpha = rw->format().hasAlpha();
     const Qt::WindowFlags flags = window->flags();
+    qDebug() << __FUNCTION__ << window ;
+    m_image->dumpHistogram();
     if ((flags & Qt::FramelessWindowHint) && QWindowsWindow::setWindowLayered(rw->handle(), flags, hasAlpha, rw->opacity()) && hasAlpha) {
+        qDebug() << __FUNCTION__ << window << "UpdateLayeredWindowIndirect";
         // Windows with alpha: Use blend function to update.
         QRect r = QHighDpi::toNativePixels(window->frameGeometry(), window);
         QPoint frameOffset(QHighDpi::toNativePixels(QPoint(window->frameMargins().left(), window->frameMargins().top()),
@@ -115,6 +118,7 @@ void QWindowsBackingStore::flush(QWindow *window, const QRegion &region,
             qErrnoWarning("%s: GetDC failed", __FUNCTION__);
             return;
         }
+        qDebug() << __FUNCTION__ << window << "BitBlt";
 
         if (!BitBlt(dc, br.x(), br.y(), br.width(), br.height(),
                     m_image->hdc(), br.x() + offset.x(), br.y() + offset.y(), SRCCOPY)) {
@@ -158,6 +162,9 @@ void QWindowsBackingStore::resize(const QSize &size, const QRegion &region)
 
         QWindowsNativeImage *oldwni = m_image.data();
         QWindowsNativeImage *newwni = new QWindowsNativeImage(size.width(), size.height(), format);
+        format = QImage::Format_ARGB32;
+        qDebug() << __FUNCTION__ << window() << "format=" << format
+                 << "systemFormat=" << QWindowsNativeImage::systemFormat();
 
         if (oldwni && !region.isEmpty()) {
             const QImage &oldimg(oldwni->image());
@@ -191,6 +198,7 @@ bool QWindowsBackingStore::scroll(const QRegion &area, int dx, int dy)
 
 void QWindowsBackingStore::beginPaint(const QRegion &region)
 {
+
     if (QWindowsContext::verbose > 1)
         qCDebug(lcQpaBackingStore) <<__FUNCTION__ << region;
 
diff --git a/src/plugins/platforms/windows/qwindowswindow.cpp b/src/plugins/platforms/windows/qwindowswindow.cpp
index 2875463..551c949 100644
--- a/src/plugins/platforms/windows/qwindowswindow.cpp
+++ b/src/plugins/platforms/windows/qwindowswindow.cpp
@@ -365,8 +365,10 @@ static void setWindowOpacity(HWND hwnd, Qt::WindowFlags flags, bool hasAlpha, bo
         if (hasAlpha && !openGL && (flags & Qt::FramelessWindowHint)) {
             // Non-GL windows with alpha: Use blend function to update.
             BLENDFUNCTION blend = {AC_SRC_OVER, 0, alpha, AC_SRC_ALPHA};
+            qDebug() << __FUNCTION__ << "UpdateLayeredWindow" << level;
             UpdateLayeredWindow(hwnd, NULL, NULL, NULL, NULL, NULL, 0, &blend, ULW_ALPHA);
         } else {
+            qDebug() << __FUNCTION__ << "SetLayeredWindowAttributes" << alpha;
             SetLayeredWindowAttributes(hwnd, 0, alpha, LWA_ALPHA);
         }
     } else if (IsWindowVisible(hwnd)) { // Repaint when switching from layered.
