[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdegames/kpat/libkcardgame
From:       Parker Coates <parker.coates () kdemail ! net>
Date:       2011-01-20 15:39:05
Message-ID: 20110120153905.37009AC8B7 () svn ! kde ! org
[Download RAW message or body]

SVN commit 1215965 by coates:

Switch back to Format_ARGB32 to avoid colour artifacts.

See comment in patch for reasoning.

 M  +7 -2      kabstractcarddeck.cpp  


--- trunk/KDE/kdegames/kpat/libkcardgame/kabstractcarddeck.cpp #1215964:1215965
@@ -88,7 +88,7 @@
         {
             kDebug() << "Renderering" << key << "in rendering thread.";
 
-            QImage img = QImage( m_size, QImage::Format_ARGB32_Premultiplied );
+            QImage img = QImage( m_size, QImage::Format_ARGB32 );
             img.fill( Qt::transparent );
             QPainter p( &img );
             {
@@ -147,7 +147,12 @@
     QString key = keyForPixmap( element , currentCardSize );
     kDebug() << "Renderering" << key << "in main thread.";
 
-    QImage img( currentCardSize, QImage::Format_ARGB32_Premultiplied );
+    // Note that we don't use Format_ARGB32_Premultiplied as it sacrifices some
+    // colour accuracy at low opacities for performance. Normally this wouldn't
+    // be an issue, but in card games we often will have, say, 52 pixmaps
+    // stacked on top of one another, which causes these colour inaccuracies to
+    // add up to the point that they're very visible.
+    QImage img( currentCardSize, QImage::Format_ARGB32 );
     img.fill( Qt::transparent );
     QPainter p( &img );
     {
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic