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-09-01 17:15:58 +0200
commitba4ca59dc3fee8a4a80cb0e935a3680aaa9eb9e3 (patch)
tree6676625cfeb38ad5bbbb3cd365f6af4a1ba4de07
parent914fa8435b2d55b062b3bb5954359c7ee2d93419 (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 b33d69f6e0e1..0e0b0e522503 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 2b141ca6a332..d339158d644b 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()