[Libreoffice-commits] core.git: vcl/source
Daniel Robertson
danlrobertson89 at gmail.com
Fri Jan 8 04:54:21 PST 2016
vcl/source/gdi/impbmp.cxx | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
New commits:
commit 7ec5073951cf7b7f71369e0819f82ae2fc6971ac
Author: Daniel Robertson <danlrobertson89 at gmail.com>
Date: Tue Nov 3 12:22:29 2015 -0500
vcl: ImpBitmap optimize GetBitCount
Use binary search to find ImpBitmap BitCount in constant time.
Change-Id: Ica13d41d1473e01c9198c985d34206267d7910d1
Reviewed-on: https://gerrit.libreoffice.org/19759
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: jan iversen <jani at documentfoundation.org>
Tested-by: jan iversen <jani at documentfoundation.org>
diff --git a/vcl/source/gdi/impbmp.cxx b/vcl/source/gdi/impbmp.cxx
index b79b0d4..ad1eca9 100644
--- a/vcl/source/gdi/impbmp.cxx
+++ b/vcl/source/gdi/impbmp.cxx
@@ -76,7 +76,8 @@ Size ImpBitmap::ImplGetSize() const
sal_uInt16 ImpBitmap::ImplGetBitCount() const
{
sal_uInt16 nBitCount = mpSalBitmap->GetBitCount();
- return( ( nBitCount <= 1 ) ? 1 : ( nBitCount <= 4 ) ? 4 : ( nBitCount <= 8 ) ? 8 : 24 );
+ return ( nBitCount <= 4 ) ? ( ( nBitCount <= 1 ) ? 1 : 4 ):
+ ( ( nBitCount <= 8 ) ? 8 : 24);
}
BitmapBuffer* ImpBitmap::ImplAcquireBuffer( BitmapAccessMode nMode )
More information about the Libreoffice-commits
mailing list