Kaydet (Commit) 19b53ac0 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

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
üst e0caeaa5
...@@ -50,7 +50,7 @@ private: ...@@ -50,7 +50,7 @@ private:
int mnBufHeight; int mnBufHeight;
std::deque< OpenGLSalBitmapOp* > maPendingOps; std::deque< OpenGLSalBitmapOp* > maPendingOps;
void makeCurrent(); void makeSomeOpenGLContextCurrent();
virtual void updateChecksum() const override; virtual void updateChecksum() const override;
bool calcChecksumGL(OpenGLTexture& rInputTexture, ChecksumType& rChecksum) const; bool calcChecksumGL(OpenGLTexture& rInputTexture, ChecksumType& rChecksum) const;
......
...@@ -380,7 +380,7 @@ Size OpenGLSalBitmap::GetSize() const ...@@ -380,7 +380,7 @@ Size OpenGLSalBitmap::GetSize() const
void OpenGLSalBitmap::ExecuteOperations() void OpenGLSalBitmap::ExecuteOperations()
{ {
makeCurrent(); makeSomeOpenGLContextCurrent();
while( !maPendingOps.empty() ) while( !maPendingOps.empty() )
{ {
OpenGLSalBitmapOp* pOp = maPendingOps.front(); OpenGLSalBitmapOp* pOp = maPendingOps.front();
...@@ -459,7 +459,7 @@ GLuint OpenGLSalBitmap::CreateTexture() ...@@ -459,7 +459,7 @@ GLuint OpenGLSalBitmap::CreateTexture()
} }
} }
makeCurrent(); makeSomeOpenGLContextCurrent();
lclInstantiateTexture(maTexture, mnBufWidth, mnBufHeight, nFormat, nType, pData); lclInstantiateTexture(maTexture, mnBufWidth, mnBufHeight, nFormat, nType, pData);
...@@ -505,7 +505,7 @@ bool OpenGLSalBitmap::ReadTexture() ...@@ -505,7 +505,7 @@ bool OpenGLSalBitmap::ReadTexture()
break; break;
} }
makeCurrent(); makeSomeOpenGLContextCurrent();
maTexture.Read(nFormat, nType, pData); maTexture.Read(nFormat, nType, pData);
mnBufWidth = mnWidth; mnBufWidth = mnWidth;
mnBufHeight = mnHeight; mnBufHeight = mnHeight;
...@@ -514,7 +514,7 @@ bool OpenGLSalBitmap::ReadTexture() ...@@ -514,7 +514,7 @@ bool OpenGLSalBitmap::ReadTexture()
else if (mnBits == 1) else if (mnBits == 1)
{ // convert buffers from 24-bit RGB to 1-bit Mask { // convert buffers from 24-bit RGB to 1-bit Mask
std::vector<sal_uInt8> aBuffer(mnWidth * mnHeight * 3); std::vector<sal_uInt8> aBuffer(mnWidth * mnHeight * 3);
makeCurrent(); makeSomeOpenGLContextCurrent();
sal_uInt8* pBuffer = aBuffer.data(); sal_uInt8* pBuffer = aBuffer.data();
maTexture.Read(GL_RGB, GL_UNSIGNED_BYTE, pBuffer); maTexture.Read(GL_RGB, GL_UNSIGNED_BYTE, pBuffer);
...@@ -669,7 +669,7 @@ rtl::Reference<OpenGLContext> OpenGLSalBitmap::GetBitmapContext() ...@@ -669,7 +669,7 @@ rtl::Reference<OpenGLContext> OpenGLSalBitmap::GetBitmapContext()
return ImplGetDefaultWindow()->GetGraphics()->GetOpenGLContext(); return ImplGetDefaultWindow()->GetGraphics()->GetOpenGLContext();
} }
void OpenGLSalBitmap::makeCurrent() void OpenGLSalBitmap::makeSomeOpenGLContextCurrent()
{ {
ImplSVData* pSVData = ImplGetSVData(); ImplSVData* pSVData = ImplGetSVData();
...@@ -833,7 +833,7 @@ bool OpenGLSalBitmap::Replace( const Color& rSearchColor, const Color& rReplaceC ...@@ -833,7 +833,7 @@ bool OpenGLSalBitmap::Replace( const Color& rSearchColor, const Color& rReplaceC
OpenGLProgram* pProgram; OpenGLProgram* pProgram;
GetTexture(); GetTexture();
makeCurrent(); makeSomeOpenGLContextCurrent();
pProgram = mpContext->UseProgram( "textureVertexShader", pProgram = mpContext->UseProgram( "textureVertexShader",
"replaceColorFragmentShader" ); "replaceColorFragmentShader" );
if( !pProgram ) if( !pProgram )
......
...@@ -279,7 +279,7 @@ bool OpenGLSalBitmap::ImplScale( const double& rScaleX, const double& rScaleY, B ...@@ -279,7 +279,7 @@ bool OpenGLSalBitmap::ImplScale( const double& rScaleX, const double& rScaleY, B
VCL_GL_INFO( "::ImplScale" ); VCL_GL_INFO( "::ImplScale" );
maUserBuffer.reset(); maUserBuffer.reset();
makeCurrent(); makeSomeOpenGLContextCurrent();
if( nScaleFlag == BmpScaleFlag::Fast ) if( nScaleFlag == BmpScaleFlag::Fast )
{ {
...@@ -350,7 +350,7 @@ bool OpenGLSalBitmap::Scale( const double& rScaleX, const double& rScaleY, BmpSc ...@@ -350,7 +350,7 @@ bool OpenGLSalBitmap::Scale( const double& rScaleX, const double& rScaleY, BmpSc
nScaleFlag == BmpScaleFlag::Default || nScaleFlag == BmpScaleFlag::Default ||
nScaleFlag == BmpScaleFlag::BestQuality ) nScaleFlag == BmpScaleFlag::BestQuality )
{ {
makeCurrent(); makeSomeOpenGLContextCurrent();
if( mpContext == nullptr ) if( mpContext == nullptr )
{ {
VCL_GL_INFO( "Add ScaleOp to pending operations" ); VCL_GL_INFO( "Add ScaleOp to pending operations" );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment