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

List:       kde-commits
Subject:    KDE/kdebase/workspace/kwin/lib
From:       Fredrik Höglund <fredrik () kde ! org>
Date:       2010-03-12 15:17:01
Message-ID: 1268407021.881198.12075.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1102455 by fredrik:

Use GL_BGRA instead of GL_RGBA when creating textures.

GL_BGRA is the native format, and should be faster since it doesn't
require any internal swizzling.


 M  +4 -4      kwinglutils.cpp  


--- trunk/KDE/kdebase/workspace/kwin/lib/kwinglutils.cpp #1102454:1102455
@@ -374,7 +374,7 @@
 
         glGenTextures( 1, &mTexture );
         bind();
-        glTexImage2D( mTarget, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
+        glTexImage2D( mTarget, 0, GL_RGBA8, width, height, 0, GL_BGRA, GL_UNSIGNED_BYTE, 0);
         unbind();
         }
     }
@@ -451,8 +451,8 @@
     if( isNull())
         glGenTextures( 1, &mTexture );
     bind();
-    glTexImage2D( mTarget, 0, GL_RGBA, img.width(), img.height(), 0,
-        GL_RGBA, GL_UNSIGNED_BYTE, img.bits());
+    glTexImage2D( mTarget, 0, GL_RGBA8, img.width(), img.height(), 0,
+        GL_BGRA, GL_UNSIGNED_BYTE, img.bits());
     unbind();
     return true;
     }
@@ -721,7 +721,7 @@
 QImage GLTexture::convertToGLFormat( const QImage& img ) const
     { // Copied from Qt's QGLWidget::convertToGLFormat()
     QImage res(img.size(), QImage::Format_ARGB32);
-    convertToGLFormatHelper(res, img.convertToFormat(QImage::Format_ARGB32), GL_RGBA);
+    convertToGLFormatHelper(res, img.convertToFormat(QImage::Format_ARGB32), GL_BGRA);
     return res;
     }
 
[prev in list] [next in list] [prev in thread] [next in thread] 

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