Commit Graph

1985 Commits

Author SHA1 Message Date
Morris Tseng
416e9b2f39 Bug 1215438 - Part 4: Rename CairoImage to SourceSurfaceImage. r=roc 2015-12-18 14:52:16 +08:00
Christoph Kerschbaumer
55778ca85a Bug 1229889 - Convert JS callsites to use asyncOpen2 within image/ (r=sicking) 2015-12-06 20:57:08 -08:00
Wes Kocher
fda6177cd9 Backed out 4 changesets (bug 1230221, bug 1230220, bug 1229890) for m-e10s(2) permafails in test_window_open_close.html CLOSED TREE
Backed out changeset a1cd28ddbfa2 (bug 1230221)
Backed out changeset 7e89f5020ac7 (bug 1230220)
Backed out changeset 91f6e72fa9f4 (bug 1229890)
Backed out changeset 7e717a810420 (bug 1229890)
2015-12-04 15:58:40 -08:00
Christoph Kerschbaumer
729a54b838 Bug 1229890 - Convert JS callsites to use asyncOpen2 within image/ (r=sicking) 2015-12-04 09:39:05 -08:00
Christoph Kerschbaumer
053758c154 Bug 1225641 - Change default security flags within NetUtil.newChannel (r=sicking) 2015-11-17 17:35:30 -08:00
Edwin Flores
b7082af263 Bug 1223465 - Clamp GIF frame rects to their screen rects - r=seth 2015-11-25 13:50:13 +00:00
Edwin Flores
fccade91ff Bug 1224100 - Initialize row buffer to 0 in Downscaler - r=seth 2015-11-24 15:05:01 +00:00
Nicholas Nethercote
b18e6e9bc1 Bug 1220021 (part 2) - Add four reftests. r=seth. 2015-11-23 18:20:21 -08:00
Nicholas Nethercote
a7e0d9de63 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
c81ad2d316 Bug 1223319 (part 1) - Remove unused function nsICODecoder::CalcAlphaRowSize(). r=seth. 2015-11-16 17:54:11 -08:00
Glenn Randers-Pehrson
713fce5b4b Bug 75077 - Interpolate interlaced PNG images instead of libpng blocky display. r=seth 2015-11-14 11:33:00 +01:00
Mason Chang
7fca435ce0 Bug 1221840. Support repeating images in 1 axis. r=seth 2015-11-23 08:17:35 -08:00
sajitk
f0c5293957 Bug 1219474 - Replace PRLogModuleInfo w/ LazyLogModule in the 'image/' directory. r=seth 2015-11-16 18:21:00 +01:00
David Anderson
f90220e3d7 Decouple CairoImage from ImageContainer. (bug 1222910, r=roc) 2015-11-17 00:09:00 -08:00
Nicholas Nethercote
f671723176 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|.
2015-10-28 01:30:20 -07:00
Nicholas Nethercote
357de81606 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.
2015-11-15 20:31:07 -08:00
Phil Ringnalda
60ea185133 Bug 1182951 - skip test_bug399925.html on b2g debug for constant timeouts 2015-11-14 18:28:40 -08:00
Nathan Froyd
13d023fa6b Bug 1217571 - fix the imagelib cache to work in e10s; r=seth
nsICachingChannel isn't available in the child process; we have to use
nsICacheInfoChannel instead.
2015-11-12 15:09:52 -05:00
Nicholas Nethercote
000b911cc5 Bug 1223690 - Remove implicit Rect conversions. r=jrmuizel.
gfxRect can be implicitly constructed from IntRect, which hides a number of
implicit conversion points, makes Moz2Dification harder, and has some
surprising effects.

This patch removes the implicit constructor and replaces it with an explicit
conversion function:

  gfxRect ThebesRect(const IntRect&)

This is the obvious outcome of removing the constructor.

But there is also a second, less obvious outcome: currently we do a number of
IntRect-to-Rect conversions using ToRect(), which (surprisingly) works because
it turns into an implicit IntRect-to-gfxRect conversion (via the implicit
constructor) combined with an explicit gfxRect-to-Rect conversion (via
ToRect()). I.e. we do two conversions, going from a Moz2D type to a Thebes
type and back to a Moz2D type!

So this patch also changes these conversion. It moves this existing function:

  Rect ToRect(const IntRect&)

from gfx2DGlue.h -- where it doesn't really belong because it doesn't involve
any Thebes types -- to gfx/2d/Rect.h, templatifying and renaming it as
IntRectToRect() in the process.

The rest of the patch deals with fall-out from these changes. The call sites
change as follows:

- IntRect-to-gfxRect conversions:
  - old: implicit
  - new: ThebesRect()

- IntRect-to-Rect conversions:
  - old: ToRect()
  - new: IntRectToRect()
2015-11-11 14:23:14 -08:00
Sotaro Ikeda
278c87baf5 Bug 1186796 - Replace nsBaseHashtable::EnumerateRead() calls in image/ with iterators r=njn 2015-11-10 23:07:09 -08:00
Sotaro Ikeda
6a631ed9f3 Bug 1187149 - Replace nsBaseHashtable::Enumerate() calls in image/ with iterators r=njn 2015-11-10 21:30:02 -08:00
Nathan Froyd
ee9e46aaa1 Bug 1216611 - add mozilla::MakeUniqueFallible and convert uses throughout the tree; r=Waldo 2015-11-05 16:24:24 -05:00
Ryan VanderMeulen
16fd981ddf Bug 1123195 - Re-enable 694165-1.xhtml on OSX. 2015-11-01 12:58:53 -05:00
Ryan VanderMeulen
c76533b080 No bug - Various crashtest manifest cleanups. 2015-10-31 19:35:27 -04:00
Timothy Nikkel
32eb200723 Bug 1219501. Limit total number of image decoding threads to 32 regardless of number asked for. r=seth 2015-11-01 11:45:40 -06:00
Timothy Nikkel
362307b1a3 Bug 1219501. In imagelib, initialize the number of cores to at least 1 in case of error. r=seth
PR_GetNumberOfProcessors returns -1 in case of error, which is MAXUINT32 when turned into an unsigned int like sNumCores.
2015-11-01 11:45:40 -06:00
Nathan Froyd
2a4a7f9cfe 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
Ehsan Akhgari
56c6b6acba Bug 1202085 - Part 6: Clear the entries in the image cache belonging to a controlled document when it gets destroyed; r=seth 2015-10-30 16:03:13 -04:00
Ehsan Akhgari
2626b371aa Bug 1202085 - Part 4: Add an ID for controlled document to the image cache key; r=seth
This ID will be null for non-controlled documents and also for image cache
entries for which a document is not available, and it will be the numerical
value of the document pointer for controlled documents.

This effectively makes sure that a controlled document doesn't share its
image cache entries with anything else.
2015-10-30 16:03:11 -04:00
Ehsan Akhgari
fb1ee97e21 Bug 1202085 - Part 2: Add an optional document argument to imgICache::FindEntryProperties(); r=seth 2015-10-30 16:03:09 -04:00
Ehsan Akhgari
3e757bfddd Bug 1202085 - Part 1: Remove imgICache::RemoveEntry(); r=seth 2015-10-30 16:03:08 -04:00
Seth Fowler
e4a2fd564f Bug 1207355 (Part 8) - Remove imgIContainer::RequestDecode() and imgIRequest::RequestDecode(). r=tn 2015-10-29 16:37:42 -07:00
Seth Fowler
a80e4289b0 Bug 1207355 (Part 7) - Only trigger intrinsic size decode in FinalizeDecoder() if StartDecoding() was called. r=tn 2015-10-29 16:37:42 -07:00
Seth Fowler
85c96a1783 Bug 1207355 (Part 6) - Only respect StartDecoding() in imgRequest/imgRequestProxy. r=tn 2015-10-29 16:37:42 -07:00
Seth Fowler
2890d430b7 Bug 1207355 (Part 5) - Request decodes intelligently in MultipartImage. r=tn 2015-10-29 16:37:42 -07:00
Phil Ringnalda
0576fa76c9 Back out 8 changesets (bug 1207355) for OS X 10.10 reftest failures in generated-content/
CLOSED TREE

Backed out changeset aafd6db2fbb4 (bug 1207355)
Backed out changeset 9dd950b837fb (bug 1207355)
Backed out changeset e941e0e106a1 (bug 1207355)
Backed out changeset ecebca101fcb (bug 1207355)
Backed out changeset 08f2017137e1 (bug 1207355)
Backed out changeset 3dc69e37c9b4 (bug 1207355)
Backed out changeset bcdf51edb121 (bug 1207355)
Backed out changeset 1d4c00dbf49a (bug 1207355)
2015-10-28 22:57:43 -07:00
Nicholas Nethercote
eed0822094 Bug 1209812 (part 3) - Rename SurfaceFormat::R5G6B5 as R5G6B5_UINT16. r=Bas. 2015-10-22 23:01:31 -07:00
Seth Fowler
9a4d95d7dd Bug 1207355 (Part 8) - Remove imgIContainer::RequestDecode() and imgIRequest::RequestDecode(). r=tn 2015-10-28 16:40:43 -07:00
Seth Fowler
58ede83aa0 Bug 1207355 (Part 7) - Only trigger intrinsic size decode in FinalizeDecoder() if StartDecoding() was called. r=tn 2015-10-28 16:40:43 -07:00
Seth Fowler
c7a39c6bfe Bug 1207355 (Part 6) - Only respect StartDecoding() in imgRequest/imgRequestProxy. r=tn 2015-10-28 16:40:43 -07:00
Seth Fowler
4b236871f0 Bug 1207355 (Part 5) - Request decodes intelligently in MultipartImage. r=tn 2015-10-28 16:40:43 -07: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
55a0f62a5c 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!
2015-10-15 17:54:41 -07:00
Nicholas Nethercote
62b24e3b47 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.
2015-10-15 17:38:32 -07:00
Nicholas Nethercote
a30977afce Bug 1215361 (part 1) - Don't set mBPP twice in nsICODecoder.cpp. r=seth.
Seth's "XXX" comment is correct.
2015-10-15 17:35:21 -07:00
Nicholas Nethercote
197ed85202 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.
2015-10-15 15:43:31 -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
Nathan Froyd
a0e2842bfa Bug 1218782 - use fallible allocations in Downscaler.cpp; r=seth
MakeUnique and its underlying |new| call will crash the program on
failure.  This code was clearly written with fallible allocations in
mind, so let's make the allocations actually be fallible.
2015-10-27 09:32:53 -04:00
Nicholas Nethercote
36df074e3e 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.
2015-10-13 21:20:10 -07:00