From ab52bb043ee0f47030203501943d3e7a1f985db6 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Fri, 19 Aug 2011 13:19:38 -0500 Subject: [PATCH] Increase size of internal shared double buffer to accommodate larger screens more typical of modern (year 2011) systems --- .../tqtinterface/qt4/src/kernel/tqinternal.cpp | 16 ++++++++++++++++ main/dependencies/qt3/src/kernel/qinternal.cpp | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/experimental/tqtinterface/qt4/src/kernel/tqinternal.cpp b/experimental/tqtinterface/qt4/src/kernel/tqinternal.cpp index 7ad13f18e..4d80f8934 100644 --- a/experimental/tqtinterface/qt4/src/kernel/tqinternal.cpp +++ b/experimental/tqtinterface/qt4/src/kernel/tqinternal.cpp @@ -44,6 +44,11 @@ #include "tqpainter.h" #include "tqcleanuphandler.h" +// Modern systems (year 2011) have very large screens in excess of 1000 pixels wide +// Some may even have screens in excess of 4000 pixels wide(!) +// Prevent drawing artifacts on such screens +#define USE_HUGE_QT_SHARED_DOUBLE_BUFFERS 1 + static TQPixmap* qdb_shared_pixmap = 0; static TQPixmap *qdb_force_pixmap = 0; static TQSharedDoubleBuffer* qdb_owner = 0; @@ -74,9 +79,15 @@ static const int hardLimitHeight = -1; // static const int sharedLimitWidth = 64; // static const int sharedLimitHeight = 20; // #else +#ifdef USE_HUGE_QT_SHARED_DOUBLE_BUFFERS +// 24M on 32bpp +static const int sharedLimitWidth = 6400; +static const int sharedLimitHeight = 1000; +#else // 240K on 32bpp static const int sharedLimitWidth = 640; static const int sharedLimitHeight = 100; +#endif // #endif // ******************************************************************* @@ -533,8 +544,13 @@ TQPixmap *TQSharedDoubleBuffer::getPixmap() rw = 4000; // 32MB seems reasonable enough, but the usage is likely to be wider than it is tall (think of multiple wide monitors) rh = 2000; #else // USE_QT4 +#ifdef USE_HUGE_QT_SHARED_DOUBLE_BUFFERS + rw = TQMIN(rw, 16000); + rh = TQMIN(rh, 16000); +#else rw = TQMIN(rw, 8000); rh = TQMIN(rh, 8000); +#endif #endif // USE_QT4 // need to create a big pixmap and start the cleaner if ( ! qdb_force_pixmap ) { diff --git a/main/dependencies/qt3/src/kernel/qinternal.cpp b/main/dependencies/qt3/src/kernel/qinternal.cpp index 4289ecd6b..cf1e037ee 100644 --- a/main/dependencies/qt3/src/kernel/qinternal.cpp +++ b/main/dependencies/qt3/src/kernel/qinternal.cpp @@ -44,6 +44,11 @@ #include "qpainter.h" #include "qcleanuphandler.h" +// Modern systems (year 2011) have very large screens in excess of 1000 pixels wide +// Some may even have screens in excess of 4000 pixels wide(!) +// Prevent drawing artifacts on such screens +#define USE_HUGE_QT_SHARED_DOUBLE_BUFFERS 1 + static QPixmap* qdb_shared_pixmap = 0; static QPixmap *qdb_force_pixmap = 0; static QSharedDoubleBuffer* qdb_owner = 0; @@ -74,10 +79,16 @@ static const int hardLimitHeight = -1; static const int sharedLimitWidth = 64; static const int sharedLimitHeight = 20; #else +#ifdef USE_HUGE_QT_SHARED_DOUBLE_BUFFERS +// 24M on 32bpp +static const int sharedLimitWidth = 6400; +static const int sharedLimitHeight = 1000; +#else // 240K on 32bpp static const int sharedLimitWidth = 640; static const int sharedLimitHeight = 100; #endif +#endif // ******************************************************************* // QSharedDoubleBufferCleaner declaration and implementation @@ -527,8 +538,13 @@ QPixmap *QSharedDoubleBuffer::getPixmap() if ( rw >= sharedLimitWidth || rh >= sharedLimitHeight ) { if ( flags & Force ) { +#ifdef USE_HUGE_QT_SHARED_DOUBLE_BUFFERS + rw = QMIN(rw, 16000); + rh = QMIN(rh, 16000); +#else rw = QMIN(rw, 8000); rh = QMIN(rh, 8000); +#endif // need to create a big pixmap and start the cleaner if ( ! qdb_force_pixmap ) { qdb_force_pixmap = new QPixmap( rw, rh );