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

Tomaž Vajngerl tomaz.vajngerl at collabora.com
Wed Feb 10 13:00:29 UTC 2016


 vcl/inc/opengl/salbmp.hxx |    2 --
 vcl/opengl/salbmp.cxx     |   23 ++++++-----------------
 vcl/opengl/scale.cxx      |    6 ------
 3 files changed, 6 insertions(+), 25 deletions(-)

New commits:
commit 30e32035adfb053637ca68127bedd68a938e7332
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date:   Tue Feb 9 23:23:54 2016 +0100

    opengl: remove unneeded mnBufWidth{Height} from OpenGLSalBitmap
    
    Reviewed-on: https://gerrit.libreoffice.org/22258
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    (cherry picked from commit b4c6cf513c5bb0ed02b95bbdbb0879a78c1eca65)
    
    Change-Id: Idf445b9f6b403a0d37650c14e17b7d754451edf1
    Reviewed-on: https://gerrit.libreoffice.org/22264
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>
    Tested-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/vcl/inc/opengl/salbmp.hxx b/vcl/inc/opengl/salbmp.hxx
index 4b34027..8917a5a 100644
--- a/vcl/inc/opengl/salbmp.hxx
+++ b/vcl/inc/opengl/salbmp.hxx
@@ -47,8 +47,6 @@ private:
     sal_uInt16                          mnBytesPerRow;
     int                                 mnWidth;
     int                                 mnHeight;
-    int                                 mnBufWidth;
-    int                                 mnBufHeight;
     std::deque< OpenGLSalBitmapOp* >    maPendingOps;
 
     virtual void updateChecksum() const override;
diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx
index 61d7575..e0205f0 100644
--- a/vcl/opengl/salbmp.cxx
+++ b/vcl/opengl/salbmp.cxx
@@ -113,8 +113,6 @@ OpenGLSalBitmap::OpenGLSalBitmap()
 , mnBytesPerRow(0)
 , mnWidth(0)
 , mnHeight(0)
-, mnBufWidth(0)
-, mnBufHeight(0)
 {
 }
 
@@ -135,8 +133,6 @@ bool OpenGLSalBitmap::Create( const OpenGLTexture& rTex, long nX, long nY, long
 
     mnWidth = nWidth;
     mnHeight = nHeight;
-    mnBufWidth = 0;
-    mnBufHeight = 0;
 
     // TODO Check the framebuffer configuration
     mnBits = 32;
@@ -166,8 +162,8 @@ bool OpenGLSalBitmap::Create( const Size& rSize, sal_uInt16 nBits, const BitmapP
         return false;
     maPalette = rBitmapPalette;
     mnBits = nBits;
-    mnWidth = mnBufWidth = rSize.Width();
-    mnHeight = mnBufHeight = rSize.Height();
+    mnWidth = rSize.Width();
+    mnHeight = rSize.Height();
     return false;
 }
 
@@ -201,8 +197,6 @@ bool OpenGLSalBitmap::Create( const SalBitmap& rSalBmp, sal_uInt16 nNewBitCount
         mnBytesPerRow = rSourceBitmap.mnBytesPerRow;
         mnWidth = rSourceBitmap.mnWidth;
         mnHeight = rSourceBitmap.mnHeight;
-        mnBufWidth = rSourceBitmap.mnBufWidth;
-        mnBufHeight = rSourceBitmap.mnBufHeight;
         maPalette = rSourceBitmap.maPalette;
         // execute any pending operations on the source bitmap
         maTexture = rSourceBitmap.GetTexture();
@@ -472,7 +466,7 @@ GLuint OpenGLSalBitmap::CreateTexture()
             VCL_GL_INFO( "::CreateTexture - convert from " << mnBits << " to 24 bits" );
 
             // convert to 24 bits RGB using palette
-            pData = new sal_uInt8[mnBufHeight * mnBufWidth * 3];
+            pData = new sal_uInt8[mnHeight * mnWidth * 3];
             bAllocated = true;
             determineTextureFormat(24, nFormat, nType);
 
@@ -481,12 +475,12 @@ GLuint OpenGLSalBitmap::CreateTexture()
             sal_uInt8* pSrcData = maUserBuffer.get();
             sal_uInt8* pDstData = pData;
 
-            sal_uInt32 nY = mnBufHeight;
+            sal_uInt32 nY = mnHeight;
             while( nY-- )
             {
                 pSrcFormat->StartLine( pSrcData );
 
-                sal_uInt32 nX = mnBufWidth;
+                sal_uInt32 nX = mnWidth;
                 if (nFormat == GL_BGR)
                 {
                     while( nX-- )
@@ -515,7 +509,7 @@ GLuint OpenGLSalBitmap::CreateTexture()
 
     OpenGLVCLContextZone aContextZone;
 
-    lclInstantiateTexture(maTexture, mnBufWidth, mnBufHeight, nFormat, nType, pData);
+    lclInstantiateTexture(maTexture, mnWidth, mnHeight, nFormat, nType, pData);
 
     VCL_GL_INFO("Created texture " << maTexture.Id() << " bits: " << mnBits);
 
@@ -559,9 +553,6 @@ bool OpenGLSalBitmap::ReadTexture()
         size_t nCanary = static_cast<sal_uInt32>(mnBytesPerRow) * mnHeight;
         assert(!memcmp(pData + nCanary, CANARY, sizeof (CANARY)));
 #endif
-
-        mnBufWidth = mnWidth;
-        mnBufHeight = mnHeight;
         return true;
     }
     else if (mnBits == 1)
@@ -602,8 +593,6 @@ bool OpenGLSalBitmap::ReadTexture()
             nIndex++;
             pData[nIndex] = 0;
         }
-        mnBufWidth = mnWidth;
-        mnBufHeight = mnHeight;
         return true;
     }
 
diff --git a/vcl/opengl/scale.cxx b/vcl/opengl/scale.cxx
index a971b15e..80bbdd6 100644
--- a/vcl/opengl/scale.cxx
+++ b/vcl/opengl/scale.cxx
@@ -68,8 +68,6 @@ bool OpenGLSalBitmap::ImplScaleFilter(
 
     mnWidth = nNewWidth;
     mnHeight = nNewHeight;
-    mnBufWidth = mnWidth;
-    mnBufHeight = mnHeight;
     maTexture = aNewTex;
 
     CHECK_GL_ERROR();
@@ -183,8 +181,6 @@ bool OpenGLSalBitmap::ImplScaleConvolution(
 
     mnWidth = nNewWidth;
     mnHeight = nNewHeight;
-    mnBufWidth = mnWidth;
-    mnBufHeight = mnHeight;
 
     CHECK_GL_ERROR();
     return true;
@@ -260,8 +256,6 @@ bool OpenGLSalBitmap::ImplScaleArea( const rtl::Reference< OpenGLContext > &xCon
 
     mnWidth = nNewWidth;
     mnHeight = nNewHeight;
-    mnBufWidth = mnWidth;
-    mnBufHeight = mnHeight;
 
     CHECK_GL_ERROR();
     return true;


More information about the Libreoffice-commits mailing list