summaryrefslogtreecommitdiff
path: root/src/plugins/platforms/minimal/qminimalbackingstore.cpp
diff options
context:
space:
mode:
authorKurt Korbatits <kurt.korbatits@nokia.com>2012-01-23 10:35:19 +1000
committerQt by Nokia <qt-info@nokia.com>2012-01-31 04:55:05 +0100
commit0790756c9308661616fffaf1d940c28497941439 (patch)
treef7eaafedc7a1ccd74a551c445f83ed78966d258e /src/plugins/platforms/minimal/qminimalbackingstore.cpp
parente24021691ffffbd9cda91340fc2e8d5dcfd88d24 (diff)
downloadqtbase-0790756c9308661616fffaf1d940c28497941439.tar.gz
Changed debug output to option in qminimalbackingstore.
- Added QT_DEBUG_BACKINGSTORE environment variable to enable debug output. Defaulting to no output if not set. Change-Id: Id9c369031f946d77605321c8b28ab3378da8fbf9 Reviewed-by: Kurt Korbatits <kurt.korbatits@nokia.com> Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com> Reviewed-by: Jonas Gastal <jgastal@profusion.mobi> Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/plugins/platforms/minimal/qminimalbackingstore.cpp')
-rw-r--r--src/plugins/platforms/minimal/qminimalbackingstore.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/plugins/platforms/minimal/qminimalbackingstore.cpp b/src/plugins/platforms/minimal/qminimalbackingstore.cpp
index eca81c244f..b6b9c0e979 100644
--- a/src/plugins/platforms/minimal/qminimalbackingstore.cpp
+++ b/src/plugins/platforms/minimal/qminimalbackingstore.cpp
@@ -48,9 +48,12 @@
QT_BEGIN_NAMESPACE
QMinimalBackingStore::QMinimalBackingStore(QWindow *window)
- : QPlatformBackingStore(window)
+ : QPlatformBackingStore(window),mDebug(false)
{
- //qDebug() << "QMinimalBackingStore::QMinimalBackingStore:" << (long)this;
+ if (QT_PREPEND_NAMESPACE(qgetenv)("QT_DEBUG_BACKINGSTORE").toInt() > 0)
+ mDebug = true;
+ if (mDebug)
+ qDebug() << "QMinimalBackingStore::QMinimalBackingStore:" << (long)this;
}
QMinimalBackingStore::~QMinimalBackingStore()
@@ -59,7 +62,9 @@ QMinimalBackingStore::~QMinimalBackingStore()
QPaintDevice *QMinimalBackingStore::paintDevice()
{
- //qDebug() << "QMinimalBackingStore::paintDevice";
+ if (mDebug)
+ qDebug() << "QMinimalBackingStore::paintDevice";
+
return &mImage;
}
@@ -69,15 +74,16 @@ void QMinimalBackingStore::flush(QWindow *window, const QRegion &region, const Q
Q_UNUSED(region);
Q_UNUSED(offset);
- static int c = 0;
- QString filename = QString("output%1.png").arg(c++, 4, 10, QLatin1Char('0'));
- qDebug() << "QMinimalBackingStore::flush() saving contents to" << filename.toLocal8Bit().constData();
- mImage.save(filename);
+ if (mDebug) {
+ static int c = 0;
+ QString filename = QString("output%1.png").arg(c++, 4, 10, QLatin1Char('0'));
+ qDebug() << "QMinimalBackingStore::flush() saving contents to" << filename.toLocal8Bit().constData();
+ mImage.save(filename);
+ }
}
void QMinimalBackingStore::resize(const QSize &size, const QRegion &)
{
- //qDebug() << "QMinimalBackingStore::setGeometry:" << (long)this << rect;
QImage::Format format = QGuiApplication::primaryScreen()->handle()->format();
if (mImage.size() != size)
mImage = QImage(size, format);