gecko-dev/image/test/gtest
Nicholas Nethercote c5432f6a1e Bug 1214072 (part 2) - Implement transparency properly for BMP images. r=seth.
Currently we don't implement transparency at all in BMP images except for an
odd-duck case of BMPs within ICOs.

This patch does the following.

- It implements transparency properly for 16bpp and 32bpp images via bitfield
  masking. (For 32bpp images this also requires handling colors via bitfield
  masking.) The patch maintains the existing BMP-within-ICO transparency
  handling.

- It also reworks BitFields::Value::Set().

  * It now works correctly if the run of 1s goes all the way to bit 31 (the
    old code didn't set mBitWidth).

  * If the mask is 0, will give an mRightShift of 0 (old code gave 32, and
    right-shifting by 32 is dodgy).

  * It's now easier to read.

- It renames transparent.bmp as transparent-if-within-ico.bmp. Ironically
  enough this file currently uses BITFIELDS compression and is WinBMPv5 format,
  which means it contains well-specified alpha data. In order to use it to test
  the hacky BMP-within-ICO transparency scheme the patch changes it to be
  WinBMPv3 format with RGB compression (i.e. no compression). I left the
  now-excess bytes (including the bitfields) in the info header in place
  because that's allowed -- thanks to the start of the pixel data being
  specified by the |dataoffset| field -- they'll just be ignored.

- It tweaks the naming of the relevant gtests and some of their finer details
  to work with the new way of doing things.

This fixes all four remaining failures in bmpsuite.

--HG--
rename : image/test/gtest/transparent.bmp => image/test/gtest/transparent-if-within-ico.bmp
extra : rebase_source : 2f4838d04bbae4fac00cc69e8d75469105a5de3b
2015-10-13 21:20:10 -07:00
..
Common.cpp Bug 1214072 (part 2) - Implement transparency properly for BMP images. r=seth. 2015-10-13 21:20:10 -07:00
Common.h Bug 1204393 (part 2) - Add more testing of the ICON decoder. r=seth. 2015-10-05 14:29:11 -07:00
TestCopyOnWrite.cpp Bug 1194912 (Part 1) - Add CopyOnWrite<T> to support automatic copy-on-write for recursive writes to data structures. r=tn 2015-08-25 16:26:39 -07:00
TestDecodeToSurface.cpp Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
TestDecoders.cpp Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
TestMetadata.cpp Bug 1214072 (part 2) - Implement transparency properly for BMP images. r=seth. 2015-10-13 21:20:10 -07:00
TestStreamingLexer.cpp Bug 1196066 (Part 2) - Add a streaming lexing framework to ImageLib. r=tn 2015-09-18 23:12:27 -07:00
corrupt.jpg
first-frame-green.gif
first-frame-green.png
first-frame-padding.gif Bug 1191114 (Part 4) - Add tests for metadata decoding, including that we always deliver HAS_TRANSPARENCY during the metadata decode. r=tn 2015-08-12 10:41:11 -07:00
green.bmp
green.gif
green.ico
green.icon Bug 1204393 (part 2) - Add more testing of the ICON decoder. r=seth. 2015-10-05 14:29:11 -07:00
green.jpg
green.png
moz.build Bug 1214072 (part 2) - Implement transparency properly for BMP images. r=seth. 2015-10-13 21:20:10 -07:00
no-frame-delay.gif Bug 1194059 (Part 4) - Add tests that we detect IS_ANIMATED during the metadata decode. r=tn 2015-08-14 00:37:19 -07:00
rle4.bmp Bug 1191114 (Part 4) - Add tests for metadata decoding, including that we always deliver HAS_TRANSPARENCY during the metadata decode. r=tn 2015-08-12 10:41:11 -07:00
rle8.bmp Bug 1191114 (Part 4) - Add tests for metadata decoding, including that we always deliver HAS_TRANSPARENCY during the metadata decode. r=tn 2015-08-12 10:41:11 -07:00
transparent-if-within-ico.bmp Bug 1214072 (part 2) - Implement transparency properly for BMP images. r=seth. 2015-10-13 21:20:10 -07:00
transparent.gif Bug 1191114 (Part 4) - Add tests for metadata decoding, including that we always deliver HAS_TRANSPARENCY during the metadata decode. r=tn 2015-08-12 10:41:11 -07:00
transparent.png Bug 1191114 (Part 4) - Add tests for metadata decoding, including that we always deliver HAS_TRANSPARENCY during the metadata decode. r=tn 2015-08-12 10:41:11 -07:00