diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2014-11-25 13:38:16 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2014-11-25 13:39:37 -0600 |
commit | d8287f97874be7db0d498f3808f68bdfee902ba3 (patch) | |
tree | 0c8de5b79b37732eb199d69e3e6cdd945cd3b816 /ksmserver | |
parent | f1baae5fff89ee638864f7d9b82f88b9dfa59796 (diff) | |
download | tdebase-d8287f97874be7db0d498f3808f68bdfee902ba3.tar.gz tdebase-d8287f97874be7db0d498f3808f68bdfee902ba3.zip |
Rewrite greyscale OpenGL system to use GLSL
Add ability to blend color and greyscale based on window alpha (actual window alpha currently set at 0.5 when blending is enabled)
Reenable greyscale logout effect when compositor is in use
Diffstat (limited to 'ksmserver')
-rw-r--r-- | ksmserver/shutdowndlg.cpp | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/ksmserver/shutdowndlg.cpp b/ksmserver/shutdowndlg.cpp index 5c50602cb..6573f8bd2 100644 --- a/ksmserver/shutdowndlg.cpp +++ b/ksmserver/shutdowndlg.cpp @@ -87,6 +87,11 @@ KSMShutdownFeedback::KSMShutdownFeedback() m_grayImage.setAlphaBuffer(false); m_grayImage.fill(0); // Set the alpha buffer to 0 (fully transparent) m_grayImage.setAlphaBuffer(true); + + // Signal that we want a greyscale filter on the transparency + Atom kde_wm_transparent_greyscale_filter; + kde_wm_transparent_greyscale_filter = XInternAtom(tqt_xdisplay(), "_TDE_TRANSPARENCY_FILTER_GREYSCALE_BLEND", False); + XChangeProperty(tqt_xdisplay(), winId(), kde_wm_transparent_greyscale_filter, XA_INTEGER, 32, PropModeReplace, (unsigned char *) "TRUE", 1L); } else { // The hacks below aren't needed any more because Qt3 supports true transparency for the fading logout screen when composition is available @@ -135,10 +140,10 @@ void KSMShutdownFeedback::slotPaintEffect() m_root.resize( width(), height() ); TQImage blendedImage = m_grayImage; TQPainter p; - p.begin( &m_root ); - blendedImage.setAlphaBuffer(false); - p.drawImage( 0, 0, blendedImage ); - p.end(); + p.begin( &m_root ); + blendedImage.setAlphaBuffer(false); + p.drawImage( 0, 0, blendedImage ); + p.end(); setBackgroundPixmap( m_root ); setGeometry( TQApplication::desktop()->geometry() ); @@ -150,7 +155,7 @@ void KSMShutdownFeedback::slotPaintEffect() uchar * end = m_grayImage.bits() + m_grayImage.numBytes(); while ( r != end ) { - *reinterpret_cast<TQRgb*>(r) = tqRgba(0, 0, 0, 128); + *reinterpret_cast<TQRgb*>(r) = tqRgba(0, 0, 0, 255); r += 4; } @@ -220,7 +225,6 @@ void KSMShutdownFeedback::slotPaintEffect() { TQImage img( imgWidth, y2-start_y1, 32 ); memcpy( img.bits(), m_grayImage.scanLine( start_y1 ), ( y2-start_y1 ) * imgWidth * 4 ); - register uchar * rs = m_unfadedImage.scanLine( start_y1 ); register uchar * rd = img.bits(); for( int y = start_y1; y < y2; ++y ) { @@ -228,8 +232,8 @@ void KSMShutdownFeedback::slotPaintEffect() short int opac = static_cast<short int>( 128 - cosf( M_PI*(y-y1)/heightUnit )*128.0f ); for( short int x = 0; x < imgWidth; ++x ) { - *reinterpret_cast<TQRgb*>(rd) = tqRgba(0, 0, 0, ((255.0-opac)/(255.0/127.0))); - rs += 4; rd += 4; + *reinterpret_cast<TQRgb*>(rd) = tqRgba(0, 0, 0, ((255.0-opac))); + rd += 4; } } bitBlt( this, 0, start_y1, &img ); |