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

Unified Diff: third_party/WebKit/Source/core/layout/ImageQualityController.h

Issue 1911273002: Don't restart the ImageQualityController timer unless it is already half over. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/ImageQualityController.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/ImageQualityController.h
diff --git a/third_party/WebKit/Source/core/layout/ImageQualityController.h b/third_party/WebKit/Source/core/layout/ImageQualityController.h
index d9da6a44788f9986aed1032397a85ac79cfecdf1..374018fccc2f5dea830d8e5a3e1f8c43a59b8b99 100644
--- a/third_party/WebKit/Source/core/layout/ImageQualityController.h
+++ b/third_party/WebKit/Source/core/layout/ImageQualityController.h
@@ -59,24 +59,28 @@ public:
InterpolationQuality chooseInterpolationQuality(const LayoutObject&, Image*, const void* layer, const LayoutSize&);
private:
+ static const double cLowQualityTimeThreshold;
+ static const double cTimerRestartThreshold;
+
ImageQualityController();
static bool has(const LayoutObject&);
void set(const LayoutObject&, LayerSizeMap* innerMap, const void* layer, const LayoutSize&, bool isResizing);
- bool shouldPaintAtLowQuality(const LayoutObject&, Image*, const void* layer, const LayoutSize&);
+ bool shouldPaintAtLowQuality(const LayoutObject&, Image*, const void* layer, const LayoutSize&, double lastFrameTimeMonotonic);
void removeLayer(const LayoutObject&, LayerSizeMap* innerMap, const void* layer);
void objectDestroyed(const LayoutObject&);
bool isEmpty() { return m_objectLayerSizeMap.isEmpty(); }
void highQualityRepaintTimerFired(Timer<ImageQualityController>*);
- void restartTimer();
+ void restartTimer(double lastFrameTimeMonotonic);
// Only for use in testing.
void setTimer(Timer<ImageQualityController>*);
ObjectLayerSizeMap m_objectLayerSizeMap;
OwnPtr<Timer<ImageQualityController>> m_timer;
+ double m_frameTimeWhenTimerStarted;
// For calling set().
FRIEND_TEST_ALL_PREFIXES(LayoutPartTest, DestroyUpdatesImageQualityController);
@@ -85,6 +89,7 @@ private:
FRIEND_TEST_ALL_PREFIXES(ImageQualityControllerTest, LowQualityFilterForResizingImage);
FRIEND_TEST_ALL_PREFIXES(ImageQualityControllerTest, MediumQualityFilterForNotAnimatedWhileAnotherAnimates);
FRIEND_TEST_ALL_PREFIXES(ImageQualityControllerTest, DontKickTheAnimationTimerWhenPaintingAtTheSameSize);
+ FRIEND_TEST_ALL_PREFIXES(ImageQualityControllerTest, DontRestartTimerUnlessAdvanced);
};
} // namespace blink
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/ImageQualityController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698