properly deal with invalid colors when calculating cache keys.

using color.rgba() for an invalid color corresponds to solid black, which in turns conflicts with the cache
value for such color. We use "transparent black" instead.
CCBUG: 304868
icc-effect-5.14.5
Hugo Pereira Da Costa 2012-08-29 14:51:14 +02:00
parent 84ac01754c
commit e06ca2e82c
1 changed files with 3 additions and 3 deletions

View File

@ -55,7 +55,7 @@ namespace Oxygen
Oxygen::Cache<QPixmap>::Value* cache( _windecoButtonCache.get( color ) );
const quint64 key( ( quint64( glow.rgba() ) << 32 ) | (sunken << 23 ) | size );
const quint64 key( ( colorKey(glow) << 32 ) | (sunken << 23 ) | size );
QPixmap *pixmap = cache->object( key );
if( !pixmap )
@ -151,7 +151,7 @@ namespace Oxygen
const QColor& DecoHelper::inactiveTitleBarTextColor( const QPalette& palette )
{
const quint32 key( palette.color(QPalette::Active, QPalette::Window).rgba() );
const quint32 key( colorKey( palette.color(QPalette::Active, QPalette::Window) ) );
QColor* out( _titleBarTextColorCache.object( key ) );
if( !out )
{
@ -173,7 +173,7 @@ namespace Oxygen
const QColor& DecoHelper::inactiveButtonTextColor( const QPalette& palette )
{
const quint32 key( palette.color(QPalette::Active, QPalette::Window).rgba() );
const quint32 key( colorKey( palette.color(QPalette::Active, QPalette::Window) ) );
QColor* out( _buttonTextColorCache.object( key ) );
if( !out )
{