Commit 5fb12d3f authored by antti@apple.com's avatar antti@apple.com
Browse files

Delay initial layer flush during loading on all platforms

https://bugs.webkit.org/show_bug.cgi?id=127347

Reviewed by Andreas Kling.

To reduce unnecessary repaints enable the same behaviour as iOS already has.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::RenderLayerCompositor):
        
    Set the initial state of m_layerFlushThrottlingEnabled correctly.

(WebCore::RenderLayerCompositor::scheduleLayerFlush):
(WebCore::RenderLayerCompositor::startInitialLayerFlushTimerIfNeeded):
* rendering/RenderLayerCompositor.h:
        
    Enable initial layer flush delay on all platforms.



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@162443 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 85fa8e43
2014-01-21 Antti Koivisto <antti@apple.com>
Delay initial layer flush during loading on all platforms
https://bugs.webkit.org/show_bug.cgi?id=127347
Reviewed by Andreas Kling.
To reduce unnecessary repaints enable the same behaviour as iOS already has.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::RenderLayerCompositor):
Set the initial state of m_layerFlushThrottlingEnabled correctly.
(WebCore::RenderLayerCompositor::scheduleLayerFlush):
(WebCore::RenderLayerCompositor::startInitialLayerFlushTimerIfNeeded):
* rendering/RenderLayerCompositor.h:
Enable initial layer flush delay on all platforms.
2014-01-21 Mihai Tica <mitica@adobe.com>
 
If you set a tiled cross-faded-image or a tiled gradient as
......@@ -45,6 +45,7 @@
#include "Logging.h"
#include "NodeList.h"
#include "Page.h"
#include "ProgressTracker.h"
#include "RenderEmbeddedObject.h"
#include "RenderFlowThread.h"
#include "RenderFullScreen.h"
......@@ -98,6 +99,7 @@ static const int canvasAreaThresholdRequiringCompositing = 50 * 100;
static const double throttledLayerFlushInitialDelay = .5;
static const double throttledLayerFlushDelay = 1.5;
#else
static const double throttledLayerFlushInitialDelay = .5;
static const double throttledLayerFlushDelay = .5;
#endif
......@@ -248,7 +250,7 @@ RenderLayerCompositor::RenderLayerCompositor(RenderView& renderView)
, m_layersWithTiledBackingCount(0)
, m_rootLayerAttachment(RootLayerUnattached)
, m_layerFlushTimer(this, &RenderLayerCompositor::layerFlushTimerFired)
, m_layerFlushThrottlingEnabled(false)
, m_layerFlushThrottlingEnabled(page() && page()->progress().isMainLoadProgressing())
, m_layerFlushThrottlingTemporarilyDisabledForInteraction(false)
, m_hasPendingLayerFlush(false)
, m_paintRelatedMilestonesTimer(this, &RenderLayerCompositor::paintRelatedMilestonesTimerFired)
......@@ -374,10 +376,8 @@ void RenderLayerCompositor::scheduleLayerFlush(bool canThrottle)
{
ASSERT(!m_flushingLayers);
#if PLATFORM(IOS)
if (canThrottle)
startInitialLayerFlushTimerIfNeeded();
#endif
if (canThrottle && isThrottlingLayerFlushes()) {
m_hasPendingLayerFlush = true;
......@@ -3677,7 +3677,6 @@ void RenderLayerCompositor::startLayerFlushTimerIfNeeded()
m_layerFlushTimer.startOneShot(throttledLayerFlushDelay);
}
#if PLATFORM(IOS)
void RenderLayerCompositor::startInitialLayerFlushTimerIfNeeded()
{
if (!m_layerFlushThrottlingEnabled)
......@@ -3686,7 +3685,6 @@ void RenderLayerCompositor::startInitialLayerFlushTimerIfNeeded()
return;
m_layerFlushTimer.startOneShot(throttledLayerFlushInitialDelay);
}
#endif
void RenderLayerCompositor::layerFlushTimerFired(Timer<RenderLayerCompositor>&)
{
......
......@@ -406,7 +406,6 @@ private:
ChromeClient* chromeClient() const;
void startInitialLayerFlushTimerIfNeeded();
#endif
void addViewportConstrainedLayer(RenderLayer&);
......@@ -430,6 +429,7 @@ private:
void scheduleLayerFlushNow();
bool isThrottlingLayerFlushes() const;
void startInitialLayerFlushTimerIfNeeded();
void startLayerFlushTimerIfNeeded();
void layerFlushTimerFired(Timer<RenderLayerCompositor>&);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment