summaryrefslogtreecommitdiff
path: root/image/RasterImage.h
diff options
context:
space:
mode:
authorMartok <martok@martoks-place.de>2022-12-30 23:47:18 +0100
committerMartok <martok@martoks-place.de>2023-01-03 02:01:10 +0100
commite7fd4ba61bec3736df2f50eb0e7b215a805dde06 (patch)
treea5cdc7d54a56b8055a2b07de3795eda42910467e /image/RasterImage.h
parent608ecc95492e1a4acd3abeefa7f06f5bf360b182 (diff)
downloaduxp-e7fd4ba61bec3736df2f50eb0e7b215a805dde06.tar.gz
Issue #2073 - m-c 1343341: Infrastructure necessary to allow discarding of animated images (squashed)
Includes squashed changes of: - m-c 1317907: Refactor FrameAnimator::GetCompositedFrame to be a bit simpler - m-c 1351434: bugfix - m-c 686905: Enable the pref image.mem.animated.discardable to allow discarding of animated images
Diffstat (limited to 'image/RasterImage.h')
-rw-r--r--image/RasterImage.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/image/RasterImage.h b/image/RasterImage.h
index 860983b22e..42af0a4887 100644
--- a/image/RasterImage.h
+++ b/image/RasterImage.h
@@ -163,7 +163,7 @@ public:
virtual nsresult StopAnimation() override;
// Methods inherited from Image
- virtual void OnSurfaceDiscarded() override;
+ virtual void OnSurfaceDiscarded(const SurfaceKey& aSurfaceKey) override;
virtual size_t SizeOfSourceWithComputedFallback(MallocSizeOf aMallocSizeOf)
const override;
@@ -321,7 +321,9 @@ private:
// never unlock so that animated images always have their lock count >= 1. In
// that case we use our animation consumers count as a proxy for lock count.
bool IsUnlocked() {
- return (mLockCount == 0 || (mAnimationState && mAnimationConsumers == 0));
+ return (mLockCount == 0 ||
+ (!gfxPrefs::ImageMemAnimatedDiscardable() &&
+ (mAnimationState && mAnimationConsumers == 0)));
}
@@ -378,6 +380,8 @@ private:
*/
void RecoverFromInvalidFrames(const nsIntSize& aSize, uint32_t aFlags);
+ void OnSurfaceDiscardedInternal(bool aAnimatedFramesDiscarded);
+
private: // data
nsIntSize mSize;
Orientation mOrientation;