gecko-dev/image/test/gtest
Andrew Osmond f072d8f9e8 Bug 1383404 - Part 2. When SourceBuffer::ExpectLength creates the initial buffer, it should not round up. r=tnikkel
Currently SourceBuffer::ExpectLength will allocate a buffer which is a
multiple of MIN_CHUNK_CAPACITY (4096) bytes, no matter what the expected
size is. While it is true that HTTP servers can lie, and that we need to
handle that for legacy purposes, it is more likely the HTTP servers are
telling the truth when it comes to the content length. Additionally
images sourced from other locations, such as the file system or data
URIs, are always going to have the correct size information (barring a
bug elsewhere in the file system or our code). We should be able to
trust the size given as a good first guess.

While overallocating in general is a waste of memory,
SourceBuffer::Compact causes a far worse problem. After we have written
all of the data, and there are no active readers, we attempt to shrink
the allocated buffer(s) into a single contiguous chunk of the exact
length that we need (e.g. N allocations to 1, or 1 oversized allocation
to 1 perfect). Since we almost always overallocate, that means we almost
always trigger the logic in SourceBuffer::Compact to reallocate the data
into a properly sized buffer. If we had simply trusted the expected size
in the first place, we could have avoided this situation for the
majority of images.

In the case that we really do get the wrong size, then we will allocate
additional chunks which are multiples of MIN_CHUNK_CAPACITY bytes to fit
the data. At most, this will increase the number of discrete allocations
by 1, and trigger SourceBuffer::Compact to consolidate at the end. Since
we are almost always doing that before, and now we rarely do, this is a
significant win.
2017-08-01 06:59:11 -04:00
..
animated-with-extra-image-sub-blocks.gif
Common.cpp Bug 1315554 - Part 10b. Force CMS output profile to be sRGB for gtests. r=me 2017-07-22 07:50:32 -04:00
Common.h Bug 1315554 - Part 10b. Force CMS output profile to be sRGB for gtests. r=me 2017-07-22 07:50:32 -04:00
corrupt-with-bad-bmp-height.ico
corrupt-with-bad-bmp-width.ico
corrupt-with-bad-ico-bpp.ico Bug 1315443 - Use the embedded BMPs BPP over the ICOs BPP when available. r=tnikkel 2016-11-16 09:57:35 -05:00
corrupt.jpg
downscaled.bmp
downscaled.gif
downscaled.ico
downscaled.icon
downscaled.jpg
downscaled.png
first-frame-green.gif
first-frame-green.png
first-frame-padding.gif
green-1x1-truncated.gif 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
green-large-bmp.ico Bug 1315554 - Part 10a. Add large embedded PNG/BMP ICO tests. r=me 2017-07-22 07:50:32 -04:00
green-large-png.ico Bug 1315554 - Part 10a. Add large embedded PNG/BMP ICO tests. r=me 2017-07-22 07:50:32 -04:00
green-multiple-sizes.ico Bug 1343499 - Expose native image sizes to imagelib users. r=tnikkel 2017-03-22 09:05:36 -04:00
green.bmp
green.gif
green.ico
green.icon
green.jpg
green.png
invalid-truncated-metadata.bmp 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
moz.build Bug 1315554 - Part 10a. Add large embedded PNG/BMP ICO tests. r=me 2017-07-22 07:50:32 -04:00
no-frame-delay.gif
rle4.bmp
rle8.bmp
TestADAM7InterpolatingFilter.cpp Bug 1296147 (Part 2) - Rename imgFrame::GetSurface() to imgFrame::GetSourceSurface() for clarity. r=edwin 2016-08-18 13:03:49 -07:00
TestCopyOnWrite.cpp
TestDecoders.cpp Bug 1315554 - Part 10a. Add large embedded PNG/BMP ICO tests. r=me 2017-07-22 07:50:32 -04:00
TestDecodeToSurface.cpp Bug 1372405 - Provide names for all runnables in the tree (r=froydnj) 2017-06-26 14:19:58 -07:00
TestDeinterlacingFilter.cpp Bug 1296147 (Part 2) - Rename imgFrame::GetSurface() to imgFrame::GetSourceSurface() for clarity. r=edwin 2016-08-18 13:03:49 -07:00
TestDownscalingFilter.cpp Bug 1296147 (Part 2) - Rename imgFrame::GetSurface() to imgFrame::GetSourceSurface() for clarity. r=edwin 2016-08-18 13:03:49 -07:00
TestDownscalingFilterNoSkia.cpp
TestMetadata.cpp Bug 1315554 - Part 2. The BMP decoder should be responsible for adjusting its size when embedded inside an ICO. r=tnikkel 2017-07-22 07:50:31 -04:00
TestRemoveFrameRectFilter.cpp
TestSourceBuffer.cpp Bug 1383404 - Part 2. When SourceBuffer::ExpectLength creates the initial buffer, it should not round up. r=tnikkel 2017-08-01 06:59:11 -04:00
TestStreamingLexer.cpp Bug 1287367 - Allow users of StreamingLexer to detect and handle truncation. r=njn 2016-07-18 23:41:20 -07:00
TestSurfacePipeIntegration.cpp Bug 1286168 - Add a RAII class to initialize ImageLib services in GTests. r=njn 2016-07-15 17:48:57 -07:00
TestSurfaceSink.cpp Backed out 5 changesets (bug 1290292, bug 1290293) for gfx assertions 2017-02-13 19:28:45 -08:00
transparent-ico-with-and-mask.ico
transparent-if-within-ico.bmp
transparent.gif
transparent.png