summaryrefslogtreecommitdiff
path: root/vcl/opengl/salbmp.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/opengl/salbmp.cxx')
-rw-r--r--vcl/opengl/salbmp.cxx15
1 files changed, 10 insertions, 5 deletions
diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx
index 75d4d21a9c18..31038c37ff0d 100644
--- a/vcl/opengl/salbmp.cxx
+++ b/vcl/opengl/salbmp.cxx
@@ -28,6 +28,7 @@
#include "svdata.hxx"
#include "salgdi.hxx"
#include "vcleventlisteners.hxx"
+#include "vcl/lazydelete.hxx"
#include "opengl/zone.hxx"
#include "opengl/program.hxx"
@@ -97,7 +98,8 @@ sal_uInt16 lclBytesPerRow(sal_uInt16 nBits, int nWidth)
return 0;
}
-static std::vector<std::unique_ptr<FixedTextureAtlasManager>> sTextureAtlases;
+typedef std::vector<std::unique_ptr< FixedTextureAtlasManager > > TextureAtlasVector;
+static vcl::DeleteOnDeinit< TextureAtlasVector > gTextureAtlases(new TextureAtlasVector());
}
@@ -381,6 +383,7 @@ void lclInstantiateTexture(OpenGLTexture& rTexture, const int nWidth, const int
{
if (nWidth == nHeight)
{
+ TextureAtlasVector &sTextureAtlases = *gTextureAtlases.get();
if (sTextureAtlases.empty())
{
sTextureAtlases.push_back(std::unique_ptr<FixedTextureAtlasManager>(new FixedTextureAtlasManager(8, 8, 16)));
@@ -582,8 +585,10 @@ bool OpenGLSalBitmap::calcChecksumGL(OpenGLTexture& rInputTexture, ChecksumType&
{
OUString FragShader("areaHashCRC64TFragmentShader");
- static const OpenGLTexture aCRCTableTexture(512, 1, GL_RGBA, GL_UNSIGNED_BYTE,
- vcl_get_crc64_table());
+ static vcl::DeleteOnDeinit<OpenGLTexture> gCRCTableTexture(
+ new OpenGLTexture(512, 1, GL_RGBA, GL_UNSIGNED_BYTE,
+ vcl_get_crc64_table()));
+ OpenGLTexture &rCRCTableTexture = *gCRCTableTexture.get();
// First Pass
@@ -603,7 +608,7 @@ bool OpenGLSalBitmap::calcChecksumGL(OpenGLTexture& rInputTexture, ChecksumType&
pProgram->SetUniform1f( "xstep", 1.0 / mnWidth );
pProgram->SetUniform1f( "ystep", 1.0 / mnHeight );
- pProgram->SetTexture("crc_table", (OpenGLTexture&)(aCRCTableTexture));
+ pProgram->SetTexture("crc_table", rCRCTableTexture);
pProgram->SetTexture("sampler", rInputTexture);
pProgram->DrawTexture(rInputTexture);
pProgram->Clean();
@@ -631,7 +636,7 @@ bool OpenGLSalBitmap::calcChecksumGL(OpenGLTexture& rInputTexture, ChecksumType&
pProgram->SetUniform1f( "xstep", 1.0 / mnWidth );
pProgram->SetUniform1f( "ystep", 1.0 / mnHeight );
- pProgram->SetTexture("crc_table", (OpenGLTexture&)(aCRCTableTexture));
+ pProgram->SetTexture("crc_table", rCRCTableTexture);
pProgram->SetTexture("sampler", aFirstPassTexture);
pProgram->DrawTexture(aFirstPassTexture);
pProgram->Clean();