summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Cecchetti <marco.cecchetti@collabora.com>2015-08-29 10:27:21 +0200
committerMarco Cecchetti <marco.cecchetti@collabora.com>2015-08-31 19:31:15 +0200
commit51e1d5790575567420dd420fb1fa9633e7949ce6 (patch)
tree5ba8fbfdbce895f6218091a5e4ec7573f14831a1
parent6022f7dab0c874ac6f29bfbe0fc9a1655fd291a7 (diff)
gl-checksum: added a minimum size check for using GL version
(nWidth * nHeight) < (1024*768) || nWidth < 128 || nHeight < 128 Change-Id: Iedda6a333958c76c19b837890eb3fa28e631bc90
-rw-r--r--vcl/inc/opengl/salbmp.hxx2
-rw-r--r--vcl/opengl/salbmp.cxx13
2 files changed, 13 insertions, 2 deletions
diff --git a/vcl/inc/opengl/salbmp.hxx b/vcl/inc/opengl/salbmp.hxx
index 89cb8af01900..53d8957a9469 100644
--- a/vcl/inc/opengl/salbmp.hxx
+++ b/vcl/inc/opengl/salbmp.hxx
@@ -55,7 +55,7 @@ private:
void makeCurrent();
virtual void updateChecksum() const;
- bool calcChecksumGL(OpenGLTexture& rHashTexture, ChecksumType& rHash) const;
+ bool calcChecksumGL(OpenGLTexture& rInputTexture, ChecksumType& rChecksum) const;
public:
OpenGLSalBitmap();
diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx
index 5ae4564f064c..42d42a20c98e 100644
--- a/vcl/opengl/salbmp.cxx
+++ b/vcl/opengl/salbmp.cxx
@@ -594,7 +594,18 @@ void OpenGLSalBitmap::updateChecksum() const
pThis->CreateTexture();
}
- pThis->mbChecksumValid = calcChecksumGL(pThis->maTexture, pThis->mnChecksum);
+ OpenGLTexture& rInputTexture = pThis->maTexture;
+ int nWidth = rInputTexture.GetWidth();
+ int nHeight = rInputTexture.GetHeight();
+
+ if( (nWidth * nHeight) < (1024*768) || nWidth < 128 || nHeight < 128 )
+ {
+ SalBitmap::updateChecksum();
+ }
+ else
+ {
+ pThis->mbChecksumValid = calcChecksumGL(rInputTexture, pThis->mnChecksum);
+ }
}
OpenGLContext* OpenGLSalBitmap::GetBitmapContext()