Граф коммитов

369 Коммитов

Автор SHA1 Сообщение Дата
Nicholas Nethercote bc8cdf084b Bug 1213613 (part 3) - Fix color-scaling of 16bpp BMP images. r=seth.
This patch implements proper color-scaling, instead of bit-shifting, and uses
it for 16bpp images.

It also cleans up the code relating to color masking in the process, by making
BitFields a proper class and introducing the Value class within it.

This fixes sub-optimal handling of four images in bmpsuite.
2015-10-13 20:01:02 -07:00
Nicholas Nethercote 74961773ab Bug 1213613 (part 2) - Move some BMP-related structs. r=seth.
This patch moves them into less exposed places. It also moves the RLE_*
constants into the RLE enum, and renames ColorTable and its fields.
2015-10-13 16:43:18 -07:00
Nicholas Nethercote a96e894e1a Bug 1213613 (part 1) - Formatting cleanups for nsBMPEncoder.h. r=seth.
Two-space indents is the Gecko standard, and it's what nsBMPDecoder.cpp uses.
This patch changes nsBMPEncoder.h to use two-space indents as well. This will
help avoid possible mis-indentation if code is moved from the .h to the .cpp or
vice versa (as subsequent patches in this bug will do).

Also, it changes some of the // comments on public methods to doxygen-style ///
comments.
2015-10-13 16:08:06 -07:00
Nicholas Nethercote 5ca8040708 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

--HG--
extra : rebase_source : 8ddc2f5fccce6998348097ff9f0a1072d273cdf4
2015-10-08 22:47:56 -07:00
Nicholas Nethercote b7e5ba36b2 Bug 1204393 (part 1) - Use StreamingLexer in the ICON decoder. r=seth.
* * *
Bug 1204393 (part 1b) - Address review comments.

--HG--
extra : rebase_source : 0015ca99e20ccd6f4d5becab38fece63cb02332b
2015-10-05 14:29:01 -07:00
Steve Singer 9156f29954 Bug 1208935 - Move Deinterlacer to a standalone file. r=seth
--HG--
extra : rebase_source : 0c5a189769dd741953cab667127ffdef39a60aa7
2015-09-28 20:40:00 +02:00
Seth Fowler ae6de3f01a Bug 1207378 (Part 2) - Use Downscaler to remove first-frame padding when downscaling GIFs. r=tn 2015-09-26 01:36:23 -07:00
Seth Fowler ba99adc235 Bug 1207378 (Part 1) - Add support for a frame rect to Downscaler. r=tn 2015-09-26 01:36:19 -07:00
Chris Peterson 71920a9550 Bug 1207030 - Enable -Wshadow flag in more directories that have no -Wshadow warnings. r=glandium 2015-09-22 21:39:03 -07:00
Seth Fowler 7a466fae73 Bug 1206836 - When downscaling ICOs, downscale the AND mask as well. r=tn a=KWierso 2015-09-21 19:52:31 -07:00
Seth Fowler c1229ef66c Bug 1146663 (Part 5) - Require that all image decoders support downscale-during-decode. r=tn 2015-09-19 16:21:08 -07:00
Seth Fowler 93cbaca5e0 Bug 1201796 (Part 4) - Add downscale-during-decode support for the ICO decoder. r=tn 2015-09-19 13:34:14 -07:00
Seth Fowler 30373cd6eb Bug 1201796 (Part 1) - Treat ICOs with wrong widths and heights as corrupt. r=tn
--HG--
rename : image/test/reftest/ico/ico-bmp-corrupted/invalid_ico_height.ico => image/test/crashtests/invalid_ico_height.ico
rename : image/test/reftest/ico/ico-bmp-corrupted/invalid_ico_width.ico => image/test/crashtests/invalid_ico_width.ico
2015-09-19 13:34:06 -07:00
Seth Fowler 8adce05f13 Bug 1196066 (Part 3) - Rewrite nsICODecoder to use StreamingLexer. r=tn 2015-09-18 23:12:30 -07:00
Wes Kocher 08de06967a Backed out 8 changesets (bug 1201796, bug 1196066) for mulet gij(28) failures CLOSED TREE
Backed out changeset 159d5d2946d3 (bug 1201796)
Backed out changeset 958988218976 (bug 1201796)
Backed out changeset 494e7553d641 (bug 1201796)
Backed out changeset d58149411b7d (bug 1201796)
Backed out changeset 35bd769b49f8 (bug 1196066)
Backed out changeset e4f3d4279b4c (bug 1196066)
Backed out changeset ca467297fa07 (bug 1196066)
Backed out changeset b4851ce6637d (bug 1196066)

--HG--
rename : image/test/crashtests/invalid_ico_height.ico => image/test/reftest/ico/ico-bmp-corrupted/invalid_ico_height.ico
rename : image/test/crashtests/invalid_ico_width.ico => image/test/reftest/ico/ico-bmp-corrupted/invalid_ico_width.ico
extra : rebase_source : 5232674f1cf0ef4d7f70568f627547c0151a801f
2015-09-18 13:01:25 -07:00
Seth Fowler b48b5d99b8 Bug 1201796 (Part 4) - Add downscale-during-decode support for the ICO decoder. r=tn 2015-09-18 10:54:40 -07:00
Seth Fowler 2035a81b8d Bug 1201796 (Part 1) - Treat ICOs with wrong widths and heights as corrupt. r=tn
--HG--
rename : image/test/reftest/ico/ico-bmp-corrupted/invalid_ico_height.ico => image/test/crashtests/invalid_ico_height.ico
rename : image/test/reftest/ico/ico-bmp-corrupted/invalid_ico_width.ico => image/test/crashtests/invalid_ico_width.ico
2015-09-18 10:54:32 -07:00
Seth Fowler dad8dccdb4 Bug 1196066 (Part 3) - Rewrite nsICODecoder to use StreamingLexer. r=tn 2015-09-18 10:54:27 -07:00
Seth Fowler b32c629237 Bug 1194058 (Part 2) - Add downscale-during-decode support for the GIF decoder. r=tn 2015-09-17 15:03:34 -07:00
Seth Fowler a27fe0e4ca Bug 1201763 - Add downscale-during-decode support for the ICON decoder. r=tn 2015-09-08 22:07:18 -07:00
Seth Fowler 9b67d0789b Bug 1062066 (Part 4) - Add downscale-during-decode support for the BMP decoder. r=tn 2015-09-08 22:07:12 -07:00
Seth Fowler 4010153517 Bug 1062066 (Part 3) - Only mark BMP surfaces as transparent if they actually have alpha data. r=tn 2015-09-08 22:07:09 -07:00
Seth Fowler 957709108c Bug 1060609 (Part 2) - Add downscale-during-decode support for the PNG decoder. r=tn,f=glennrp 2015-09-01 14:13:17 -07:00
Nicholas Nethercote f44287005f 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.

--HG--
extra : rebase_source : 82e3387abfbd5f1471e953961d301d3d97ed2973
2015-08-27 20:44:53 -07:00
Gijs Kruitbosch 1aa68e8c0f Bug 1173214, r=seth,bz
--HG--
extra : commitid : 4vG71pjrBIY
2015-08-26 10:24:04 +01:00
Seth Fowler 3460e34af9 Bug 1194900 - Stop deciding when to send invalidations in nsPNGDecoder and let Decoder handle it. r=tn 2015-08-24 19:49:36 -07:00
Glenn Randers-Pehrson feec7ca127 Bug 1187569 - PNGs getting stuck in a pixelated state. r=seth
--HG--
extra : amend_source : 9efb698c7535f8817618da390c6316e86306a735
2015-08-20 14:17:10 -07:00
Michael Layzell 945c9a35f4 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
Seth Fowler f89ca1d90f 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
Seth Fowler 7e909725b3 Bug 1194059 (Part 2) - Always detect IS_ANIMATED during the metadata decode. r=tn 2015-08-14 00:37:13 -07:00
Christoph Kerschbaumer a2927d618d Bug 1193924 - Add assertion to AsyncOpen to make sure asyncOpen2() was called first when securityflags in loadInfo are set (r=sicking) 2015-08-12 21:36:33 -07:00
Ryan VanderMeulen ec552557f5 Backed out changeset f99b27e40987 (bug 1193924) for B2G emulator bustage.
CLOSED TREE
2015-08-13 12:45:05 -04:00
Christoph Kerschbaumer ecdc701ca0 Bug 1193924 - Add assertion to AsyncOpen to make sure asyncOpen2() was called first when securityflags in loadInfo are set (r=sicking) 2015-08-12 21:36:33 -07:00
Seth Fowler c012dc0aa9 Bug 1191114 (Part 1) - Always detect HAS_TRANSPARENCY during the metadata decode. r=tn
--HG--
extra : rebase_source : 97c8568f33abd1f2a8d9ef5679ce3ac904f0758f
2015-08-12 10:41:02 -07:00
Seth Fowler c0f83249c8 Bug 1191090 - Use the normal PNG decoder for PNG metadata decodes. r=tn
--HG--
extra : rebase_source : c0d1f9f8e376cbe4ebf1921d3e1edf85234e8f7b
2015-08-10 15:34:27 -07:00
Seth Fowler c17342d0b4 Bug 1187546 - Make it possible to ask image decoders to only decode the first frame. r=tn 2015-07-31 18:10:23 -07:00
Seth Fowler 947de7376b Bug 1187386 (Part 2) - Rework decoder code to avoid calling Decode::GetImage(). r=tn
--HG--
extra : rebase_source : 6fc835a3468e846cb59474efcfea5355914a9dc4
2015-07-31 07:29:03 -07:00
Seth Fowler 5a46946f86 Bug 1187386 (Part 1) - Make most decoder state private. r=tn
--HG--
extra : rebase_source : 0d9179626707ac70e772ed3d768ce4d802a144be
2015-07-31 07:29:00 -07:00
Wes Kocher 84dc3c46ed Backed out changesets f6d75433812f,7864cbaa9e5d (bug 1173214) for reftest failures CLOSED TREE
--HG--
extra : amend_source : ca7728a234390116922c2390f748afcc87f6a082
extra : histedit_source : 7864cbaa9e5d105f4c758025ccbe51317f35b108%2C00b8364cdec6b60907bd71508c092df02878a834
2015-07-28 15:20:25 -07:00
Gijs Kruitbosch c02e9dd583 Bug 1173214. Be a little more more careful with moz-icon URIs. r=bzbarsky 2015-07-16 15:24:51 +01:00
Seth Fowler 88affc4d10 Bug 1184996 (Part 4) - Forbid instantiation of decoders except via DecoderFactory. r=tn 2015-07-22 22:39:56 -07:00
Seth Fowler 1732630df1 Bug 1184996 (Part 3) - Replace all remaining references to 'size decodes' with 'metadata decodes'. r=tn 2015-07-22 22:39:54 -07:00
Seth Fowler 2697700b81 Bug 1186112 - Get rid of the #define'd constants in BMPFileHeaders.h. r=tn
--HG--
extra : rebase_source : f9b19180e1a09adff4695a50eb65612f337392f3
2015-07-22 15:49:49 -07:00
Christoph Kerschbaumer 2ddb4064ec Bug 1143922 - Add AsyncOpen2 to nsIChannel and perform security checks when opening a channel - channel changes (r=mcmanus,sicking) 2015-05-15 13:21:20 -07:00
Seth Fowler d564a3b0a5 Bug 1117607 - Make decoders responsible for their own frame allocations. r=tn 2015-07-10 19:26:15 -07:00
Dragana Damjanovic 7987d2203e Bug 905127 - Part 2 - remove unnecessary nsNetUtil.h includes r=jduell 2015-07-06 07:55:00 +02:00
Emanuel Hoogeveen 7d1e52f2ff Bug 905127 - Part 1 - Make some functions from nsNetUtil not inline. r=jduell 2015-07-07 04:17:00 +02:00
Juan Gomez 258ad59e3f Bug 1171931 - Refactor duplicated code using XRE_IsParent/ContentProcess. r=froydnj 2015-07-03 18:29:00 -07:00
Ryan VanderMeulen 5f5c327690 Backed out changeset 8b4e4083639e (bug 1171931) for B2G debug emulator bustage. 2015-06-25 19:48:42 -04:00
Juan Gomez 702a59d135 Bug 1171931 - Refactor duplicated code using XRE_IsParent/ContentProcess. r=froydnj
--HG--
extra : rebase_source : 2ecbe6c1dd8a7ad8dc529b53349ad431cf1116c9
2015-06-24 14:11:00 -04:00