From kde-commits Sat Apr 14 07:21:17 2007 From: Mark Kretschmann Date: Sat, 14 Apr 2007 07:21:17 +0000 To: kde-commits Subject: extragear/multimedia/amarok/src Message-Id: <1176535277.206481.27225.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=117661908317306 SVN commit 653775 by markey: Shadowed text works again :) M +3 -9 osd.cpp --- trunk/extragear/multimedia/amarok/src/osd.cpp #653774:653775 @@ -368,13 +368,11 @@ rect.setBottom( rect.bottom() - graphicsHeight ); - // FIXME Disabled because it draws a weird black rectangle -#if 0 + // Draw "shadow" text effect (black outline) if( m_drawShadow ) { QPixmap pixmap( rect.size() + QSize(10,10) ); pixmap.fill( Qt::black ); - pixmap.setMask( pixmap.createHeuristicMask( true ) ); QPainter p2( &pixmap ); p2.setFont( font() ); @@ -385,7 +383,6 @@ p.drawImage( rect.topLeft() - QPoint(5,5), ShadowEngine::makeShadow( pixmap, shadowColor ) ); } -#endif p.setPen( foregroundColor() ); p.setFont( font() ); @@ -801,8 +798,6 @@ QImage makeShadow( const QPixmap& textPixmap, const QColor &bgColor ) { - QImage result; - const int w = textPixmap.width(); const int h = textPixmap.height(); const int bgr = bgColor.red(); @@ -812,11 +807,10 @@ int alphaShadow; // This is the source pixmap - QImage img = textPixmap.convertToImage().convertDepth( 32 ); + QImage img = textPixmap.toImage(); - result.create( w, h, 32 ); + QImage result( w, h, QImage::Format_ARGB32 ); result.fill( 0 ); // fill with black - result.setAlphaBuffer( true ); static const int M = 5; for( int i = M; i < w - M; i++) {