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

3076 Коммитов

Автор SHA1 Сообщение Дата
Andrew Osmond fefdf99992 Bug 523950 - Part 10. Add mochitest for when we discard frames from an animated image. r=tnikkel
With the previous parts, for large animated images, we will now discard
previous frames after we reach the threshold. This mochitest configures
a very low threshold, such that it will trigger on a small animated
image. It then verifies that we are already to loop the animation a
couple of times.
2018-02-28 13:34:53 -05:00
Andrew Osmond 39b30d06d4 Bug 523950 - Part 9. Integrate AnimationSurfaceProvider with AnimationFrameBuffer. r=tnikkel 2018-02-28 13:34:53 -05:00
Andrew Osmond 01f0dbdb83 Bug 523950 - Part 8. Add gtests for AnimationFrameBuffer. r=tnikkel 2018-02-28 13:34:52 -05:00
Andrew Osmond 984f23cd9c Bug 523950 - Part 7. Add AnimatedFrameBuffer to manage storage and decoding of frames in an animation. r=tnikkel 2018-02-28 13:34:52 -05:00
Andrew Osmond 97d3a61a18 Bug 523950 - Part 6. Add DecoderFactory::CloneAnimationDecoder to clone an existing image decoder. r=tnikkel
Used later in the patch series, this API allows one to get an identical
decoder to the one given, but decodes from the beginning.
2018-02-28 13:34:52 -05:00
Andrew Osmond 54898d5d6c Bug 523950 - Part 5. Pass the currently displayed frame of an animation to its decoder. r=tnikkel
When we need to recreate an animated image decoder because it was
discarded, the animation may have progressed beyond the first frame.
Given that later in the patch series we need FrameAnimator to be driving
the decoding more actively, it simplifies its role by making it assume
the initial state of the decoder matches its initial state. Passing in
the currently displayed frame allows the decoder to advance its frame
buffer (and potentially discard unnecessary frames), such that when the
animation actually wants to advance as it normally would, the decoder
state matches what it would have been if it had never been discarded.
2018-02-28 13:34:52 -05:00
Andrew Osmond 646219b1e7 Bug 523950 - Part 4. Expose new surface provider APIs that will help drive animation decoding. r=tnikkel
Note that AnimationSurfaceProvider will override these methods to give a
proper implementation in a later patch in this series. For now, they are
mostly stubbed, using the default implementation from ISurfaceProvider.

They focus on the main operations we perform on an animation:

1) Progressing through the animation, e.g. advancing a frame. If we
don't decode the whole animation up front, we need to know at the
decoder level where we are in the display of the animation.

2) Restarting an animation from the beginning. This is a specialized
case of the above, where we want to skip explicitly advancing through
the remaining frames and instead restart at the beginning. The decoder
may have already discarded the earliest frames and must start redecoding
them.

3) Knowing whether or not the decoder is still active, e.g. can we be
missing frames.
2018-02-28 13:34:52 -05:00
Andrew Osmond 28978c4f66 Bug 523950 - Part 2. Expose image decoder type and SourceBuffer to owners. r=tnikkel
Later in the patch series, we use the new APIs to facilitate cloning of
an existing decoder. This is useful when you want to redecode the same
image with the exact same configuration but from the very beginning.
2018-02-28 13:34:52 -05:00
Andrew Osmond 1a18b79e50 Bug 523950 - Part 1. Do some unified build accounting, missing headers and namespaces. r=tnikkel 2018-02-28 13:34:51 -05:00
Florian Quèze 6df7549a3e Bug 1433175 - semi-automated indent fix, r=Mossop. 2018-02-28 18:51:34 +01:00
Florian Quèze c714053d73 Bug 1433175 - scripted patch to replace Components.classes[, Components.interfaces.nsI, Components.utils. and Components.results. with Cc, Ci, Cu and Cr, r=Mossop. 2018-02-28 18:51:33 +01:00
Nathan Froyd b5d5605a54 Bug 1441584 - part 2 - declare some URI classes final; r=valentin 2018-02-27 20:13:57 -05:00
Nathan Froyd c821ec9351 Bug 1441584 - part 1 - declare inner URI Mutator classes final; r=valentin
For documentation purposes and to assist the compiler.
2018-02-27 20:13:57 -05:00
Joel Maher 7ebe98f725 Bug 1438838 - download-svg-1[ce].html fails on windows 10. r=gbrown 2018-02-23 11:20:21 -05:00
Andrew Osmond cd7cf0fad3 Bug 1427639 - Part 2. Fix misleading image memory reporting on Android. r=tnikkel
The shared memory handle reporting has been generalized to be an
external handle reporting. This is used for both shared memory, and for
volatile memory (on Android.) This will allow us to have a better sense
of just how many handles are being used by images on Android.

Additionally we were not properly reporting forced heap allocated
memory, if we were putting animated frames on the heap. This is because
we used SourceSurfaceAlignedRawData without implementing
AddSizeOfExcludingThis.
2018-02-22 14:26:29 -05:00
Andrew Osmond b18fc05e36 Bug 1427639 - Part 1. Add preferences to control image frame allocations in volatile memory or the heap. r=tnikkel
image.mem.volatile.min_threshold_kb is the minimum buffer allocation for
an image frame in KB before it will use volatile memory. If it is less
than it will use the heap. This only is set to > 0 on Android.

image.mem.animated.use_heap forces image frames to use the heap if it is
for an animated image. This is only enabled for Android, and was
previously a compile time option also for Android.
2018-02-22 14:26:29 -05:00
Jonathan Kingston 8afc412494 Bug 1435733 - Upgrade mixed display content pref. r=baku,ckerschb,francois,mayhemer
MozReview-Commit-ID: ETIgVF3zhRu

--HG--
extra : rebase_source : e4c59f50584158f4b31527347b10424b56692fa1
2018-02-05 15:37:27 +00:00
Robert Longson 728a3f36fc Bug 1435477 - Make the SVG dom code use the WebIDL constants from the bindings r=jwatt 2018-02-18 15:53:13 +00:00
Chris Peterson fe5cd3d5d9 Bug 1436263 - Part 3: Remove `virtual` from final virtual function declarations. r=froydnj
MozReview-Commit-ID: 8pjYjEvQF42

--HG--
extra : rebase_source : 5eb0bea2ef5f06a811b4f3daf57ce8720f12dd07
2018-02-08 21:22:43 -08:00
Chris Peterson 0129d900f3 Bug 1436263 - Part 2: Replace `override final` virtual function specifiers with just `final`. r=froydnj
MozReview-Commit-ID: 70gt5SUu4Dv

--HG--
extra : rebase_source : 71912c6bde22aaed01e70615a4ee794a36e70d0e
extra : source : 1c22d4c65d70b797ee3e963ec426c90e1f89b5e3
2018-02-05 22:50:00 -08:00
Andrew Osmond 6529a8c077 Bug 1437886 - Prevent shared surfaces from being used without WebRender. r=nical
Move the initialization of SharedSurfacesParent from the compositor
thread creation to mirror the other WebRender-specific components, such
as the render thread creation. Now it will only be created if WebRender
is in use. Also prevent shared surfaces from being used by the image
frame allocator, even if image.mem.shared is set -- there is no purpose
in allowing this at present. It was causing startup crashes for users
who requested image.mem.shared and/or WebRender via gfx.webrender.all
but did not actually get WebRender at all. Surfaces would get allocated
in the shared memory, try to register themselves with the WR render
thread, and then crash since that thread was never created.
2018-02-16 09:50:40 -05:00
Andrew Osmond 5380fd8762 Bug 1436247 - Part 3. Fix image/DecodePool.h inclusions. r=tnikkel 2018-02-13 06:43:31 -05:00
Andrew Osmond 4318a7dc60 Bug 1436247 - Part 2. Shutdown idle image decoder threads after the configured timeout. r=tnikkel
The image decoding thread pool can grow to be quite large, up to 32
threads, depending on the number of processors on the system. If the
user is not actively browsing, these threads are occupying resources
which could be reused elsewhere. After the timeout period, it will
release up to half of the threads in the pool.
2018-02-13 06:43:31 -05:00
Andrew Osmond 852af60687 Bug 1436247 - Part 1. Spawn image decoder threads on demand, rather than at startup. r=tnikkel
Currently imagelib's DecodePool spawns the maximum number of threads
during startup, based on the number of processors. This patch changes it
to spawn a single thread on startup (which cannot fail), and more up to
the maximum as jobs are added to the queue. A thread will only be
spawned if there is a backlog present when a new job is added. This
typically results in fewer threads allocated in the parent process, as
well as deferred spawning in the content processes.
2018-02-13 06:43:30 -05:00
Andrew Osmond f6a1a2419b Bug 1438207 - Finalize the current frame of an ICO decoder correctly. r=tnikkel
Originally we attempted to finalize the current frame from the contained
decoder in nsICODecoder::FinishResource. This is wrong because we
haven't acquired the frame from the contained decoder yet. This happens
in nsICODecoder::GetFinalStateFromContainedDecoder, and so
imgFrame::Finalize call should be moved there. This was causing us to
use fallback image sharing with WebRender after a GPU process crash,
instead of shared surfaces, because it can't get a new file handle for
the surface data until we have finished writing all of the image data.
2018-02-16 06:27:36 -05:00
Andrew Osmond 71ec66dad0 Backed out changeset 2ffed9c081fa (bug 1437886) for test bustage on a CLOSED TREE. r=backout 2018-02-15 10:03:42 -05:00
Andrew Osmond ddb7905e51 Bug 1437886 - Prevent shared surfaces from being used without WebRender. r=nical
Move the initialization of SharedSurfacesParent from the compositor
thread creation to mirror the other WebRender-specific components, such
as the render thread creation. Now it will only be created if WebRender
is in use. Also prevent shared surfaces from being used by the image
frame allocator, even if image.mem.shared is set -- there is no purpose
in allowing this at present. It was causing startup crashes for users
who requested image.mem.shared and/or WebRender via gfx.webrender.all
but did not actually get WebRender at all. Surfaces would get allocated
in the shared memory, try to register themselves with the WR render
thread, and then crash since that thread was never created.
2018-02-15 09:26:05 -05:00
Margareta Eliza Balazs 2fd871d8b3 Backed out 4 changesets (bug 1436247) for c2 failures in dom/events/test/test_DataTransferItemList.html on a CLOSED TREE
Backed out changeset 858d629f761d (bug 1436247)
Backed out changeset 4ce2bfe462a0 (bug 1436247)
Backed out changeset 3650631487c7 (bug 1436247)
Backed out changeset c32ead4e3525 (bug 1436247)
2018-02-13 19:56:26 +02:00
Andrew Osmond cf10de0f91 Bug 1436247 - Part 4. Fix image/DecodePool.h inclusions. r=tnikkel 2018-02-13 06:43:31 -05:00
Andrew Osmond c6886d2e24 Bug 1436247 - Part 3. Process image decoding tasks in a more predictable order. r=tnikkel
Originally image decoding tasks were processed in a FILO ordering, due
to that being the most efficient way to use an nsTArray as a queue. This
patch changes the decoding pool to use an std::queue to promise FIFO
ordering (relative to the priority of the tasks). This will allow the
first images to be requested to be the first images displayed.
2018-02-13 06:43:31 -05:00
Andrew Osmond 94c773742a Bug 1436247 - Part 2. Shutdown idle image decoder threads after the configured timeout. r=tnikkel
The image decoding thread pool can grow to be quite large, up to 32
threads, depending on the number of processors on the system. If the
user is not actively browsing, these threads are occupying resources
which could be reused elsewhere. After the timeout period, it will
release up to half of the threads in the pool.
2018-02-13 06:43:31 -05:00
Andrew Osmond a2cece0cab Bug 1436247 - Part 1. Spawn image decoder threads on demand, rather than at startup. r=tnikkel
Currently imagelib's DecodePool spawns the maximum number of threads
during startup, based on the number of processors. This patch changes it
to spawn a single thread on startup (which cannot fail), and more up to
the maximum as jobs are added to the queue. A thread will only be
spawned if there is a backlog present when a new job is added. This
typically results in fewer threads allocated in the parent process, as
well as deferred spawning in the content processes.
2018-02-13 06:43:30 -05:00
Boris Zbarsky 9bdcffc985 Bug 1436902 part 3. Replace usage of NS_IMPL_ISUPPORTS_INHERITED0 with NS_INLINE_DECL_REFCOUNTING_INHERITED when possible. r=mccr8
The change to RootAccessible.cpp fixes an obvious bug introduced in bug 741707.

The visibility changes in gfx/thebes are because NS_DECL_ISUPPORTS has a
trailing "public:" that those classes were relying on to have public
constructors.

MozReview-Commit-ID: IeB8KIJCGhU
2018-02-12 15:44:40 -05:00
Andrew Osmond 3088ddd210 Bug 1437648 - Make image/test/test_animSVGImage.html yield the full log. r=aosmond
In order to reduce the log size, increase the snapshot polling timeout
from 1ms to 20ms. Additionally use SimpleTest.requestCompleteLog() to
ensure we get everything when the test eventually fails.
2018-02-12 15:00:52 -05:00
Andrew Osmond 5567686405 Bug 1432375 - Part 2. Images decoded into an SourceSurfaceSharedData should be shared immediately. r=nical 2018-02-12 07:59:58 -05:00
Andrew Osmond c35d734095 Bug 1389988 - Handle a data race between a new sync decode request and a pending decoder. r=tnikkel
If there is an active provider which has yet to produce a frame, any
calls to SurfaceCache::Lookup will return MatchType::PENDING. If
RasterImage::Lookup gets the above result while given FLAG_SYNC_DECODE,
it will attempt to start a new decoder. It is entirely possible that
when we try to insert the new provider into the SurfaceCache, it cannot
because the original provider finally did produce something. In that
case we should abandon attempting to redecode and retry our lookup.
2018-02-09 08:51:28 -05:00
Andrew Osmond f229366eba Bug 1435456 - Remove asserts checking that downscale-on-decode is enabled. r=tnikkel
These asserts are somewhat faulty given the
image.downscale-during-decode.enabled preference is a live preference
and thus can change at any time. Given the decision to downscale is made
on the main thread, and it is asserted on a decoder thread, this will
always be inherently racy. Most of the time this isn't a problem, but
with our automated tests, we frequently flip this preference, and the
assertion may fail unnecessarily with an unrelated image. The reftests
themselves verify downscaling did or did not occur based upon comparison
to the reference, and don't require the assert for verification.
2018-02-09 06:27:55 -05:00
Josh Matthews 19738f789f Bug 1436743 - Dispatch events via the docgroup rather than the tabgroup when possible. r=mystor 2018-02-08 15:54:00 -05:00
Timothy Nikkel 56490d71bb Bug 1432679. Do multiplication in nsGIFDecoder2::FinishImageDescriptor as int64_t to avoid overflow. r=aosmond
pixels_remaining is already an int64_t.
2018-02-07 17:00:06 -06:00
Timothy Nikkel 3de4dd3353 Bug 1432678. Convert to size_t in DecodedSurfaceProvider::LogicalSizeInBytes so multiplication doesn't overflow. r=aosmond 2018-02-07 17:00:04 -06:00
Andrew Osmond e68d0fd3d2 Bug 1383682 - Part 3. Prevent imgRequestProxy from leaking the current state when validating. r=tnikkel
There are two other means from which a caller can get the current state
which originally ignored validation -- GetImageStatus and
StartDecodingWithResult. These methods are used by layout in some
circumstances to decide whether or not the image is ready to display. As
observed in some web platform tests, in particular
css/css-backgrounds-3/background-size-031.html, we may actually validate
and purge the cache for images under test. The state given by the
aforementioned methods was misleading, because validation changed it.
Now they take into account validation, and do not imply any particular
state while validation is in progress.
2018-02-07 07:27:28 -05:00
Andrew Osmond b1c05068b8 Bug 1383682 - Part 2. Rename IProgressObserver::SetNotificationsDeferred to make purpose clear. r=tnikkel
IProgressObserver::SetNotificationsDeferred is now used just for
ProgressTracker to track when there is a pending notification for
an observer. It has been renamed to MarkPendingNotify and
ClearPendingNotify to make a clear distinction.
2018-02-07 07:27:27 -05:00
Andrew Osmond dab9b6216c Bug 1383682 - Part 1. Split off imgRequestProxy notification deferrals for validation. r=tnikkel
When cache validation is in progress, imgRequestProxy defers its
notifications to its listener until the validation is complete. This is
because the cache may be discarded, and the current state will change.
It attempted to share the same flags with notification deferrals used by
ProgressTracker to indicate that there is a pending notification, but
this has problematic/confusing. Hence this patch creates dedicated flags
for notification deferrals due to cache validation.
2018-02-07 07:27:27 -05:00
Kartikaya Gupta 4751a8b16b Bug 1436084 - Mark some reftests as passing with webrender. r=jrmuizel
MozReview-Commit-ID: IWXBqj0Vqbz

--HG--
extra : rebase_source : 182709310a15157d9533cc2429198f93599a95ed
2018-02-06 11:49:33 -05:00
Andrew McCreight 5dec0e0beb Bug 1432992, part 1 - Remove definitions of Ci, Cr, Cc, and Cu. r=florian
This patch was autogenerated by my decomponents.py

It covers almost every file with the extension js, jsm, html, py,
xhtml, or xul.

It removes blank lines after removed lines, when the removed lines are
preceded by either blank lines or the start of a new block. The "start
of a new block" is defined fairly hackily: either the line starts with
//, ends with */, ends with {, <![CDATA[, """ or '''. The first two
cover comments, the third one covers JS, the fourth covers JS embedded
in XUL, and the final two cover JS embedded in Python. This also
applies if the removed line was the first line of the file.

It covers the pattern matching cases like "var {classes: Cc,
interfaces: Ci, utils: Cu, results: Cr} = Components;". It'll remove
the entire thing if they are all either Ci, Cr, Cc or Cu, or it will
remove the appropriate ones and leave the residue behind. If there's
only one behind, then it will turn it into a normal, non-pattern
matching variable definition. (For instance, "const { classes: Cc,
Constructor: CC, interfaces: Ci, utils: Cu } = Components" becomes
"const CC = Components.Constructor".)

MozReview-Commit-ID: DeSHcClQ7cG

--HG--
extra : rebase_source : d9c41878036c1ef7766ef5e91a7005025bc1d72b
2018-02-06 09:36:57 -08:00
Coroiu Cristina e06af9c36a Merge inbound to mozilla-central a=merge 2018-02-02 19:38:23 +02:00
Boris Zbarsky 13dda50f75 Bug 1435138 part 4. Remove nsIDOMSVGLength. r=qdot
MozReview-Commit-ID: HwKT9Bdby6F
2018-02-02 08:21:33 -05:00
Valentin Gosu eea7e5e494 Bug 1432620 - Make nsIMozIconURI attributes readonly r=mayhemer
MozReview-Commit-ID: LLSjC2fBa4x

--HG--
extra : rebase_source : 8e8cf5f7650913a1e0c3640f9cc3fdb88e084b66
2018-01-23 22:25:18 +01:00
Kris Maglione 918ed6c474 Bug 1431533: Part 5a - Auto-rewrite code to use ChromeUtils import methods. r=florian
This was done using the following script:
37e3803c7a/processors/chromeutils-import.jsm

MozReview-Commit-ID: 1Nc3XDu0wGl

--HG--
extra : source : 12fc4dee861c812fd2bd032c63ef17af61800c70
extra : intermediate-source : 34c999fa006bffe8705cf50c54708aa21a962e62
extra : histedit_source : b2be2c5e5d226e6c347312456a6ae339c1e634b0
2018-01-29 15:20:18 -08:00
Cosmin Sabou 9a65a40178 Backed out 3 changesets (bug 1431533) for Android mochitest failures on testEventDispatcher on a CLOSED TREE
Backed out changeset a1eca62826a1 (bug 1431533)
Backed out changeset 34c999fa006b (bug 1431533)
Backed out changeset e2674287e57f (bug 1431533)
2018-01-30 07:17:48 +02:00