[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - 2 commits - vcl/opengl

Tomaž Vajngerl tomaz.vajngerl at collabora.co.uk
Fri Aug 7 02:35:19 PDT 2015


 vcl/opengl/program.cxx |    1 +
 vcl/opengl/salbmp.cxx  |    7 +++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

New commits:
commit b55e95ab39c684e226c667af456dea4f3d53b791
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Mon Aug 3 10:13:38 2015 +0900

    Apply MVP matrix when drawing texture using OpenGLProgram
    
    Change-Id: I1dc34eee645b77537517e147b86599cfe74f09a9
    (cherry picked from commit d97cc94a02c00b912bbcb430cde55ce0cfb0292c)
    Reviewed-on: https://gerrit.libreoffice.org/17560
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/vcl/opengl/program.cxx b/vcl/opengl/program.cxx
index 157243b..3bfa6c2 100644
--- a/vcl/opengl/program.cxx
+++ b/vcl/opengl/program.cxx
@@ -278,6 +278,7 @@ bool OpenGLProgram::DrawTexture( OpenGLTexture& rTexture )
     rTexture.GetWholeCoord( aTexCoord );
     SetVertices( aPosition );
     SetTextureCoord( aTexCoord );
+    ApplyMatrix(fWidth, fHeight);
     glDrawArrays( GL_TRIANGLE_FAN, 0, 4 );
     CHECK_GL_ERROR();
 
commit 127768880d44881defa937a98d222df321a47262
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Fri Jul 31 16:46:47 2015 +0900

    opengl: support reading 8bit texture (fixes icon corruption)
    
    Change-Id: Iba3fd58374a550f3411b02f029f12f4509fb6048
    (cherry picked from commit f73e1f50240208257964e28e0e65a56e323d86da)
    Reviewed-on: https://gerrit.libreoffice.org/17559
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx
index 982de8b..7b7f674 100644
--- a/vcl/opengl/salbmp.cxx
+++ b/vcl/opengl/salbmp.cxx
@@ -368,7 +368,7 @@ GLuint OpenGLSalBitmap::CreateTexture()
         else
         {
             // convert to 32 bits RGBA using palette
-            pData = new sal_uInt8[ mnBufHeight * (mnBufWidth << 2) ];
+            pData = new sal_uInt8[mnBufHeight * mnBufWidth * 4];
             bAllocated = true;
             nFormat = GL_RGBA;
             nType = GL_UNSIGNED_BYTE;
@@ -424,13 +424,16 @@ bool OpenGLSalBitmap::ReadTexture()
     if( pData == NULL )
         return false;
 
-    if( mnBits == 16 || mnBits == 24 || mnBits == 32 )
+    if (mnBits == 8 || mnBits == 16 || mnBits == 24 || mnBits == 32)
     {
         // no conversion needed for truecolor
         pData = maUserBuffer.get();
 
         switch( mnBits )
         {
+        case 8:     nFormat = GL_LUMINANCE;
+                    nType = GL_UNSIGNED_BYTE;
+                    break;
         case 16:    nFormat = GL_RGB;
                     nType = GL_UNSIGNED_SHORT_5_6_5;
                     break;


More information about the Libreoffice-commits mailing list