Kaydet (Commit) 7ec50739 authored tarafından Daniel Robertson's avatar Daniel Robertson Kaydeden (comit) jan iversen

vcl: ImpBitmap optimize GetBitCount

Use binary search to find ImpBitmap BitCount in constant time.

Change-Id: Ica13d41d1473e01c9198c985d34206267d7910d1
Reviewed-on: https://gerrit.libreoffice.org/19759Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarjan iversen <jani@documentfoundation.org>
Tested-by: 's avatarjan iversen <jani@documentfoundation.org>
üst 3113ecb2
...@@ -76,7 +76,8 @@ Size ImpBitmap::ImplGetSize() const ...@@ -76,7 +76,8 @@ Size ImpBitmap::ImplGetSize() const
sal_uInt16 ImpBitmap::ImplGetBitCount() const sal_uInt16 ImpBitmap::ImplGetBitCount() const
{ {
sal_uInt16 nBitCount = mpSalBitmap->GetBitCount(); 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 ) BitmapBuffer* ImpBitmap::ImplAcquireBuffer( BitmapAccessMode nMode )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment