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

66 Коммитов

Автор SHA1 Сообщение Дата
Timothy Nikkel 0f1d7652b6 Backed out changeset 29e2e6dd82d2 (bug 1343341) 2017-03-15 03:13:33 -05:00
Timothy Nikkel d1b5ed8ea1 Bug 1343341. Only set the animation state as discarded if we discarded the animated frames (and not a static frame from a first-frame-only decode). r=aosmond
The SurfaceCache can hold the first frame of a "static" decode as well as the animated frames in two seperate entries. We only care about what happens to the animated frames, so ignore OnSurfaceDiscarded for anything else.

To accomplish this we must pass the SurfaceKey to OnSurfaceDiscarded.
2017-03-15 02:47:40 -05:00
Andrew Osmond 57499ffb90 Bug 1320684 - Start metadata decoding when the first data chunk has been received. r=tnikkel 2016-11-28 08:42:55 -05:00
cku 09c56e6da6 Bug 1323912 - Part 2. Pass opacity down to imgIContainer::Draw. r=mstange
Each concrete class of imgIContainer is able to handle opacity already. All we
need to do is pass opacity value to them.

MozReview-Commit-ID: EMkLnG3YXA1

--HG--
extra : rebase_source : b0a0aad1fec0c2765e96d23ed9b627345c793795
2017-01-03 13:53:22 +08:00
Iris Hsiao c8e876e89c Backed out changeset c868ab532766 (bug 1323912) 2017-01-04 21:47:12 -05:00
cku adab9bea9f Bug 1323912 - Part 2. Pass opacity down to imgIContainer::Draw. r=mstange
Each concrete class of imgIContainer is able to handle opacity already. All we
need to do is pass opacity value to them.

MozReview-Commit-ID: EMkLnG3YXA1

--HG--
extra : rebase_source : 080a843b34cc1ca27831310d474243b4066f59f2
2017-01-03 13:53:22 +08:00
Timothy Nikkel 748db52939 Bug 1325297. Create a variant of imgIContainer::StartDecoding that returns if the current image frame is complete. r=aosmond
During painting we do some image decoding, but we want to send the image progress notifications from that decoding async. The CSS image renderer checks if the image is complete before painting it. So if the decoding we did during painting resulted in the images becoming complete there is no way to tell that during the same paint. Thus making that decoding a waste of time.

So we add a limited way of telling if the result of a StartDecoding call has resulting in an image that is ready to paint so we can get that result during the same paint.

I would have prefered to change StartDecoding to just return a bool but that would have made the bool an outparam, which would make every StartDecoding call uglier with extra code. Changing it to a notxpcom function would have fixed that, but I'm not sure if that is safe.
2016-12-23 01:07:45 -06:00
Timothy Nikkel b46e1a9d16 Bug 1325296. RasterImage::LookupFrame does not return a surface if it was created as a result of a sync decode from with the FLAG_SYNC_DECODE_IF_FAST flag. r=aosmond
The Decode call may result in synchronously creating the surface, but we only check again if the surface is there for FLAG_SYNC_DECODE, not FLAG_SYNC_DECODE_IF_FAST.

All of the decoding we do during painting is of the type FLAG_SYNC_DECODE_IF_FAST, which means it would be useless to do that decoding synchronously during painting because the paint doesn't benefit from the result of that decoding.

Looking at the history of this code it looks like https://hg.mozilla.org/mozilla-central/rev/435df926eb10 (part 6 of bug 1119774) was where this bug was introduced. Before that changeset we always did another LookupFrameInternal call after the Decode (called WantDecodedFrames back then). But that changeset changed it to only be done for standard sync decodes, not "sync decode if fast".
2016-12-22 13:15:41 -06:00
Ehsan Akhgari ba68896bf9 Bug 1311246 - Remove support for the -moz-samplesize media fragment; r=jrmuizel
This removes the feature added in bug 854795 for Tarako b2g devices.
2016-11-16 08:18:56 -05:00
Timothy Nikkel 05dc5b9ede Bug 1260324. Don't draw garbage to the screen if an image doesn't happen to be decoded. r=seth
Layout has been using imgIContainer::IsOpaque to determine if the image will draw opaquely to all pixels it covers, and doing culling based on this.

However imgIContainer::IsOpaque doesn't guarantee anything. It only describes if the image, when in a decoded state, has all opaque pixels. So if the image doesn't have fully decoded frames around (because they got discarded) it may not draw opaquely to all of its pixels.

So we create a new function that first checks if there is a fully decoded frame.
2016-08-22 21:15:38 -05:00
Wes Kocher 3de1ea925a Backed out changeset 54933b5b96f1 (bug 1260324) for frequent windows reftest failures a=backout CLOSED TREE 2016-08-23 13:50:14 -07:00
Timothy Nikkel 9e89a17b91 Bug 1260324. Don't draw garbage to the screen if an image doesn't happen to be decoded. r=seth
Layout has been using imgIContainer::IsOpaque to determine if the image will draw opaquely to all pixels it covers, and doing culling based on this.

However imgIContainer::IsOpaque doesn't guarantee anything. It only describes if the image, when in a decoded state, has all opaque pixels. So if the image doesn't have fully decoded frames around (because they got discarded) it may not draw opaquely to all of its pixels.

So we create a new function that first checks if there is a fully decoded frame.
2016-08-22 21:15:38 -05: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
Seth Fowler ec7c520520 Bug 1291071 (Part 6) - Stop passing a decoder to FinalizeDecoder() and rename it NotifyDecodeComplete(). r=edwin 2016-08-05 18:50:32 -07:00
Seth Fowler 0403b4baba Bug 1291071 (Part 5) - Pass the decoder's final status explicitly to FinalizeDecoder(). r=edwin 2016-08-05 18:50:31 -07:00
Seth Fowler baf4983cd8 Bug 1291071 (Part 3) - Pass telemetry explicitly to FinalizeDecoder. r=edwin 2016-08-05 18:50:27 -07:00
Seth Fowler e3510bdeff Bug 1291071 (Part 2) - Pass decoder progress explicitly to FinalizeDecoder. r=edwin 2016-08-05 18:50:25 -07:00
Seth Fowler b765419db3 Bug 1291071 (Part 1) - Pass ImageMetadata explicitly to FinalizeDecoder. r=edwin 2016-08-05 18:50:24 -07:00
Seth Fowler 2799864a33 Bug 1290682 (Part 3) - Remove RasterImage::CopyFrame(). r=edwin 2016-08-01 17:51:20 -07: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 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 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 f6528fc852 Bug 1282352 - Make DecoderFactory use NotNull where possible. r=edwin 2016-06-29 18:33:22 -07:00
Aidin Gharibnavaz 523608513b Bug 1247972 - specialize NS_ProxyRelease for nsISupports to be out-of-line; r=erahm
NS_ProxyRelease's current implementation requires a lot of code.  We can
reduce the impact of this by providing an out-of-line implementation for
classes based on nsISupports.  This change reduces codesize by ~60K on
a Linux x86-64 build.
2016-06-29 18:56:41 -04:00
Jonathan Watt 2eb705bb3f 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
Kyle Huey c73656947b Bug 1265927: Move nsRunnable to mozilla::Runnable, CancelableRunnable to mozilla::CancelableRunnable. r=froydnj 2016-04-25 17:23:21 -07: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
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
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
Nathan Froyd 583afa0965 Bug 1207245 - part 3 - switch all uses of mozilla::RefPtr<T> to nsRefPtr<T>; r=ehsan
This commit was generated using the following script, executed at the
top level of a typical source code checkout.

 # Don't modify select files in mfbt/ because it's not worth trying to
 # tease out the dependencies currently.
 #
 # Don't modify anything in media/gmp-clearkey/0.1/ because those files
 # use their own RefPtr, defined in their own RefCounted.h.
find . -name '*.cpp' -o -name '*.h' -o -name '*.mm' -o -name '*.idl'| \
    grep -v 'mfbt/RefPtr.h' | \
    grep -v 'mfbt/nsRefPtr.h' | \
    grep -v 'mfbt/RefCounted.h' | \
    grep -v 'media/gmp-clearkey/0.1/' | \
    xargs perl -p -i -e '
 s/mozilla::RefPtr/nsRefPtr/g; # handle declarations in headers
 s/\bRefPtr</nsRefPtr</g; # handle local variables in functions
 s#mozilla/RefPtr.h#mozilla/nsRefPtr.h#; # handle #includes
 s#mfbt/RefPtr.h#mfbt/nsRefPtr.h#;       # handle strange #includes
'

 # |using mozilla::RefPtr;| is OK; |using nsRefPtr;| is invalid syntax.
find . -name '*.cpp' -o -name '*.mm' | xargs sed -i -e '/using nsRefPtr/d'

 # RefPtr.h used |byRef| for dealing with COM-style outparams.
 # nsRefPtr.h uses |getter_AddRefs|.
 # Fixup that mismatch.
find . -name '*.cpp' -o -name '*.h'| \
    xargs perl -p -i -e 's/byRef/getter_AddRefs/g'
2015-10-18 00:40:10 -04:00
Nicholas Nethercote 0f5722f4da Bug 1211324 (part 5) - Remove GraphicsFilter and gfxGraphicsFilter. r=mattwoodrow. 2015-10-05 17:18:10 -07:00
Seth Fowler ee578a0619 Bug 1118926 (Part 1) - Remove remnants of -moz-resolution in C++ code. r=tn 2015-09-30 17:00:52 -07:00
Seth Fowler a1d7413fd3 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
Seth Fowler df31b64d6c Bug 1146663 (Part 4) - Make all RasterImages support downscale-during-decode. r=tn 2015-09-19 16:21:05 -07:00
Seth Fowler 3e6e1a075a Bug 1146663 (Part 1) - Remove HQ scaling, which is now dead code. r=tn 2015-09-19 16:20:56 -07:00
Seth Fowler ddc24ded58 Bug 1201796 (Part 2) - Add GetFrameAtSize() to support downscale-during-decode for GetFrame() use cases. r=tn 2015-09-19 13:34:09 -07:00
Wes Kocher 08de06967a Backed out 8 changesets (bug 1201796, bug 1196066) for mulet gij(28) failures CLOSED TREE
Backed out changeset 159d5d2946d3 (bug 1201796)
Backed out changeset 958988218976 (bug 1201796)
Backed out changeset 494e7553d641 (bug 1201796)
Backed out changeset d58149411b7d (bug 1201796)
Backed out changeset 35bd769b49f8 (bug 1196066)
Backed out changeset e4f3d4279b4c (bug 1196066)
Backed out changeset ca467297fa07 (bug 1196066)
Backed out changeset b4851ce6637d (bug 1196066)

--HG--
rename : image/test/crashtests/invalid_ico_height.ico => image/test/reftest/ico/ico-bmp-corrupted/invalid_ico_height.ico
rename : image/test/crashtests/invalid_ico_width.ico => image/test/reftest/ico/ico-bmp-corrupted/invalid_ico_width.ico
extra : rebase_source : 5232674f1cf0ef4d7f70568f627547c0151a801f
2015-09-18 13:01:25 -07:00
Seth Fowler cbc63cc08f Bug 1201796 (Part 2) - Add GetFrameAtSize() to support downscale-during-decode for GetFrame() use cases. r=tn 2015-09-18 10:54:35 -07:00
Seth Fowler be0cccfa8a Bug 1187401 (Part 2) - Eliminate the nsresult return value from RasterImage::SetMetadata, since it's not used anymore. r=tn
--HG--
extra : rebase_source : dc15e712deda9fe140cb1adc1c88b0c968307852
2015-08-18 10:19:26 -07:00
Seth Fowler 1dba6dbf50 Bug 1194575 - Rename RecoverFromLossOfFrames() to RecoverFromInvalidFrames() to better reflect its role. r=tn
--HG--
extra : rebase_source : b28b2575544bbf09e554ced17568aca30d36f5a2
2015-08-18 10:19:14 -07: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
Seth Fowler edf105e8f6 Bug 1181863 (Part 1) - Add support for reading from nsIInputStreams directly to SourceBuffer. r=tn 2015-07-31 18:10:29 -07:00
Seth Fowler ffee281e15 Bug 1187386 (Part 6) - Merge Decoder::Finish() and RasterImage::OnDecodingComplete() into RasterImage::FinalizeDecoder(). r=tn
--HG--
extra : rebase_source : e2d1bce9222366f3dff2bf8b1ccb755ba44140ae
2015-07-31 07:29:15 -07:00
Seth Fowler 947de7376b Bug 1187386 (Part 2) - Rework decoder code to avoid calling Decode::GetImage(). r=tn
--HG--
extra : rebase_source : 6fc835a3468e846cb59474efcfea5355914a9dc4
2015-07-31 07:29:03 -07:00
Nicholas Nethercote 03c7260391 Bug 1188705 (part 2) - Remove unused SizeOfDecodedWithComputedFallbackIfHeap declaration. r=seth.
--HG--
extra : rebase_source : 3a961b643e5a96b6e13bf54c05e057f50156a037
2015-07-28 18:58:57 -07:00
Seth Fowler 1732630df1 Bug 1184996 (Part 3) - Replace all remaining references to 'size decodes' with 'metadata decodes'. r=tn 2015-07-22 22:39:54 -07:00
Seth Fowler aaf1463494 Bug 1184996 (Part 2) - Clean up RasterImage's decoding API. r=tn 2015-07-22 22:39:51 -07:00