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:
int mnBufHeight;
std::deque< OpenGLSalBitmapOp* > maPendingOps;
void makeCurrent();
void makeSomeOpenGLContextCurrent();
virtual void updateChecksum() const override;
bool calcChecksumGL(OpenGLTexture& rInputTexture, ChecksumType& rChecksum) const;
......
......@@ -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 )
......
......@@ -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" );
......
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