gecko-dev/image
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
..
build Backed out 1 changesets (bug 1160200) for causing R2 test failures 2015-09-29 11:48:53 +02:00
decoders Bug 1214072 (part 2) - Implement transparency properly for BMP images. r=seth. 2015-10-13 21:20:10 -07:00
encoders Bug 1217320 - Remove more XPIDL signature comments in .cpp files. r=froydnj 2015-10-27 06:54:25 +02:00
test Bug 1214072 (part 2) - Implement transparency properly for BMP images. r=seth. 2015-10-13 21:20:10 -07:00
BMPFileHeaders.h Bug 1213613 (part 2) - Move some BMP-related structs. r=seth. 2015-10-13 16:43:18 -07:00
ClippedImage.cpp Bug 1215763 - part 2 - s/nsAutoPtr/UniquePtr/ in image/; r=seth 2015-10-17 06:53:28 -04:00
ClippedImage.h Bug 1215763 - part 2 - s/nsAutoPtr/UniquePtr/ in image/; r=seth 2015-10-17 06:53:28 -04:00
CopyOnWrite.h Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
DecodePool.cpp Bug 1215763 - part 1 - remove unnecessary nsAutoPtr.h includes; r=seth 2015-10-17 06:52:21 -04:00
DecodePool.h Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
Decoder.cpp Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
Decoder.h Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
DecoderFactory.cpp Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
DecoderFactory.h Bug 1118926 (Part 1) - Remove remnants of -moz-resolution in C++ code. r=tn 2015-09-30 17:00:52 -07:00
DecoderFlags.h Bug 1185800 - Add DecoderFlags and SurfaceFlags enum classes and use them instead of imgIContainer flags in all decoder-related code. r=tn 2015-08-14 17:56:44 -07:00
Deinterlacer.cpp Bug 1208935 - Move Deinterlacer to a standalone file. r=seth 2015-09-28 20:40:00 +02:00
Deinterlacer.h Bug 1208935 - Move Deinterlacer to a standalone file. r=seth 2015-09-28 20:40:00 +02:00
Downscaler.cpp Bug 1213744 (Part 1) - Support zero-size frame rects and detecting the end of the frame in Downscaler. r=tn 2015-10-25 13:14:14 -07:00
Downscaler.h Bug 1213744 (Part 1) - Support zero-size frame rects and detecting the end of the frame in Downscaler. r=tn 2015-10-25 13:14:14 -07:00
DrawResult.h Bug 1209715 - Add operator overloads for combining DrawResults. r=tn 2015-10-13 23:21:39 -07:00
DynamicImage.cpp Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
DynamicImage.h Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
FrameAnimator.cpp Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
FrameAnimator.h Bug 1194059 (Part 2) - Always detect IS_ANIMATED during the metadata decode. r=tn 2015-08-14 00:37:13 -07:00
FrozenImage.cpp Bug 1211324 (part 5) - Remove GraphicsFilter and gfxGraphicsFilter. r=mattwoodrow. 2015-10-05 17:18:10 -07:00
FrozenImage.h Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
ICOFileHeaders.h Bug 1038536 - Flatten image/src/ directory. r=seth 2015-05-14 20:52:05 -07:00
IProgressObserver.h Bug 1177615 - Rip everything related to FLAG_DECODE_STARTED out of ImageLib. r=tn 2015-07-06 17:11:14 -07:00
Image.cpp Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
Image.h Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
ImageCacheKey.cpp Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
ImageCacheKey.h Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
ImageFactory.cpp Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
ImageFactory.h Bug 1038536 - Flatten image/src/ directory. r=seth 2015-05-14 20:52:05 -07:00
ImageLogging.h Bug 1165515 - Part 13-2: Replace usage of PRLogModuleLevel and PR_LOG_*. rs=froydnj 2015-06-03 15:25:57 -07:00
ImageMetadata.h Bug 1194059 (Part 2) - Always detect IS_ANIMATED during the metadata decode. r=tn 2015-08-14 00:37:13 -07:00
ImageOps.cpp Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
ImageOps.h Bug 1181863 (Part 3) - Add tests for DecodeToSurface(). r=tn 2015-07-31 18:10:34 -07:00
ImageRegion.h Bug 1182996 - Fix and add missing namespace comments. rs=ehsan 2015-07-13 08:25:42 -07:00
ImageURL.h Bug 1169680 - Don't merge image cache entries for blob URIs with different refs. r=tn 2015-06-05 01:52:06 -07:00
ImageWrapper.cpp Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
ImageWrapper.h Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
LookupResult.h Bug 1176124 (Part 1) - Add a MatchType enum to LookupResult to let Lookup*() return more detailed information. r=dholbert 2015-07-19 18:39:40 -07:00
MultipartImage.cpp Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
MultipartImage.h Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
Orientation.h Bug 1038536 - Flatten image/src/ directory. r=seth 2015-05-14 20:52:05 -07:00
OrientedImage.cpp Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
OrientedImage.h Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
ProgressTracker.cpp Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
ProgressTracker.h Bug 1214054 - Don't fire DECODE_COMPLETE in VectorImage::OnSVGDocumentError(). r=dholbert 2015-10-22 23:29:38 -07:00
RasterImage.cpp Bug 1217320 - Remove more XPIDL signature comments in .cpp files. r=froydnj 2015-10-27 06:54:25 +02:00
RasterImage.h Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
SVGDocumentWrapper.cpp Bug 1217320 - Remove more XPIDL signature comments in .cpp files. r=froydnj 2015-10-27 06:54:25 +02:00
SVGDocumentWrapper.h Bug 1182996 - Fix and add missing namespace comments. rs=ehsan 2015-07-13 08:25:42 -07:00
ScriptedNotificationObserver.cpp Bug 1038536 - Flatten image/src/ directory. r=seth 2015-05-14 20:52:05 -07:00
ScriptedNotificationObserver.h Bug 1038536 - Flatten image/src/ directory. r=seth 2015-05-14 20:52:05 -07:00
ShutdownTracker.cpp Bug 1215763 - part 1 - remove unnecessary nsAutoPtr.h includes; r=seth 2015-10-17 06:52:21 -04:00
ShutdownTracker.h Bug 1038536 - Flatten image/src/ directory. r=seth 2015-05-14 20:52:05 -07:00
SourceBuffer.cpp Bug 1196065 - Add sanity tests for image decoders. r=tn 2015-08-19 14:04:01 -07:00
SourceBuffer.h Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
StreamingLexer.h Bug 1196066 (Part 2) - Add a streaming lexing framework to ImageLib. r=tn 2015-09-18 23:12:27 -07:00
SurfaceCache.cpp Bug 1215763 - part 1 - remove unnecessary nsAutoPtr.h includes; r=seth 2015-10-17 06:52:21 -04:00
SurfaceCache.h Bug 1210553 - Remove the alternate flags arguments from SurfaceCache's Lookup functions. r=dholbert 2015-10-05 17:06:34 -07:00
SurfaceFlags.h Bug 1195878 - If we detect animation during a full decode, drop the results of the full decode on the floor. r=tn 2015-09-23 16:53:40 -07:00
VectorImage.cpp Bug 1217320 - Remove more XPIDL signature comments in .cpp files. r=froydnj 2015-10-27 06:54:25 +02:00
VectorImage.h Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
imgFrame.cpp Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
imgFrame.h Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
imgICache.idl Bug 1038536 - Flatten image/public/ directory. r=seth 2015-05-06 10:57:19 -07:00
imgIContainer.idl Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
imgIContainerDebug.idl Bug 1038536 - Flatten image/public/ directory. r=seth 2015-05-06 10:57:19 -07:00
imgIEncoder.idl Bug 1038536 - Flatten image/public/ directory. r=seth 2015-05-06 10:57:19 -07:00
imgILoader.idl Bug 1038536 - Flatten image/public/ directory. r=seth 2015-05-06 10:57:19 -07:00
imgINotificationObserver.idl Bug 1038536 - Flatten image/public/ directory. r=seth 2015-05-06 10:57:19 -07:00
imgIOnloadBlocker.idl Bug 1038536 - Flatten image/public/ directory. r=seth 2015-05-06 10:57:19 -07:00
imgIRequest.idl Bug 1177615 - Rip everything related to FLAG_DECODE_STARTED out of ImageLib. r=tn 2015-07-06 17:11:14 -07:00
imgIScriptedNotificationObserver.idl Bug 1038536 - Flatten image/public/ directory. r=seth 2015-05-06 10:57:19 -07:00
imgITools.idl Bug 1038536 - Flatten image/public/ directory. r=seth 2015-05-06 10:57:19 -07:00
imgLoader.cpp Bug 1217320 - Remove more XPIDL signature comments in .cpp files. r=froydnj 2015-10-27 06:54:25 +02:00
imgLoader.h Bug 1215763 - part 2 - s/nsAutoPtr/UniquePtr/ in image/; r=seth 2015-10-17 06:53:28 -04:00
imgRequest.cpp Bug 1217320 - Remove more XPIDL signature comments in .cpp files. r=froydnj 2015-10-27 06:54:25 +02:00
imgRequest.h Bug 1215763 - part 1 - remove unnecessary nsAutoPtr.h includes; r=seth 2015-10-17 06:52:21 -04:00
imgRequestProxy.cpp Bug 1215763 - part 2 - s/nsAutoPtr/UniquePtr/ in image/; r=seth 2015-10-17 06:53:28 -04:00
imgRequestProxy.h Bug 1215763 - part 2 - s/nsAutoPtr/UniquePtr/ in image/; r=seth 2015-10-17 06:53:28 -04:00
imgTools.cpp Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
imgTools.h Bug 1151694 - Part 2 - imgTools should be inside mozilla::image namespace. r=bbirtles 2015-09-03 23:00:00 +02:00
moz.build Bug 1209715 - Add operator overloads for combining DrawResults. r=tn 2015-10-13 23:21:39 -07:00
nsIIconURI.idl Bug 1195415 - Add asciiHostPort field to nsIURI, and use it in the implementation of nsPrincipal::GetOriginForURI, r=bholley 2015-08-18 14:52:24 -04:00