Bug 1214476 - Remove unused code for encoding BMPv2 files. r=seth.

nsBMPEncoder produces either BMPv3 or BMPv5 files. (See the Version enum which
only has VERSION_3 and VERSION_5 values, and ParseOptions()'s handling of the
|version| parameter.

Nonetheless, there is some code to handle encoding of BMPv2 files. This patch
removes this.
This commit is contained in:
Nicholas Nethercote 2015-10-14 14:47:29 -07:00
parent ce6db513af
commit 450dc59dc6

View File

@ -615,28 +615,16 @@ nsBMPEncoder::EncodeInfoHeader()
NativeEndian::swapToLittleEndianInPlace(&littleEndianmBIH.profile_size, 1);
ENCODE(&mImageBufferCurr, littleEndianmBIH.bihsize);
if (mBMPInfoHeader.bihsize == InfoHeaderLength::WIN_V2) {
uint16_t width = (uint16_t) littleEndianmBIH.width;
ENCODE(&mImageBufferCurr, width);
uint16_t height = (uint16_t) littleEndianmBIH.width;
ENCODE(&mImageBufferCurr, height);
} else {
ENCODE(&mImageBufferCurr, littleEndianmBIH.width);
ENCODE(&mImageBufferCurr, littleEndianmBIH.height);
}
ENCODE(&mImageBufferCurr, littleEndianmBIH.width);
ENCODE(&mImageBufferCurr, littleEndianmBIH.height);
ENCODE(&mImageBufferCurr, littleEndianmBIH.planes);
ENCODE(&mImageBufferCurr, littleEndianmBIH.bpp);
if (mBMPInfoHeader.bihsize > InfoHeaderLength::WIN_V2) {
ENCODE(&mImageBufferCurr, littleEndianmBIH.compression);
ENCODE(&mImageBufferCurr, littleEndianmBIH.image_size);
ENCODE(&mImageBufferCurr, littleEndianmBIH.xppm);
ENCODE(&mImageBufferCurr, littleEndianmBIH.yppm);
ENCODE(&mImageBufferCurr, littleEndianmBIH.colors);
ENCODE(&mImageBufferCurr, littleEndianmBIH.important_colors);
}
ENCODE(&mImageBufferCurr, littleEndianmBIH.compression);
ENCODE(&mImageBufferCurr, littleEndianmBIH.image_size);
ENCODE(&mImageBufferCurr, littleEndianmBIH.xppm);
ENCODE(&mImageBufferCurr, littleEndianmBIH.yppm);
ENCODE(&mImageBufferCurr, littleEndianmBIH.colors);
ENCODE(&mImageBufferCurr, littleEndianmBIH.important_colors);
if (mBMPInfoHeader.bihsize > InfoHeaderLength::WIN_V3) {
ENCODE(&mImageBufferCurr, littleEndianmBIH.red_mask);