gecko/image
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
..
build 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
decoders Bug 1246851 (Part 4) - Add a test suite for SurfacePipes and SurfaceFilters. r=njn 2016-02-25 16:21:29 -08:00
encoders Bug 1219474 - Replace PRLogModuleInfo w/ LazyLogModule in the 'image/' directory. r=seth 2015-11-16 18:21:00 +01:00
test Bug 1249474. Part 2 - Update tests to handle new default image Accept header value. r=mcmanus 2016-02-29 14:52:12 -06:00
BMPHeaders.h Bug 1215334 (part 2) - Avoid creating a fake header for BMP files in ICO files. r=seth. 2015-10-15 15:43:31 -07:00
ClippedImage.cpp Bug 1215763 - part 2 - s/nsAutoPtr/UniquePtr/ in image/; r=seth 2015-10-17 06:53:28 -04:00
ClippedImage.h Bug 1215763 - part 2 - s/nsAutoPtr/UniquePtr/ in image/; r=seth 2015-10-17 06:53:28 -04:00
CopyOnWrite.h Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
DecodePool.cpp Bug 1219501. Limit total number of image decoding threads to 32 regardless of number asked for. r=seth 2015-11-01 11:45:40 -06:00
DecodePool.h Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
Decoder.cpp 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
Decoder.h 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
DecoderFactory.cpp Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
DecoderFactory.h Bug 1118926 (Part 1) - Remove remnants of -moz-resolution in C++ code. r=tn 2015-09-30 17:00:52 -07:00
DecoderFlags.h
Deinterlacer.cpp Bug 1235605 - Use CheckedInt in Deinterlacer and make its buffer allocation fallible. r=tn 2015-12-30 17:03:24 -05:00
Deinterlacer.h Bug 1235605 - Use CheckedInt in Deinterlacer and make its buffer allocation fallible. r=tn 2015-12-30 17:03:24 -05:00
Downscaler.cpp Bug 1242093 - Fix assertion in Downscaler::ClearRow. r=njn 2016-02-16 08:04:57 +01:00
Downscaler.h Bug 1242093 - Fix assertion in Downscaler::ClearRow. r=njn 2016-02-16 08:04:57 +01:00
DownscalingFilter.h Bug 1246851 (Part 2) - Add SurfaceFilter implementations for basic surface output operations. r=njn 2016-02-25 16:21:29 -08:00
DrawResult.h Bug 1209715 - Add operator overloads for combining DrawResults. r=tn 2015-10-13 23:21:39 -07:00
DynamicImage.cpp Bug 1207355 (Part 8) - Remove imgIContainer::RequestDecode() and imgIRequest::RequestDecode(). r=tn 2015-10-29 16:37:42 -07:00
DynamicImage.h Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
FrameAnimator.cpp Bug 926048. Part 3. Correctly check if we are at the end of an animated image. r=edwin 2016-03-01 22:34:40 -06:00
FrameAnimator.h Bug 1242778: Add MOZ_COUNT_CTOR & MOZ_COUNT_DTOR calls to track leaks of imagelib's FrameAnimator class. r=tn 2016-01-26 11:08:26 -08:00
FrozenImage.cpp Bug 1211324 (part 5) - Remove GraphicsFilter and gfxGraphicsFilter. r=mattwoodrow. 2015-10-05 17:18:10 -07:00
FrozenImage.h Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
ICOFileHeaders.h
Image.cpp Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
Image.h Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
ImageCacheKey.cpp Bug 1202085 - Part 4: Add an ID for controlled document to the image cache key; r=seth 2015-10-30 16:03:11 -04:00
ImageCacheKey.h Bug 1202085 - Part 6: Clear the entries in the image cache belonging to a controlled document when it gets destroyed; r=seth 2015-10-30 16:03:13 -04:00
ImageFactory.cpp Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
ImageFactory.h
ImageLogging.h Bug 1219474 - Replace PRLogModuleInfo w/ LazyLogModule in the 'image/' directory. r=seth 2015-11-16 18:21:00 +01:00
ImageMetadata.h
ImageOps.cpp Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
ImageOps.h
ImageRegion.h Bug 1221840. Support repeating images in 1 axis. r=seth 2015-11-23 08:17:35 -08:00
ImageURL.h
ImageWrapper.cpp Bug 1207355 (Part 8) - Remove imgIContainer::RequestDecode() and imgIRequest::RequestDecode(). r=tn 2015-10-29 16:37:42 -07:00
ImageWrapper.h Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
imgFrame.cpp Bug 1221840. Support repeating images in 1 axis. r=seth 2015-11-23 08:17:35 -08:00
imgFrame.h Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
imgICache.idl Bug 1202085 - Part 6: Clear the entries in the image cache belonging to a controlled document when it gets destroyed; r=seth 2015-10-30 16:03:13 -04:00
imgIContainer.idl Bug 1207355 (Part 8) - Remove imgIContainer::RequestDecode() and imgIRequest::RequestDecode(). r=tn 2015-10-29 16:37:42 -07:00
imgIContainerDebug.idl
imgIEncoder.idl
imgILoader.idl
imgINotificationObserver.idl
imgIOnloadBlocker.idl
imgIRequest.idl Bug 1207355 (Part 8) - Remove imgIContainer::RequestDecode() and imgIRequest::RequestDecode(). r=tn 2015-10-29 16:37:42 -07:00
imgIScriptedNotificationObserver.idl
imgITools.idl
imgLoader.cpp Bug 1235261 - Part 1: Rename nsAutoTArray to AutoTArray. r=froydnj 2016-02-02 17:36:30 +02:00
imgLoader.h Bug 1215763 - part 2 - s/nsAutoPtr/UniquePtr/ in image/; r=seth 2015-10-17 06:53:28 -04:00
imgRequest.cpp Bug 1219474 - Replace PRLogModuleInfo w/ LazyLogModule in the 'image/' directory. r=seth 2015-11-16 18:21:00 +01:00
imgRequest.h Bug 1207355 (Part 8) - Remove imgIContainer::RequestDecode() and imgIRequest::RequestDecode(). r=tn 2015-10-29 16:37:42 -07:00
imgRequestProxy.cpp Bug 1219474 - Replace PRLogModuleInfo w/ LazyLogModule in the 'image/' directory. r=seth 2015-11-16 18:21:00 +01:00
imgRequestProxy.h Bug 1215763 - part 2 - s/nsAutoPtr/UniquePtr/ in image/; r=seth 2015-10-17 06:53:28 -04:00
imgTools.cpp Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
imgTools.h
IProgressObserver.h
LookupResult.h
moz.build 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
MultipartImage.cpp Bug 1207355 (Part 5) - Request decodes intelligently in MultipartImage. r=tn 2015-10-29 16:37:42 -07:00
MultipartImage.h Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
nsIIconURI.idl
Orientation.h
OrientedImage.cpp Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
OrientedImage.h Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
ProgressTracker.cpp Bug 1219474 - Replace PRLogModuleInfo w/ LazyLogModule in the 'image/' directory. r=seth 2015-11-16 18:21:00 +01:00
ProgressTracker.h Bug 1214054 - Don't fire DECODE_COMPLETE in VectorImage::OnSVGDocumentError(). r=dholbert 2015-10-22 23:29:38 -07:00
RasterImage.cpp Bug 1251808 - Construct the SourceSurfaceImage with the correct size in RasterImage::GetCurrentImage(). r=seth 2016-02-26 21:01:50 -08:00
RasterImage.h Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00
ScriptedNotificationObserver.cpp
ScriptedNotificationObserver.h
ShutdownTracker.cpp Bug 1215763 - part 1 - remove unnecessary nsAutoPtr.h includes; r=seth 2015-10-17 06:52:21 -04:00
ShutdownTracker.h
SourceBuffer.cpp
SourceBuffer.h Bug 1218823 - use UniquePtr<> in preference to delete[] in image/; r=seth 2015-10-27 10:47:51 -04:00
StreamingLexer.h Bug 1237201 part 3 - Handle Vector OOM in StreamingLexer. r=njn 2016-01-14 15:19:21 +01:00
SurfaceCache.cpp Bug 1251091. Fix surface key comparison in ImageSurfaceCache::LookupBestMatch. r=dholbert 2016-02-29 12:20:50 -06:00
SurfaceCache.h Bug 1251742. Avoid overflow in computing area of surface sizes in SurfaceCache. r=dholbert 2016-02-26 17:13:59 -06:00
SurfaceFilters.h Bug 1246851 (Part 2) - Add SurfaceFilter implementations for basic surface output operations. r=njn 2016-02-25 16:21:29 -08:00
SurfaceFlags.h Bug 1195878 - If we detect animation during a full decode, drop the results of the full decode on the floor. r=tn 2015-09-23 16:53:40 -07:00
SurfacePipe.cpp 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
SurfacePipe.h 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
SurfacePipeFactory.h Bug 1246851 (Part 3) - Add a factory for constructing SurfacePipes. r=njn 2016-02-25 16:21:29 -08:00
SVGDocumentWrapper.cpp Bug 1217320 - Remove more XPIDL signature comments in .cpp files. r=froydnj 2015-10-27 06:54:25 +02:00
SVGDocumentWrapper.h
VectorImage.cpp Bug 1207355 (Part 8) - Remove imgIContainer::RequestDecode() and imgIRequest::RequestDecode(). r=tn 2015-10-29 16:37:42 -07:00
VectorImage.h Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat 2015-10-18 01:24:48 -04:00