remove dead code
this code has been dead for some time, no need to keep it anymore. Change-Id: I9c553fa7460bda5331f5908311783207bf88be17 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144927 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
committed by
Noel Grandin
parent
ab81b5e097
commit
efda8aa8ee
@@ -441,7 +441,6 @@ Bitmap Bitmap::CreateMask(const Color& rTransColor, sal_uInt8 nTol) const
|
|||||||
// better supported by hardware, and the memory savings are not worth
|
// better supported by hardware, and the memory savings are not worth
|
||||||
// it anymore.
|
// it anymore.
|
||||||
// TODO: Possibly remove the 1bpp code later.
|
// TODO: Possibly remove the 1bpp code later.
|
||||||
constexpr bool use8BitMask = true;
|
|
||||||
|
|
||||||
if (!nTol && pReadAcc
|
if (!nTol && pReadAcc
|
||||||
&& (pReadAcc->GetScanlineFormat() == ScanlineFormat::N1BitLsbPal
|
&& (pReadAcc->GetScanlineFormat() == ScanlineFormat::N1BitLsbPal
|
||||||
@@ -453,9 +452,8 @@ Bitmap Bitmap::CreateMask(const Color& rTransColor, sal_uInt8 nTol) const
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto ePixelFormat = use8BitMask ? vcl::PixelFormat::N8_BPP : vcl::PixelFormat::N1_BPP;
|
auto ePixelFormat = vcl::PixelFormat::N8_BPP;
|
||||||
Bitmap aNewBmp(GetSizePixel(), ePixelFormat,
|
Bitmap aNewBmp(GetSizePixel(), ePixelFormat, &Bitmap::GetGreyPalette(256));
|
||||||
use8BitMask ? &Bitmap::GetGreyPalette(256) : nullptr);
|
|
||||||
BitmapScopedWriteAccess pWriteAcc(aNewBmp);
|
BitmapScopedWriteAccess pWriteAcc(aNewBmp);
|
||||||
bool bRet = false;
|
bool bRet = false;
|
||||||
|
|
||||||
@@ -470,49 +468,10 @@ Bitmap Bitmap::CreateMask(const Color& rTransColor, sal_uInt8 nTol) const
|
|||||||
{
|
{
|
||||||
const BitmapColor aTest(pReadAcc->GetBestMatchingColor(rTransColor));
|
const BitmapColor aTest(pReadAcc->GetBestMatchingColor(rTransColor));
|
||||||
|
|
||||||
if (pWriteAcc->GetBitCount() == 1
|
if (pWriteAcc->GetScanlineFormat() == pReadAcc->GetScanlineFormat()
|
||||||
&& pReadAcc->GetScanlineFormat() == ScanlineFormat::N8BitPal)
|
&& aWhite.GetIndex() == 1
|
||||||
{
|
&& (pReadAcc->GetScanlineFormat() == ScanlineFormat::N1BitLsbPal
|
||||||
// optimized for 8Bit source palette
|
|| pReadAcc->GetScanlineFormat() == ScanlineFormat::N1BitMsbPal))
|
||||||
const sal_uInt8 cTest = aTest.GetIndex();
|
|
||||||
|
|
||||||
if (pWriteAcc->GetScanlineFormat() == ScanlineFormat::N1BitMsbPal
|
|
||||||
&& aWhite.GetIndex() == 1)
|
|
||||||
{
|
|
||||||
// optimized for 1Bit-MSB destination palette
|
|
||||||
for (tools::Long nY = 0; nY < nHeight; ++nY)
|
|
||||||
{
|
|
||||||
Scanline pSrc = pReadAcc->GetScanline(nY);
|
|
||||||
Scanline pDst = pWriteAcc->GetScanline(nY);
|
|
||||||
for (tools::Long nX = 0; nX < nWidth; ++nX)
|
|
||||||
{
|
|
||||||
if (cTest == pSrc[nX])
|
|
||||||
pDst[nX >> 3] |= 1 << (7 - (nX & 7));
|
|
||||||
else
|
|
||||||
pDst[nX >> 3] &= ~(1 << (7 - (nX & 7)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
for (tools::Long nY = 0; nY < nHeight; ++nY)
|
|
||||||
{
|
|
||||||
Scanline pSrc = pReadAcc->GetScanline(nY);
|
|
||||||
Scanline pDst = pWriteAcc->GetScanline(nY);
|
|
||||||
for (tools::Long nX = 0; nX < nWidth; ++nX)
|
|
||||||
{
|
|
||||||
if (cTest == pSrc[nX])
|
|
||||||
pWriteAcc->SetPixelOnData(pDst, nX, aWhite);
|
|
||||||
else
|
|
||||||
pWriteAcc->SetPixelOnData(pDst, nX, aBlack);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (pWriteAcc->GetScanlineFormat() == pReadAcc->GetScanlineFormat()
|
|
||||||
&& aWhite.GetIndex() == 1
|
|
||||||
&& (pReadAcc->GetScanlineFormat() == ScanlineFormat::N1BitLsbPal
|
|
||||||
|| pReadAcc->GetScanlineFormat() == ScanlineFormat::N1BitMsbPal))
|
|
||||||
{
|
{
|
||||||
for (tools::Long nY = 0; nY < nHeight; ++nY)
|
for (tools::Long nY = 0; nY < nHeight; ++nY)
|
||||||
{
|
{
|
||||||
@@ -524,8 +483,7 @@ Bitmap Bitmap::CreateMask(const Color& rTransColor, sal_uInt8 nTol) const
|
|||||||
pDst[nX] = ~pSrc[nX];
|
pDst[nX] = ~pSrc[nX];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (use8BitMask && pWriteAcc->GetBitCount() == 8
|
else if (pReadAcc->GetScanlineFormat() == ScanlineFormat::N8BitPal)
|
||||||
&& pReadAcc->GetScanlineFormat() == ScanlineFormat::N8BitPal)
|
|
||||||
{
|
{
|
||||||
// optimized for 8Bit source palette
|
// optimized for 8Bit source palette
|
||||||
const sal_uInt8 cTest = aTest.GetIndex();
|
const sal_uInt8 cTest = aTest.GetIndex();
|
||||||
|
Reference in New Issue
Block a user