Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(647)

Unified Diff: third_party/WebKit/Source/platform/graphics/BitmapImage.h

Issue 2262493003: Prevent synchronous layout while painting the last frame of a gif (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Refactor Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/platform/graphics/BitmapImage.h
diff --git a/third_party/WebKit/Source/platform/graphics/BitmapImage.h b/third_party/WebKit/Source/platform/graphics/BitmapImage.h
index a7dadc2ad1384ca2056a0572862f0556b4218f9a..8dc47dd808fcd8ae4264c09500e0b310ef912a10 100644
--- a/third_party/WebKit/Source/platform/graphics/BitmapImage.h
+++ b/third_party/WebKit/Source/platform/graphics/BitmapImage.h
@@ -90,7 +90,7 @@ public:
// Construct a BitmapImage with the given orientation.
static PassRefPtr<BitmapImage> createWithOrientationForTesting(const SkBitmap&, ImageOrientation);
// Advance the image animation by one frame.
- void advanceAnimationForTesting() override { internalAdvanceAnimation(false); }
+ void advanceAnimationForTesting() override { internalAdvanceAnimation(); }
private:
enum RepetitionCountStatus {
@@ -150,12 +150,18 @@ private:
// we force the next animation to skip the catch up logic.
void advanceAnimationWithoutCatchUp(TimerBase*);
- // Function that does the real work of advancing the animation. When
- // skippingFrames is true, we're in the middle of a loop trying to skip over
- // a bunch of animation frames, so we should not do things like decode each
- // one or notify our observers.
+ // This function does the real work of advancing the animation. When
+ // skipping frames to catch up, we're in the middle of a loop trying to skip
+ // over a bunch of animation frames, so we should not do things like decode
+ // each one or notify our observers.
// Returns whether the animation was advanced.
- bool internalAdvanceAnimation(bool skippingFrames);
+ enum AnimationAdvancement {
+ Normal,
+ SkipFramesToCatchUp
+ };
+ bool internalAdvanceAnimation(AnimationAdvancement = Normal);
+
+ void notifyObserversOfAnimationAdvance(TimerBase*);
ImageSource m_source;
mutable IntSize m_size; // The size to use for the overall image (will just be the size of the first image).

Powered by Google App Engine
This is Rietveld 408576698