Commit graph

60 commits

Author SHA1 Message Date
Martok
845411a7ad Issue #2073 - m-c 1454149: Do not advance animated images which are not displayed 2023-01-10 07:31:40 +08:00
Martok
a6a420259c Issue #2073 - m-c 1546500: Avoid dispatching synchronous thread shutdown runnables 2023-01-10 07:31:26 +08:00
Martok
9a39001cc3 Issue #2073 - m-c 1651587: Make image::Image release efficient on main thread 2023-01-10 07:31:09 +08:00
Martok
03a4a17ccf Issue #2073 - m-c 1383404: make SourceBuffer::Compact more efficient (squashed)
The first part also means that Compact no longer needs the SurfaceCache lock (used to be via CreateChunk->CanHold),
which avoids potential deadlocks during shutdown that m-c 523950 would otherwise cause
2023-01-10 07:30:55 +08:00
Martok
e96122ede2 Issue #2073 - m-c 523950: Discard decoded frames of very large GIF animations (squashed)
Controlled by image.animated.decode-on-demand.threshold-kb, default 256MB

Includes squashed bugfixes/regressions:
 - m-c 1444537: Shutting down the decode pool should make animated decoders bail early
 - m-c 1628606: Make sure to mark the surface cache entry available before sending the frame complete notification
 - m-c 1502275: Skip recreating the decoder after redecode errors if an animated image is reset
 - m-c 1443232: Don't insert frames into our AnimationFrameBuffer that we consider in error and unusable
2023-01-10 07:30:36 +08:00
Martok
eac8afce35 Issue #2073 - m-c 1343341: Infrastructure necessary to allow discarding of animated images (squashed)
Includes squashed changes of:
 - m-c 1317907: Refactor FrameAnimator::GetCompositedFrame to be a bit simpler
 - m-c 1351434: bugfix
 - m-c 686905: Enable the pref image.mem.animated.discardable to allow discarding of animated images
2023-01-10 07:29:50 +08:00
Martok
7d75c2717f Issue #2073 - m-c 1382683: Accelerate GIF decoding to SurfacePipe
1. Implement SurfacePipe::WritePixelBlocks for faster writing of pixels
2. Switch nsGIFDecoder2 to write pixels in blocks instead of individually
2023-01-10 07:29:36 +08:00
Moonchild
e69b52eac1 Hold some strong references on nsRefreshDriver 2022-10-27 09:03:27 +08:00
Job Bautista
e40697c0c6 Issue #1926 - Update image/Orientation.h 2022-06-22 09:03:10 +08:00
roytam1
6ec59e7984 image: sync with 8e42fccca6 2022-05-31 09:36:20 +08:00
Brian Smith
13fcc4a046 Issue #1829 - Revert "Issue #1751" 2022-05-04 09:40:24 +08:00
FranklinDM
8a7587b401 Issue #21 - Remove use counters telemetry
This reverts Bug 968923 - Implement some equivalent of Chrome's use counters (on top of telemetry?)

For reference: https://bugzilla.mozilla.org/show_bug.cgi?id=968923
2022-04-28 10:43:09 +08:00
Moonchild
eaf9e756a0 Issue #21 - Remove remaining telemetry structs, callers and flags. 2022-04-28 10:33:44 +08:00
Moonchild
8d800b1cb0 Issue #21 - Remove Telemetry plumbing and fix build.
Note this won't give working applications. Requires FE changes and
additional js module changes (next part).
2022-04-28 10:25:48 +08:00
roytam1
92a1cc3139 Revert "Issue #21 - Remove use counters telemetry"
This reverts commit 8ca9db6b65.
2022-04-27 16:25:00 +08:00
FranklinDM
8ca9db6b65 Issue #21 - Remove use counters telemetry
This reverts Bug 968923 - Implement some equivalent of Chrome's use counters (on top of telemetry?)

For reference: https://bugzilla.mozilla.org/show_bug.cgi?id=968923
2022-04-27 16:15:31 +08:00
Moonchild
ba0e98e3bd [Image] Add some additional locks to ImgFrame 2022-03-22 23:22:33 +08:00
Randell Jesup
9060ad1fce [Image] Image cleanup 2022-03-22 23:14:31 +08:00
Moonchild
ba00d14c12 Issue #1751 - Remove Mac code behind MOZ_WIDGET_TOOLKIT == 'cocoa' 2021-06-24 11:09:47 +08:00
Moonchild
a4b0f333ba Issue #1751 -- Remove XP_MACOSX conditionals from the rest of the tree.
This also removes some PP abuse and takes file entries out of PP when no longer
needed without XP_MACOSX conditionals.
2021-05-07 09:53:59 +08:00
Moonchild
d5919942ff Issue #1656 - Part 8: Devtools and misc. 2020-09-25 22:06:55 +08:00
Moonchild
0cd673d720 Issue #1656 - Part 6: Clean up the build files 2020-09-25 22:04:23 +08:00
Moonchild
8c395520d9 Issue #1656 - Part 1: Nuke most vim config lines in the tree.
Since these are just interpreted comments, there's 0 impact on actual code.
This removes all lines that match /* vim: set(.*)tw=80: */ with S&R -- there are
a few others scattered around which will be removed manually in a second part.
2020-09-25 22:04:12 +08:00
Andy
3c02d3fc0d Issue #1619 - Convert Intrinsic Ratio to Float
https://bugzilla.mozilla.org/show_bug.cgi?id=1547792

Aspect Ratio handling simplified by using floating point integers:
- Multiplication of value (or inverse value) to a known side for Scaling
- No unequal equal values such as "4/3" vs "8/6" vs "20/15"
- Truly "Empty" aspect ratios, even if one dimension is not 0
2020-08-06 10:23:07 +08:00
Moonchild
6cf5f024c4 [image] Add a sanity check to JPEG encoder buffer handling, just in case. 2020-07-10 22:18:38 +08:00
Moonchild
594c930eca Issue #439 - Remove, fix and clean up automated tests
With the big amount of code churn around DOM a lot of tests
broke severely enough that they caused build bustage.
This commit cleans up, removes or otherwise fixes tests
that are broken, no longer relevant or obsolete.
2020-06-10 21:00:09 +08:00
Moonchild
db14a637c4 Issue #1543 - Align <img> with no src to the updated spec. 2020-05-16 06:49:14 +08:00
Matt A. Tobin
6df3c70708 Issue #1053 - Remove android support from image 2020-02-27 07:31:31 +08:00
win7-7
e6f376f5ef Convert dom/base/nsImageLoadingContent.cpp to use AsyncOpen2 and followups along with it (1445670 and 1373780 part 2 and 3)
Convert dom/base/nsImageLoadingContent.cpp to use AsyncOpen2 and followups along with it (1445670 and 1373780 part 2 and 3)
2019-08-10 06:26:08 +08:00
adeshkp
5193311ea5 Fix order of member variables in a couple of initializer lists 2019-03-16 07:04:11 +08:00
Andrew Osmond
4f5c2d5a46 BMPs from the clipboard may include extra padding.
In the original Windows clipboard BMP decoder implementation in
nsImageFromClipboard::ConvertColorBitMap, if the bitmap used bitfields
compression, it always adjusted the offset to the RGB data by 12 bytes.
It did this even for newer BMP header formats which explicitly include
space for the bitfields in their header sizes. This patch updates our
BMP decoder to do the same for clipboard BMPs, since we have observed
pasted BMPs using bitfield compression appearing incorrectly. To the
user this appears as if we read a color mask; completely red, blue,
green pixels at the start of the last row, causing all of the other rows
to start with the last three pixels of the previous row.
2019-02-17 12:07:06 +08:00
wolfbeast
c15f982d7a Use existing image decoders to handle clipboard BMP data.
This gets rid of the old nsImageClipboard widget code in favor of using
the nsBMPDecoder in imglib.
2019-02-16 00:28:11 +08:00
wolfbeast
a1c22f3a76 Check for contiguous buffer state.
When we are reading large image data (i.e.: people using webp to stream
video instead of the native webm format; I'm looking at you, Giphy!)
we can run into the situation where the available data is not in a
contiguous buffer, and we need to either buffer additional data or
re-buffer from the start. If we don't do this, we can run into issues
because of buffer over-reading (causing corrupted data if allocated or
more likely crashes if not allocated).
Re-buffering is expensive, but this should be rare and limited to
dealing with unintended use for animated image formats.

This resolves #940.
2019-02-16 00:24:38 +08:00
wolfbeast
3640321580 Make Sourcebuffer::AppendFromInputStream handle canceled image loads. 2019-02-16 00:24:36 +08:00
wolfbeast
f84fdea422 Make resuming of decoding work for anonymous decoders. 2019-02-16 00:24:35 +08:00
adeshkp
aea50f182f Telemetry: Remove stubs and related code 2019-02-16 00:24:04 +08:00
wolfbeast
f52945acfa Avoid overflow in nsPNGEncoder::WriteCallback. 2019-02-16 00:22:15 +08:00
wolfbeast
989fd6953d Fix debug assertion.
See: 622098073e (commitcomment-31390051)
2019-02-16 00:20:22 +08:00
wolfbeast
82e68ebad1 Fix blank pixel color for truncated GIFs 2019-02-16 00:20:20 +08:00
wolfbeast
e03052f3d3 Split out FrameTimeout into its own header file for re-use. 2019-02-16 00:20:18 +08:00
wolfbeast
7a3a9214a5 Unrefactor mRawVeggies back to mVBuffMeat ;P
(mRawSurface -> mVBuf)
2019-02-16 00:20:17 +08:00
wolfbeast
d3b77513d5 Fix pasta error 2019-02-16 00:20:15 +08:00
wolfbeast
7937138cb0 Bug 1462355 - Part 1c. Make individual image decoders to use updated Decoder/SurfacePipe methods.
Extend this change to nsWebPDecoder.cpp
2019-02-16 00:20:14 +08:00
wolfbeast
a08160ac44 Bug 1462355 - Part 1b. Update Decoder and SurfacePipe plumbing to use updated imgFrame methods. 2019-02-16 00:20:12 +08:00
wolfbeast
75cb341c44 Bug 1462355 - Part 1a. Make imgFrame animation parameters threadsafe.
We currently choose to set the animation parameters (blend method, blend
rect, disposal method, timeout) in imgFrame::Finish instead of
imgFrame::InitForDecoder. The decoders themselves already have access to
the necessary information at the time InitForDecoder is called, so there
is no reason to do this. Moving the configuration to initialization will
allow us to relax the mutex protection on these parameters.

This part simply reorganizes imgFrame, and subsequent parts will
introduce the necessary changes to SurfacePipe and decoders.
2019-02-16 00:20:11 +08:00
wolfbeast
dfe6efae2f Port WebP decoder changes.
This breaks animated WebP for the moment, but adds QCMS color management and lexer changes.
Tag #831
2019-02-16 00:20:09 +08:00
wolfbeast
8c8145e620 Remove all C++ Telemetry Accumulation calls.
This creates a number of stubs and leaves some surrounding code that may be irrelevant (eg. recorded time stamps, status variables).
Stub resolution/removal should be a follow-up to this.
2019-02-16 00:12:32 +08:00
wolfbeast
ee622ef7cc Free the decoded image buffer before deleting the WebP decoder.
This should solve #483.
2019-02-16 00:02:45 +08:00
Pale Moon
1b173ad9e4 Perform some sanity checks on nsMozIconURI. 2019-02-16 00:01:30 +08:00
Gaming4JC
d4ac94cf3e Remove support and tests for HSTS priming from the tree. Fixes #384 2019-02-15 23:59:39 +08:00