Commit Graph

2051 Commits

Author SHA1 Message Date
Kartikaya Gupta
99fd3d6f18 Bug 1261158 - Convert test_bullet_animation.html to a mochitest-plain. r=tnikkel a=test-only
MozReview-Commit-ID: 8kgi3p2DMkw
2016-04-04 16:27:58 -04:00
Kartikaya Gupta
8c7e85438a Bug 1261158 - Convert test_background_image_anim.html to a mochitest-plain. r=tnikkel a=test-only
MozReview-Commit-ID: 5RJwrm5RKiU
2016-04-04 16:27:58 -04:00
Kartikaya Gupta
5230acebee Bug 1261158 - Convert test_animSVGImage2.html to a mochitest-plain. r=tnikkel a=test-only
MozReview-Commit-ID: JT02zkq1JJm
2016-04-04 16:27:58 -04:00
Kartikaya Gupta
b071de6b2c Bug 1261158 - Convert test_animSVGImage.html to a mochitest-plain. r=tnikkel a=test-only
MozReview-Commit-ID: E2n2JM0PjzR
2016-04-04 16:27:57 -04:00
Seth Fowler
278aa793ba Bug 1225934 - Never allow surface substitution when FLAG_HIGH_QUALITY_SCALING is disabled. r=tn, a=ritu 2016-03-07 17:17:16 -08:00
Timothy Nikkel
4c706e5993 Bug 1253362. SVGDocumentWrapper::IsAnimated can be called after SVGDocumentWrapper::DestroyViewer so null check mViewer. r=dholbert
The testcase has an svg-as-image inside an svg-as-image. At shutdown the viewer of the inner svg-as-image is destroyed (via the shutdown observer) first. Then the outer svg-as-image destroys its viewer which tries to unregister all image requests from the refresh driver. So it unregisters the inner svg-as-image, which calls GetAnimated.
2016-03-06 14:59:19 -06:00
Timothy Nikkel
fde95fcc03 Bug 1251405. Part 2. Use 64 bit ints to hold the delay between the current time and the last animation time. r=edwin
When storing ms, 32 bit ints can hold 2^32/1000/60/60/24 ~= 49 days. It's quite conceivable that someone would leave a tab in the background for 50 days.
2016-03-04 21:54:03 -06:00
Timothy Nikkel
f0724d93e6 Bug 1251405. Part 1. Fix a significant signed/unsigned mismatch in handling the return value of FrameAnimator::GetSingleLoopTime. r=edwin
GetSingleLoopTime returns -1 on exceptional cases but we used an unsigned int to hold the return value in AdvanceFrame. So the |loopTime > 0| check would succeed. Fortunately the |delay.ToMilliseconds() > loopTime| check would fail because loopTime was MAX_UNIT32, so we didn't do anything incorrect.

http://hg.mozilla.org/mozilla-central/rev/263980931d1b (bug 890743) changed GetSingleLoopTime from returning 0 (and uint32_t) to -1 (and int32_t) on exceptional cases. But the caller of GetSingleLoopTime wasn't updated.
2016-03-04 21:54:00 -06:00
Matt Woodrow
13ac8417d3 Bug 1220082 - Assign frame ids to animated images so that they get invalidated correctly. r=seth 2016-01-12 17:14:09 +13:00
Sebastian Hengst
7ba929967a Backed out changeset a5d2e586777c (bug 1220082) for bustage. r=bustage on CLOSED TREE 2016-03-03 17:19:22 +01:00
Martijn Wargers
153c131077 Bug 1252444 - Rewrite some dom mochitests to use pushPrefEnv instead of setCharPref. r=jmaher 2016-03-03 09:41:14 -05:00
Matt Woodrow
0adea39e2b Bug 1220082 - Assign frame ids to animated images so that they get invalidated correctly. r=seth 2016-01-12 17:14:09 +13:00
Timothy Nikkel
803d464992 Bug 1251403. Determine the correct index of the next frame before getting the next frame. r=edwin
With the addition of the mDoneDecoding check to this code it is now safe to move it before the canDisplay check.
2016-03-02 21:52:36 -06:00
Jonathan Watt
6e065e1657 Bug 763784 - Make VectorImage::GetAnimated check for CSS animations. r=dholbert 2016-02-22 13:05:20 +00:00
Timothy Nikkel
b71974da3a Bug 926048. Part 4. Update the current animation frame time if we hit the end of decoded frames before all frames are decoded. r=edwin
Before the previous patch we would (wrongly) loop through the decoded frames even though we didn't have all of the frames of the animation. This had the beneficial side effect of advancing mCurrentAnimationFrameTime to aTime (the current time). With the previous patch we stop at the last decoded frame and don't advance mCurrentAnimationFrameTime, so it can lag behind. The problem with this is that when we have finished decoding we will then try to catch mCurrentAnimationFrameTime up, and this will jump us to a random point in the animation. So we need to advance mCurrentAnimationFrameTime ourselves.

If we were blocked on network/decoding then displaying the last available decoded frame is the correct frame to be displaying. So we are up to date. So we advance mCurrentAnimationFrameTime to the current time.
2016-03-01 22:34:40 -06:00
Timothy Nikkel
5624a569c7 Bug 926048. Part 3. Correctly check if we are at the end of an animated image. r=edwin
mImage->GetNumFrames() is the current number of decoded frames (that the RasterImage knows about), so it only represents the last frame of the animation if we are done decoding.

If we are not fully decoded, and we are on the last decoded frame, just stay on the last decoded frame. When more frames get decoded (or we determine that we are the last frame of the animation) we will advance.

One might expect that if |nextFrameIndex == mImage->GetNumFrames()| then |GetRawFrame(nextFrameIndex)| would return a null surface. But that is not the case because the decoding thread can insert frames into the surface cache that the RasterImage hasn't acknowledged yet (because it has to do so on the main thread, which we are currently running on).

This is why moving animated images to the surface cache is likely the cause of this bug.

This introduces an issue that is explained in, and fixed by the next patch.
2016-03-01 22:34:40 -06:00
Timothy Nikkel
6929f5ca0d Bug 926048. Part 2. Remove useless GetRawFrame call. r=edwin
|nextFrameIndex| is either |currentFrameIndex + 1| or 0, as can be seen from reading the code above this.

Also fix the whitespace on DoBlend call.
2016-03-01 22:34:39 -06:00
Timothy Nikkel
56eacd06a4 Bug 926048. Part 1. Simplify FrameAnimator::AdvanceFrame slightly. We don't need a |timeout| variable, we only check it once. r=edwin 2016-03-01 22:34:39 -06:00
Mike Taylor
67e3fade30 Bug 1249474. Part 2 - Update tests to handle new default image Accept header value. r=mcmanus 2016-02-29 14:52:12 -06:00
Timothy Nikkel
cf873fd10a Bug 1251091. Add crashtest. 2016-02-29 12:20:50 -06:00
Timothy Nikkel
01f0934130 Bug 1251091. Fix surface key comparison in ImageSurfaceCache::LookupBestMatch. r=dholbert
http://hg.mozilla.org/mozilla-central/rev/411f18fdffeb (bug 1186796) had a mistake in it.

It changed ImageSurfaceCache::LookupBestMatch to use a for loop instead of using a callback to iterate each entry of the hashtable. The callback was called with the surface key of its entry, and it used the name |aSurfaceKey| for that key. ImageSurfaceCache::LookupBestMatch uses the name |aSurfaceKey| for the key we are looking for. So when the code from the callback was moved into the for loop in ImageSurfaceCache::LookupBestMatch the meaning of |aSurfaceKey| changed, but the code was not updated.
2016-02-29 12:20:50 -06:00
Seth Fowler
bd7203ae49 Bug 1251808 - Construct the SourceSurfaceImage with the correct size in RasterImage::GetCurrentImage(). r=seth 2016-02-26 21:01:50 -08:00
Seth Fowler
1276556d86 Bug 1250648 - Clean up the style of for loops in TestStreamingLexer. r=njn 2016-02-26 21:01:49 -08:00
Timothy Nikkel
07274faf88 Bug 1249576. Add crashtest. 2016-02-26 17:14:32 -06:00
Timothy Nikkel
4932973dce Bug 1251742. Avoid overflow in computing area of surface sizes in SurfaceCache. r=dholbert
http://hg.mozilla.org/mozilla-central/rev/9727cdebb2ee (bug 1228314) fixed the first instance of this, but missed the next two for some reason.
2016-02-26 17:13:59 -06:00
Bogdan Postelnicu
91b8c4ed3b Bug 1228314 - added static_cast<int64> in order to avoid overflow. r=seth
MozReview-Commit-ID: KY3qpIlzE5K
2016-01-18 17:23:23 +02:00
Seth Fowler
7b188e94c9 Bug 1246851 (Part 4) - Add a test suite for SurfacePipes and SurfaceFilters. r=njn 2016-02-25 16:21:29 -08:00
Seth Fowler
db19165d58 Bug 1246851 (Part 3) - Add a factory for constructing SurfacePipes. r=njn 2016-02-25 16:21:29 -08:00
Seth Fowler
9ad1f2cd59 Bug 1246851 (Part 2) - Add SurfaceFilter implementations for basic surface output operations. r=njn 2016-02-25 16:21:29 -08:00
Seth Fowler
b7c8493982 Bug 1246851 (Part 1) - Add a new SurfacePipe API for writing to image surfaces in a safe and composable manner. r=njn 2016-02-25 16:21:29 -08:00
Timothy Nikkel
d4dd09b6f4 Bug 1249576 - If the first frame of an APNG doesn't cover the whole image mark the image as transparent. r=edwin
In (non-animated) PNGs the image data is contained in IDAT chunks. In APNGs there are IDAT chunks, which contain the default image, and fDAT chunks, which contain frames of the animation. The default image is sometimes part of the animation (as the first frame), and sometimes not (displayed only by non-APNG aware viewers).

The default image must have the same size as in the PNG header chunk. But the fDAT images can be any (smaller) size. So the first frame of a PNG is allowed to be smaller than the whole image size so long as we are in an APNG and the first frame is from an fDAT chunk, not an IDAT chunk.

We post transparency if we encounter this case because we don't draw into those pixels on at least the first frame.
2016-02-23 20:22:00 +01:00
Timothy Nikkel
ac5b4e6021 Bug 1120141. Don't use surface with alpha for first frames of all pngs. r=edwin
It was a hack, not needed anymore.
2016-02-24 09:56:03 -06:00
Nicholas Nethercote
498dfa5d63 Bug 1249550 (part 2) - Add a test. r=tn. 2016-02-23 10:58:05 +11:00
Nicholas Nethercote
0494c4820e Bug 1249550 (part 1) - Flip BMPs with negative height when downscaling. r=tn. 2016-02-22 13:38:58 +11:00
Mason Chang
bc1757fb85 Bug 1246213 - Skia reftest fuzzing for Skia content on OS X. r=jmuizelaar 2016-02-16 09:07:52 -08:00
Timothy Nikkel
c815fb7027 Bug 1242093 - Fix assertion in Downscaler::ClearRow. r=njn
The starting column can be the last column, and we handle that correctly.

Also split function into ClearRow and ClearRestOfRow.
2016-02-16 08:04:57 +01:00
ISHIKAWA, Chiaki
72d38a6835 Bug 1248252 - Improper outdated octal constant syntax in M-C tree. Use '0o' prefix. r=dao
Be warned. Do not attemp to change the .js "test" source code in ./js
They are meant to check

 - the outdated 0666 octal constant is still parsed correctly,
 - the outdated 0666 octal constant raises syntax error flag
   in strict mode, etc.

So leave them alone.
2016-02-15 08:57:00 +01:00
Timothy Nikkel
5d08b6b3a7 Bug 1240629. Add reftest. 2016-02-12 16:58:34 -06:00
Timothy Nikkel
02307afbff Bug 1240629. Don't buffer image file data that we are never going to look at in the gap between the header and the pixel data for BMP files. r=njn
The length of the gap is computed from the BMP file header, so in a malformed BMP we could needlessly make our input file buffer huge for no reason.
2016-02-12 16:58:34 -06:00
Aidin Gharibnavaz
e084f12c9a Bug 1164581 - Adding an overload for NS_ProxyRelease that accepts already_AddRefed, and removing all the others. r=bobbyholley 2016-02-10 08:23:00 +01:00
Nicholas Nethercote
5795435fb8 Bug 1238558 (part 2) - Add a test. r=tnikkel. 2016-02-10 09:55:37 +11:00
Nicholas Nethercote
506abe122b Bug 1238558 (part 1) - Add Decoder::BeforeFinishInternal(). r=tnikkel. 2016-01-27 16:15:06 -08:00
Carsten "Tomcat" Book
ab60132384 Backed out changeset c18e29c1b369 (bug 1164581) for cpp unit tests test failures 2016-02-08 11:17:38 +01:00
Aidin Gharibnavaz
238dcd01fc Bug 1164581 - Adding an overload for NS_ProxyRelease that accepts already_AddRefed, and removing all the others. r=bobbyholley 2016-02-07 10:56:00 +01:00
Birunthan Mohanathas
9bed3781f9 Bug 1235261 - Part 1: Rename nsAutoTArray to AutoTArray. r=froydnj 2016-02-02 17:36:30 +02:00
Phil Ringnalda
863943dfb7 Back out 7 changesets (bug 1235261) for cpptest failures in TestTArray
CLOSED TREE

Backed out changeset d66c3f19a210 (bug 1235261)
Backed out changeset 467d945426bb (bug 1235261)
Backed out changeset 32b61df13142 (bug 1235261)
Backed out changeset c50bb8ed4196 (bug 1235261)
Backed out changeset 0ff0fa6fe81f (bug 1235261)
Backed out changeset df70e89669da (bug 1235261)
Backed out changeset 064969357fc9 (bug 1235261)
2016-01-31 10:10:57 -08:00
Birunthan Mohanathas
f94b4ff6a2 Bug 1235261 - Part 1: Rename nsAutoTArray to AutoTArray. r=froydnj 2016-01-31 17:12:12 +02:00
Timothy Nikkel
2679542a37 Bug 1224979. Check if we compute usable filters for the downscaler, and if not put the downscaler in error state so it's not used. r=edwin 2016-01-28 17:30:01 -06:00
Chris Peterson
346a4bf91c Bug 1235297 - Annotate intentional switch fallthroughs to suppress -Wimplicit-fallthrough warnings in image/decoders/. r=tn
image/FrameAnimator.cpp:442:5: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
image/FrameAnimator.cpp:576:7: warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]

image/decoders/nsGIFDecoder2.cpp:1110:5 [-Wimplicit-fallthrough] unannotated fall-through between switch labels

image/decoders/nsJPEGDecoder.cpp:418:3 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
image/decoders/nsJPEGDecoder.cpp:444:3 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
image/decoders/nsJPEGDecoder.cpp:465:3 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
image/decoders/nsJPEGDecoder.cpp:537:3 [-Wimplicit-fallthrough] unannotated fall-through between switch labels
2015-12-24 23:50:32 -07:00
Timothy Nikkel
37f2843999 Bug 1241729. Add crashtest. 2016-01-27 16:19:34 -06:00