gecko-dev/image
Timothy Nikkel 9ba87d3afb Bug 1321946. Adjust asserts about the progress of an image to deal with how multipart images are handled. r=aosmond
For multipart images we create a MultipartImage which contains each part. Each part in turn is a VectorImage or RasterImage. The MultipartImage and each part image all have their own ProgressTracker. The ProgressTracker for the MultipartImage observes the notifications of each part image via the IProgressObserver interface. This interfaces notably has no way to notify about an image error. So when a part image has an error it never gets propagated to the MultipartImage's ProgressTracker. This confuses our assertions about consistency of progress notifications. In this case we expect that when we get the load complete notification then we either have the size of the image or we encountered an error. So if the first part of a multipart image is broken and we are unable to get a size from it we will trigger this assertion.

There are two ways to fix this. One would be to propagate errors to the MultipartImage's ProgressTracker. This would put the ProgressTracker for the MultipartImage permanently into error state and prevent showing the images from the remaining parts if one part image had an error.

So in this patch I create a way to tell a ProgressTracker that is is for a multipart image, and use that to relax the assertions. As far as I can tell our code should be able to handle "ignoring" an error in a bad part image.

Addtionaly there is a way that an error flag can get propagated to the MultipartImage's tracker: in MultipartImage::FinishTransition we get the progress directly from the part image and notify for it. This seems like an oversight as the comment at

https://dxr.mozilla.org/mozilla-central/rev/bfa85d23df57c8a1db17c99b267667becc1c4afd/image/imgRequest.cpp#989

indicates that we don't want one bad part to prevent later parts from displaying. So we add the error flag to the ones we filter out when we propagate progress.
2016-12-03 16:07:10 -06:00
..
build Bug 1160200 - APNG can't be used with type switching. r=mcaceres, r=jrmuizel, r=johns 2016-08-09 22:15:00 +02:00
decoders Bug 1315863 - Use PNG_MAXIMUM_INFLATE_WINDOW to ensure maximum compatibility with existing images. r=glennrp 2016-11-16 15:21:33 -05:00
encoders Bug 1286877 - do not set c-basic-offset for python-mode; r=gps 2016-07-14 10:16:42 -06:00
test Bug 1321220 - Remove legacy generator from image/. r=aosmond 2016-12-01 18:12:14 +09:00
AnimationSurfaceProvider.cpp Bug 1296828 (Part 3) - Update SurfaceCache API to rely on ImageKeys and SurfaceKeys stored on ISurfaceProviders. r=dholbert 2016-08-26 17:03:19 -07:00
AnimationSurfaceProvider.h Bug 1296828 (Part 2) - Store ImageKeys and SurfaceKeys directly on ISurfaceProviders. r=dholbert,edwin 2016-08-26 17:03:17 -07:00
BMPHeaders.h
ClippedImage.cpp Bug 1284837 - Disallow implicit conversions from float to integer when creating IntPoint and IntSize objects. r=botond 2016-07-26 16:48:30 +02:00
ClippedImage.h Bug 1277862, part 3 - Rename Moz2D's Filter to SamplingFilter in the rest of the tree. r=Bas 2016-05-25 17:01:18 +01:00
CopyOnWrite.h
DecodedSurfaceProvider.cpp Bug 1296828 (Part 3) - Update SurfaceCache API to rely on ImageKeys and SurfaceKeys stored on ISurfaceProviders. r=dholbert 2016-08-26 17:03:19 -07:00
DecodedSurfaceProvider.h Bug 1296828 (Part 2) - Store ImageKeys and SurfaceKeys directly on ISurfaceProviders. r=dholbert,edwin 2016-08-26 17:03:17 -07:00
DecodePool.cpp Bug 1320256 - use PR_GetThreadName as the register name in profiler. r=cyu 2016-11-29 19:00:04 +08:00
DecodePool.h Bug 1282259 - Run IDecodingTasks instead of Decoders directly in image::DecodePool. r=dholbert 2016-06-29 13:46:27 -07:00
Decoder.cpp Bug 1258741 - Part 2. Ensure we consistently render partially decoded images. r=tnikkel 2016-09-26 14:18:37 -04:00
Decoder.h Bug 1311246 - Remove support for the -moz-samplesize media fragment; r=jrmuizel 2016-11-16 08:18:56 -05:00
DecoderFactory.cpp Bug 1311246 - Remove support for the -moz-samplesize media fragment; r=jrmuizel 2016-11-16 08:18:56 -05:00
DecoderFactory.h Bug 1311246 - Remove support for the -moz-samplesize media fragment; r=jrmuizel 2016-11-16 08:18:56 -05:00
DecoderFlags.h
Downscaler.cpp Bug 1282670, part 1: Add missing #include & "using" declarations in imagelib. r=seth 2016-06-30 10:24:27 -07:00
Downscaler.h Bug 1282670, part 1: Add missing #include & "using" declarations in imagelib. r=seth 2016-06-30 10:24:27 -07:00
DownscalingFilter.h Bug 1282670, part 2: Remove unnecessary/redundant string-related #include & "using" declarations in imagelib. r=seth 2016-06-30 10:25:35 -07:00
DrawResult.h Bug 1267550 (part 1) - Rename MOZ_MUST_USE as MOZ_MUST_USE_TYPE. r=ehsan. 2016-04-27 08:22:10 +10:00
DynamicImage.cpp Bug 1317562. Allow flags to be passed to StartDecoding for the sole purpose of allowing async notifications to be requested. r=aosmond 2016-11-26 01:56:26 -06:00
DynamicImage.h
FrameAnimator.cpp Bug 1317907. Refactor FrameAnimator::GetCompositedFrame to be a bit simpler. r=aosmond 2016-11-29 01:01:43 -06:00
FrameAnimator.h Bug 1317907. Refactor FrameAnimator::GetCompositedFrame to be a bit simpler. r=aosmond 2016-11-29 01:01:43 -06:00
FrozenImage.cpp Bug 1282670, part 1: Add missing #include & "using" declarations in imagelib. r=seth 2016-06-30 10:24:27 -07:00
FrozenImage.h Bug 1277862, part 3 - Rename Moz2D's Filter to SamplingFilter in the rest of the tree. r=Bas 2016-05-25 17:01:18 +01:00
ICOFileHeaders.h
IDecodingTask.cpp Bug 1293472 (Part 3) - Store animated images in the surface cache as a sequence of frames, rather than each frame getting its own cache entry. r=dholbert,edwin,njn 2016-08-18 15:42:48 -07:00
IDecodingTask.h Bug 1293472 (Part 3) - Store animated images in the surface cache as a sequence of frames, rather than each frame getting its own cache entry. r=dholbert,edwin,njn 2016-08-18 15:42:48 -07:00
Image.cpp Bug 1317552. Send unlocked draw notifications for images async when asked to. r=aosmond 2016-11-17 00:25:53 -06:00
Image.h Bug 1317552. Send unlocked draw notifications for images async when asked to. r=aosmond 2016-11-17 00:25:53 -06:00
ImageCacheKey.cpp Bug 1321261 - create dom/file for File APIs, r=qdot 2016-12-01 15:12:42 +01:00
ImageCacheKey.h Bug 1297300 - Add missing checks to GetSpec() calls in image/. r=tnikkel. 2016-08-29 15:34:32 +10:00
ImageFactory.cpp Bug 1311246 - Remove support for the -moz-samplesize media fragment; r=jrmuizel 2016-11-16 08:18:56 -05:00
ImageFactory.h
ImageLogging.h Bug 1282670, part 2: Remove unnecessary/redundant string-related #include & "using" declarations in imagelib. r=seth 2016-06-30 10:25:35 -07:00
ImageMetadata.h (No bug) - Fix a trivial formatting issue in ImageMetadata.h. r=me 2016-07-21 16:42:29 -07:00
ImageOps.cpp Bug 1296147 (Part 2) - Rename imgFrame::GetSurface() to imgFrame::GetSourceSurface() for clarity. r=edwin 2016-08-18 13:03:49 -07:00
ImageOps.h
ImageRegion.h
ImageURL.h Bug 1299498 - Keep a main thread only pointer to the underlying nsIURI for ImageURL. r=tnikkel 2016-11-28 08:40:42 -05:00
ImageWrapper.cpp Bug 1317562. Allow flags to be passed to StartDecoding for the sole purpose of allowing async notifications to be requested. r=aosmond 2016-11-26 01:56:26 -06:00
ImageWrapper.h
imgFrame.cpp Bug 1311779 - Part 2. Add telemetry to track optimizable opaque images decoded into B8G8R8A8 surfaces. r=tnikkel 2016-10-19 12:34:30 -04:00
imgFrame.h Bug 1296657: Attempt to create an mOptSurface of the correct type for the DT we're drawing to. r=tnikkel 2016-09-15 13:53:12 +02:00
imgICache.idl Bug 1297300 - Add missing checks to GetSpec() calls in image/. r=tnikkel. 2016-08-29 15:34:32 +10:00
imgIContainer.idl Bug 1317562. Allow flags to be passed to StartDecoding for the sole purpose of allowing async notifications to be requested. r=aosmond 2016-11-26 01:56:26 -06:00
imgIContainerDebug.idl
imgIEncoder.idl
imgILoader.idl
imgINotificationObserver.idl
imgIOnloadBlocker.idl
imgIRequest.idl Bug 1317562. Allow flags to be passed to StartDecoding for the sole purpose of allowing async notifications to be requested. r=aosmond 2016-11-26 01:56:26 -06:00
imgIScriptedNotificationObserver.idl
imgITools.idl
imgLoader.cpp Bug 1318000 - Use C++11's override and remove virtual where applicable in image/. r=jrmuizel 2016-11-16 17:41:47 +02:00
imgLoader.h Bug 1275464 - Part 1. Unregister from handling image memory reports when shutting down. r=njn 2016-09-19 13:29:59 -04:00
imgRequest.cpp Bug 1321946. Adjust asserts about the progress of an image to deal with how multipart images are handled. r=aosmond 2016-12-03 16:07:10 -06:00
imgRequest.h Bug 1297300 - Add missing checks to GetSpec() calls in image/. r=tnikkel. 2016-08-29 15:34:32 +10:00
imgRequestProxy.cpp Bug 1317562. Allow flags to be passed to StartDecoding for the sole purpose of allowing async notifications to be requested. r=aosmond 2016-11-26 01:56:26 -06:00
imgRequestProxy.h Bug 1265927: Move nsRunnable to mozilla::Runnable, CancelableRunnable to mozilla::CancelableRunnable. r=froydnj 2016-04-25 17:23:21 -07:00
imgTools.cpp
imgTools.h
IProgressObserver.h
ISurfaceProvider.h Bug 1296828 (Part 3) - Update SurfaceCache API to rely on ImageKeys and SurfaceKeys stored on ISurfaceProviders. r=dholbert 2016-08-26 17:03:19 -07:00
LookupResult.h Bug 1296147 (Part 1) - Add a DrawableSurface smart pointer type to allow lazy surface generation. r=dholbert,edwin 2016-08-18 13:03:44 -07:00
moz.build Bug 1293472 (Part 2) - Add AnimationSurfaceProvider. r=dholbert,edwin 2016-08-18 15:39:43 -07:00
MultipartImage.cpp Bug 1321946. Adjust asserts about the progress of an image to deal with how multipart images are handled. r=aosmond 2016-12-03 16:07:10 -06:00
MultipartImage.h
nsIIconURI.idl
Orientation.h
OrientedImage.cpp Bug 1284837 - Disallow implicit conversions from float to integer when creating. r=botond 2016-09-16 17:49:39 +02:00
OrientedImage.h Bug 1277862, part 3 - Rename Moz2D's Filter to SamplingFilter in the rest of the tree. r=Bas 2016-05-25 17:01:18 +01:00
PlaybackType.h Bug 1293472 (Part 3) - Store animated images in the surface cache as a sequence of frames, rather than each frame getting its own cache entry. r=dholbert,edwin,njn 2016-08-18 15:42:48 -07:00
ProgressTracker.cpp Bug 1321946. Adjust asserts about the progress of an image to deal with how multipart images are handled. r=aosmond 2016-12-03 16:07:10 -06:00
ProgressTracker.h Bug 1321946. Adjust asserts about the progress of an image to deal with how multipart images are handled. r=aosmond 2016-12-03 16:07:10 -06:00
RasterImage.cpp Bug 1317837. RasterImage::RequestDecodeForSize should set mWantFullDecode just like StartDecoding if we don't have our size yet. r=aosmond 2016-12-01 15:52:06 -06:00
RasterImage.h Bug 1311246 - Remove support for the -moz-samplesize media fragment; r=jrmuizel 2016-11-16 08:18:56 -05:00
ScriptedNotificationObserver.cpp
ScriptedNotificationObserver.h
ShutdownTracker.cpp Bug 1256981 - Make ShutdownTracker observe xpcom-will-shutdown instead of xpcom-shutdown. r=dholbert 2016-06-26 13:30:37 -07:00
ShutdownTracker.h Bug 1256981 - Make ShutdownTracker observe xpcom-will-shutdown instead of xpcom-shutdown. r=dholbert 2016-06-26 13:30:37 -07:00
SourceBuffer.cpp Bug 1284117 - Make RasterImage and SourceBuffer handle input stream read errors. r=edwin 2016-10-13 10:09:35 -04:00
SourceBuffer.h Bug 1292632 part 3: Include <algorithm> in image/SourceBuffer.h, to provide std::min. r=seth 2016-08-05 17:09:48 -07:00
StreamingLexer.h Bug 1287367 - Allow users of StreamingLexer to detect and handle truncation. r=njn 2016-07-18 23:41:20 -07:00
SurfaceCache.cpp Bug 1298551 - Respect CachedSurface::SetLocked() even if the underlying ISurfaceProvider is always locked. r=dholbert 2016-08-26 17:03:25 -07:00
SurfaceCache.h Bug 1296828 (Part 3) - Update SurfaceCache API to rely on ImageKeys and SurfaceKeys stored on ISurfaceProviders. r=dholbert 2016-08-26 17:03:19 -07:00
SurfaceCacheUtils.cpp Bug 1293449 - Stop exposing SurfaceCache implementation code outside of ImageLib. r=dholbert 2016-08-15 18:19:39 -07:00
SurfaceCacheUtils.h Bug 1293449 - Stop exposing SurfaceCache implementation code outside of ImageLib. r=dholbert 2016-08-15 18:19:39 -07:00
SurfaceFilters.h Bug 1255107 (Part 2) - Add a SurfaceFilter for bilinear interpolation for ADAM7 interlaced images. f=glennrp,r=njn 2016-06-25 14:04:03 -07:00
SurfaceFlags.h
SurfacePipe.cpp Bug 1262338 (Part 1) - Ensure that SurfaceFilter always knows when AdvanceRow() is called. r=njn 2016-05-25 22:48:29 -07:00
SurfacePipe.h Bug 1297276 - Rename mfbt/unused.h to mfbt/Unused.h for consistency. r=froydnj 2016-08-24 14:47:04 +08:00
SurfacePipeFactory.h Bug 1255107 (Part 2) - Add a SurfaceFilter for bilinear interpolation for ADAM7 interlaced images. f=glennrp,r=njn 2016-06-25 14:04:03 -07:00
SVGDocumentWrapper.cpp Bug 1307242 - Add a non-blank paint telemetry probe for foreground root content documents. r=bkelly, f=bsmedberg 2016-11-10 14:26:54 -05:00
SVGDocumentWrapper.h
VectorImage.cpp Bug 1317562. Allow flags to be passed to StartDecoding for the sole purpose of allowing async notifications to be requested. r=aosmond 2016-11-26 01:56:26 -06:00
VectorImage.h Bug 1296657: Attempt to create an mOptSurface of the correct type for the DT we're drawing to. r=tnikkel 2016-09-15 13:53:12 +02:00