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

List:       kde-commits
Subject:    KDE/kdebase/workspace/kwin
From:       Lucas Murray <lmurray () undefinedfire ! com>
Date:       2008-10-19 13:43:25
Message-ID: 1224423805.149982.19017.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 873440 by lmurray:

Make the client shadowOpacity() return a relative opacity instead of absolute.

 M  +4 -4      client.h  
 M  +2 -2      clients/oxygen/oxygen.cpp  
 M  +1 -1      clients/oxygen/oxygen.h  
 M  +2 -2      clients/oxygen/oxygenclient.cpp  
 M  +1 -1      clients/oxygen/oxygenclient.h  
 M  +2 -2      clients/ozone/oxygen.cpp  
 M  +1 -1      clients/ozone/oxygen.h  
 M  +2 -2      clients/ozone/oxygenclient.cpp  
 M  +1 -1      clients/ozone/oxygenclient.h  
 M  +4 -5      effects.cpp  
 M  +1 -1      effects.h  
 M  +7 -5      effects/shadow.cpp  
 M  +3 -3      lib/kcommondecoration.cpp  
 M  +1 -1      lib/kcommondecoration.h  
 M  +3 -3      lib/kcommondecoration_p.cpp  
 M  +1 -1      lib/kcommondecoration_p.h  
 M  +3 -3      lib/kdecoration.cpp  
 M  +2 -3      lib/kdecoration.h  
 M  +2 -2      lib/kdecorationfactory.cpp  
 M  +2 -3      lib/kdecorationfactory.h  
 M  +2 -3      lib/kwineffects.h  
 M  +4 -4      workspace.h  


--- trunk/KDE/kdebase/workspace/kwin/client.h #873439:873440
@@ -286,7 +286,7 @@
         
         // Decorations <-> Effects
         QList<QRect> shadowQuads( ShadowType type ) const;
-        double shadowOpacity( ShadowType type, double dataOpacity ) const;
+        double shadowOpacity( ShadowType type ) const;
         double shadowBrightness( ShadowType type ) const;
         double shadowSaturation( ShadowType type ) const;
 
@@ -802,11 +802,11 @@
     return QList<QRect>();
     }
 
-inline double Client::shadowOpacity( ShadowType type, double dataOpacity ) const
+inline double Client::shadowOpacity( ShadowType type ) const
     {
     if( KDecorationUnstable* decoration2 = dynamic_cast< KDecorationUnstable* >( \
                decoration ))
-        return decoration2->shadowOpacity( type, dataOpacity );
-    return dataOpacity;
+        return decoration2->shadowOpacity( type );
+    return 1.0;
     }
 
 inline double Client::shadowBrightness( ShadowType type ) const
--- trunk/KDE/kdebase/workspace/kwin/clients/oxygen/oxygen.cpp #873439:873440
@@ -367,9 +367,9 @@
     return quads;
 }
 
-double OxygenFactory::shadowOpacity( ShadowType type, double dataOpacity ) const
+double OxygenFactory::shadowOpacity( ShadowType type ) const
 {
-    return dataOpacity;
+    return 1.0;
 }
 
 } //namespace Oxygen
--- trunk/KDE/kdebase/workspace/kwin/clients/oxygen/oxygen.h #873439:873440
@@ -65,7 +65,7 @@
     virtual QList< QList<QImage> > shadowTextures();
     virtual int shadowTextureList( ShadowType type ) const;
     virtual QList<QRect> shadowQuads( ShadowType type, QSize size ) const;
-    virtual double shadowOpacity( ShadowType type, double dataOpacity ) const;
+    virtual double shadowOpacity( ShadowType type ) const;
 
     static bool initialized();
     static Qt::Alignment titleAlignment();
--- trunk/KDE/kdebase/workspace/kwin/clients/oxygen/oxygenclient.cpp #873439:873440
@@ -449,12 +449,12 @@
     return quads;
 }
 
-double OxygenClient::shadowOpacity( ShadowType type, double dataOpacity ) const
+double OxygenClient::shadowOpacity( ShadowType type ) const
 {
     switch( type ) {
         case ShadowBorderedActive:
             if( isActive() )
-                return dataOpacity;
+                return 1.0;
             return 0.0;
         case ShadowBorderedInactive:
             if( isActive() )
--- trunk/KDE/kdebase/workspace/kwin/clients/oxygen/oxygenclient.h #873439:873440
@@ -52,7 +52,7 @@
     virtual void init();
 
     virtual QList<QRect> shadowQuads( ShadowType type ) const;
-    virtual double shadowOpacity( ShadowType type, double dataOpacity ) const;
+    virtual double shadowOpacity( ShadowType type ) const;
 
 private:
     void paintEvent(QPaintEvent *e);
--- trunk/KDE/kdebase/workspace/kwin/clients/ozone/oxygen.cpp #873439:873440
@@ -373,9 +373,9 @@
     return quads;
 }
 
-double OxygenFactory::shadowOpacity( ShadowType type, double dataOpacity ) const
+double OxygenFactory::shadowOpacity( ShadowType type ) const
 {
-    return dataOpacity;
+    return 1.0;
 }
 
 } //namespace Oxygen
--- trunk/KDE/kdebase/workspace/kwin/clients/ozone/oxygen.h #873439:873440
@@ -67,7 +67,7 @@
     virtual QList< QList<QImage> > shadowTextures();
     virtual int shadowTextureList( ShadowType type ) const;
     virtual QList<QRect> shadowQuads( ShadowType type, QSize size ) const;
-    virtual double shadowOpacity( ShadowType type, double dataOpacity ) const;
+    virtual double shadowOpacity( ShadowType type ) const;
 
     static bool initialized();
     static Qt::Alignment titleAlignment();
--- trunk/KDE/kdebase/workspace/kwin/clients/ozone/oxygenclient.cpp #873439:873440
@@ -458,12 +458,12 @@
     return quads;
 }
 
-double OxygenClient::shadowOpacity( ShadowType type, double dataOpacity ) const
+double OxygenClient::shadowOpacity( ShadowType type ) const
 {
     switch( type ) {
         case ShadowBorderedActive:
             if( isActive() )
-                return dataOpacity;
+                return 1.0;
             return 0.0;
         case ShadowBorderedInactive:
             if( isActive() )
--- trunk/KDE/kdebase/workspace/kwin/clients/ozone/oxygenclient.h #873439:873440
@@ -54,7 +54,7 @@
     virtual void init();
 
     virtual QList<QRect> shadowQuads( ShadowType type ) const;
-    virtual double shadowOpacity( ShadowType type, double dataOpacity ) const;
+    virtual double shadowOpacity( ShadowType type ) const;
 
 private:
     void paintEvent(QPaintEvent *e);
--- trunk/KDE/kdebase/workspace/kwin/effects.cpp #873439:873440
@@ -1347,16 +1347,15 @@
     return toplevel->workspace()->decorationShadowQuads( type, toplevel->size() );
     }
 
-double EffectWindowImpl::shadowOpacity( ShadowType type, double dataOpacity ) const
+double EffectWindowImpl::shadowOpacity( ShadowType type ) const
     {
-    dataOpacity *= opacity();
     if( type == ShadowBorderedActive ||  type == ShadowBorderedInactive )
         {
         if( Client* c = dynamic_cast< Client* >( toplevel ))
-            return c->shadowOpacity( type, dataOpacity );
-        return dataOpacity;
+            return c->shadowOpacity( type );
+        return 1.0;
         }
-    return toplevel->workspace()->decorationShadowOpacity( type, dataOpacity );
+    return toplevel->workspace()->decorationShadowOpacity( type );
     }
 
 double EffectWindowImpl::shadowBrightness( ShadowType type ) const
--- trunk/KDE/kdebase/workspace/kwin/effects.h #873439:873440
@@ -239,7 +239,7 @@
         virtual EffectWindowList mainWindows() const;
 
         virtual QList<QRect> shadowQuads( ShadowType type ) const;
-        virtual double shadowOpacity( ShadowType type, double dataOpacity ) const;
+        virtual double shadowOpacity( ShadowType type ) const;
         virtual double shadowBrightness( ShadowType type ) const;
         virtual double shadowSaturation( ShadowType type ) const;
 
--- trunk/KDE/kdebase/workspace/kwin/effects/shadow.cpp #873439:873440
@@ -530,7 +530,7 @@
                         { // Decorated windows
                         // Active shadow
                         mShadowTextures.at( texture ).at( quad.id() )->bind();
-                        glColor4f( 1.0, 1.0, 1.0, window->shadowOpacity( \
ShadowBorderedActive, data.opacity )); +                        glColor4f( 1.0, 1.0, \
                1.0, data.opacity * window->shadowOpacity( ShadowBorderedActive ));
                         glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
                         mShadowTextures.at( texture ).at( quad.id() \
                )->enableNormalizedTexCoords();
                         renderGLGeometry( region, 4, verts.data(), texcoords.data() \
); @@ -540,7 +540,7 @@
                         // Inactive shadow
                         texture = effects->shadowTextureList( ShadowBorderedInactive \
                );
                         mShadowTextures.at( texture ).at( quad.id() )->bind();
-                        glColor4f( 1.0, 1.0, 1.0, window->shadowOpacity( \
ShadowBorderedInactive, data.opacity )); +                        glColor4f( 1.0, \
                1.0, 1.0, data.opacity * window->shadowOpacity( \
                ShadowBorderedInactive ));
                         glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
                         mShadowTextures.at( texture ).at( quad.id() \
                )->enableNormalizedTexCoords();
                         renderGLGeometry( region, 4, verts.data(), texcoords.data() \
); @@ -550,11 +550,13 @@
                     else if( effects->shadowTextureList( ShadowBorderlessActive ) == \
texture )  { // Decoration-less normal windows
                         if( effects->activeWindow() == window )
-                            glColor4f( 1.0, 1.0, 1.0, window->shadowOpacity( \
ShadowBorderlessActive, data.opacity )); +                            glColor4f( 1.0, \
1.0, 1.0, +                                       data.opacity * \
window->shadowOpacity( ShadowBorderlessActive ));  else
                             {
                             texture = effects->shadowTextureList( \
                ShadowBorderlessInactive );
-                            glColor4f( 1.0, 1.0, 1.0, window->shadowOpacity( \
ShadowBorderlessInactive, data.opacity )); +                            glColor4f( \
1.0, 1.0, 1.0, +                                       data.opacity * \
window->shadowOpacity( ShadowBorderlessInactive ));  }
                         mShadowTextures.at( texture ).at( quad.id() )->bind();
                         glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
@@ -566,7 +568,7 @@
                     else
                         { // Other windows
                         mShadowTextures.at( texture ).at( quad.id() )->bind();
-                        glColor4f( 1.0, 1.0, 1.0, window->shadowOpacity( \
ShadowOther, data.opacity )); +                        glColor4f( 1.0, 1.0, 1.0, \
                data.opacity * window->shadowOpacity( ShadowOther ));
                         glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
                         mShadowTextures.at( texture ).at( quad.id() \
                )->enableNormalizedTexCoords();
                         renderGLGeometry( region, 4, verts.data(), texcoords.data() \
                );
--- trunk/KDE/kdebase/workspace/kwin/lib/kcommondecoration.cpp #873439:873440
@@ -1238,12 +1238,12 @@
     Q_UNUSED( type );
     return QList<QRect>();
     }
-double KCommonDecorationUnstable::shadowOpacity( ShadowType type, double dataOpacity \
) const +double KCommonDecorationUnstable::shadowOpacity( ShadowType type ) const
     {
     if( isActive() && type == ShadowBorderedActive )
-        return dataOpacity;
+        return 1.0;
     else if( !isActive() && type == ShadowBorderedInactive )
-        return dataOpacity;
+        return 1.0;
     return 0.0;
     }
 double KCommonDecorationUnstable::shadowBrightness( ShadowType type ) const
--- trunk/KDE/kdebase/workspace/kwin/lib/kcommondecoration.h #873439:873440
@@ -370,7 +370,7 @@
         KCommonDecorationUnstable(KDecorationBridge* bridge, KDecorationFactory* \
factory);  virtual ~KCommonDecorationUnstable();
         virtual QList<QRect> shadowQuads( ShadowType type ) const;
-        virtual double shadowOpacity( ShadowType type, double dataOpacity ) const;
+        virtual double shadowOpacity( ShadowType type ) const;
         virtual double shadowBrightness( ShadowType type ) const;
         virtual double shadowSaturation( ShadowType type ) const;
         void repaintShadow();
--- trunk/KDE/kdebase/workspace/kwin/lib/kcommondecoration_p.cpp #873439:873440
@@ -120,11 +120,11 @@
     return QList<QRect>();
     }
 
-double KCommonDecorationWrapper::shadowOpacity( ShadowType type, double dataOpacity \
) const +double KCommonDecorationWrapper::shadowOpacity( ShadowType type ) const
     {
     if( KCommonDecorationUnstable *decoration2 = \
                dynamic_cast<KCommonDecorationUnstable*>( decoration ))
-        return decoration2->shadowOpacity( type, dataOpacity );
-    return dataOpacity;
+        return decoration2->shadowOpacity( type );
+    return 1.0;
     }
 
 double KCommonDecorationWrapper::shadowBrightness( ShadowType type ) const
--- trunk/KDE/kdebase/workspace/kwin/lib/kcommondecoration_p.h #873439:873440
@@ -60,7 +60,7 @@
         virtual void reset( unsigned long changed );
 
         virtual QList<QRect> shadowQuads( ShadowType type ) const;
-        virtual double shadowOpacity( ShadowType type, double dataOpacity ) const;
+        virtual double shadowOpacity( ShadowType type ) const;
         virtual double shadowBrightness( ShadowType type ) const;
         virtual double shadowSaturation( ShadowType type ) const;
     private:
--- trunk/KDE/kdebase/workspace/kwin/lib/kdecoration.cpp #873439:873440
@@ -399,12 +399,12 @@
     return QList<QRect>();
     }
 
-double KDecorationUnstable::shadowOpacity( ShadowType type, double dataOpacity ) \
const +double KDecorationUnstable::shadowOpacity( ShadowType type ) const
     {
     if( isActive() && type == ShadowBorderedActive )
-        return dataOpacity;
+        return 1.0;
     else if( !isActive() && type == ShadowBorderedInactive )
-        return dataOpacity;
+        return 1.0;
     return 0.0;
     }
 
--- trunk/KDE/kdebase/workspace/kwin/lib/kdecoration.h #873439:873440
@@ -882,10 +882,9 @@
          */
         virtual QList<QRect> shadowQuads( ShadowType type ) const;
         /**
-         * This function should return the opacity of the shadow. This is not \
                multiplied
-         * with the opacity of the window afterwards but is instead provided as \a \
dataOpacity +         * This function should return the desired opacity of the \
                shadow.
          */
-        virtual double shadowOpacity( ShadowType type, double dataOpacity ) const;
+        virtual double shadowOpacity( ShadowType type ) const;
         /**
          * This function should return the desired brightness of the shadow.
          */
--- trunk/KDE/kdebase/workspace/kwin/lib/kdecorationfactory.cpp #873439:873440
@@ -97,10 +97,10 @@
     return QList<QRect>();
     }
 
-double KDecorationFactoryUnstable::shadowOpacity( ShadowType type, double \
dataOpacity ) const +double KDecorationFactoryUnstable::shadowOpacity( ShadowType \
type ) const  {
     Q_UNUSED( type );
-    return dataOpacity;
+    return 1.0;
     }
 
 double KDecorationFactoryUnstable::shadowBrightness( ShadowType type ) const
--- trunk/KDE/kdebase/workspace/kwin/lib/kdecorationfactory.h #873439:873440
@@ -141,10 +141,9 @@
          */
         virtual QList<QRect> shadowQuads( ShadowType type, QSize size ) const;
         /**
-         * This function should return the opacity of the shadow. This is not \
                multiplied
-         * with the opacity of the window afterwards but is instead provided as \a \
dataOpacity +         * This function should return the desired opacity of the \
                shadow.
          */
-        virtual double shadowOpacity( ShadowType type, double dataOpacity ) const;
+        virtual double shadowOpacity( ShadowType type ) const;
         /**
          * This function should return the desired brightness of the shadow.
          */
--- trunk/KDE/kdebase/workspace/kwin/lib/kwineffects.h #873439:873440
@@ -825,10 +825,9 @@
          */
         virtual QList<QRect> shadowQuads( ShadowType type ) const = 0;
         /**
-         * Returns the opacity of the shadow. This has already been pre-multiplied \
                by
-         * the window's opacity if the decoration desires so.
+         * Returns the desired opacity of the shadow.
          */
-        virtual double shadowOpacity( ShadowType type, double dataOpacity ) const = \
0; +        virtual double shadowOpacity( ShadowType type ) const = 0;
         /**
          * Returns the desired brightness of the shadow.
          */
--- trunk/KDE/kdebase/workspace/kwin/workspace.h #873439:873440
@@ -248,7 +248,7 @@
         QList< QList<QImage> > decorationShadowTextures();
         int decorationShadowTextureList( ShadowType type ) const;
         QList<QRect> decorationShadowQuads( ShadowType type, QSize size ) const;
-        double decorationShadowOpacity( ShadowType type, double dataOpacity ) const;
+        double decorationShadowOpacity( ShadowType type ) const;
         double decorationShadowBrightness( ShadowType type ) const;
         double decorationShadowSaturation( ShadowType type ) const;
 
@@ -1022,11 +1022,11 @@
     }
 
 inline
-double Workspace::decorationShadowOpacity( ShadowType type, double dataOpacity ) \
const +double Workspace::decorationShadowOpacity( ShadowType type ) const
     {
     if( KDecorationFactoryUnstable* factory = dynamic_cast< \
                KDecorationFactoryUnstable* >( mgr->factory() ))
-        return factory->shadowOpacity( type, dataOpacity );
-    return dataOpacity;
+        return factory->shadowOpacity( type );
+    return 1.0;
     }
 
 inline


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

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