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

3283 Коммитов

Автор SHA1 Сообщение Дата
Andrew Osmond efc0d9172c Bug 1504237 - Ensure partial animated frames always use BGRA instead of BGRX. r=tnikkel
For decoders which produce unpaletted partial frames (APNG, WebP), the
surface format should always be BGRA. These frames while partial, are
the same size as the output size of the animated image. When
FrameAnimator performs the blend with the compositing frame, it expects
all pixels we don't care about to be set to fully transparent. If it is
BGRX, they will be set to solid white instead.

Differential Revision: https://phabricator.services.mozilla.com/D10753
2018-11-03 19:47:54 -04:00
Andrew Osmond 379404ac50 Bug 1428558 - Part 8. Integrate SharedSurfacesAnimation with the rest of imagelib. r=nical
This patch makes ImageContainer create a SharedSurfacesAnimation object
when it detects that we are using shared surfaces and are producing full
frames.

Differential Revision: https://phabricator.services.mozilla.com/D7505
2018-11-02 09:09:52 -04:00
Andrew Osmond 414919edbf Bug 1503935 - Fix some WebP decoder implementation bugs. r=tnikkel
First we did not handle the SourceBufferIterator::WAITING state which
can happen when we get woken up but there is no data to read from the
SourceBufferIterator. StreamingLexer handled this properly by yielding
with NEED_MORE_DATA, and properly scheduling the decoder to resume. This
patch does the same in the WebP decoder.

Second nsWebPDecoder::GetType was not implemented. This meant it would
return DecoderType::UNKNOWN, and would fail to recreate the decoder if
we are discarding frames and need to restart from the beginning. In
addition to implementing that method, this patch also corrects an assert
in DecoderFactory::CloneAnimationDecoder which failed to check for WebP
as a supported animated decoder.

This patch also modestly improves the logging output and library method
checks.

Differential Revision: https://phabricator.services.mozilla.com/D10624
2018-11-01 19:26:14 -04:00
Andrew Osmond 7d59969d56 Bug 1503850 - Remove expired WebP telemetry probes. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D10550
2018-11-01 16:59:02 -04:00
Andrew Osmond 0ccd2cb7f6 Bug 1294490 - Part 6. Implement WebP gtests. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D8119
2018-10-31 15:01:08 -04:00
Andrew Osmond a4554fb9cf Bug 1294490 - Part 4. Implement telemetry for WebP decoder. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D8117
2018-10-31 15:01:08 -04:00
Andrew Osmond 4c9b7d3ad8 Bug 1294490 - Part 3. Implement WebP decoder. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D8116
2018-10-31 15:01:08 -04:00
Andrew Osmond d78eab076c Bug 1501212 - Fix faulty assert when requesting a frame from a previously discarded animated image. r=tnikkel
We should only assert that the caller is requesting the first frame or
we have advanced to or beyond the expected initial frame, when we
successfully return a frame. This is because FrameAnimator will request
on refresh ticks for the current frame again, until it observes it. If
decoding is still behind, then we likely still have frames to
auto-advance, and we will trip the assert.

Differential Revision: https://phabricator.services.mozilla.com/D9507
2018-10-26 07:50:23 -04:00
Andrew Osmond 8066d5c0b3 Bug 1501120 - Fix faulty assert when calculating memory footprint of animation. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D9506
2018-10-26 07:50:21 -04:00
Andrew Osmond 6f04b04574 Bug 1465619 - Part 14. Add gtests for AnimationFrameRecyclingQueue. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D7519
2018-10-22 13:40:35 -04:00
Andrew Osmond 414bbd29d6 Bug 1465619 - Part 13. Add gtests for AnimationFrameDiscardingQueue. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D7518
2018-10-22 13:40:35 -04:00
Andrew Osmond 6a652ed7cb Bug 1465619 - Part 12. Add gtests for AnimationFrameRetainedBuffer. r=tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D7517
2018-10-22 13:40:35 -04:00
Andrew Osmond 0f2cb305c1 Bug 1465619 - Part 11. Add support for recycling animated image frames. r=tnikkel
This is what we have been working towards in all of the previous parts
in the series. This subclasses AnimationFrameDiscardingQueue to save the
discarded frames for recycling by the decoder, if the frame is marked as
supporting recycling.

Differential Revision: https://phabricator.services.mozilla.com/D7516
2018-10-22 13:40:35 -04:00
Andrew Osmond fa96750373 Bug 1465619 - Part 10. Re-add support for discarding animated image frames. r=tnikkel
AnimatedFrameDiscardingQueue subclasses AnimationFrameBuffer to allow a
cleaner abstraction over the behaviour change when we cross the
threshold of too high a memory footprint for an animated image. The next
patch will build on top of this to provide an abstraction to reuse the
discarded frames.

Differential Revision: https://phabricator.services.mozilla.com/D7515
2018-10-22 13:40:35 -04:00
Andrew Osmond f525b64a4b Bug 1465619 - Part 9. Use redesigned AnimationFrameBuffer interface and retaining buffer. r=tnikkel
This patch makes AnimationSurfaceProvider use the new abstractions
provided by AnimationFrameBuffer and AnimationFrameRetainedBuffer to
provide storage and lifetime management of decoders and the produced
frames. We initially start out with an implementation that will just
keep every frame forever, like our historical behaviour. The next patch
will add support for discarding.

Differential Revision: https://phabricator.services.mozilla.com/D7514
2018-10-22 13:40:35 -04:00
Andrew Osmond 561519762d Bug 1465619 - Part 8. Remove the old AnimationFrameBuffer implementation. r=tnikkel
In the next few patches, AnimationFrameBuffer will be reworked to split
the discarding behaviour from the retaining behaviour. Once implemented
as separate classes, it will allow easier reuse of the discarding code
for recycling.

Differential Revision: https://phabricator.services.mozilla.com/D7513
2018-10-22 13:40:35 -04:00
Andrew Osmond 4e0ba74469 Bug 1465619 - Part 7. Add support for recycling to image::Decoder. r=tnikkel
The owner for the decoder may implement IDecoderFrameRecycler to allow
the decoder to request a recycled frame instead of allocating a new one.
If none are available, it will fallback to allocating a new frame.

Not only may the IDecoderFrameRecycler not have any frames available for
recycling, the recycled frame itself may still be in use by other
entities outside of imagelib. Additionally it may still be required by
BlendAnimationFilter to restore the previous frame's data. It may even
be the same frame as to restore. In the worst case, we will simply
choose to allocate an entirely new frame, just like before.

When we allocate a new frame, that means the old frame we tried to
recycle will be taken out of circulation and not reused again,
regardless of why it failed.

Differential Revision: https://phabricator.services.mozilla.com/D7512
2018-10-22 13:40:35 -04:00
Andrew Osmond 6f594078d6 Bug 1465619 - Part 6. Add support for recycling to imgFrame. r=tnikkel
Beyond the necessary reinitialization methods, we need to protect
ourselves from recycling a frame that some other entity in the browser
is still using. Generally speaking the animated surface will only be
used in imgFrame::Draw since we don't layerize animated images, which
will be safe. However with OMTP or blob recordings, we could retain a
reference to the surface outside the current stack context. Additional
if something calls RasterImage::GetImageContainer(AtSize) or
RasterImage::GetFrame(AtSize), it may also have a reference to the
surface for an indetermine period of time.

As such, if an imgFrame is a candidate for recycling, it will wrap
imgFrame::mLockedSurface in a RecyclingSourceSurface. Its job is to
track how many consumers there are still of the surface, so that after
we advance the animation, the decoder will know if there are still
outstanding consumers.

If the surface is still in use, it will block for a finite period of
time (the refresh interval) before giving up on reclaiming the surface,
and will allocate a new surface. The old surface can then remain in
circulation for as long as necessary without further blocking the
animation progression, since we stop recycling that surface/imgFrame.

Differential Revision: https://phabricator.services.mozilla.com/D7511
2018-10-22 13:40:35 -04:00
Andrew Osmond d0b9475af5 Bug 1465619 - Part 5. Move actual drawing in imgFrame::Draw outside the monitor. r=tnikkel
Since imgFrame::Draw will limit the drawing to only look at pixels that
we have written to and posted an invalidation for, there is no need to
hold the monitor while doing so. By taking the most expensive operation
outside the lock, we will minimize our chances of hitting contention
with the decoder thread.

A later part in this series will require that a surface be freed outside
the lock because it may end up reacquiring it. In addition to the
contention win, this change should facilitate that.

Differential Revision: https://phabricator.services.mozilla.com/D7510
2018-10-22 13:40:35 -04:00
Andrew Osmond 2c6fa568a4 Bug 1465619 - Part 4. Move the first frame refresh area calculation to frame commit. r=tnikkel
If we discard a frame during decoding, e.g. due to an error, then we
don't want to take that frame into account for the first frame refresh
area. We should also be handling partial frames here (the dirty rect
needs to encompass the rows that did not get written with actual pixel
data). The only place that can have the necessary information is at the
end rather than at the beginning.

Differential Revision: https://phabricator.services.mozilla.com/D7509
2018-10-22 13:40:35 -04:00
Andrew Osmond 392b20c95e Bug 1465619 - Part 3. Improve the clear rect calculations to take into account recycling in BlendAnimationFilter. r=tnikkel
The clear rect and the recycle rect can overlap, and depending on the
size of the clear rect, it could be a significant amount of data that
needs to be copied from the restore frame. This patch minimizes the
copying for a row which contains both the recycle rect and the clear
rect.

Differential Revision: https://phabricator.services.mozilla.com/D7508
2018-10-22 13:40:35 -04:00
Andrew Osmond c838361d7c Bug 1465619 - Part 2. Add basic support for recycling a frame buffer to BlendAnimationFilter. r=tnikkel
Given an invalidation rect, called the recycle rect, which represents
the area which may have changed between the current frame and the frame
we are recycling, we can not only reuse the buffer itself to avoid an
allocation and free, we can also avoid copying pixel data from the
restore frame which is already set.

Differential Revision: https://phabricator.services.mozilla.com/D7507
2018-10-22 13:40:35 -04:00
Andrew Osmond 95d4e6266a Bug 1465619 - Part 1. Use imgFrame directly instead of RawAccessFrameRef in FrameAnimator. r=tnikkel
When blending full frames off the main thread, FrameAnimator no longer
requires access to the raw data of the frame to advance the animation.
Now we only request a RawAccessFrameRef for the current/next frames when
we have discovered that we need to do blending on the main thread.

In addition to avoiding the mutex overhead of RawAccessFrameRef, this
will also facilitate potentially optimizing the surfaces for the
DrawTarget for individual animated image frames.

Differential Revision: https://phabricator.services.mozilla.com/D7506
2018-10-22 13:40:35 -04:00
Timothy Nikkel 1f15ab4d53 Bug 1256603. Change MultipartImage to use RequestDecode instead of GetFrame to avoid marking the frame as used. r=aosmond 2018-10-14 00:38:42 -05:00
Timothy Nikkel 18f6f5c418 Bug 1256603. Fix comment for imgIContainer::RequestDecodeForSize to match reality. r=aosmond 2018-10-13 00:31:03 -05:00
Timothy Nikkel 6a62719550 Bug 1256603. Make aMarkUsed parameters required everywhere. r=aosmond 2018-10-13 00:31:03 -05:00
Timothy Nikkel df61b9e8ff Bug 1256603. Only mark images as used in the surface cache if we actually use them. r=aosmond
We were marking them used even if only a decode was requested.

This can cause us to hold extra decoded copies of the image around because we have a tendency to request decode at the intrinsic size.
2018-10-13 00:31:02 -05:00
Jonathan Watt 1afc0b4ff4 Bug 1495851. Comment why StopObserving is called in SVGRenderingObserver base class dtors. r=longsonr
Differential Revision: https://phabricator.services.mozilla.com/D7525

--HG--
extra : rebase_source : 136b2757f572b42b89af23554da3d93822b140f8
2018-09-25 10:40:12 +01:00
Daniel Varga a11c128b90 Merge mozilla-inbound to mozilla-central. a=merge 2018-10-03 00:47:40 +03:00
Andrew McCreight ea6021b769 Bug 1494127 - Fix trivial calls to do_QueryInterface that return an nsresult r=smaug
Calls to do_QueryInterface to a base class can be replaced by a static
cast, which is faster.

Differential Revision: https://phabricator.services.mozilla.com/D7224

--HG--
extra : moz-landing-system : lando
2018-10-01 21:38:43 +00:00
Gurzau Raul ca3641419f Merge inbound to mozilla-central. a=merge
--HG--
rename : docshell/test/bug123696-subframe.html => docshell/test/mochitest/bug123696-subframe.html
rename : docshell/test/bug404548-subframe.html => docshell/test/mochitest/bug404548-subframe.html
rename : docshell/test/bug404548-subframe_window.html => docshell/test/mochitest/bug404548-subframe_window.html
rename : docshell/test/bug413310-post.sjs => docshell/test/mochitest/bug413310-post.sjs
rename : docshell/test/bug413310-subframe.html => docshell/test/mochitest/bug413310-subframe.html
rename : docshell/test/bug529119-window.html => docshell/test/mochitest/bug529119-window.html
rename : docshell/test/bug530396-noref.sjs => docshell/test/mochitest/bug530396-noref.sjs
rename : docshell/test/bug530396-subframe.html => docshell/test/mochitest/bug530396-subframe.html
rename : docshell/test/bug570341_recordevents.html => docshell/test/mochitest/bug570341_recordevents.html
rename : docshell/test/bug668513_redirect.html => docshell/test/mochitest/bug668513_redirect.html
rename : docshell/test/bug668513_redirect.html^headers^ => docshell/test/mochitest/bug668513_redirect.html^headers^
rename : docshell/test/bug691547_frame.html => docshell/test/mochitest/bug691547_frame.html
rename : docshell/test/dummy_page.html => docshell/test/mochitest/dummy_page.html
rename : docshell/test/file_anchor_scroll_after_document_open.html => docshell/test/mochitest/file_anchor_scroll_after_document_open.html
rename : docshell/test/file_bfcache_plus_hash_1.html => docshell/test/mochitest/file_bfcache_plus_hash_1.html
rename : docshell/test/file_bfcache_plus_hash_2.html => docshell/test/mochitest/file_bfcache_plus_hash_2.html
rename : docshell/test/file_bug1121701_1.html => docshell/test/mochitest/file_bug1121701_1.html
rename : docshell/test/file_bug1121701_2.html => docshell/test/mochitest/file_bug1121701_2.html
rename : docshell/test/file_bug1151421.html => docshell/test/mochitest/file_bug1151421.html
rename : docshell/test/file_bug1186774.html => docshell/test/mochitest/file_bug1186774.html
rename : docshell/test/file_bug1450164.html => docshell/test/mochitest/file_bug1450164.html
rename : docshell/test/file_bug385434_1.html => docshell/test/mochitest/file_bug385434_1.html
rename : docshell/test/file_bug385434_2.html => docshell/test/mochitest/file_bug385434_2.html
rename : docshell/test/file_bug385434_3.html => docshell/test/mochitest/file_bug385434_3.html
rename : docshell/test/file_bug475636.sjs => docshell/test/mochitest/file_bug475636.sjs
rename : docshell/test/file_bug509055.html => docshell/test/mochitest/file_bug509055.html
rename : docshell/test/file_bug511449.html => docshell/test/mochitest/file_bug511449.html
rename : docshell/test/file_bug540462.html => docshell/test/mochitest/file_bug540462.html
rename : docshell/test/file_bug580069_1.html => docshell/test/mochitest/file_bug580069_1.html
rename : docshell/test/file_bug580069_2.sjs => docshell/test/mochitest/file_bug580069_2.sjs
rename : docshell/test/file_bug590573_1.html => docshell/test/mochitest/file_bug590573_1.html
rename : docshell/test/file_bug590573_2.html => docshell/test/mochitest/file_bug590573_2.html
rename : docshell/test/file_bug598895_1.html => docshell/test/mochitest/file_bug598895_1.html
rename : docshell/test/file_bug598895_2.html => docshell/test/mochitest/file_bug598895_2.html
rename : docshell/test/file_bug634834.html => docshell/test/mochitest/file_bug634834.html
rename : docshell/test/file_bug598895_1.html => docshell/test/mochitest/file_bug637644_1.html
rename : docshell/test/file_bug598895_2.html => docshell/test/mochitest/file_bug637644_2.html
rename : docshell/test/file_bug640387.html => docshell/test/mochitest/file_bug640387.html
rename : docshell/test/file_bug653741.html => docshell/test/mochitest/file_bug653741.html
rename : docshell/test/file_bug660404 => docshell/test/mochitest/file_bug660404
rename : docshell/test/file_bug660404-1.html => docshell/test/mochitest/file_bug660404-1.html
rename : docshell/test/file_bug660404^headers^ => docshell/test/mochitest/file_bug660404^headers^
rename : docshell/test/file_bug653741.html => docshell/test/mochitest/file_bug662170.html
rename : docshell/test/file_bug668513.html => docshell/test/mochitest/file_bug668513.html
rename : docshell/test/file_bug669671.sjs => docshell/test/mochitest/file_bug669671.sjs
rename : docshell/test/file_bug675587.html => docshell/test/mochitest/file_bug675587.html
rename : docshell/test/file_bug680257.html => docshell/test/mochitest/file_bug680257.html
rename : docshell/test/file_bug703855.html => docshell/test/mochitest/file_bug703855.html
rename : docshell/test/file_bug728939.html => docshell/test/mochitest/file_bug728939.html
rename : docshell/test/file_close_onpagehide1.html => docshell/test/mochitest/file_close_onpagehide1.html
rename : docshell/test/file_close_onpagehide2.html => docshell/test/mochitest/file_close_onpagehide2.html
rename : docshell/test/file_framedhistoryframes.html => docshell/test/mochitest/file_framedhistoryframes.html
rename : docshell/test/file_pushState_after_document_open.html => docshell/test/mochitest/file_pushState_after_document_open.html
rename : docshell/test/historyframes.html => docshell/test/mochitest/historyframes.html
rename : docshell/test/mochitest.ini => docshell/test/mochitest/mochitest.ini
rename : docshell/test/start_historyframe.html => docshell/test/mochitest/start_historyframe.html
rename : docshell/test/test_anchor_scroll_after_document_open.html => docshell/test/mochitest/test_anchor_scroll_after_document_open.html
rename : docshell/test/test_bfcache_plus_hash.html => docshell/test/mochitest/test_bfcache_plus_hash.html
rename : docshell/test/test_bug1045096.html => docshell/test/mochitest/test_bug1045096.html
rename : docshell/test/test_bug1121701.html => docshell/test/mochitest/test_bug1121701.html
rename : docshell/test/test_bug1151421.html => docshell/test/mochitest/test_bug1151421.html
rename : docshell/test/test_bug1186774.html => docshell/test/mochitest/test_bug1186774.html
rename : docshell/test/test_bug123696.html => docshell/test/mochitest/test_bug123696.html
rename : docshell/test/test_bug1450164.html => docshell/test/mochitest/test_bug1450164.html
rename : docshell/test/test_bug384014.html => docshell/test/mochitest/test_bug384014.html
rename : docshell/test/test_bug385434.html => docshell/test/mochitest/test_bug385434.html
rename : docshell/test/test_bug387979.html => docshell/test/mochitest/test_bug387979.html
rename : docshell/test/test_bug402210.html => docshell/test/mochitest/test_bug402210.html
rename : docshell/test/test_bug404548.html => docshell/test/mochitest/test_bug404548.html
rename : docshell/test/test_bug413310.html => docshell/test/mochitest/test_bug413310.html
rename : docshell/test/test_bug475636.html => docshell/test/mochitest/test_bug475636.html
rename : docshell/test/test_bug509055.html => docshell/test/mochitest/test_bug509055.html
rename : docshell/test/test_bug511449.html => docshell/test/mochitest/test_bug511449.html
rename : docshell/test/test_bug529119-1.html => docshell/test/mochitest/test_bug529119-1.html
rename : docshell/test/test_bug529119-2.html => docshell/test/mochitest/test_bug529119-2.html
rename : docshell/test/test_bug530396.html => docshell/test/mochitest/test_bug530396.html
rename : docshell/test/test_bug540462.html => docshell/test/mochitest/test_bug540462.html
rename : docshell/test/test_bug551225.html => docshell/test/mochitest/test_bug551225.html
rename : docshell/test/test_bug570341.html => docshell/test/mochitest/test_bug570341.html
rename : docshell/test/test_bug580069.html => docshell/test/mochitest/test_bug580069.html
rename : docshell/test/test_bug590573.html => docshell/test/mochitest/test_bug590573.html
rename : docshell/test/test_bug598895.html => docshell/test/mochitest/test_bug598895.html
rename : docshell/test/test_bug634834.html => docshell/test/mochitest/test_bug634834.html
rename : docshell/test/test_bug637644.html => docshell/test/mochitest/test_bug637644.html
rename : docshell/test/test_bug640387_1.html => docshell/test/mochitest/test_bug640387_1.html
rename : docshell/test/test_bug640387_2.html => docshell/test/mochitest/test_bug640387_2.html
rename : docshell/test/test_bug653741.html => docshell/test/mochitest/test_bug653741.html
rename : docshell/test/test_bug660404.html => docshell/test/mochitest/test_bug660404.html
rename : docshell/test/test_bug662170.html => docshell/test/mochitest/test_bug662170.html
rename : docshell/test/test_bug668513.html => docshell/test/mochitest/test_bug668513.html
rename : docshell/test/test_bug669671.html => docshell/test/mochitest/test_bug669671.html
rename : docshell/test/test_bug675587.html => docshell/test/mochitest/test_bug675587.html
rename : docshell/test/test_bug680257.html => docshell/test/mochitest/test_bug680257.html
rename : docshell/test/test_bug691547.html => docshell/test/mochitest/test_bug691547.html
rename : docshell/test/test_bug694612.html => docshell/test/mochitest/test_bug694612.html
rename : docshell/test/test_bug703855.html => docshell/test/mochitest/test_bug703855.html
rename : docshell/test/test_bug728939.html => docshell/test/mochitest/test_bug728939.html
rename : docshell/test/test_bug797909.html => docshell/test/mochitest/test_bug797909.html
rename : docshell/test/test_close_onpagehide_by_history_back.html => docshell/test/mochitest/test_close_onpagehide_by_history_back.html
rename : docshell/test/test_close_onpagehide_by_window_close.html => docshell/test/mochitest/test_close_onpagehide_by_window_close.html
rename : docshell/test/test_forceinheritprincipal_overrule_owner.html => docshell/test/mochitest/test_forceinheritprincipal_overrule_owner.html
rename : docshell/test/test_framedhistoryframes.html => docshell/test/mochitest/test_framedhistoryframes.html
rename : docshell/test/test_pushState_after_document_open.html => docshell/test/mochitest/test_pushState_after_document_open.html
rename : docshell/test/test_triggeringprincipal_location_seturi.html => docshell/test/mochitest/test_triggeringprincipal_location_seturi.html
rename : docshell/test/test_windowedhistoryframes.html => docshell/test/mochitest/test_windowedhistoryframes.html
rename : docshell/test/url1_historyframe.html => docshell/test/mochitest/url1_historyframe.html
rename : docshell/test/url2_historyframe.html => docshell/test/mochitest/url2_historyframe.html
rename : third_party/rust/syn/src/parsers.rs => third_party/rust/syn-0.14.6/src/parsers.rs
rename : third_party/rust/syn/src/verbatim.rs => third_party/rust/syn-0.14.6/src/verbatim.rs
rename : third_party/rust/uuid/.travis.yml => third_party/rust/uuid-0.5.1/.travis.yml
rename : third_party/rust/uuid/src/rustc_serialize.rs => third_party/rust/uuid-0.5.1/src/rustc_serialize.rs
rename : third_party/rust/uuid/src/serde.rs => third_party/rust/uuid-0.5.1/src/serde.rs
2018-10-02 19:03:40 +03:00
Andrew McCreight 837f0af066 Bug 1493737 - Fix many trivial calls to do_QueryInterface r=smaug
If class A is derived from class B, then an instance of class A can be
converted to B via a static cast, so a slower QI is not needed.

Differential Revision: https://phabricator.services.mozilla.com/D6861

--HG--
extra : moz-landing-system : lando
2018-10-01 21:38:01 +00:00
Gurzau Raul ede1418858 Merge mozilla-central to inbound. a=merge CLOSED TREE 2018-10-02 19:08:39 +03:00
Andrea Marchesini bfc819fe65 Bug 1495738 - Image cache entry should compare the window ID together with the loadID because the loadID can be a reused pointer, r=aosmond 2018-10-02 17:05:21 +02:00
Jonathan Watt 7b3a3b2d10 Bug 1494953 p1. Rename lots of SVGObserverUtils functions. r=longsonr
The lack of clarity over which functions initiate observing and which don't
is a headache since it makes it hard to reason about what's going on. This
rename makes it explicit in the function names.

Differential Revision: https://phabricator.services.mozilla.com/D7187

--HG--
extra : rebase_source : 1f2f86423a9bee7843533c09b3ea78416b233bcd
extra : amend_source : a89125d6a3b7b75a4056c4d600de74a5386ac4ff
2018-09-04 10:04:07 +01:00
Timothy Nikkel fb8e88c218 Bug 1434490. Avoid overflow in nsPNGEncoder::WriteCallback. r=aosmond 2018-09-28 23:23:01 -05:00
Timothy Nikkel 1438d13673 Bug 1490938. Pass the high quality scaling flag when we request decode of images in most cases. r=aosmond
If we do not pass the high quality scaling flag than the resulting surface will be marked as cannot substitute, which is not accurate, so we don't want.

The only place that actually tries to be smart about the size is nsImageFrame::MaybeDecodeForPredictedSize. All other cases just ask for the intrinsic size.

The two most likely cases are that there are no decoded copies of the image, or there is one decoded (or in progress) copy of the image.

In the first case we will request decode at the instrinsic size, and then if we draw at a different size that draw will request the proper size. This doesn't change with this patch.

In the second case there is a decoded copy already available, this is likely from a draw call on the image, and that is the surface size that we want. So we save a decode. If we are actually drawing the image at two different sizes the second size will be slightly delayed, but we have the wrongly sized copy of the image that we can draw until then. This seems like a good tradeoff to avoid always decoding an instrinic size copy of images.
2018-09-27 18:30:17 -05:00
Narcis Beleuzu 010feac062 Backed out 2 changesets (bug 1495562, bug 1495554) for crashes on [@ CrashReporter::TerminateHandler()] . CLOSED TREE
Backed out changeset ec5d3c12ad4c (bug 1495562)
Backed out changeset 28792d9adea2 (bug 1495554)
2018-10-02 02:58:09 +03:00
Jonathan Watt 930cf1de0f Bug 1495554. Call StopObserving in SVGRenderingObserver's dtor instead of individual subclasses' dtors. r=longsonr
Differential Revision: https://phabricator.services.mozilla.com/D7328

--HG--
extra : rebase_source : 8cf78efc46d4e94d0328742e836fefab3c977060
2018-09-21 21:16:49 +01:00
Andrew Osmond a31bd9b85e Bug 1492930 - Part 6. Integrate extra shared surface memory reporting with imagelib. r=tnikkel 2018-09-25 09:13:52 -04:00
Andrew Osmond d70925f00b Bug 1492930 - Part 4. Add ImageMemoryReporter to support extra shared surfaces reporting. r=tnikkel
By delegating responsibility for shared surfaces reporting to imagelib,
we can cross reference the GPU shared surfaces cache with the local
surface cache in a content process (or the main process). This will
allow us to identify entries that are in the GPU cache but not in the
content/main process cache, and aid in debugging memory leaks. This
functionality is pref'd off by default behind image.mem.debug-reporting.

Additionally, we want to report every entry that was mapped into the
compositor process, in the compositor process memory report. This will
give us a sense of how much of our resident memory is consumed by mapped
images in absence of the more detailed cross referencing above.
2018-09-25 09:13:51 -04:00
Andrew Osmond b6cb944219 Bug 1492930 - Part 3. Expose all frames to image memory reporting. r=tnikkel
At present, surface providers roll up all of their individual surfaces
into a single reporting unit. Specifically this means animated image
frames are all reported as a block. This patch removes that
consolidation and reports every frame as its own SurfaceMemoryReport.
This is important because each frame may have its own external image ID,
and we want to cross reference that with what we expect from the GPU
shared surfaces cache.
2018-09-25 09:13:51 -04:00
Narcis Beleuzu 3a8485e6e6 Backed out 6 changesets (bug 1492930) for build bustages on ImageMemoryReporter.cpp. CLOSED TREE
Backed out changeset 9d1ff0d0af47 (bug 1492930)
Backed out changeset bdb1bf2d8062 (bug 1492930)
Backed out changeset 2959314ecf7c (bug 1492930)
Backed out changeset 587e01daa080 (bug 1492930)
Backed out changeset 1a6b422c5a90 (bug 1492930)
Backed out changeset a3b3f4cdc9fa (bug 1492930)
2018-09-25 13:33:17 +03:00
Andrew Osmond cb18b15c36 Bug 1492930 - Part 6. Integrate extra shared surface memory reporting with imagelib. r=tnikkel 2018-09-25 06:18:07 -04:00
Andrew Osmond 5d483b60ce Bug 1492930 - Part 4. Add ImageMemoryReporter to support extra shared surfaces reporting. r=tnikkel
By delegating responsibility for shared surfaces reporting to imagelib,
we can cross reference the GPU shared surfaces cache with the local
surface cache in a content process (or the main process). This will
allow us to identify entries that are in the GPU cache but not in the
content/main process cache, and aid in debugging memory leaks. This
functionality is pref'd off by default behind image.mem.debug-reporting.

Additionally, we want to report every entry that was mapped into the
compositor process, in the compositor process memory report. This will
give us a sense of how much of our resident memory is consumed by mapped
images in absence of the more detailed cross referencing above.
2018-09-25 06:18:06 -04:00
Andrew Osmond d49646bb7a Bug 1492930 - Part 3. Expose all frames to image memory reporting. r=tnikkel
At present, surface providers roll up all of their individual surfaces
into a single reporting unit. Specifically this means animated image
frames are all reported as a block. This patch removes that
consolidation and reports every frame as its own SurfaceMemoryReport.
This is important because each frame may have its own external image ID,
and we want to cross reference that with what we expect from the GPU
shared surfaces cache.
2018-09-25 06:18:06 -04:00
Andrew Osmond cee95ec8de Bug 1456558 - Part 3. Implement factor of 2 scaling support for SVGs in VectorImage. r=tnikkel
If FLAG_HIGH_QUALITY_SCALING is used, we should use
SurfaceCache::LookupBestMatch just like how it is done in RasterImage.
This may provide an alternative size at which we should rasterize the
SVG instead of the requested size. Since SurfaceCache imposes a maximum
size for which it will permit rasterized SVGs, we should also bypass the
cache entirely if we are well above that and simply draw directly to the
draw target in such cases.

With WebRender, it is somewhat more complicated. We will now return
NOT_SUPPORTED if the size is too big, and this should trigger fallback
to blob images. This should only produce drawing commands for the
relevant region and save us the high cost of rasterized a very large
surface on the main thread, which at the same time, looking as crisp as
a user would expect.
2018-09-20 20:22:06 -04:00
Andrew Osmond 5f4c3fc4b2 Bug 1456558 - Part 2. Implement factor of 2 scaling support for SVGs in the surface cache. r=tnikkel
There is one main difference between raster images and vector images
with respect to factor of 2 scaling. Vector images may be scaled
infinitely and so we need to extend factor of 2 scaling to permit
growing instead of just shrinking. Also, we don't want to scale
infinitely, so we should configure a maximum size limit. This size limit
will apply even outside of factor of 2 scaling, and so the caller
(VectorImage) will need to be careful to take this into account.
2018-09-20 20:22:03 -04:00
Andrew Osmond 70ad830c48 Bug 1456558 - Part 1. Move the allowed raster size calculation from imgFrame to SurfaceCache. r=tnikkel 2018-09-20 20:22:00 -04:00
Andreea Pavel 3805f6a285 Backed out 3 changesets (bug 1456558) for crashtest assertion failures on a CLOSED TREE
Backed out changeset 70d8f11cf6e8 (bug 1456558)
Backed out changeset af9fc3daf97c (bug 1456558)
Backed out changeset f209a9d848f4 (bug 1456558)
2018-09-21 02:13:41 +03:00