[Libreoffice-commits] core.git: 4 commits - include/vcl solenv/bin vcl/opengl vcl/source

Jan Holesovsky kendy at collabora.com
Thu Mar 19 10:14:13 PDT 2015


 include/vcl/salbtype.hxx            |    2 +-
 solenv/bin/unittest-failed.sh       |   31 ++++++++++++++++---------------
 vcl/opengl/gdiimpl.cxx              |    2 +-
 vcl/source/opengl/OpenGLContext.cxx |    2 +-
 4 files changed, 19 insertions(+), 18 deletions(-)

New commits:
commit f3c0085d966d4a8e2223326c52c045b7529ef320
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Thu Mar 19 18:06:27 2015 +0100

    opengl: Off-by-one in getPixel.
    
    Change-Id: I971d94c353adcdf70e0f251d6103b1e19042687c

diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index baf04ff..5ed9db6 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -1529,7 +1529,7 @@ SalColor OpenGLSalGraphicsImpl::getPixel( long nX, long nY )
     char pixel[3] = { 0, 0, 0 };
 
     PreDraw();
-    nY = GetHeight() - nY;
+    nY = GetHeight() - nY - 1;
     glReadPixels( nX, nY, 1, 1, GL_RGB, GL_UNSIGNED_BYTE, pixel);
     PostDraw();
 
commit 3637dc8a573b025106b4a652d837458c2e427d14
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Thu Mar 19 15:56:12 2015 +0100

    opengl: We need to return the GLWindow.
    
    Fixes an unitialized read in wglDeleteContext, thanks Dr.Memory!
    
    Change-Id: I3706b18526c48277f9b4a6801c95c26a10a86965

diff --git a/vcl/source/opengl/OpenGLContext.cxx b/vcl/source/opengl/OpenGLContext.cxx
index 352b630..09b0257 100644
--- a/vcl/source/opengl/OpenGLContext.cxx
+++ b/vcl/source/opengl/OpenGLContext.cxx
@@ -180,7 +180,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM l
     }
 }
 
-int InitTempWindow(HWND *hwnd, int width, int height, const PIXELFORMATDESCRIPTOR& inPfd, GLWindow glWin)
+int InitTempWindow(HWND *hwnd, int width, int height, const PIXELFORMATDESCRIPTOR& inPfd, GLWindow& glWin)
 {
     PIXELFORMATDESCRIPTOR  pfd = inPfd;
     int  pfmt;
commit 8e0d758f852b0b4e4242b7fb2ebee8cbd17fc2f4
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Thu Mar 19 15:35:04 2015 +0100

    Hint how to use Dr.Memory for unit tests / memory checking.
    
    Change-Id: I7df8716e90e9097336919d2a9208a549b8f7d3d0

diff --git a/solenv/bin/unittest-failed.sh b/solenv/bin/unittest-failed.sh
index 6bbd458..b1e93d5 100755
--- a/solenv/bin/unittest-failed.sh
+++ b/solenv/bin/unittest-failed.sh
@@ -17,27 +17,28 @@
 #   except in compliance with the License. You may obtain a copy of
 #   the License at http://www.apache.org/licenses/LICENSE-2.0 .
 
-cat << EOF
-
-Error: a unit test failed, please do one of:
+ECHECKING='export DEBUGCPPUNIT=TRUE            # for exception catching'
+DEBUGGING=
+MCHECKING='export VALGRIND=memcheck            # for memory checking'
 
-export DEBUGCPPUNIT=TRUE            # for exception catching
-EOF
 if [ "$3" = "WNT" ]; then
-cat << EOF
-export CPPUNITTRACE="\"[full path to devenv.exe]\" /debugexe" # for interactive debugging in Visual Studio
-EOF
+    ECHECKING='export DEBUGCPPUNIT=TRUE                                      # for exception catching'
+    DEBUGGING='export CPPUNITTRACE="\"[full path to devenv.exe]\" /debugexe" # for interactive debugging in Visual Studio'
+    MCHECKING='export CPPUNITTRACE="drmemory -free_max_frames 20"            # for memory checking (install Dr.Memory first)'
 elif [ "$3" = "MACOSX" ]; then
-cat << EOF
-export CPPUNITTRACE="lldb --" # for interactive debugging on OS X
-EOF
+    DEBUGGING='export CPPUNITTRACE="lldb --"       # for interactive debugging on OS X'
 else
-cat << EOF
-export CPPUNITTRACE="gdb --args"    # for interactive debugging on Linux
-EOF
+    DEBUGGING='export CPPUNITTRACE="gdb --args"    # for interactive debugging on Linux'
 fi
+
+# print the actual error message
 cat << EOF
-export VALGRIND=memcheck            # for memory checking
+
+Error: a unit test failed, please do one of:
+
+$ECHECKING
+$DEBUGGING
+$MCHECKING
 
 and retry using: make $1Test_$2
 
commit 684aec5496f7394969743614cfda12b11c0466af
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Tue Mar 17 12:44:36 2015 +0100

    Dr.Memory complains about this...
    
    Change-Id: I00ad970ab7cc97cfa37d6785540d6cfa825976c8

diff --git a/include/vcl/salbtype.hxx b/include/vcl/salbtype.hxx
index 40dfd8f..1dd62c2 100644
--- a/include/vcl/salbtype.hxx
+++ b/include/vcl/salbtype.hxx
@@ -406,7 +406,7 @@ inline BitmapColor& BitmapColor::Invert()
 inline sal_uInt8 BitmapColor::GetLuminance() const
 {
     DBG_ASSERT( !mbIndex, "Pixel represents index into colortable!" );
-    return( (sal_uInt8) ( ( mcBlueOrIndex * 28UL + mcGreen * 151UL + mcRed * 77UL ) >> 8UL ) );
+    return (unsigned long(mcBlueOrIndex) * 28UL + unsigned long(mcGreen) * 151UL + unsigned long(mcRed) * 77UL) >> 8;
 }
 
 inline BitmapColor& BitmapColor::IncreaseLuminance( sal_uInt8 cGreyInc )


More information about the Libreoffice-commits mailing list