Граф коммитов

40 Коммитов

Автор SHA1 Сообщение Дата
Andrew Osmond 1d4866a48f Bug 1120279 - Always check if the next frame is available before advancing an animation. 2016-09-21 12:55:26 -04:00
Seth Fowler 1f92f3a7b9 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
Seth Fowler 8d183cc877 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
Timothy Nikkel d7a0b010ae Backed out changeset 37340346a89e (Bug 1289628 - Return ISurfaceProvider objects from SurfaceCache lookup functions. r=dholbert,edwin) for causing bug 1292290. 2016-08-15 19:58:35 -05:00
Seth Fowler 97b4a5d8c7 Bug 1289957 (Part 2) - Notify RasterImage about new frames in NotifyProgress() and remove OnAddedFrame(). r=edwin 2016-07-28 00:12:50 -07:00
Seth Fowler 77c1dbccdb Bug 1289628 - Return ISurfaceProvider objects from SurfaceCache lookup functions. r=dholbert,edwin 2016-07-27 13:54:23 -07:00
Seth Fowler dc9bddc5cd Bug 1288040 (Part 12) - Use Moz2D types in FrameAnimator code. r=edwin 2016-07-20 16:30:44 -07:00
Seth Fowler 8bb93146a8 Bug 1288040 (Part 11) - Clean up RefreshResult. r=edwin 2016-07-20 16:30:41 -07:00
Seth Fowler 3e8d8d790f Bug 1288040 (Part 10) - Determine the first frame refresh area of animated images while decoding them. r=edwin 2016-07-20 16:30:39 -07:00
Seth Fowler 642c28d837 Bug 1288040 (Part 9) - Determine the loop length of animated images while decoding them. r=edwin 2016-07-20 16:30:36 -07:00
Seth Fowler 049339870a Bug 1288040 (Part 8) - Return a FrameTimeout value from FrameAnimator::GetSingleLoopTime(). r=edwin 2016-07-20 16:30:34 -07:00
Seth Fowler 930f26424f Bug 1288040 (Part 7) - Make FrameAnimator::GetTimeoutForFrame() a private method that doesn't rely on AnimationState. r=edwin 2016-07-20 16:30:32 -07:00
Seth Fowler 78ccdc2e84 Bug 1288040 (Part 5) - Wrap frame timeout values in a FrameTimeout type that ensures they're normalized. r=edwin 2016-07-20 16:30:28 -07:00
Seth Fowler 4306ec9de5 Bug 1288040 (Part 3) - Get rid of RefreshResult.error, a field which nothing cares about. r=edwin 2016-07-20 16:30:24 -07:00
Seth Fowler 4af805ced1 Bug 1288040 (Part 2) - Don't reset the last composited frame index when we reset animation. r=edwin 2016-07-20 16:30:21 -07:00
Seth Fowler 34caf5552c Bug 1288040 (Part 1) - Separate FrameAnimator's state into a separate class, AnimationState. r=edwin 2016-07-20 16:30:19 -07:00
Seth Fowler 17074a1b49 Bug 1255107 (Part 3) - Use SurfacePipe in the PNG decoder. r=njn 2016-06-25 14:04:05 -07:00
Nicholas Nethercote 9ec20a644f Bug 1277122 - Add missing null checks for pixman_image_create_bits(). r=seth,lsalzman.
--HG--
extra : rebase_source : dec917d2efd9a262bd06816dcbb541acd3892340
2016-06-01 14:27:30 +10: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 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
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
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
Chris Peterson c5cfbed605 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

--HG--
extra : rebase_source : ec1da93105ef06d156d9d60ae8950d04f3197e38
2015-12-24 23:50:32 -07:00
David Rajchenbach-Teller 583ca7286d Bug 1224374 - Profiler labels for the top 26-100 chrome hangs;r=BenWa
--HG--
extra : rebase_source : 39e94507c0288863e495322a6899ff009840870d
2016-01-15 11:38:03 +01:00
Sebastian Hengst d8d4a2d1a5 Backed out 2 changesets (bug 1224374) for Windows bustage. r=bustage on a CLOSED TREE
Backed out changeset 5f458e6e4997 (bug 1224374)
Backed out changeset 0dc02cb0b604 (bug 1224374)
2016-01-19 21:30:41 +01:00
David Rajchenbach-Teller 2d53758d08 Bug 1224374 - Profiler labels for the top 26-100 chrome hangs;r=BenWa
--HG--
extra : rebase_source : 51d39d6f88bf58ccb29f5897c3dbbe71007ee842
2016-01-15 11:38:03 +01:00
Nathan Froyd 01583602a9 Bug 1207245 - part 6 - rename nsRefPtr<T> to RefPtr<T>; r=ehsan; a=Tomcat
The bulk of this commit was generated with a script, executed at the top
level of a typical source code checkout.  The only non-machine-generated
part was modifying MFBT's moz.build to reflect the new naming.

CLOSED TREE makes big refactorings like this a piece of cake.

 # The main substitution.
find . -name '*.cpp' -o -name '*.cc' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    xargs perl -p -i -e '
 s/nsRefPtr\.h/RefPtr\.h/g; # handle includes
 s/nsRefPtr ?</RefPtr</g;   # handle declarations and variables
'

 # Handle a special friend declaration in gfx/layers/AtomicRefCountedWithFinalize.h.
perl -p -i -e 's/::nsRefPtr;/::RefPtr;/' gfx/layers/AtomicRefCountedWithFinalize.h

 # Handle nsRefPtr.h itself, a couple places that define constructors
 # from nsRefPtr, and code generators specially.  We do this here, rather
 # than indiscriminantly s/nsRefPtr/RefPtr/, because that would rename
 # things like nsRefPtrHashtable.
perl -p -i -e 's/nsRefPtr/RefPtr/g' \
     mfbt/nsRefPtr.h \
     xpcom/glue/nsCOMPtr.h \
     xpcom/base/OwningNonNull.h \
     ipc/ipdl/ipdl/lower.py \
     ipc/ipdl/ipdl/builtin.py \
     dom/bindings/Codegen.py \
     python/lldbutils/lldbutils/utils.py

 # In our indiscriminate substitution above, we renamed
 # nsRefPtrGetterAddRefs, the class behind getter_AddRefs.  Fix that up.
find . -name '*.cpp' -o -name '*.h' -o -name '*.idl' | \
    xargs perl -p -i -e 's/nsRefPtrGetterAddRefs/RefPtrGetterAddRefs/g'

if [ -d .git ]; then
    git mv mfbt/nsRefPtr.h mfbt/RefPtr.h
else
    hg mv mfbt/nsRefPtr.h mfbt/RefPtr.h
fi

--HG--
rename : mfbt/nsRefPtr.h => mfbt/RefPtr.h
2015-10-18 01:24:48 -04:00
Seth Fowler f89ca1d90f Bug 1185800 - Add DecoderFlags and SurfaceFlags enum classes and use them instead of imgIContainer flags in all decoder-related code. r=tn 2015-08-14 17:56:44 -07:00
Seth Fowler 7e909725b3 Bug 1194059 (Part 2) - Always detect IS_ANIMATED during the metadata decode. r=tn 2015-08-14 00:37:13 -07:00
Nicholas Nethercote 31ef869796 Bug 1188705 (part 3) - Simplify imgFrame::SizeOfExcludingThis(). r=seth.
imgFrame::SizeOfExcludingThis() measures heap and non-heap memory in a very
complex way. This patch simplifies it and removes gfxMemoryLocation in the
process. (gfxMemoryLocation::OUT_OF_PROCESS was unused.)

--HG--
extra : rebase_source : 72af38fa438b4b42df02231bcf2fa731d247b60d
2015-07-28 21:02:45 -07:00
Seth Fowler 5d3cfb8d11 Bug 1176124 (Part 1) - Add a MatchType enum to LookupResult to let Lookup*() return more detailed information. r=dholbert 2015-07-19 18:39:40 -07:00
Mihai Volmer e5f8e6f315 Bug 1126330 - Remove the check for non-looping animations. r=seth 2015-07-13 19:53:27 -07:00
Seth Fowler 95894af506 Bug 1139641 - Return more information from SurfaceCache::Lookup and SurfaceCache::LookupBestMatch. r=dholbert
--HG--
extra : rebase_source : cc4e6059cea739b96ead71b4922ace59b543bd34
2015-06-30 18:57:03 -07:00
Carsten "Tomcat" Book 7b1fb1fb5c Backed out changeset dd25b4d148af (bug 1139641) for bustage on a CLOSED TREE 2015-06-03 08:51:36 +02:00
Seth Fowler 58544b3813 Bug 1139641 - Return more information from SurfaceCache::Lookup and SurfaceCache::LookupBestMatch. r=dholbert 2015-06-02 23:30:14 -07:00
Birunthan Mohanathas db2ca75447 Bug 1038536 - Flatten image/src/ directory. r=seth
--HG--
rename : image/src/BMPFileHeaders.h => image/BMPFileHeaders.h
rename : image/src/ClippedImage.cpp => image/ClippedImage.cpp
rename : image/src/ClippedImage.h => image/ClippedImage.h
rename : image/src/DecodePool.cpp => image/DecodePool.cpp
rename : image/src/DecodePool.h => image/DecodePool.h
rename : image/src/Decoder.cpp => image/Decoder.cpp
rename : image/src/Decoder.h => image/Decoder.h
rename : image/src/Downscaler.cpp => image/Downscaler.cpp
rename : image/src/Downscaler.h => image/Downscaler.h
rename : image/src/DynamicImage.cpp => image/DynamicImage.cpp
rename : image/src/DynamicImage.h => image/DynamicImage.h
rename : image/src/FrameAnimator.cpp => image/FrameAnimator.cpp
rename : image/src/FrameAnimator.h => image/FrameAnimator.h
rename : image/src/FrozenImage.cpp => image/FrozenImage.cpp
rename : image/src/FrozenImage.h => image/FrozenImage.h
rename : image/src/ICOFileHeaders.h => image/ICOFileHeaders.h
rename : image/src/IProgressObserver.h => image/IProgressObserver.h
rename : image/src/Image.cpp => image/Image.cpp
rename : image/src/Image.h => image/Image.h
rename : image/src/ImageFactory.cpp => image/ImageFactory.cpp
rename : image/src/ImageFactory.h => image/ImageFactory.h
rename : image/src/ImageMetadata.cpp => image/ImageMetadata.cpp
rename : image/src/ImageMetadata.h => image/ImageMetadata.h
rename : image/src/ImageOps.cpp => image/ImageOps.cpp
rename : image/src/ImageOps.h => image/ImageOps.h
rename : image/src/ImageRegion.h => image/ImageRegion.h
rename : image/src/ImageURL.h => image/ImageURL.h
rename : image/src/ImageWrapper.cpp => image/ImageWrapper.cpp
rename : image/src/ImageWrapper.h => image/ImageWrapper.h
rename : image/src/MultipartImage.cpp => image/MultipartImage.cpp
rename : image/src/MultipartImage.h => image/MultipartImage.h
rename : image/src/Orientation.h => image/Orientation.h
rename : image/src/OrientedImage.cpp => image/OrientedImage.cpp
rename : image/src/OrientedImage.h => image/OrientedImage.h
rename : image/src/ProgressTracker.cpp => image/ProgressTracker.cpp
rename : image/src/ProgressTracker.h => image/ProgressTracker.h
rename : image/src/RasterImage.cpp => image/RasterImage.cpp
rename : image/src/RasterImage.h => image/RasterImage.h
rename : image/src/SVGDocumentWrapper.cpp => image/SVGDocumentWrapper.cpp
rename : image/src/SVGDocumentWrapper.h => image/SVGDocumentWrapper.h
rename : image/src/ScriptedNotificationObserver.cpp => image/ScriptedNotificationObserver.cpp
rename : image/src/ScriptedNotificationObserver.h => image/ScriptedNotificationObserver.h
rename : image/src/ShutdownTracker.cpp => image/ShutdownTracker.cpp
rename : image/src/ShutdownTracker.h => image/ShutdownTracker.h
rename : image/src/SourceBuffer.cpp => image/SourceBuffer.cpp
rename : image/src/SourceBuffer.h => image/SourceBuffer.h
rename : image/src/SurfaceCache.cpp => image/SurfaceCache.cpp
rename : image/src/SurfaceCache.h => image/SurfaceCache.h
rename : image/src/VectorImage.cpp => image/VectorImage.cpp
rename : image/src/VectorImage.h => image/VectorImage.h
rename : image/src/imgFrame.cpp => image/imgFrame.cpp
rename : image/src/imgFrame.h => image/imgFrame.h
rename : image/src/imgLoader.cpp => image/imgLoader.cpp
rename : image/src/imgLoader.h => image/imgLoader.h
rename : image/src/imgRequest.cpp => image/imgRequest.cpp
rename : image/src/imgRequest.h => image/imgRequest.h
rename : image/src/imgRequestProxy.cpp => image/imgRequestProxy.cpp
rename : image/src/imgRequestProxy.h => image/imgRequestProxy.h
rename : image/src/imgTools.cpp => image/imgTools.cpp
rename : image/src/imgTools.h => image/imgTools.h
2015-05-14 20:52:05 -07:00