Kaydet (Commit) 30d58306 authored tarafından Caolán McNamara's avatar Caolán McNamara

ofz#968 short-cut slow create mask when we are our own mask already

Change-Id: I5969226bf2da34d34e30e44ae763792cdc072bc8
Reviewed-on: https://gerrit.libreoffice.org/35921Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst d9d94d71
......@@ -1107,9 +1107,16 @@ bool Bitmap::Expand( sal_uLong nDX, sal_uLong nDY, const Color* pInitColor )
Bitmap Bitmap::CreateMask( const Color& rTransColor, sal_uLong nTol ) const
{
Bitmap aNewBmp( GetSizePixel(), 1 );
ScopedReadAccess pReadAcc(const_cast<Bitmap&>(*this));
ScopedReadAccess pReadAcc(const_cast<Bitmap&>(*this));
if (!nTol && (pReadAcc->GetScanlineFormat() == ScanlineFormat::N1BitLsbPal || pReadAcc->GetScanlineFormat() == ScanlineFormat::N1BitMsbPal)
&& pReadAcc->GetBestMatchingColor(Color(COL_WHITE)) == pReadAcc->GetBestMatchingColor(rTransColor))
{
//if we're a 1 bit pixel already, and the transcolor matches the color that would replace it already already, then just return a copy
return *this;
}
Bitmap aNewBmp(GetSizePixel(), 1);
ScopedWriteAccess pWriteAcc(aNewBmp);
bool bRet = false;
......
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