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

2921 Коммитов

Автор SHA1 Сообщение Дата
Andrew Osmond dedad4d54f Bug 1370412 - Part 6. ImageSurfaceCache::LookupBestMatch should enter factor of 2 mode on cache misses. r=tnikkel 2017-09-05 07:58:45 -04:00
Andrew Osmond 7dae87727c Bug 1370412 - Part 5. Add ImageSurfaceCache factor of 2 mode size calculations. r=tnikkel 2017-09-05 07:58:45 -04:00
Andrew Osmond 403e25501d Bug 1370412 - Part 4. Add ImageSurfaceCache::MaybeSetFactor2Mode and state. r=tnikkel 2017-09-05 07:58:45 -04:00
Andrew Osmond dc7109aa94 Bug 1370412 - Part 3. Break out ImageSurfaceCache::CompareArea from LookupBestMatch for reuse. r=tnikkel 2017-09-05 07:58:45 -04:00
Andrew Osmond caf9b84aa6 Bug 1370412 - Part 2. Give image::LookupResult an optional preferred size to decode at when the surface is not found. r=tnikkel 2017-09-05 07:58:45 -04:00
Andrew Osmond 480d81cc52 Bug 1370412 - Part 0. Add imgIContainer::GetNativeSizesLength to determine a ceiling on the maximum number of expected, unique surfaces. r=tnikkel 2017-09-05 07:58:44 -04:00
Emilio Cobos Álvarez 6b100f997c Bug 1384232: Same for test_xultree_animation.xhtml. r=me
MozReview-Commit-ID: HFo0aFXezzF
2017-09-01 15:35:01 +02:00
Andrew Osmond 2c86b9676b Bug 1391430 - Force heap allocated surfaces for image decoding to use an unaligned stride. r=tnikkel
In bug 1383499 we fixed the case where on Android, animated images could
consume all of the available file handles. This is because each volatile
buffer will contain a file handle on Android, and animated images can
contain many, many frames. However in doing so we introduced a bug where
the stride of replacement surface was aligned to a 16-byte boundary. We
do not currently support any stride value but pixel size * image width
in the image decoding framework. This may be something we correct in the
future but for now, we should just ensure all surfaces follow the
expected stride value.
2017-08-31 06:38:55 -04:00
Nicholas Nethercote f582d96b98 Bug 1390428 (part 9) - Remove nsXPIDLCString. r=erahm.
This is straightforward, with only two notable things.

- `#include "nsXPIDLString.h" is replaced with `#include "nsString.h"`
  throughout, because all nsXPIDLString.h did was include nsString.h. The
  exception is for files which already include nsString.h, in which case the
  patch just removes the nsXPIDLString.h inclusion.

- The patch removes the |xpidl_string| gtest, but improves the |voided| test to
  cover some of its ground, e.g. testing Adopt(nullptr).

--HG--
extra : rebase_source : 452cc4a08046a1adb1a8099a7e85a1917de5add8
2017-08-17 15:29:03 +10:00
Eric Rahm a33f11e0f5 Bug 1391803 - Use nsStringFwd.h for forward declaring string classes. r=froydnj
We should not be declaring forward declarations for nsString classes directly,
instead we should use nsStringFwd.h. This will make changing the underlying
types easier.

--HG--
extra : rebase_source : b2c7554e8632f078167ff2f609392e63a136c299
2017-08-16 16:48:52 -07:00
Nicholas Nethercote 092af8e0a1 Bug 1390428 (part 5) - Remove more nsXPIDLCString uses. r=erahm.
These are all simple cases, with similarities to previous patches in this
series.

--HG--
extra : rebase_source : 6ef36382df9fef217d5cb737e218d65ac062f90a
2017-08-16 14:07:18 +10:00
Joel Maher a322883818 Bug 1370784 - Disable image/test/mochitest/test_animSVGImage.html on windows. r=me a=testonly 2017-08-22 14:21:44 -04:00
Nicholas Nethercote 8a72cf2251 Bug 1390428 (part 2, attempt 2) - Remove more nsXPIDLCString local variables. r=erahm.
--HG--
extra : rebase_source : 69d58b0cfb56efc6b03d8e2d7be2ce3c3e6cd843
2017-08-21 20:01:27 +10:00
Ryan VanderMeulen 24c9581b48 Backed out changeset fbf0e8609abb (bug 1390428) for Windows clipboard test failures on a CLOSED TREE. 2017-08-18 10:58:47 -04:00
Nicholas Nethercote 5241bea863 Bug 1390428 (part 2) - Remove more nsXPIDLCString local variables. r=erahm.
These are all easy cases where an nsXPIDLCString local variable is set via
getter_Copies() and then is used in ways that rely on the implicit conversion
to |char*|. The patch uses get() and EqualsLiteral() calls to replace the
implicit conversions.
2017-08-16 13:58:55 +10:00
Kevin Hsieh 2ab70861b6 Bug 1325080 - Synchronously decode image metadata for data URIs. r=tnikkel
MozReview-Commit-ID: IPrP3EepQ6a
2017-08-16 19:04:20 -07:00
Daniel Holbert b6c8e1e084 Backed out changeset 393eadbb146f (bug 1325080) for causing a talos regression.
MozReview-Commit-ID: E0SE51ZWru5
2017-08-17 09:46:16 -07:00
Andrew Osmond 539ab65d03 Bug 1383499 - Animated PNGs should allocate after-first frames on the heap instead of as volatile buffers on Android. r=tnikkel
Animated image frames are never actually released to let the OS purge
them, because AnimationSurfaceProvider keeps them as RawAccessFrameRef.
Meanwhile, each volatile buffer on Android needs a file handle to be
retained for as long as the buffer lives. Given sufficient number of
animated image frames, we could easily exhaust the available file
handles (which in turn causes many problems). As such on Android we
should stick with the heap for animated image frames. On other platforms
it is better to stay because we will avoid a memset, because the OS will
zero-fill the requested pages on our behalf.
2017-08-16 08:57:40 -04:00
Carsten "Tomcat" Book eea1986e03 merge mozilla-inbound to mozilla-central a=merge 2017-08-16 11:23:24 +02:00
Wes Kocher be24aec8e9 Merge m-c to inbound a=merge
MozReview-Commit-ID: JqsSD85rE4W
2017-08-15 19:15:22 -07:00
Wes Kocher 7921644d1b Merge inbound to central, a=merge
MozReview-Commit-ID: 1DadhJTLBXN
2017-08-15 19:02:51 -07:00
Andrew Osmond 2aac283f14 Bug 1389479 - Part 3. AnimationSurfaceProvider no longer needs to always dispatch to free its RasterImage. r=tnikkel 2017-08-15 15:02:14 -04:00
Andrew Osmond 5360de90d7 Bug 1389479 - Part 2. Make the SurfaceCache free ImageSurfaceCache objects outside of the lock. r=tnikkel 2017-08-15 15:02:14 -04:00
Mike Hommey 60432eb34f Bug 1390704 - Skip 694165-1.xhtml crashtest on stylo debug. r=bholley
--HG--
extra : rebase_source : cad1d36159767362c646f3a8ed05ae7568c5d1eb
2017-08-16 12:54:04 +09:00
Andrew Osmond 6be360ba2c Bug 1388590 - StreamingLexer::Clone should bail if SourceBufferIterator::Advance returns not ready. r=tnikkel
StreamingLexer::Clone should always succeed because we are merely
creating a new SourceBufferIterator which is at the same position as the
given iterator. However it is possible if there is no more data after,
the current position, it could return COMPLETE instead of READY.

This should not happen during the first Advance loop however. We handle
the failure gracefully now, and if someone files a report with the
invalid ICO file causing this problem, then we can investigate further.
2017-08-15 17:44:03 -04:00
Carsten "Tomcat" Book a6ae5910bb Merge mozilla-central to autoland 2017-08-15 13:12:22 +02:00
Carsten "Tomcat" Book 6b36e00b7c merge mozilla-inbound to mozilla-central a=merge 2017-08-15 11:42:11 +02:00
Kevin Hsieh d113ce52dc Bug 1325080 - Always synchronously decode image size. r=tnikkel
MozReview-Commit-ID: LYNLjwy1kAy

--HG--
extra : rebase_source : 7d5d4b4f90efb4cb461828e3222e948f70a9d1fe
2017-08-07 13:54:11 -07:00
Jan Beich d525be7d2f Bug 1389733 - Add missing Skia compile guards. r=lsalzman
MozReview-Commit-ID: BXYxGjj0j73

--HG--
extra : rebase_source : dc54b6f513468879a2aeb8f298f1b920572c6402
2017-08-12 04:31:21 +00:00
Milan Sreckovic 5c01b5706c Bug 1387514: Upgrade BaseRect (derived classes) width and height direct member variable use to instead use Width()/SetWidth() and Height()/SetHeight() in image/*. r=aosmond
MozReview-Commit-ID: 8gyxxLziVe7

--HG--
extra : rebase_source : c79e81e10c54106645539c590bf81a03a300a909
2017-08-14 08:29:56 -04:00
Andrew Osmond 1cdcc57ee2 Bug 1390109 - Gracefully propogate ImageSurfaceCache::Insert OOM failures to SurfaceCache::Insert. r=tnikkel 2017-08-14 21:35:43 -04:00
Wes Kocher 7a772df5bf Merge m-c to inbound, a=merge
MozReview-Commit-ID: BYZASFIrXxp
2017-08-14 17:58:17 -07:00
Andrew Osmond 5fd7930ced Bug 1382664 - RasterImage::OnSurfaceDiscarded should dispatch with ProgressTracker::GetEventTarget. r=tnikkel 2017-08-14 20:26:40 -04:00
Andrew Osmond 358b89b79c Bug 1382662 - ImageResource::SendOnUnlockedDraw should dispatch using ProgressTracker::GetEventTarget. r=tnikkel 2017-08-14 20:24:55 -04:00
Andrew Osmond 904a5bf8ca Bug 1351869 - Part 2. Make imgCacheExpirationTracker use the system group for its expiration events. r=tnikkel 2017-08-14 20:23:16 -04:00
Andrew Osmond 20dd87011b Bug 1351869 - Part 1. Make SurfaceCache using the system group for its expiration events. r=tnikkel 2017-08-14 20:23:09 -04:00
Andrew Osmond 444c3a179f Bug 1378488 - Part 2. imgRequest::Cancel should dispatch using ProgressTracker::GetEventTarget. r=tnikkel 2017-08-14 16:59:58 -04:00
Andrew Osmond 3afc88f6f9 Bug 1378488 - Part 1. imgRequest::FinishPreparingForNewPart should dispatch using ProgressTracker::GetEventTarget. r=tnikkel 2017-08-14 16:59:58 -04:00
Nicholas Nethercote 9ab2597a8d Bug 1387956 (part 2) - Overhaul handling of nsWindowSizes. r=mccr8.
This patch does the following.

- Moves nsWindowSizes from nsWindowMemoryReporter.h to its own file,
  nsWindowSizes.h, so it can be included more widely without exposing
  nsWindowMemoryReporter.

- Merges nsArenaMemoryStats.h (which defines nsTabSizes and nsArenaMemoryStats)
  into nsWindowSizes.h.

- Renames nsArenaMemoryStats as nsArenaSizes, and nsWindowSizes::mArenaStats as
  nsWindowSizes::mArenaSizes. This is the more usual naming scheme for such
  types.

- Renames FRAME_ID_STAT_FIELD as NS_ARENA_SIZES_FIELD.

- Passes nsWindowSizes to PresShell::AddSizeOfIncludingThis() and
  nsPresArena::AddSizeOfExcludingThis(), instead of a bunch of smaller things.
  One nice consequence is that the odd nsArenaMemoryStats::mOther field is no
  longer necessary, because we can update nsWindowSizes::mLayoutPresShellSize
  directly in nsPresArena::AddSizeOfExcludingThis().

- Adds |const| to a few methods.

MozReview-Commit-ID: EpgFWKFqy7Y
2017-08-10 14:14:09 +10:00
Nicholas Nethercote 764c284800 Bug 1387956 (part 1) - Change |nsWindowSizes*| arguments to |nsWindowSizes&|. r=mccr8.
This makes it clear they are never null.

MozReview-Commit-ID: H4i8uqZs48H

--HG--
extra : rebase_source : c7ada64881f015c68eaee2fbfad901f806cab833
2017-08-10 14:13:22 +10:00
Andrew Osmond da707462b6 Bug 1382658 - imgRequestProxy::DoRemoveFromLoadGroup and imgCancelRunnable should be dispatched on labelled group if possible. r=tnikkel 2017-08-15 07:14:51 -04:00
Wes Kocher 936a9461f6 Merge inbound to m-c a=merge
MozReview-Commit-ID: KRQeIGmhAPA
2017-08-10 18:14:34 -07:00
Sebastian Hengst 51d351f567 merge mozilla-central to mozilla-inbound. r=merge a=merge 2017-08-10 17:41:11 +02:00
Masatoshi Kimura 6815cee2bd Bug 1387790 - Remove [deprecated] decodeImageData from imgITools. r=tnikkel
MozReview-Commit-ID: GZBYTPanHH6

--HG--
extra : rebase_source : f6ccc1a661533f7bdba8bb33bc9a85855b51ffae
2017-08-06 10:54:14 +09:00
Andrew Osmond b15e213fc9 Bug 1388733 - Ensure animations resume when the image surfaces are discarded while still decoding. r=tnikkel
When an animated image has been discarded, we avoided marking the
composited frame invalid unless it had been previously decoded. Most of
the time this was fine, but if the animated image was still decoding for
the first time, then we still had a composited frame lingering that we
did not mark as invalid. As a result, when we called
RasterImage::LookupFrame (and indirectly
FrameAnimator::GetCompositedFrame), it would always return the
composited frame. This meant that RasterImage::Decode would never be
called to trigger a redecode. At the same time,
FrameAnimator::RequestRefresh would not cause us to advance the frame
because the state was still discarded.

With this patch we separate out the concepts of "has ever requested to
be decoded" and "has ever completed decoding." The former is now used to
control whether or not a composited frame is marked as invalid after we
discover we currently have no surface for the animation -- this solves
the animation remaining frozen as we now request the redecode as
expected. The latter remains used to determine if we actually know the
total number of frames.
2017-08-09 22:26:55 -04:00
Xidorn Quan 58e5987209 Bug 1383992 part 1 - Disable failing mochitests. r=heycam
MozReview-Commit-ID: J9LoovJJJgM

--HG--
extra : rebase_source : a5ed4b2a11c293c50d642c3a0da6831ce5a885a1
extra : source : 8d97565b7dedaef3b46e65b92b1ca1e0598d2a76
extra : histedit_source : 72834d0bc485e78cb8c1de357e4b545d7e6408f5
2017-08-09 08:31:26 +10:00
Ryan VanderMeulen 6eb7aef00e Merge m-c to autoland. a=merge 2017-08-09 18:51:26 -04:00
KuoE0 e418f1ccf5 Bug 1377158 - (Part 2) Add the info of StyloEnabled() to hash function to make reftests of styloVsGecko get the correct caches. r=heycam
MozReview-Commit-ID: 7cyXheHQ7Ot

--HG--
extra : rebase_source : 4a92de63228cb2a138d95d8f366b39122dbdc05e
2017-07-24 11:51:20 +08:00
Valentin Gosu 7520c99a2c Bug 1380617 - Add nsIURI.displayPrePath r=mcmanus,Gijs
- Use displayPrePath in the pageInfo permissions that shows "Permissions for:"
- The extra displayPrePath method is necessary because it's difficult to compute it manually, as opposed to not having a displaySpecWithoutRef - as it's easy to get that by truncating displaySpec at the first '#' symbol.

MozReview-Commit-ID: 9RM5kQ2OqfC
2017-08-09 17:43:58 +02:00
Andrew Osmond 42e6712830 Bug 1388332 - Fix a shutdown crash when destroying image decoders before initializing its SurfacePipe. r=tnikkel
A default constructed SurfacePipe contains a NullSurfaceSink as its
filter in mHead. This filter does nothing and is merely a placeholder.
Since most SurfacePipe objects are constructed with the default
constructor, and NullSurfaceSink has no (modified) state, we use a
singleton to represent it. Normally the SurfacePipe owns its filter, so
it needs to do a special check for NullSurfaceSink to ensure it doesn't
free it explicitly.

A Decoder object contains a default constructed SurfacePipe until it
needs to create the first frame from an image. This is a very brief
window because it does not take very long or much data to get to this
stage of decoding.

The NullSurfaceSink singleton is freed upon shutdown, however some
ISurfaceProvider objects may be lingering after this. If their Decoder
has yet to create the first frame, that means the SurfacePipe actually
contains a dangling pointer to the already freed singleton. To make
things worse, it actually tried to free the filter because it didn't
match the singleton (it got freed!).

As such, this change removes NullSurfaceSink entirely. We never use the
SurfacePipe before initializing it with a proper filter, and it would be
considered a programming error to do so. Instead let SurfacePipe::mHead
be null, and assert that it is not null when any operations are
performed on the SurfacePipe.
2017-08-09 06:54:55 -04:00
Masatoshi Kimura 8b713b2b0f Bug 1375125 - Stop using nsILocalFile in the tree. r=froydnj
This mechanically replaces nsILocalFile with nsIFile in
*.js, *.jsm, *.sjs, *.html, *.xul, *.xml, and *.py.

MozReview-Commit-ID: 4ecl3RZhOwC

--HG--
extra : rebase_source : 412880ea27766118c38498d021331a3df6bccc70
2017-08-04 17:49:22 +09:00
Masatoshi Kimura 8ed4a80a4e Bug 1322874 - Get rid of nsIURI.originCharset. r=valentin.gosu
nsIURI.originCharset had two use cases:
 1) Dealing with the spec-incompliant feature of escapes in the hash
    (reference) part of the URL.
 2) For UI display of non-UTF-8 URLs.

For hash part handling, we use the document charset instead. For pretty
display of query strings on legacy-encoded pages, we no longer care to them
(see bug 817374 comment 18).

Also, the URL Standard has no concept of "origin charset". This patch
removes nsIURI.originCharset for reducing complexity and spec compliance.

MozReview-Commit-ID: 3tHd0VCWSqF

--HG--
extra : rebase_source : b2caa01f75e5dd26078a7679fd7caa319a65af14
2017-08-02 20:43:30 +09:00
Johann Hofmann 4ac05f9ead Bug 1386439 - Record image-drawing in RasterImage::GetImageContainer and RasterImage::GetFrameAtSize for browser_image_startup.js. r=tnikkel
MozReview-Commit-ID: 1JDWyx8toTB

--HG--
extra : rebase_source : 32659556571acb887f85b922731489f91fcd9075
2017-08-02 00:08:02 +02:00
Masatoshi Kimura f143125cc2 Bug 1326520 - Rename nsIURI.path to pathQueryRef. r=valentin.gosu
MozReview-Commit-ID: DqJdTGopR9G

--HG--
extra : rebase_source : e8c9eb03468c075b79013b6e0bd8b367229c24cd
2017-07-29 20:50:21 +09:00
Andrew Osmond 9bc359ef2c Bug 1385409 - Ignore ICO resource entries which contain little or no data. r=tnikkel 2017-08-01 07:21:14 -04:00
Andrew Osmond 9ea902f3c5 Bug 1383404 - Part 4. imgTools::DecodeImage should set the source size hint to optimize the allocation. r=tnikkel 2017-08-01 06:59:12 -04:00
Andrew Osmond af89f9b9b6 Bug 1383404 - Part 3. SourceBuffer::mChunks should be an AutoTArray instead of FallibleTArray. r=tnikkel
We should use AutoTArray instead because telemetry shows that the vast
majority of images loaded (95%+) contain only a single chunk when
decoding finishes. Even if part 2 of this bug increases the number of
images loaded with multiple chunks, we still call SourceBuffer::Compact
after the decode is complete, which typically will reduce the number of
chunks to 1 (unless memory is very low and we fail to consolidate the
chunks). Thus it should be rare to contain more than 1 chunk on
anything but a temporary basis, and we can easily save the malloc
overhead.

Note that SourceBuffer::AppendChunk still uses the fallible variant of
nsTArray::AppendElement.
2017-08-01 06:59:11 -04:00
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
Andrew Osmond e0e5004eb0 Bug 1383404 - Part 1. SourceBuffer::Compact should use realloc to grow the first chunk to try to avoid a copy. r=tnikkel
SourceBuffer::Compact attempts to consolidate multiple, discrete
allocations into a single buffer, as well as trim excess capacity from a
singular allocation if we set aside too much. Using realloc lets
jemalloc (or whatever heap implementation we have) decide which is
better -- growing the existing buffer if there is sufficient free memory
contiguous with the first chunk, or allocating a new buffer entirely.
Since we were going to copy regardless, this should result either in an
improvement or the status quo. Brief empirical testing on Linux suggests
somewhere from 1/3 to 1/2 of allocations resulted in reusing the same
data pointer (and presumably avoided a copy as a result). This also has
the advantage of potentially reducing OOM errors, as it may have enough
room to satisfy an expansion, but not an entirely new buffer.
2017-08-01 06:59:11 -04:00
Nicholas Nethercote 72c884bf74 Bug 1384835 (part 3, attempt 2) - Remove the Preferences::Get*CString() variants that return nsAdoptingCString. r=froydnj.
--HG--
extra : rebase_source : d317b25be2ec21d1a60d25da3689e46cdce0b649
2017-07-31 14:28:48 +10:00
Nicholas Nethercote 49eb219ff5 Bug 1383982 (attempt 2) - Introduce a general mechanism for measuring memory usage of graph-like structures. r=erahm.
--HG--
extra : rebase_source : 7075f9570a4262158351ce9ac3ca8360ea4d5394
2017-07-28 20:10:04 +10:00
Sebastian Hengst 744a0a216b Backed out changeset ef5feef07bed (bug 1384835) 2017-07-28 10:29:24 +02:00
Sebastian Hengst 9077ac8886 Backed out changeset a57d8f30d1bf (bug 1383982) for build bustage at nsGlobalWindow.cpp:13826: 'class nsWindowSizes' has no member named 'mMallocSizeOf'. r=backout 2017-07-28 09:50:48 +02:00
Nicholas Nethercote 5c3abe8aab Bug 1383982 - Introduce a general mechanism for measuring memory usage of graph-like structures. r=erahm.
All the SizeOf{In,Ex}cludingThis() functions take a MallocSizeOf function
which measures memory blocks. This patch introduces a new type, SizeOfState,
which includes a MallocSizeOf function *and* a table of already-measured
pointers, called SeenPtrs. This gives us a general mechanism to measure
graph-like data structures, by recording which nodes have already been
measured. (This approach is used in a number of existing reporters, but not in
a uniform fashion.)

The patch also converts the window memory reporting to use SizeOfState in a lot
of places, all the way through to the measurement of Elements. This is a
precursor for bug 1383977 which will measure Stylo elements, which involve
Arcs.

The patch also converts the existing mAlreadyMeasuredOrphanTrees table in the
OrphanReporter to use the new mechanism.

--HG--
extra : rebase_source : 2c23285f8b6c3b667560a9d14014efc4633aed51
2017-07-28 15:03:44 +10:00
Nicholas Nethercote 200d8ec18b Bug 1384835 (part 3) - Remove the Preferences::Get*CString() variants that return nsAdoptingCString. r=froydnj.
This is similar like the previous patch, but for the 8-bit string variants.
Also, it changes assignment to Adopt() in GetCString() and GetDefaultCString()
to avoid an extra copy.

--HG--
extra : rebase_source : eba805c3a7b809d5ccd6e853b1c9010db9477667
2017-07-27 16:45:10 +10:00
Andrew Osmond 16a218837a Bug 1383579 - SourceBufferIterator::SetWaiting should not assert for spurious wakeups if no consumer was given. r=tnikkel
The ICO decoder creates a cloned SourceBufferIterator for its own
SourceBuffer bounded by the resource size. This iterator is used by the
child decoder (PNG, BMP) for decoding the actual image. However we rely
upon the ICO decoder and its iterator to drive event loop, rather than
the child decoder and the cloned iterator. The cloned iterator knows how
many bytes it requires, but it is problematic to give it a consumer to
tell us when to resume without changes to StreamingLexer.

Without a consumer (IResumable), we won't have anything to notify when
we get the appropriate amount of data for the caller. If the caller
tries to advance after some, unknown amount of data has been written to
the SourceBuffer, then it may need to go back to waiting. Thus it should
only assert for a spurious wakeup if we have an actual consumer.
2017-07-27 21:18:17 -04:00
Honza Bambas eafe13d61a Bug 1381048 - Add few object tracking logs to imagelib. r=tnikkel 2017-07-25 11:14:00 -04:00
Andrew Osmond 1c78f9203b Bug 1315554 - Part 10b. Force CMS output profile to be sRGB for gtests. r=me
Thus far gtests have only tested fairly simple images which already
render the same on all platforms (e.g. solid green 100x100 square).
If we want to test more complicated images consistently across
platforms, we need to ensure the color adjustments we perform are
also consistent. Using the pref gfx.color_management.force_srgb to
force an sRGB CMS profile makes us consistent with the reftests and
mochitests.

However an additional quirk of the gtests is that we own the main
thread and we never check our event queue to see if anything is
pending. Depending on the initialization order of our graphics
dependencies, it may or may not have created pending runnables to
process the pref change. As such, we need to change the pref,
initialize imagelib/gfx and then check for, and if present execute,
any necessary runnables. Only then can we be sure that our desired
CMS profile is applied.
2017-07-22 07:50:32 -04:00
Andrew Osmond 3155630a3f Bug 1315554 - Part 10a. Add large embedded PNG/BMP ICO tests. r=me 2017-07-22 07:50:32 -04:00
Andrew Osmond cd5abe3e4e Bug 1315554 - Part 9. Get the ICO size from the resource instead of the dir entry if unspecified. r=tnikkel 2017-07-22 07:50:32 -04:00
Andrew Osmond d400495cf1 Bug 1315554 - Part 8. Allow DecoderFactory::CreateDecoderForICOResource to create metadata decoders. r=tnikkel 2017-07-22 07:50:32 -04:00
Andrew Osmond 99d43905e2 Bug 1315554 - Part 7. Remove unnecessary buffering of BMP header in ICO decoder. r=tnikkel 2017-07-22 07:50:32 -04:00
Andrew Osmond a162fde8c7 Bug 1315554 - Part 6. Reuse the same SourceBuffer when decoding a resource within an ICO. r=tnikkel 2017-07-22 07:50:31 -04:00
Andrew Osmond 6d97dbaa41 Bug 1315554 - Part 5. Add method to clone a SourceBufferIterator when decoding. r=tnikkel 2017-07-22 07:50:31 -04:00
Andrew Osmond 35f9b857b0 Bug 1315554 - Part 4. Combine nsICODecoder::ReadBMP and ::ReadPNG. r=tnikkel 2017-07-22 07:50:31 -04:00
Andrew Osmond 93efb56fbf Bug 1315554 - Part 3. Expose Decoder::IsValidICOResource for all decoders. r=tnikkel 2017-07-22 07:50:31 -04:00
Andrew Osmond e5537d8caf 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
Andrew Osmond ac14e4f8f5 Bug 1315554 - Part 1. Enforce the parent decoder size (ICO) for child decoders (BMP, PNG). r=tnikkel 2017-07-22 07:50:31 -04:00
Sebastian Hengst cc27374338 Backed out changeset fd310390a64a (bug 1315554) for failing GTest's ImageDecoders.LargeICOWithPNGSingleChunk on OS X opt. r=backout 2017-07-22 11:05:35 +02:00
Sebastian Hengst b33e39c76b Backed out changeset e1eec63b920f (bug 1315554) 2017-07-22 11:04:22 +02:00
Sebastian Hengst 7197a59a77 Backed out changeset 9780a01b3e94 (bug 1315554) 2017-07-22 11:04:17 +02:00
Sebastian Hengst 501b9eab08 Backed out changeset e67f6df41836 (bug 1315554) 2017-07-22 11:04:12 +02:00
Sebastian Hengst c8ba1dd256 Backed out changeset 6fa3ad97ce9c (bug 1315554) 2017-07-22 11:04:07 +02:00
Sebastian Hengst b2ef50b2fe Backed out changeset e39309b6fe7f (bug 1315554) 2017-07-22 11:04:02 +02:00
Sebastian Hengst 767a09b296 Backed out changeset dbae61d1cbee (bug 1315554) 2017-07-22 11:03:57 +02:00
Sebastian Hengst 5981e481e8 Backed out changeset d46b7e02802c (bug 1315554) 2017-07-22 11:03:52 +02:00
Sebastian Hengst 8604a9cc71 Backed out changeset 18614b05270d (bug 1315554) 2017-07-22 11:03:46 +02:00
Sebastian Hengst d4bb320357 Backed out changeset abc949687bdc (bug 1315554) 2017-07-22 11:03:41 +02:00
Andrew Osmond 8202116fbd Bug 1315554 - Part 10. Add large embedded PNG/BMP ICO tests. r=me 2017-07-22 00:15:00 -04:00
Andrew Osmond 081dd8f0be Bug 1315554 - Part 9. Get the ICO size from the resource instead of the dir entry if unspecified. r=tnikkel 2017-07-22 00:14:59 -04:00
Andrew Osmond ea108d0367 Bug 1315554 - Part 8. Allow DecoderFactory::CreateDecoderForICOResource to create metadata decoders. r=tnikkel 2017-07-22 00:14:59 -04:00
Andrew Osmond 1c5f449591 Bug 1315554 - Part 7. Remove unnecessary buffering of BMP header in ICO decoder. r=tnikkel 2017-07-22 00:14:59 -04:00
Andrew Osmond 88e2751836 Bug 1315554 - Part 6. Reuse the same SourceBuffer when decoding a resource within an ICO. r=tnikkel 2017-07-22 00:14:59 -04:00
Andrew Osmond 1404a847cc Bug 1315554 - Part 5. Add method to clone a SourceBufferIterator when decoding. r=tnikkel 2017-07-22 00:14:59 -04:00
Andrew Osmond 10a558df00 Bug 1315554 - Part 4. Combine nsICODecoder::ReadBMP and ::ReadPNG. r=tnikkel 2017-07-22 00:14:59 -04:00
Andrew Osmond a5bb792dc9 Bug 1315554 - Part 3. Expose Decoder::IsValidICOResource for all decoders. r=tnikkel 2017-07-22 00:14:59 -04:00
Andrew Osmond 27542e8875 Bug 1315554 - Part 2. The BMP decoder should be responsible for adjusting its size when embedded inside an ICO. r=tnikkel 2017-07-22 00:14:59 -04:00
Andrew Osmond 1e83b97079 Bug 1315554 - Part 1. Enforce the parent decoder size (ICO) for child decoders (BMP, PNG). r=tnikkel 2017-07-22 00:14:58 -04:00
Andrew Osmond 6764b5b440 Bug 1382495 - Fix assert in imgRequestProxy::Dispatch to accept a listener or a tab group. r=me
imgRequestProxy::IsOnEventTarget must return false in order for imgRequestProxy::Dispatch to be called. Typically we check for mListener before any of this but in imgRequest::OnLoadComplete, we have other things to do besides notifying the listener. As such, we want to dispatch even if there is no listener, and that is when the assert can fail. Since IsOnEventTarget can only return false if it has either a tab group *or* a listener, we can change the assert to match.
2017-07-20 07:53:53 -04:00
Andrew Osmond 7deae0134b Bug 1359833 - Part 10. Add telemetry to track how often imgRequestProxy needs to dispatch. r=tnikkel data-r=bsmedberg 2017-07-19 14:15:12 -04:00