Commit Graph

2071 Commits

Author SHA1 Message Date
Seth Fowler
603db7a389 Bug 1209780 (Part 1) - Mark DrawResult MOZ_MUST_USE. r=tn 2015-10-25 13:20:13 -07:00
Timothy Nikkel
5afe8e5453 Bug 1257101. imgFrame::IsImageComplete says whether we've had pixels decoded to the whole image rect, but it's used to check if the frame is finished decoding. These are different things when the image has more than one progress pass. r=seth
This means that in RasterImage::LookupFrame when we are asked to do a sync decode (if needed) we use WaitUntilComplete to wait until the frame is finished decoding.  But we would actually return after the next progressive pass notified the monitor to wake up. Thus, we would draw a not-fully-decoded image even though the sync decode flag was passed.

The change in FrameAnimator means that we won't draw the next frame in an animated image until all progressive passes of that image are complete. This seems like what we want anyways.

There is one real use of IsImageComplete left, in imgFrame::Draw, where we need to know if the decoded image data covers the whole image frame. (There are a couple of uses of IsImageComplete in asserts.)
2016-03-23 19:31:42 -05:00
Timothy Nikkel
28d73a34c5 Backed out changeset bc854d1c6ab7 (bug 1209780) for statis analysis failures on OS X. 2016-03-21 16:29:15 -05:00
Timothy Nikkel
417ecff3c2 Bug 1210745. Change image progress asserts to allow transparency to be posted after the size is posted. r=seth
The PNG decoder posts the size almost immediately, and later posts transparency (even for non-animated images).

It would be nice to still assert what this assert is intending (that transparency of non-animated images is posted during the metadata decode) but we don't have any easy way of telling when a metadata finishes here.
2016-03-21 16:15:20 -05:00
Seth Fowler
3822e4c6c4 Bug 1210745 - Update CheckProgressConsistency() to match current ImageLib behavior. r=tn 2016-02-25 13:12:58 -06:00
Timothy Nikkel
393d0a8b07 Bug 1225934. Better describe the effect of the flag FLAG_HIGH_QUALITY_SCALING. Comment only change. 2016-03-21 16:15:20 -05:00
Seth Fowler
8b46f4d5f2 Bug 1209780 (Part 1) - Mark DrawResult MOZ_MUST_USE. r=tn 2015-10-25 13:20:13 -07:00
Geoff Brown
f8b671c940 Bug 1251013 - Update AndroidVersion annotations in test manifests - xpcshell; r=jmaher 2016-03-17 10:00:50 -06:00
Geoff Brown
29977660c0 Bug 1251013 - Update android_version annotations in test manifests - mochitest; r=jmaher 2016-03-17 10:00:48 -06:00
Mike Hommey
0a771514a8 Bug 1256988 - Replace tests on MOZ_WIDGET_GTK with tests on MOZ_WIDGET_TOOLKIT containing gtk. r=chmanchester
But only do that for the AC_SUBST. The AC_DEFINE is still useful.
2016-03-17 06:49:44 +09:00
Timothy Nikkel
cc2e20ef2c Bug 1255675. Add very basic reftests that test our downscale during decode code for every image format we support.
Some fuzz is necessary of course, but these tests catch this bug, so they should be successful in ensuring basically functionality isn't regressed.
2016-03-16 14:10:31 -05:00
Edwin Flores
0d5d29eb98 Bug 1234077 - Test that GIFs are still drawn correctly when their frame rects are truncated - r=seth 2016-03-15 10:31:31 +00:00
Sebastian Hengst
17ed0683ac Backed out changeset e7b960c2c8e9 (bug 1234077) for reftest failures. r=backout 2016-03-14 21:08:53 +01:00
Timothy Nikkel
ce9ddc5a29 Bug 1255675. SurfacePipe handles removing the frame rect, so pass the frame rect directly.
This is left over from the pre-SurfacePipe code that interacted directly with the Downscaler. It was calculating the size of the surface for the Downscaler to use, and then the Downscaler would handle putting transparent pixels inside that surface (and outside the framerect).

--HG--
extra : rebase_source : aad384fa8589f291254f0a18537a5d6674487182
2016-03-13 15:56:00 -07:00
Edwin Flores
3a94cf4328 Bug 1234077 - Test that GIFs are still drawn correctly when their frame rects are truncated - r=seth 2016-03-14 18:26:38 +00:00
Bogdan Postelnicu
c9c042d934 Bug 1230907 - mPixelRowSize added to constructor with 0 value. r=seth 2016-03-14 10:36:36 +02:00
Seth Fowler
c987885db6 Bug 1255104 - Use SurfacePipe in nsIconDecoder. r=njn 2016-03-10 18:45:29 -08:00
Seth Fowler
3978c77cb6 Bug 1247152 (Part 2) - Remove even more code from the GIF decoder. r=edwin 2016-03-09 15:39:02 -08:00
Seth Fowler
875464424a Bug 1247152 (Part 1) - Use SurfacePipe in the GIF decoder. r=njn 2016-03-09 15:39:02 -08:00
CJKu
1c893a0ddf Bug 619500: Part 4. Remove one unused data member in SVGDrawingParameters; r=dholbert
MozReview-Commit-ID: EN3HVuwTm7y
2016-03-08 15:54:14 +08:00
CJKu
d57efebb5f Bug 619500: Part 2. When drawing an SVG image as a CSS border-image, use preverveAspectRatio="none"; r=dholbert
MozReview-Commit-ID: JH5E3An4opJ
2016-03-08 15:54:13 +08:00
CJKu
19414f3998 Bug 619500: Part 1. Default sizing for specified size of SVG images which have no constraints; r=dholbert r=seth
MozReview-Commit-ID: 8DI86w6Ni8T
2016-03-08 15:54:13 +08:00
Seth Fowler
b935d483a8 Bug 1225934 - Never allow surface substitution when FLAG_HIGH_QUALITY_SCALING is disabled. r=tn 2016-03-07 17:17:16 -08:00
Seth Fowler
5a675c9ccb Bug 1251806 - In RasterImage::GetFrameInternal(), check if the frame covers the actual surface size rather than the requested surface size. r=tn 2016-03-07 17:17:16 -08:00
Seth Fowler
6451b96c1d Bug 1251807 - Use the surface's size, not the intrinsic size, in CopyFrame. r=tn 2016-03-07 17:15:25 -08:00
Timothy Nikkel
c2cd155669 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
931f4f6e1d 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
01190b0b2c 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
4dcfda62de 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
1e69d4c08b Backed out changeset a5d2e586777c (bug 1220082) for bustage. r=bustage on CLOSED TREE 2016-03-03 17:19:22 +01:00
Martijn Wargers
5c4ab36d15 Bug 1252444 - Rewrite some dom mochitests to use pushPrefEnv instead of setCharPref. r=jmaher
--HG--
extra : rebase_source : 7b61270760aa225f8c087ea190aaeb49670ca900
2016-03-03 09:41:14 -05:00
Matt Woodrow
6350413d1b 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
0676b70928 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
1c0c9bcf8a Bug 763784 - Make VectorImage::GetAnimated check for CSS animations. r=dholbert 2016-02-22 13:05:20 +00:00
Timothy Nikkel
fbd3ebdb6d 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
9199efb919 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
4bad8c1f9e 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
57a929ef04 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
bdd8f0ca83 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
183fc6e22a Bug 1251091. Add crashtest. 2016-02-29 12:20:50 -06:00
Timothy Nikkel
567c526765 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
0b454da72c Bug 1251808 - Construct the SourceSurfaceImage with the correct size in RasterImage::GetCurrentImage(). r=seth 2016-02-26 21:01:50 -08:00
Seth Fowler
09c97b5b63 Bug 1250648 - Clean up the style of for loops in TestStreamingLexer. r=njn 2016-02-26 21:01:49 -08:00
Timothy Nikkel
d885673df5 Bug 1249576. Add crashtest. 2016-02-26 17:14:32 -06:00
Timothy Nikkel
91dcacc8f5 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
3627cdff1f Bug 1228314 - added static_cast<int64> in order to avoid overflow. r=seth
MozReview-Commit-ID: KY3qpIlzE5K

--HG--
extra : rebase_source : a716abcb496c9923318f58d21250b6c13182add0
2016-01-18 17:23:23 +02:00
Seth Fowler
618f960cdd Bug 1246851 (Part 4) - Add a test suite for SurfacePipes and SurfaceFilters. r=njn 2016-02-25 16:21:29 -08:00
Seth Fowler
d58e9fda35 Bug 1246851 (Part 3) - Add a factory for constructing SurfacePipes. r=njn 2016-02-25 16:21:29 -08:00
Seth Fowler
c116948476 Bug 1246851 (Part 2) - Add SurfaceFilter implementations for basic surface output operations. r=njn 2016-02-25 16:21:29 -08:00
Seth Fowler
b1ec50b23f 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