diff options
Diffstat (limited to 'src/3rdparty/webkit/WebCore/page/FrameView.cpp')
-rw-r--r-- | src/3rdparty/webkit/WebCore/page/FrameView.cpp | 54 |
1 files changed, 40 insertions, 14 deletions
diff --git a/src/3rdparty/webkit/WebCore/page/FrameView.cpp b/src/3rdparty/webkit/WebCore/page/FrameView.cpp index bc0519f..a53db36 100644 --- a/src/3rdparty/webkit/WebCore/page/FrameView.cpp +++ b/src/3rdparty/webkit/WebCore/page/FrameView.cpp @@ -80,23 +80,25 @@ using namespace HTMLNames; double FrameView::sCurrentPaintTimeStamp = 0.0; +// REPAINT_THROTTLING now chooses default values for throttling parameters. +// Should be removed when applications start using runtime configuration. #if ENABLE(REPAINT_THROTTLING) // Normal delay -static const double deferredRepaintDelay = 0.025; +double FrameView::s_deferredRepaintDelay = 0.025; // Negative value would mean that first few repaints happen without a delay -static const double initialDeferredRepaintDelayDuringLoading = 0; +double FrameView::s_initialDeferredRepaintDelayDuringLoading = 0; // The delay grows on each repaint to this maximum value -static const double maxDeferredRepaintDelayDuringLoading = 2.5; +double FrameView::s_maxDeferredRepaintDelayDuringLoading = 2.5; // On each repaint the delay increses by this amount -static const double deferredRepaintDelayIncrementDuringLoading = 0.5; +double FrameView::s_deferredRepaintDelayIncrementDuringLoading = 0.5; #else // FIXME: Repaint throttling could be good to have on all platform. // The balance between CPU use and repaint frequency will need some tuning for desktop. // More hooks may be needed to reset the delay on things like GIF and CSS animations. -static const double deferredRepaintDelay = 0; -static const double initialDeferredRepaintDelayDuringLoading = 0; -static const double maxDeferredRepaintDelayDuringLoading = 0; -static const double deferredRepaintDelayIncrementDuringLoading = 0; +double FrameView::s_deferredRepaintDelay = 0; +double FrameView::s_initialDeferredRepaintDelayDuringLoading = 0; +double FrameView::s_maxDeferredRepaintDelayDuringLoading = 0; +double FrameView::s_deferredRepaintDelayIncrementDuringLoading = 0; #endif // The maximum number of updateWidgets iterations that should be done before returning. @@ -200,7 +202,7 @@ void FrameView::reset() m_deferringRepaints = 0; m_repaintCount = 0; m_repaintRects.clear(); - m_deferredRepaintDelay = initialDeferredRepaintDelayDuringLoading; + m_deferredRepaintDelay = s_initialDeferredRepaintDelayDuringLoading; m_deferredRepaintTimer.stop(); m_lastPaintTime = 0; m_paintBehavior = PaintBehaviorNormal; @@ -1218,13 +1220,13 @@ void FrameView::updateDeferredRepaintDelay() { Document* document = m_frame->document(); if (!document || (!document->parsing() && !document->docLoader()->requestCount())) { - m_deferredRepaintDelay = deferredRepaintDelay; + m_deferredRepaintDelay = s_deferredRepaintDelay; return; } - if (m_deferredRepaintDelay < maxDeferredRepaintDelayDuringLoading) { - m_deferredRepaintDelay += deferredRepaintDelayIncrementDuringLoading; - if (m_deferredRepaintDelay > maxDeferredRepaintDelayDuringLoading) - m_deferredRepaintDelay = maxDeferredRepaintDelayDuringLoading; + if (m_deferredRepaintDelay < s_maxDeferredRepaintDelayDuringLoading) { + m_deferredRepaintDelay += s_deferredRepaintDelayIncrementDuringLoading; + if (m_deferredRepaintDelay > s_maxDeferredRepaintDelayDuringLoading) + m_deferredRepaintDelay = s_maxDeferredRepaintDelayDuringLoading; } } @@ -2143,4 +2145,28 @@ IntPoint FrameView::convertFromContainingView(const IntPoint& parentPoint) const return parentPoint; } +// Normal delay +void FrameView::setRepaintThrottlingDeferredRepaintDelay(double p) +{ + s_deferredRepaintDelay = p; +} + +// Negative value would mean that first few repaints happen without a delay +void FrameView::setRepaintThrottlingnInitialDeferredRepaintDelayDuringLoading(double p) +{ + s_initialDeferredRepaintDelayDuringLoading = p; +} + +// The delay grows on each repaint to this maximum value +void FrameView::setRepaintThrottlingMaxDeferredRepaintDelayDuringLoading(double p) +{ + s_maxDeferredRepaintDelayDuringLoading = p; +} + +// On each repaint the delay increases by this amount +void FrameView::setRepaintThrottlingDeferredRepaintDelayIncrementDuringLoading(double p) +{ + s_deferredRepaintDelayIncrementDuringLoading = p; +} + } // namespace WebCore |