Commit Graph

621 Commits

Author SHA1 Message Date
Timothy Nikkel
0e7000fdce Bug 1352282. Always fill in the number of loops when decoding an APNG file. r=aosmond
If we were doing a first frame only decode we wouldn't fill in this value. The spec says this chunk must come before any image data so it should always be available at the end of any full decode (whether it be truly full or first frame only).
2017-04-05 11:28:40 -05:00
Brendan Dahl
a1f2e12af8 Bug 1338004 - Add headless browser mode. r=jrmuizel, r=ted
Supports creating a windowless browser on Linux without an X server. Most of the
changes are just adding branches to avoid calls in to GTK which calls
into X. Some of the bigger additions were adding a separate headless widget
which implements just enough to render a page. A headless look and
feel were also added since there are many calls into GTK in the platform
specific one.
2017-04-04 10:22:00 -04:00
Makoto Kato
f3c1c49239 Bug 1348177 - Part 1. Remove GetProcAddress for shell32 to use Vista+ API (image part). r=jimm,tnikkel
Since we drop XP support, it is unnecessary to use SHGetStockIconInfo via LoadLibrary.

MozReview-Commit-ID: 4lvhVObHv5U

--HG--
extra : rebase_source : 04ac6f97e6a3eff7c52e11e3868da0939efd6ffe
2017-03-17 13:26:57 +09:00
Andrew Osmond
449b1552c1 Bug 1343499 - Expose native image sizes to imagelib users. r=tnikkel 2017-03-22 09:05:36 -04:00
Andrew Osmond
c21c5cb4c8 Backed out changeset 619b5b27ce87 (bug 1343499) for CLOSED TREE build bustage r=backout 2017-03-22 11:04:30 -04:00
Andrew Osmond
a60b290b56 Bug 1343499 - Expose native image sizes to imagelib users. r=tnikkel 2017-03-22 09:05:36 -04:00
Andrew Osmond
9f71f348c1 Backed out changeset 0b797601dc36 (bug 1343499) for build bustages. r=backout 2017-03-22 09:19:05 -04:00
Andrew Osmond
cbf46adaef Bug 1343499 - Expose native image sizes to imagelib users. r=tnikkel 2017-03-22 09:05:36 -04:00
Andrea Marchesini
1fd1bc3935 Bug 1343933 - Renaming Principal classes - part 2 - NullPrincipal, r=qdot
--HG--
rename : caps/nsNullPrincipal.cpp => caps/NullPrincipal.cpp
rename : caps/nsNullPrincipal.h => caps/NullPrincipal.h
rename : caps/nsNullPrincipalURI.cpp => caps/NullPrincipalURI.cpp
rename : caps/nsNullPrincipalURI.h => caps/NullPrincipalURI.h
2017-03-22 11:38:40 +01:00
Vedant Sareen
7d4bd52fae Bug 1330907 - Rename Telemetry::ID to Telemetry::HistogramID. r=dexter
Changed |print("enum ID : uint32_t {", file=output)| to |print("enum HistogramID : uint32_t {", file=output)| at line 53 of the file |toolkit/components/telemetry/gen-histogram-enum.py|, and then replaced all the textual occurrences of |Telemetry::ID| to |Telemetry::HistogramID| and |ID| to |HistogramID| in 43 other files.
2017-02-16 00:45:15 +05:30
Wes Kocher
017c515285 Merge inbound to m-c a=merge
MozReview-Commit-ID: IKI0zVtF1n9
2017-02-15 16:18:13 -08:00
Andrew Osmond
4f8eb1363e Bug 1339202 - Decode images to shared surfaces for WebRender. r=tnikkel 2017-02-08 15:48:59 -05:00
Sylvestre Ledru
a54302b9d6 Bug 1338086 - Remove useless else blocks in order to reduce complexity image/ r=dholbert
MozReview-Commit-ID: 8qUQk8w0QSk

--HG--
extra : rebase_source : c7451383027a14144490d2a8d2639f73cead1a5c
2017-02-10 13:52:27 +01:00
Phil Ringnalda
c7b01ecbda Backed out 5 changesets (bug 1290292, bug 1290293) for gfx assertions
CLOSED TREE

Backed out changeset 652c909b75ad (bug 1290293)
Backed out changeset 90a284ea19e3 (bug 1290292)
Backed out changeset 8401d12fe936 (bug 1290293)
Backed out changeset d87488b69c18 (bug 1290293)
Backed out changeset 7368aa665fae (bug 1290293)
2017-02-13 19:28:45 -08:00
Andrew Osmond
42d8ee76ab Bug 1290293 - Part 2f. Assert there is no frame on the finish decoding error path. r=tnikkel 2017-02-10 08:33:11 -05:00
Andrew Osmond
e7ce25346c Bug 1290293 - Part 2c. Make nsGIFDecoder2 use B8G8R8X8 only for unpaletted frames. r=tnikkel 2016-11-03 10:32:21 -04:00
Andrew Osmond
6679005d2a Bug 1290293 - Part 2e. Make SurfacePipe users clear unwritten pixels if the image is truncated. r=tnikkel 2016-08-18 09:55:45 -04:00
Andrew Osmond
f6a09f3997 Bug 1290293 - Part 2d. Make nsJPEGDecoder clear unwritten pixels if the image is truncated. r=tnikkel 2016-08-18 09:55:45 -04:00
Andrew Osmond
bd54fc7365 Bug 1290293 - Part 2b. Make nsBMPDecoder explicitly write transparent pixels for those skipped by delta encoding. r=tnikkel 2017-02-13 19:51:40 -05:00
Sebastian Hengst
3ce82bcd4f Backed out changeset 45dd83a63162 (bug 1339202) for crashing in image processing related tests, e.g. xpcshell test test_imgtools.js. r=backout 2017-02-13 22:34:54 +01:00
Andrew Osmond
1683b602b4 Bug 1339202 - Decode images to shared surfaces for WebRender. r=tnikkel 2017-02-08 15:48:59 -05:00
Patrick McManus
d986482512 Bug 1333142 - audit asyncopen2 impls for callback release on failure r=dragana 2017-02-08 12:55:15 -05:00
Andrew Osmond
ca5d0ac0fd Bug 1290293 - Part 2a. Make nsPNGDecoder clear on which surface format is being used. r=tnikkel 2016-08-18 09:55:45 -04:00
Masatoshi Kimura
0c6dc2ea73 Bug 1323683 - Fold nsIURIWithQuery into nsIURI. r=valentin.gosu
MozReview-Commit-ID: BFfgr42sNyx

--HG--
extra : rebase_source : a28d6a3c96f0c86dd7269147f130b3195b1f1faf
2016-12-28 20:40:21 +09:00
Martin Husemann
6a9a8c76b3 Bug 1322112. Use memcpy() instead of dereferencing a casted pointer where the cast would increase alignement requirements on some architectures in nsIconDecoder. r=tnikkel 2016-12-08 14:10:58 -06:00
Andrew Osmond
f944648035 Bug 1315863 - Use PNG_MAXIMUM_INFLATE_WINDOW to ensure maximum compatibility with existing images. r=glennrp 2016-11-16 15:21:33 -05:00
Andrew Osmond
65f399d680 Bug 1315443 - Use the embedded BMPs BPP over the ICOs BPP when available. r=tnikkel 2016-11-16 09:57:35 -05:00
Ehsan Akhgari
ba68896bf9 Bug 1311246 - Remove support for the -moz-samplesize media fragment; r=jrmuizel
This removes the feature added in bug 854795 for Tarako b2g devices.
2016-11-16 08:18:56 -05:00
Andrew Osmond
cff4a19210 Bug 1311779 - Part 1. Ensure JPEG and BMP image decoders use B8G8R8X8 surfaces when possible. r=tnikkel 2016-10-20 14:43:26 -04:00
Andrew Osmond
54d6f7e0c4 Bug 1258741 - Part 1. Remove dead/unused image decoder aborted flag. r=tnikkel 2016-09-21 07:13:08 -04:00
Andrew Osmond
1286146b81 Bug 1303427 - Continue parsing buffered LZW codes in GIFs even if input stream is complete. r=tn 2016-09-19 09:16:28 -04:00
Nicholas Nethercote
3ac8aee67f Bug 1297300 - Add missing checks to GetSpec() calls in image/. r=tnikkel. 2016-08-29 15:34:32 +10:00
Glenn Randers-Pehrson
d0f907ce9b Bug 1297907 - Wrap long lines in nsPNGDecoder.cpp. r=tn
--HG--
extra : rebase_source : 01aba31d91a42a3afe30ea2ddc21118ae779ef79
2016-09-07 09:03:00 -04:00
Nicholas Nethercote
34dcc7b852 Bug 1299384 - Use MOZ_MUST_USE with NS_warn_if_impl(). r=erahm.
This change avoids lots of false positives for Coverity's CHECKED_RETURN
warning, caused by NS_WARN_IF's current use in both statement-style and
expression-style.

In the case where the code within the NS_WARN_IF has side-effects, I made the
following change.

> NS_WARN_IF(NS_FAILED(FunctionWithSideEffects()));
> -->
> Unused << NS_WARN_IF(NS_FAILED(FunctionWithSideEffects()));

In the case where the code within the NS_WARN_IF lacks side-effects, I made the
following change.

> NS_WARN_IF(!condWithoutSideEffects);
> -->
> NS_WARNING_ASSERTION(condWithoutSideEffects, "msg");

This has two improvements.
- The condition is not evaluated in non-debug builds.
- The sense of the condition is inverted to the familiar "this condition should
  be true" sense used in assertions.

A common variation on the side-effect-free case is the following.

> nsresult rv = Fn();
> NS_WARN_IF_(NS_FAILED(rv));
> -->
> DebugOnly<nsresult rv> = Fn();
> NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "Fn failed");

--HG--
extra : rebase_source : 58788245021096efa8372a9dc1d597a611d45611
2016-09-02 17:12:24 +10:00
Glenn Randers-Pehrson
7cd996e732 Bug 1295671 - Detect use of system libpng in nsPNGDecoder.cpp. r=tn
--HG--
extra : histedit_source : d6ce06bff319953f2abfa9b3d3acad3386b0a654
2016-08-27 01:23:00 -04:00
Dragana Damjanovic
67635a6600 Bug 1295636 - SetHostPort should reset the port if the host parameter does not have a port number. r=valentin, r=smaug
--HG--
extra : rebase_source : 2e63afd5708c55810206f9bc47b6f078a0824400
2016-08-17 23:25:00 -04:00
Seth Fowler
e527c3b511 Bug 1295506 - Don't yield hidden frames in the PNG decoder. r=edwin 2016-08-17 22:19:42 -07:00
Igor
175543fda8 Bug 1293384 - Part 2: Rename Snprintf.h header to Sprintf.h. r=froydnj 2016-08-14 23:43:21 -07:00
Igor
a57972337d Bug 1293384 - Part 1: Rename snprintf_literal to SprintfLiteral. r=froydnj 2016-08-14 23:44:00 -07:00
Glenn Randers-Pehrson
dc0ab41166 Bug 1288588 - Exit on bad CRC in fcTL or fdAT chunk in an APNG file. r=jrmuizel 2016-08-12 21:31:31 -04:00
Seth Fowler
98a9fd7db6 Bug 1291071 (Part 4) - Clean up Decoder::SpeedHistogram() and related code. r=edwin 2016-08-05 18:50:29 -07:00
Seth Fowler
19dc4aba32 Bug 1292505 (Part 2) - Remove remaining references to Downscaler in the SurfacePipe decoders. r=edwin 2016-08-05 13:44:52 -07:00
Seth Fowler
6a44833af8 Bug 1292505 (Part 1c) - Use ExplicitOutputSize() instead of Downscaler::TargetSize() in nsICODecoder. r=edwin 2016-08-05 13:44:48 -07:00
Igor
4efade90d4 Bug 1197331 - remove PR_snprintf calls in miscellaneous directories. r=nfroyd
--HG--
extra : rebase_source : a19f77db06e68bd3d69faf56b8bbdc1825f13249
2016-08-04 16:41:00 +02:00
Glenn Randers-Pehrson
a5af07b18b Bug 1240665 - Log all error returns from the PNG decoder. r=tnikkel
--HG--
extra : rebase_source : 373eef390fe03a2559e336539ddc6a546d6ec2d7
2016-07-29 05:11:00 +02:00
Seth Fowler
9f0a5862e4 Bug 1291059 - Yield in the GIF decoder at the beginning of a new frame, not at the end of the previous frame. r=edwin 2016-08-02 04:10:59 -07:00
Seth Fowler
6ce660afb2 Bug 1291054 (Part 4) - Add Decoder convenience methods for the common case of frame rects that cover the whole image. r=edwin 2016-08-02 04:10:52 -07:00
Seth Fowler
3cca5ff418 Bug 1291054 (Part 3) - Rename Decoder::GetSize() to Decoder::Size() to be consistent with the style guide. r=edwin 2016-08-02 04:10:51 -07:00
Seth Fowler
881c87ebec Bug 1291054 (Part 2) - Add a Decoder::OutputSize() getter and use it in the decoders. r=edwin 2016-08-02 04:10:49 -07:00
Glenn Randers-Pehrson
e2b623ebe9 Bug 1283961 - Part 2: Remove limits on PNG image dimensions (nsPNGDecoder). r=seth
--HG--
extra : rebase_source : 8c138a12011233e320d4e55e95348c4c961b95b6
2016-07-28 07:37:00 -04:00
Gijs Kruitbosch
61094e5a36 Bug 1280584 - implement cloneWithNewRef and thereby make hash/ref links use a simple unified codepath in the IO service, r=valentin
MozReview-Commit-ID: 8FIyclkJPDp

--HG--
extra : rebase_source : 49fb2b12488bd57a5417c7c3bff2211d651c5de7
extra : amend_source : d9940a1d9009930dc2f499417a7e1446d4601c20
2016-07-26 23:38:46 +01:00
Tom Tromey
5538d692d3 Bug 1286877 - do not set c-basic-offset for python-mode; r=gps
This removes the unnecessary setting of c-basic-offset from all
python-mode files.

This was automatically generated using

    perl -pi -e 's/; *c-basic-offset: *[0-9]+//'

... on the affected files.

The bulk of these files are moz.build files but there a few others as
well.

MozReview-Commit-ID: 2pPf3DEiZqx

--HG--
extra : rebase_source : 0a7dcac80b924174a2c429b093791148ea6ac204
2016-07-14 10:16:42 -06:00
Seth Fowler
78ccdc2e84 Bug 1288040 (Part 5) - Wrap frame timeout values in a FrameTimeout type that ensures they're normalized. r=edwin 2016-07-20 16:30:28 -07:00
Seth Fowler
62bf80f260 Bug 1287691 (Part 3) - Yield after each frame in the PNG decoder. r=edwin 2016-07-20 02:30:37 -07:00
Seth Fowler
6d790d3506 Bug 1287691 (Part 2) - Yield after each frame in the GIF decoder. r=edwin 2016-07-20 02:30:35 -07:00
Seth Fowler
7edd4cdb0d Bug 1287691 (Part 1) - Expose yielding to decoding tasks. r=edwin 2016-07-20 02:30:33 -07:00
Makoto Kato
1cb4228397 Backed out 4 changesets (bug 1287691) due to Windows build failure
MozReview-Commit-ID: KgV3nU9a64F
2016-07-20 11:03:59 +09:00
Seth Fowler
78f3ee9ee6 Bug 1287691 (Part 3) - Yield after each frame in the PNG decoder. r=edwin 2016-07-19 17:15:01 -07:00
Seth Fowler
014dc44721 Bug 1287691 (Part 2) - Yield after each frame in the GIF decoder. r=edwin 2016-07-19 17:15:01 -07:00
Seth Fowler
966d0547b7 Bug 1287691 (Part 1) - Expose yielding to decoding tasks. r=edwin 2016-07-19 17:15:01 -07:00
Seth Fowler
666fc943cb Bug 1287367 - Allow users of StreamingLexer to detect and handle truncation. r=njn 2016-07-18 23:41:20 -07:00
Seth Fowler
938a963f7f Bug 1287246 (Part 1) - Expose LexerResult from the StreamingLexer API and add an explicit Yield type. r=njn 2016-07-18 01:25:37 -07:00
Seth Fowler
4c2a4667a7 Bug 1286165 (Part 2) - Advance decoders' SourceBufferIterator directly in StreamingLexer. r=edwin,njn 2016-07-15 17:48:57 -07:00
Seth Fowler
4be29e46b3 Bug 1285867 (Part 7) - Clean up remaining references to decoder 'data errors' and refer to them as just 'errors'. r=edwin 2016-07-15 16:41:11 -07:00
Seth Fowler
396c016b13 Bug 1285867 (Part 4) - Decide whether we're done decoding by checking if we've reached a terminal state. r=edwin 2016-07-15 16:41:11 -07:00
Seth Fowler
0d49568090 Bug 1285867 (Part 3e) - Use TerminalState to exit the Decode() loop. r=edwin 2016-07-15 16:41:11 -07:00
Seth Fowler
0872ad00cb Bug 1285867 (Part 2) - Don't call Decoder::PostDataError() from Decoder subclasses. r=edwin 2016-07-15 16:41:11 -07:00
Seth Fowler
3c38000891 Bug 1285867 (Part 1) - Remove Decoder's notion of decoder errors. r=edwin 2016-07-15 16:41:11 -07:00
Lee Salzman
16ca3223d9 Bug 1286317 - part 1 - remove Qt widget usage from gfx. r=jrmuizel 2016-07-12 20:27:57 -04:00
Seth Fowler
bd9732ac1b Bug 1285865 (Part 6) - Pass a SourceBufferIterator to Decoder::DoDecode(). r=edwin 2016-07-11 12:13:13 -07:00
Seth Fowler
e80fff4085 Bug 1285865 (Part 5) - Return a Maybe<TerminalState> from Decoder::DoDecode(). r=edwin 2016-07-11 12:13:11 -07:00
Seth Fowler
a9f24e8308 Bug 1285865 (Part 4) - Rename Decoder::WriteInternal() to Decoder::DoDecode() and fix its argument types. r=edwin 2016-07-11 12:13:09 -07:00
Seth Fowler
e4439cf3bc Bug 1185799 (Part 3) - Make nsICODecoder use only the public Decoder interface for writing to its contained decoder. r=edwin 2016-07-07 15:50:49 -07:00
Seth Fowler
d6de2d01f5 Bug 1185799 (Part 2) - Make nsBMPDecoder and nsPNGDecoder no longer friends with nsICODecoder. r=edwin 2016-07-07 15:50:46 -07:00
Seth Fowler
6361b2adb8 Bug 1185799 (Part 1) - Use DecoderFactory to construct nsICODecoder's contained decoder. r=edwin 2016-07-07 15:50:44 -07:00
Benjamin Smedberg
bf05496a83 Bug 1282866 - remove widget/qt and other supporting QT code, r=dougt. This patch does not remove all of the checks for MOZ_WIDGET_QT (which are dead code), but that will be a followup mentored bug.
MozReview-Commit-ID: EGqHHhCD7vD

--HG--
extra : rebase_source : a4b9593959dd3ba80189db47eabb056ea207490f
extra : amend_source : a744d833693f0fe7adbea961c00bb5fb55a91580
2016-07-07 12:14:25 -04:00
Seth Fowler
c40d87a382 Bug 1283359 - Use StreamingLexer in the JPEG decoder. r=edwin 2016-07-01 20:50:00 -06:00
Mason Chang
02f263e5b9 Bug 1282496 - memset unoptimized images with RGBX surface format to 0xFF. r=seth 2016-06-30 18:59:29 -07:00
Daniel Holbert
3996555d1a Bug 1282670, part 3: Make several imagelib .cpp files #inclue their corresponding .h file as their very first #include, per Gecko convention. r=seth
(In some cases, I've left "ImageLogging.h" being included before the corresponding .h file, because I ran across a warning comment saying that it needs to be included before any IPDL-generated files & anything that includes prlog.h; and it seems possible that Foo.cpp's corresponding Foo.h file could include such headers now or in the future.)

MozReview-Commit-ID: HPvUVj8YuKc
2016-06-30 10:27:03 -07:00
Daniel Holbert
17deb8bb7c Bug 1282670, part 2: Remove unnecessary/redundant string-related #include & "using" declarations in imagelib. r=seth
MozReview-Commit-ID: 1hgnUosiOFU
2016-06-30 10:25:35 -07:00
Daniel Holbert
c1e322c6c5 Bug 1282670, part 1: Add missing #include & "using" declarations in imagelib. r=seth
I found these issues locally by moving all of imagelib's .cpp files to SOURCES instead of UNIFIED_SOURCES.  (That change isn't part of this patch, though.)

MozReview-Commit-ID: 97Xpfu8eFE6
2016-06-30 10:24:27 -07:00
Seth Fowler
a54d2d7a22 Bug 1282566 (Part 3) - Use StreamingLexer in the PNG decoder. r=edwin 2016-06-29 12:12:36 -07:00
Seth Fowler
e75a45eb03 Bug 1282566 (Part 2) - Remove some unused fields from nsPNGDecoder. r=edwin 2016-06-29 12:12:34 -07:00
Seth Fowler
a0645af1a6 Bug 1282566 (Part 1) - Use png_process_data_pause for early exits in nsPNGDecoder. r=edwin 2016-06-29 12:12:32 -07:00
Phil Ringnalda
10f146a52a Back out 269a48e67579 (bug 1282496) for Windows gfx crashes and assertion failures
CLOSED TREE
2016-06-27 19:13:12 -07:00
Mason Chang
dbf96fa749 Bug 1282496 - memset unoptimized images with RGBX surface format to 0xFF when using the skia backend. r=seth 2016-06-27 17:45:55 -07:00
Seth Fowler
c92db2d7ab Bug 1255107 (Followup) - Add an explicit cast to a usage of DebugOnly to work around MSVC. r=me 2016-06-25 14:36:47 -07:00
Seth Fowler
17074a1b49 Bug 1255107 (Part 3) - Use SurfacePipe in the PNG decoder. r=njn 2016-06-25 14:04:05 -07:00
Lee Salzman
1a695a53a7 Bug 1281419 - ignore negative icon size in URI. r=seth 2016-06-23 10:47:36 -04:00
Seth Fowler
3983e48e1d Bug 1280712 - Remove redundant memset() of GIF frame data. r=edwin 2016-06-21 20:19:19 -07:00
Seth Fowler
1d5c203221 Bug 1249578 (Part 1) - Verify that the size in the BIH header matches the ICO directory entry instead of fixing it. r=njn 2016-06-21 19:48:31 -07:00
Wes Kocher
7e180fa924 Backed out 2 changesets (bug 1249578) for build bustage
Backed out changeset caddb604d934 (bug 1249578)
Backed out changeset a2a645bf7ccf (bug 1249578)
2016-06-21 18:38:46 -07:00
Seth Fowler
79d8677d76 Bug 1249578 (Part 1) - Verify that the size in the BIH header matches the ICO directory entry instead of fixing it. r=njn 2016-06-21 18:06:28 -07:00
Seth Fowler
bc967b6b86 Bug 1279859 - Correctly skip over extra image sub blocks in the GIF decoder. r=njn 2016-06-20 21:09:29 -07:00
Ralph Giles
5f548c968f Bug 1275744 - Reference MOZ_LOG in graphics comments. r=erahm
NSPR_LOG_MODULES is deprecated.

MozReview-Commit-ID: HZzskDYsTo9

--HG--
extra : rebase_source : 21d4c4a94d80ad962ef56fceb8d6fbabc017d2ea
2016-05-26 11:41:29 -07:00
Seth Fowler
112f55ea0c Bug 1204392 - Use StreamingLexer in the GIF decoder. r=njn,seth 2016-06-08 12:17:17 -07:00
Seth Fowler
01cb7efe41 (No bug) - Remove unnecessary include in nsGIFDecoder2.cpp. r=me DONTBUILD 2016-06-04 15:28:27 -07:00
Chris Peterson
11ef78ae89 Bug 1275016 - Rename Endian.h to EndianUtils.h to avoid #include confusion with Android's endian.h stdlib header. r=froydnj
--HG--
rename : mfbt/Endian.h => mfbt/EndianUtils.h
2016-05-22 13:31:11 -07:00
Seth Fowler
9a13e8933c Bug 1261964 - Specify the frame rect in input space, not output space, in nsIconDecoder. r=njn 2016-05-25 22:48:29 -07:00
Chris Peterson
8a9e2d2bd4 Bug 1272513 - Part 2: Remove redundant -Wshadow CXXFLAGS from moz.build files. r=glandium 2016-05-14 00:54:55 -07:00
Chris Peterson
353ee65255 Bug 1272513 - Part 1: Suppress -Wshadow warnings-as-errors in some directories. r=glandium 2016-05-11 00:00:01 -07:00
Christoph Kerschbaumer
88454785ba Bug 1269271 - Remove SEC_NORMAL from image/decoders (r=seth) 2016-05-08 20:05:51 +02:00
Yoshi Huang
ba1bb72568 Bug 1263496 - Part 3: fix for nsNullPrincipal::Create
This fixed the locations listed by
http://searchfox.org/mozilla-central/search?q=nsNullPrincipal::Create(&redirect=true
that needs to inherit origin attributes.
2016-04-27 18:38:07 +08:00
Timothy Nikkel
5afe8e5453 Bug 1257101. imgFrame::IsImageComplete says whether we've had pixels decoded to the whole image rect, but it's used to check if the frame is finished decoding. These are different things when the image has more than one progress pass. r=seth
This means that in RasterImage::LookupFrame when we are asked to do a sync decode (if needed) we use WaitUntilComplete to wait until the frame is finished decoding.  But we would actually return after the next progressive pass notified the monitor to wake up. Thus, we would draw a not-fully-decoded image even though the sync decode flag was passed.

The change in FrameAnimator means that we won't draw the next frame in an animated image until all progressive passes of that image are complete. This seems like what we want anyways.

There is one real use of IsImageComplete left, in imgFrame::Draw, where we need to know if the decoded image data covers the whole image frame. (There are a couple of uses of IsImageComplete in asserts.)
2016-03-23 19:31:42 -05:00
Mike Hommey
0a771514a8 Bug 1256988 - Replace tests on MOZ_WIDGET_GTK with tests on MOZ_WIDGET_TOOLKIT containing gtk. r=chmanchester
But only do that for the AC_SUBST. The AC_DEFINE is still useful.
2016-03-17 06:49:44 +09:00
Timothy Nikkel
ce9ddc5a29 Bug 1255675. SurfacePipe handles removing the frame rect, so pass the frame rect directly.
This is left over from the pre-SurfacePipe code that interacted directly with the Downscaler. It was calculating the size of the surface for the Downscaler to use, and then the Downscaler would handle putting transparent pixels inside that surface (and outside the framerect).

--HG--
extra : rebase_source : aad384fa8589f291254f0a18537a5d6674487182
2016-03-13 15:56:00 -07:00
Bogdan Postelnicu
c9c042d934 Bug 1230907 - mPixelRowSize added to constructor with 0 value. r=seth 2016-03-14 10:36:36 +02:00
Seth Fowler
c987885db6 Bug 1255104 - Use SurfacePipe in nsIconDecoder. r=njn 2016-03-10 18:45:29 -08:00
Seth Fowler
3978c77cb6 Bug 1247152 (Part 2) - Remove even more code from the GIF decoder. r=edwin 2016-03-09 15:39:02 -08:00
Seth Fowler
875464424a Bug 1247152 (Part 1) - Use SurfacePipe in the GIF decoder. r=njn 2016-03-09 15:39:02 -08:00
Seth Fowler
618f960cdd Bug 1246851 (Part 4) - Add a test suite for SurfacePipes and SurfaceFilters. r=njn 2016-02-25 16:21:29 -08:00
Timothy Nikkel
c29791aa23 Bug 1249576 - If the first frame of an APNG doesn't cover the whole image mark the image as transparent. r=edwin
In (non-animated) PNGs the image data is contained in IDAT chunks. In APNGs there are IDAT chunks, which contain the default image, and fDAT chunks, which contain frames of the animation. The default image is sometimes part of the animation (as the first frame), and sometimes not (displayed only by non-APNG aware viewers).

The default image must have the same size as in the PNG header chunk. But the fDAT images can be any (smaller) size. So the first frame of a PNG is allowed to be smaller than the whole image size so long as we are in an APNG and the first frame is from an fDAT chunk, not an IDAT chunk.

We post transparency if we encounter this case because we don't draw into those pixels on at least the first frame.
2016-02-23 20:22:00 +01:00
Timothy Nikkel
34fd9a4a11 Bug 1120141. Don't use surface with alpha for first frames of all pngs. r=edwin
It was a hack, not needed anymore.
2016-02-24 09:56:03 -06:00
Nicholas Nethercote
034cfd65bb Bug 1249550 (part 1) - Flip BMPs with negative height when downscaling. r=tn.
--HG--
extra : rebase_source : f0eef7233b52ec8e1e368d96b5776ca70e5eb328
2016-02-22 13:38:58 +11:00
Timothy Nikkel
fa7da9c935 Bug 1242093 - Fix assertion in Downscaler::ClearRow. r=njn
The starting column can be the last column, and we handle that correctly.

Also split function into ClearRow and ClearRestOfRow.
2016-02-16 08:04:57 +01:00
Timothy Nikkel
d4c4df334e Bug 1240629. Don't buffer image file data that we are never going to look at in the gap between the header and the pixel data for BMP files. r=njn
The length of the gap is computed from the BMP file header, so in a malformed BMP we could needlessly make our input file buffer huge for no reason.
2016-02-12 16:58:34 -06:00
Aidin Gharibnavaz
686438c658 Bug 1164581 - Adding an overload for NS_ProxyRelease that accepts already_AddRefed, and removing all the others. r=bobbyholley 2016-02-10 08:23:00 +01:00
Nicholas Nethercote
8c0fc6309a Bug 1238558 (part 1) - Add Decoder::BeforeFinishInternal(). r=tnikkel.
--HG--
extra : rebase_source : 613a2ce0931b8b6c67d93e4d55e965193bbb55d0
2016-01-27 16:15:06 -08:00
Carsten "Tomcat" Book
5b358688b7 Backed out changeset c18e29c1b369 (bug 1164581) for cpp unit tests test failures
--HG--
extra : rebase_source : fb6fd434c8e3f4b5fa53ea645a54c07cab207894
2016-02-08 11:17:38 +01:00
Aidin Gharibnavaz
69cf7e035f Bug 1164581 - Adding an overload for NS_ProxyRelease that accepts already_AddRefed, and removing all the others. r=bobbyholley
--HG--
extra : rebase_source : 3c6bba6613a14e48239d302bdd0f7fe2e322265d
2016-02-07 10:56:00 +01:00
Birunthan Mohanathas
d7371d07d0 Bug 1235261 - Part 1: Rename nsAutoTArray to AutoTArray. r=froydnj 2016-02-02 17:36:30 +02:00
Phil Ringnalda
d381b4bca6 Back out 7 changesets (bug 1235261) for cpptest failures in TestTArray
CLOSED TREE

Backed out changeset d66c3f19a210 (bug 1235261)
Backed out changeset 467d945426bb (bug 1235261)
Backed out changeset 32b61df13142 (bug 1235261)
Backed out changeset c50bb8ed4196 (bug 1235261)
Backed out changeset 0ff0fa6fe81f (bug 1235261)
Backed out changeset df70e89669da (bug 1235261)
Backed out changeset 064969357fc9 (bug 1235261)
2016-01-31 10:10:57 -08:00
Birunthan Mohanathas
373593275e Bug 1235261 - Part 1: Rename nsAutoTArray to AutoTArray. r=froydnj 2016-01-31 17:12:12 +02:00
Chris Peterson
c5cfbed605 Bug 1235297 - Annotate intentional switch fallthroughs to suppress -Wimplicit-fallthrough warnings in image/decoders/. r=tn
image/FrameAnimator.cpp:442:5: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
image/FrameAnimator.cpp:576:7: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]

image/decoders/nsGIFDecoder2.cpp:1110:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels

image/decoders/nsJPEGDecoder.cpp:418:3 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
image/decoders/nsJPEGDecoder.cpp:444:3 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
image/decoders/nsJPEGDecoder.cpp:465:3 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
image/decoders/nsJPEGDecoder.cpp:537:3 [-Wimplicit-fallthrough] unannotated fall-through between switch labels

--HG--
extra : rebase_source : ec1da93105ef06d156d9d60ae8950d04f3197e38
2015-12-24 23:50:32 -07:00
Edwin Flores
4623e471a3 Bug 1207958 - Fix heuristic for choosing which ICO sub-image to render - r=tn 2016-01-20 11:00:12 +00:00
Nicholas Nethercote
f28cd689c3 Bug 1238551 (part 1) - Reject BITMAPV3INFOHEADER BMP images. r=tn.
This is an obscure BMP variant that's not worth supporting.

--HG--
extra : rebase_source : d4f8180a3e7700490daf4d07685a853c4f122c23
2016-01-17 21:12:17 -08:00
Nicholas Nethercote
02921e7c85 Bug 1237171 - Improve a case where ICO and BMP files disagree on an image size. r=tn.
--HG--
extra : rebase_source : 80701833249881c3022309f6237a3084b61b1881
2016-01-07 16:18:22 -08:00
Edwin Flores
cde8e15ecd Bug 1235605 - Use CheckedInt in Deinterlacer and make its buffer allocation fallible. r=tn 2015-12-30 17:03:24 -05:00
Edwin Flores
3c1a9580ee Bug 1229825 - Make GIF deinterlacer respect the frame rect bounds. r=tn 2015-12-29 18:19:27 -05:00
Christoph Kerschbaumer
413a60a063 Bug 1225641 - Change default security flags within NetUtil.newChannel (r=sicking) 2015-11-17 17:35:30 -08:00
Edwin Flores
ce990e88c7 Bug 1223465 - Clamp GIF frame rects to their screen rects - r=seth 2015-11-25 13:50:13 +00:00
Nicholas Nethercote
eeb418d47f Bug 1220021 (part 1) - Don't treat 0RGB ICO files as transparent. r=seth.
This approach is much the same as the one we had before bug 1062066 caused the
regression.
2015-11-23 15:32:39 -08:00
Nicholas Nethercote
2c9bfa2dec Bug 1223319 (part 1) - Remove unused function nsICODecoder::CalcAlphaRowSize(). r=seth. 2015-11-16 17:54:11 -08:00
Glenn Randers-Pehrson
fde5c53117 Bug 75077 - Interpolate interlaced PNG images instead of libpng blocky display. r=seth 2015-11-14 11:33:00 +01:00
sajitk
32ccc4c2b0 Bug 1219474 - Replace PRLogModuleInfo w/ LazyLogModule in the 'image/' directory. r=seth
--HG--
extra : rebase_source : 1ce8c7a9d4ff2610506584e9f58ab9d9a6e92e06
2015-11-16 18:21:00 +01:00
Nicholas Nethercote
ce10603db1 Bug 1210291 - Streamline StreamingLexer's handling of terminal states. r=seth.
This patch introduces TerminalState and changes LexerTransition::mNextState to
be a Variant<State, TerminalState>. This means that SUCCESS and FAILURE no
longer need to be part of State.

Some things to note:

- This simplifies the handling of Lex()'s return value, which is nice.

- The patch splits Terminate() into TerminateSuccess() and TerminateFailure().

- |const State& aNextState| wouldn't work for the first arg to
  LexerTransition's ctor due to errors in Variant construction that I didn't
  understand. I had to change it to |State aNextState|.

--HG--
extra : rebase_source : f405a67fdf0f1bb712409eafecb21ac9b59d6db0
2015-10-28 01:30:20 -07:00
Nicholas Nethercote
8b78d5e498 Bug 1217465 - Fill in missing pixels caused by truncated BMP files. r=seth.
This fixes failures for
image/test/reftest/bmp/bmpsuite/b/{badrle.bmp,shortfile.bmp} with the Skia
back-end.

--HG--
extra : rebase_source : 6c5b967cebf43cf5d49d0e532619bdd1c8ccc69e
2015-11-15 20:31:07 -08:00
Nathan Froyd
77af195199 Bug 1219405 - use LazyLogModule for PNG decoder logging; r=seth
This change eliminates some TSan warnings and also eliminates some
boilerplate.
2015-10-28 16:08:06 -04:00
Nicholas Nethercote
2a85ac5257 Bug 1215361 (part 3) - Deconvolute nsICODecoder's handling of endianness. r=seth.
nsICODecoder's reading and writing of little-endian values can be simplified
greatly.

Also, ReadBPP() was highly dodgy: BMP's bpp field is 16-bit
but ReadBPP() read it as if it's 32-bit. I think this currently works because
the bpp field is followed by the 32-bit compression field which is usually 0
for BMPs within ICOs!

--HG--
extra : rebase_source : 5fd43dedc036dca5bc2ff79b029855dc76d62515
2015-10-15 17:54:41 -07:00
Nicholas Nethercote
ad948a5a38 Bug 1215361 (part 2) - Streamline nsBMPDecoder's getters. r=seth.
- GetBitsPerPixel() and GetWidth() are no longer used.

- GetHeight() is now only used within nsBMPDecoder and can be renamed and
  inlined into the header.

- GetImageData() can be inlined into the header.

--HG--
extra : rebase_source : f902f7ce6513e54eaa7fe6210b4ff3ff6865c4bf
2015-10-15 17:38:32 -07:00
Nicholas Nethercote
5203886b92 Bug 1215361 (part 1) - Don't set mBPP twice in nsICODecoder.cpp. r=seth.
Seth's "XXX" comment is correct.

--HG--
extra : rebase_source : 0a3c20d7c8a67e8eb0ec21cdd197a901a463c707
2015-10-15 17:35:21 -07:00
Nicholas Nethercote
65c73a3e0e Bug 1215334 (part 2) - Avoid creating a fake header for BMP files in ICO files. r=seth.
This requires delaying the creation of the BMP decoder used by the ICO decoder.

--HG--
extra : rebase_source : 629a2ac387a9c8ee1a520c70733adb10cc156aa8
2015-10-15 15:43:31 -07:00
Nicholas Nethercote
a685206641 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.

--HG--
rename : image/BMPFileHeaders.h => image/BMPHeaders.h
extra : rebase_source : 2227679b8aef25e48d3e8e7d38a3ba79a57c40d3
2015-10-15 15:43:25 -07:00
Nathan Froyd
e73e798e13 Bug 1218823 - use UniquePtr<> in preference to delete[] in image/; r=seth 2015-10-27 10:47:51 -04:00
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
Nicholas Nethercote
6acba8cc1c Bug 1214072 (part 1) - Read BMP bitfields during metadata decoding. r=seth.
Currently we don't read BMP bitfields during metadata decoding. But we'll need
to in order implement alpha, because we need to know during metadata decoding
if alpha is used.

This patch moves code around to achieve this (and adds the required
mMayHaveTransparency field). The change has no noticeable effect for now.

--HG--
extra : rebase_source : 32106149bf064f0e44ec9dcf8f013612dceacbb7
2015-10-13 20:01:24 -07:00
Nathan Froyd
ed0f5e4822 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
Nathan Froyd
d1d54b4b48 Bug 1215156 - move SetPixel* functions into nsBMPDecoder.cpp; r=seth
These functions are only used in nsBMPDecoder.cpp; we don't need them
anywhere else.  The only other place they might get used would be the
BMP encoder, but the encoder appears to have its own routines for
setting pixel data, which don't overlap very well with the decoder's.
2015-10-15 19:58:52 -04:00
Seth Fowler
6a4428a1e6 Bug 1213744 (Part 2) - Clamp the GIF frame rect to the visible rect for DDD and don't decode outside it. r=tn 2015-10-25 13:14:14 -07:00
Seth Fowler
02cb32707b Backed out changeset 154fa450fb1f (bug 1214055) because it wasn't ready to land. 2015-10-22 23:34:04 -07:00