[Libreoffice-commits] core.git: vcl/inc vcl/opengl

Tor Lillqvist tml at collabora.com
Tue Dec 8 07:03:55 PST 2015


 vcl/inc/opengl/salbmp.hxx |    2 +-
 vcl/opengl/salbmp.cxx     |   12 ++++++------
 vcl/opengl/scale.cxx      |    4 ++--
 3 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit 19b53ac04df4a87735b45bf8cdc25d3b1c5bf319
Author: Tor Lillqvist <tml at collabora.com>
Date:   Tue Dec 8 16:44:19 2015 +0200

    Rename OpenGLSalBitmap::makeCurrent() to makeSomeOpenGLContextCurrent()
    
    The function does not, in any way, as far as I see, make the
    OpenGLSalBitmap object "current". It picks one OpenGLContext object
    and makes that current. So, rename it to be less misleading. Am I
    missing something?
    
    Change-Id: Ia9f8e2415e1075dd5892cd40140e6ad764feeaa4

diff --git a/vcl/inc/opengl/salbmp.hxx b/vcl/inc/opengl/salbmp.hxx
index 6442f18..e9fd6f7 100644
--- a/vcl/inc/opengl/salbmp.hxx
+++ b/vcl/inc/opengl/salbmp.hxx
@@ -50,7 +50,7 @@ private:
     int                                 mnBufHeight;
     std::deque< OpenGLSalBitmapOp* >    maPendingOps;
 
-    void makeCurrent();
+    void makeSomeOpenGLContextCurrent();
     virtual void updateChecksum() const override;
 
     bool calcChecksumGL(OpenGLTexture& rInputTexture, ChecksumType& rChecksum) const;
diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx
index 9a704d9..4a05af4 100644
--- a/vcl/opengl/salbmp.cxx
+++ b/vcl/opengl/salbmp.cxx
@@ -380,7 +380,7 @@ Size OpenGLSalBitmap::GetSize() const
 
 void OpenGLSalBitmap::ExecuteOperations()
 {
-    makeCurrent();
+    makeSomeOpenGLContextCurrent();
     while( !maPendingOps.empty() )
     {
         OpenGLSalBitmapOp* pOp = maPendingOps.front();
@@ -459,7 +459,7 @@ GLuint OpenGLSalBitmap::CreateTexture()
         }
     }
 
-    makeCurrent();
+    makeSomeOpenGLContextCurrent();
 
     lclInstantiateTexture(maTexture, mnBufWidth, mnBufHeight, nFormat, nType, pData);
 
@@ -505,7 +505,7 @@ bool OpenGLSalBitmap::ReadTexture()
                     break;
         }
 
-        makeCurrent();
+        makeSomeOpenGLContextCurrent();
         maTexture.Read(nFormat, nType, pData);
         mnBufWidth = mnWidth;
         mnBufHeight = mnHeight;
@@ -514,7 +514,7 @@ bool OpenGLSalBitmap::ReadTexture()
     else if (mnBits == 1)
     {   // convert buffers from 24-bit RGB to 1-bit Mask
         std::vector<sal_uInt8> aBuffer(mnWidth * mnHeight * 3);
-        makeCurrent();
+        makeSomeOpenGLContextCurrent();
         sal_uInt8* pBuffer = aBuffer.data();
         maTexture.Read(GL_RGB, GL_UNSIGNED_BYTE, pBuffer);
 
@@ -669,7 +669,7 @@ rtl::Reference<OpenGLContext> OpenGLSalBitmap::GetBitmapContext()
     return ImplGetDefaultWindow()->GetGraphics()->GetOpenGLContext();
 }
 
-void OpenGLSalBitmap::makeCurrent()
+void OpenGLSalBitmap::makeSomeOpenGLContextCurrent()
 {
     ImplSVData* pSVData = ImplGetSVData();
 
@@ -833,7 +833,7 @@ bool OpenGLSalBitmap::Replace( const Color& rSearchColor, const Color& rReplaceC
     OpenGLProgram* pProgram;
 
     GetTexture();
-    makeCurrent();
+    makeSomeOpenGLContextCurrent();
     pProgram = mpContext->UseProgram( "textureVertexShader",
                                       "replaceColorFragmentShader" );
     if( !pProgram )
diff --git a/vcl/opengl/scale.cxx b/vcl/opengl/scale.cxx
index 102ec73..56658e5 100644
--- a/vcl/opengl/scale.cxx
+++ b/vcl/opengl/scale.cxx
@@ -279,7 +279,7 @@ bool OpenGLSalBitmap::ImplScale( const double& rScaleX, const double& rScaleY, B
     VCL_GL_INFO( "::ImplScale" );
 
     maUserBuffer.reset();
-    makeCurrent();
+    makeSomeOpenGLContextCurrent();
 
     if( nScaleFlag == BmpScaleFlag::Fast )
     {
@@ -350,7 +350,7 @@ bool OpenGLSalBitmap::Scale( const double& rScaleX, const double& rScaleY, BmpSc
         nScaleFlag == BmpScaleFlag::Default ||
         nScaleFlag == BmpScaleFlag::BestQuality )
     {
-        makeCurrent();
+        makeSomeOpenGLContextCurrent();
         if( mpContext == nullptr )
         {
             VCL_GL_INFO( "Add ScaleOp to pending operations" );


More information about the Libreoffice-commits mailing list