Commit Graph

89 Commits

Author SHA1 Message Date
Nathan Froyd
ee9e46aaa1 Bug 1216611 - add mozilla::MakeUniqueFallible and convert uses throughout the tree; r=Waldo 2015-11-05 16:24:24 -05:00
Nicholas Nethercote
82f0fc9967 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.
2015-10-14 14:47:29 -07:00
Nicholas Nethercote
2ea46d1849 Bug 1215334 (part 1) - Avoid creating a fake header for BMP files in ICO files. r=seth.
The FileHeader and V5InfoHeader structs are shared by the BMP decoder and
encoder. But most of the fields within those structs are actually unused by the
decoder. It makes things clearer if we create a decoder-only struct that
contains the used fields, and then make FileHeader and V5InfoHeader only used
by the encoder. This patch does that.

This patch also renames BMPFileHeaders.h as BMPHeaders.h, which is now a better
name for it.
2015-10-15 15:43:25 -07:00
Nathan Froyd
889f2d5617 Bug 1218823 - use UniquePtr<> in preference to delete[] in image/; r=seth 2015-10-27 10:47:51 -04:00
Birunthan Mohanathas
68c551a17a Bug 1217320 - Remove more XPIDL signature comments in .cpp files. r=froydnj
Comment-only, DONTBUILD.
2015-10-27 06:54:25 +02:00
Nathan Froyd
78ba06cc19 Bug 1215763 - part 3 - s/nsAutoArrayPtr/UniquePtr/ in nsBMPEncoder; r=seth
The wrinkle here is that while we can pass a UniquePtr to
ConvertHostARGBRow, we can't pass UniquePtr to
EncodeImageDataRow{24,32}, as the latter get called with raw pointers
out of our control.
2015-10-17 07:01:31 -04:00
Nathan Froyd
05430e2a2c Bug 1215763 - part 1 - remove unnecessary nsAutoPtr.h includes; r=seth
These turned up when grepping around for nsAutoPtr; it seemed easier to
remove them as a first step.
2015-10-17 06:52:21 -04:00
Nicholas Nethercote
01292964d7 Bug 1204394 (part 1) - Using StreamingLexer in the BMP decoder. r=seth.
This patch is a major overhaul of nsBMPDecoder.

The patch improves the code in the following ways.

- It converts nsBMPDecoder to use StreamingLexer, which makes it much easier to
  read.

- It adds a detailed comment about the BMP format at the top of
  nsBMPDecoder.cpp.

- It fixes lots of inconsistent indenting.

- It moves |bihsize| from |mBFH| to |mBIH| to match the file format and common
  sense. The avoids the need for the confusing LENGTH/INTERNAL_LENGTH
  distinction.

- It renames most of the types in BMPFileHeader.h, so they have better names,
  in StudlyCaps form, and within the new |bmp| namespace.

- It removes the BMP_HEADER_LENGTH struct and inlines its values directly into
  the two places they were used.

- It removes the MOZ_LOG logging done on some of the failure cases. (Most
  failure cases lacked logging so why bother with some?)

- It removes over 200 lines of code, despite the addition of the big format
  comment.

The patch changes the way BMPs are decoded as follows.

- It adds stricter testing of the InfoHeader length, rejecting files with bad
  values.

- It moves all header sanity checking that can lead to file rejection into the
  metadata decode phase. (Previously, bpp/compression consistency checking did
  not occur during a metadata decode.)

- It removes BMPINFOHEADER::ALPHABITFIELDS, which was (a) a weird WinCE-only
  thing, and (b) we didn't actually allow it, and (c) we used the value 4
  instead of 6(!).

- It rejects the previously-accepted compression==RLE4 && bpp=1 combination
  because it doesn't make sense.

- It removes a fudge in RLE absolute mode handling that permitted one pixel too
  many in a row but only if the row's width was odd(!)

- It now rejects a file with a negative gap between the color table and the
  pixel data.

The patch leaves the following problems unaddressed.

- If bpp==32 we totally ignore compression==BITFIELDS and treat it like
  compression=RGB.

- Transparency as specified in WinBMPv{4,5} isn't handled at all.

These will be fixed in follow-ups.

All these changes affect (for the better) the results of the following tests
that will be added in part 2:

- g/pal8v4.bmp
- g/pal8v5.bmp
- q/pal8os2sp.bmp
- q/pal8os2v2.bmp
- q/pal8os2v2-16.bmp
- b/badheadersize.bmp
- b/badpalettesize.bmp
- b/badrle.bmp
2015-10-08 22:47:56 -07:00
Chris Peterson
b06d7f99a7 Bug 1207030 - Enable -Wshadow flag in more directories that have no -Wshadow warnings. r=glandium 2015-09-22 21:39:03 -07:00
Nicholas Nethercote
10d95cca57 Bug 1198334 (part 1) - Replace the opt-in FAIL_ON_WARNINGS with the opt-out ALLOW_COMPILER_WARNINGS. r=glandium.
The patch removes 455 occurrences of FAIL_ON_WARNINGS from moz.build files, and
adds 78 instances of ALLOW_COMPILER_WARNINGS. About half of those 78 are in
code we control and which should be removable with a little effort.
2015-08-27 20:44:53 -07:00
Birunthan Mohanathas
9b6236a10a Bug 1191100 - Remove XPIDL signature comments in .cpp files. r=ehsan
Comment-only so DONTBUILD.
2015-08-04 16:17:36 -07:00
Seth Fowler
04030c87f4 Bug 1186112 - Get rid of the #define'd constants in BMPFileHeaders.h. r=tn 2015-07-22 15:49:49 -07:00
Eric Rahm
29f00ac208 Bug 1165515 - Part 13-2: Replace usage of PRLogModuleLevel and PR_LOG_*. rs=froydnj
This is straightforward mapping of PR_LOG levels to their LogLevel
counterparts:
  PR_LOG_ERROR   -> LogLevel::Error
  PR_LOG_WARNING -> LogLevel::Warning
  PR_LOG_WARN    -> LogLevel::Warning
  PR_LOG_INFO    -> LogLevel::Info
  PR_LOG_DEBUG   -> LogLevel::Debug
  PR_LOG_NOTICE  -> LogLevel::Debug
  PR_LOG_VERBOSE -> LogLevel::Verbose

Instances of PRLogModuleLevel were mapped to a fully qualified
mozilla::LogLevel, instances of PR_LOG levels in #defines were mapped to a
fully qualified mozilla::LogLevel::* level, and all other instances were
mapped to us a shorter format of LogLevel::*.

Bustage for usage of the non-fully qualified LogLevel were fixed by adding
|using mozilla::LogLevel;| where appropriate.
2015-06-03 15:25:57 -07:00
Carsten "Tomcat" Book
e2f82674b8 Backed out 14 changesets (bug 1165515) for linux x64 e10s m2 test failures
Backed out changeset d68dcf2ef372 (bug 1165515)
Backed out changeset 7c3b45a47811 (bug 1165515)
Backed out changeset b668b617bef2 (bug 1165515)
Backed out changeset d0916e1283a2 (bug 1165515)
Backed out changeset ac4dc7489942 (bug 1165515)
Backed out changeset e9632ce8bc65 (bug 1165515)
Backed out changeset c16d215cc7e4 (bug 1165515)
Backed out changeset e4d474f3c51a (bug 1165515)
Backed out changeset d87680bf9f7c (bug 1165515)
Backed out changeset b3c0a45ba99e (bug 1165515)
Backed out changeset 9370fa197674 (bug 1165515)
Backed out changeset 50970d668ca1 (bug 1165515)
Backed out changeset ffa4eb6d24b9 (bug 1165515)
Backed out changeset 5fcf1203cc1d (bug 1165515)
2015-06-02 13:05:56 +02:00
Eric Rahm
18bd3de863 Bug 1165515 - Part 13-2: Replace usage of PRLogModuleLevel and PR_LOG_*. rs=froydnj
This is straightforward mapping of PR_LOG levels to their LogLevel
counterparts:
  PR_LOG_ERROR   -> LogLevel::Error
  PR_LOG_WARNING -> LogLevel::Warning
  PR_LOG_WARN    -> LogLevel::Warning
  PR_LOG_INFO    -> LogLevel::Info
  PR_LOG_DEBUG   -> LogLevel::Debug
  PR_LOG_NOTICE  -> LogLevel::Debug
  PR_LOG_VERBOSE -> LogLevel::Verbose

Instances of PRLogModuleLevel were mapped to a fully qualified
mozilla::LogLevel, instances of PR_LOG levels in #defines were mapped to a
fully qualified mozilla::LogLevel::* level, and all other instances were
mapped to us a shorter format of LogLevel::*.

Bustage for usage of the non-fully qualified LogLevel were fixed by adding
|using mozilla::LogLevel;| where appropriate.
2015-06-01 22:17:33 -07:00
Wes Kocher
bd796581dc Backed out 14 changesets (bug 1165515) for b2g mochitest-6 permafail CLOSED TREE
Backed out changeset 9b97e2aa2ed9 (bug 1165515)
Backed out changeset 150606c022a2 (bug 1165515)
Backed out changeset 4e875a488349 (bug 1165515)
Backed out changeset 467e7feeb546 (bug 1165515)
Backed out changeset d6b6cc373197 (bug 1165515)
Backed out changeset 0615265b593c (bug 1165515)
Backed out changeset fafd1dce9f08 (bug 1165515)
Backed out changeset d1df869245f9 (bug 1165515)
Backed out changeset 6876a7c63611 (bug 1165515)
Backed out changeset b7841c94a9a3 (bug 1165515)
Backed out changeset e5e3617f7c73 (bug 1165515)
Backed out changeset 39be3db95978 (bug 1165515)
Backed out changeset 0ec74176f8de (bug 1165515)
Backed out changeset 5b928dd10d71 (bug 1165515)
2015-06-01 17:57:58 -07:00
Eric Rahm
ae32743ed2 Bug 1165515 - Part 13-2: Replace usage of PRLogModuleLevel and PR_LOG_*. rs=froydnj
This is straightforward mapping of PR_LOG levels to their LogLevel
counterparts:
  PR_LOG_ERROR   -> LogLevel::Error
  PR_LOG_WARNING -> LogLevel::Warning
  PR_LOG_WARN    -> LogLevel::Warning
  PR_LOG_INFO    -> LogLevel::Info
  PR_LOG_DEBUG   -> LogLevel::Debug
  PR_LOG_NOTICE  -> LogLevel::Debug
  PR_LOG_VERBOSE -> LogLevel::Verbose

Instances of PRLogModuleLevel were mapped to a fully qualified
mozilla::LogLevel, instances of PR_LOG levels in #defines were mapped to a
fully qualified mozilla::LogLevel::* level, and all other instances were
mapped to us a shorter format of LogLevel::*.

Bustage for usage of the non-fully qualified LogLevel were fixed by adding
|using mozilla::LogLevel;| where appropriate.
2015-06-01 14:31:01 -07:00
Eric Rahm
ccf1ec07c6 Bug 1165515 - Part 1: Convert PR_LOG to MOZ_LOG. r=froydnj 2015-05-21 13:22:04 -07:00
Birunthan Mohanathas
ab03747a9e Bug 1038536 - Flatten image/src/ directory. r=seth 2015-05-14 20:52:05 -07:00
Eric Rahm
f109b37da6 Bug 1162751 - Part 1: Remove instances of #ifdef PR_LOGGING in image. r=froydnj
PR_LOGGING is now always defined, we can remove #ifdefs checking for it.
2015-05-11 13:42:20 -07:00
Andrea Marchesini
124186054d Bug 1156632 - Remove unused forward class declarations - patch 4 - netwerk image and dom, r=ehsan 2015-04-22 08:29:20 +02:00
Glenn Randers-Pehrson
d7520656b9 Bug 1102048 (Part 23, encoders) - Make image/src files comply with the Mozilla Coding Style Guide. r=seth 2015-04-06 19:19:00 -07:00
Mike Hommey
4da5ed0b71 Bug 1138293 - Use malloc/free/realloc/calloc instead of moz_malloc/moz_free/moz_realloc/moz_calloc. r=njn
The distinction between moz_malloc/moz_free and malloc/free is not
interesting. We are inconsistent in our use of one or the other, and
I wouldn't be surprised if we are mixing them anyways.
2015-03-31 12:32:49 +09:00
Ehsan Akhgari
33bb32f549 Bug 1145631 - Part 1: Replace MOZ_OVERRIDE and MOZ_FINAL with override and final in the tree; r=froydnj
This patch was automatically generated using the following script:

function convert() {
echo "Converting $1 to $2..."
find . \
       ! -wholename "*/.git*" \
       ! -wholename "obj-ff-dbg*" \
         -type f \
      \( -iname "*.cpp" \
         -o -iname "*.h" \
         -o -iname "*.c" \
         -o -iname "*.cc" \
         -o -iname "*.idl" \
         -o -iname "*.ipdl" \
         -o -iname "*.ipdlh" \
         -o -iname "*.mm" \) | \
    xargs -n 1 sed -i -e "s/\b$1\b/$2/g"
}

convert MOZ_OVERRIDE override
convert MOZ_FINAL final
2015-03-21 12:28:04 -04:00
Glenn Randers-Pehrson
dfcfb7d851 Bug 1132081 - Speed up ConvertHostARGBRow() in the PNG encoder. r=jmuizelaar 2015-02-21 05:54:00 +01:00
Mike Hommey
824818ee98 Bug 1126593 - Add a global fallible instance, so that using fallible works directly, everywhere. r=njn
--HG--
rename : memory/mozalloc/fallible.h => memory/fallible/fallible.h
2015-02-02 09:56:13 +09:00
Glenn Randers-Pehrson
e2bc55a28c Bug 991149 - Improve image/* source compliance with Mozilla Coding Style. r=seth 2014-11-14 12:59:00 -05:00
Glenn Randers-Pehrson
d15c56cd63 Bug 1072340 - Clean up PNG codecs in image/encoders,decoders. r=jmuizelaar
--HG--
extra : rebase_source : e8789fd34910ae510483034a769e77e70e644198
2014-09-24 17:38:00 -04:00
Birunthan Mohanathas
1309100133 Bug 1049997 - Separate statements declaring multiple pointers into separate statements. r=froydnj 2014-08-08 07:04:45 -07:00
Mike Hommey
d10b15b035 Bug 1041860 - Avoid setting FINAL_LIBRARY to libraries that further use a FINAL_LIBRARY. r=mshal 2014-07-23 08:37:51 +09:00
Jonathan Watt
1f3d08cbbf Add some documenting comments to the image encoders; no bug 2014-06-25 12:59:55 +01:00
Benoit Jacob
2d78cefb06 Bug 1028588 - Fix dangerous public destructors in image/ - r=jrmuizel 2014-06-23 14:49:08 -04:00
Birunthan Mohanathas
c4568a7085 Bug 869836 - Part 6: Use EqualsLiteral instead of Equals where possible. r=ehsan 2014-05-22 06:48:51 +03:00
Birunthan Mohanathas
ff8ce9bd42 Bug 900908 - Part 3: Change uses of numbered macros in nsIClassInfoImpl.h/nsISupportsImpl.h to the variadic variants. r=froydnj 2014-04-27 03:06:00 -04:00
Mike Hommey
a65383e1e9 Bug 939632 - Remove LIBRARY_NAME for leaf libraries. r=gps
Landing on a CLOSED TREE.
2013-11-19 11:50:54 +09:00
Mike Hommey
8ceb917350 Bug 939074 - Remove most LIBXUL_LIBRARY. rs=gps 2013-11-19 11:48:10 +09:00
Mike Hommey
bb6779efe3 Bug 939044 - Remove most definitions of MODULE. r=mshal 2013-11-19 11:47:39 +09:00
Mike Hommey
d7b6f95761 Bug 935881 - Use FINAL_LIBRARY for all (fake) libraries that end up linked in a single other library. r=gps 2013-11-19 11:47:14 +09:00
Mike Hommey
1d566f7586 Bug 929905 - Consolidate sources in moz.build. r=gps 2013-10-25 08:23:05 +09:00
Ms2ger
6ab8122e99 Bug 923395 - Part d: Remove some Makefiles in image/; r=gps 2013-10-20 09:25:19 +02:00
Glenn Randers-Pehrson
26ae7698d8 Bug 922471 - Remove MOZ_PNG_READ-WRITE global defines. r=jmuizelaar 2013-10-06 15:30:32 -04:00
Trevor Saunders
e8f7d269ed bug 920754 - rm more makefiles r=mshal 2013-09-25 16:39:06 -04:00
Seth Fowler
428388057f Bug 908514 (Part 1) - Replace imagelib endian macros with MFBT's endian functions. r=jrmuizel 2013-09-05 15:55:13 -07:00
Mike Hommey
f1cf3b4238 Bug 912293 - Remove now redundant boilerplate from Makefile.in. r=gps 2013-09-05 09:01:46 +09:00
Ms2ger
dba42e4001 Bug 883284 - Part d: Move LIBXUL_LIBRARY into moz.build (f-j); r=bsmedberg 2013-08-22 08:56:00 +02:00
Ms2ger
4d968c40e1 Bug 882859 - Part b: Move FAIL_ON_WARNINGS into moz.build; r=joey+gps 2013-08-22 08:55:59 +02:00
Trevor Saunders
7da524d402 bug 886526 - remove IS_COMPONENT and MODULE_NAME makefile vars for things in libxul r=bsmedberg r=glandium 2013-08-08 20:12:37 -04:00
Trevor Saunders
6b3c839046 backout bug 886526 because it probably made us use a lot more memory to link on windows 2013-07-29 11:03:21 -04:00
Joshua Cranmer
5d51157f46 Bug 884061 - Part 3k: Use NS_DECL_THREADSAFE_ISUPPORTS in image/, r=joedrew
--HG--
extra : rebase_source : f8582736fc5306c441ddcab7a215e16262c6f517
2013-07-18 21:23:31 -05:00
Trevor Saunders
82e5558b37 bug 887483 - remove a bunch of useless assignments to FORCE_STATIC_LIB implied by LIBXUL_LIBRARY=1 r=mshal 2013-07-11 11:06:34 -04:00